summaryrefslogtreecommitdiff
path: root/game/shared/tf2/weapon_flame_thrower.h
blob: f2700e217db2a00f4ef7c0b092276ec8d0143c7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef WEAPON_FLAME_THROWER_H
#define WEAPON_FLAME_THROWER_H
#ifdef _WIN32
#pragma once
#endif

#include "weapon_combat_usedwithshieldbase.h"

#if defined( CLIENT_DLL )
	#define CWeaponFlameThrower C_WeaponFlameThrower

	#include "particlemgr.h"
	#include "particle_util.h"
	#include "particles_simple.h"

#else

	class CGasolineBlob;

#endif

//=========================================================
// Medikit Weapon
//=========================================================
class CWeaponFlameThrower : public CWeaponCombatUsedWithShieldBase
{
	DECLARE_CLASS( CWeaponFlameThrower, CWeaponCombatUsedWithShieldBase );
public:
	DECLARE_NETWORKCLASS();
	DECLARE_PREDICTABLE();

	CWeaponFlameThrower();
	CWeaponFlameThrower( bool bCanister );
	~CWeaponFlameThrower();

	virtual void			Precache();

	// The gas canister says yes so we can do different things.
	bool					IsGasCanister() const;

	// All predicted weapons need to implement and return true
	virtual bool			IsPredicted( void ) const;
	virtual void			ItemPostFrame();


#if defined( CLIENT_DLL )

	virtual bool	ShouldPredict( void );

	virtual void			NotifyShouldTransmit( ShouldTransmitState_t state );
	virtual void			ClientThink();

	// Start/stop the fire sound.
	void					StartSound();
	void					StopFlameSound();
	bool					m_bSoundOn;	// Is the sound on?

	CSmartPtr<CSimpleEmitter>	m_hFlameEmitter;
	PMaterialHandle				m_hFireMaterial;
	TimedEvent					m_FlameEvent;

#else

	virtual bool			Holster( CBaseCombatWeapon *pSwitchingTo );
	void					IgniteNearbyGasolineBlobs();

private:

	// Used to link the blobs together.
	CHandle<CGasolineBlob>	m_hPrevBlob;


#endif


private:

	void		PrimaryAttack();
	void		InternalConstructor( bool bCanister );

	CNetworkVar( bool, m_bFiring );
	bool		m_bCanister;	// Tells if we're a gas canister or a flamethrower (both act in similar ways).
	float		m_flNextPrimaryAttack;

	CWeaponFlameThrower( const CWeaponFlameThrower & );
};

#endif // WEAPON_FLAME_THROWER_H