summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_shotgun.h
blob: 56c5fb037a89ccff08167c22d9d7aa062dd3b0c9 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================

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

#include "tf_weaponbase_gun.h"

#if defined( CLIENT_DLL )
#define CTFShotgun C_TFShotgun
#define CTFShotgun_Soldier C_TFShotgun_Soldier
#define CTFShotgun_HWG C_TFShotgun_HWG
#define CTFShotgun_Pyro C_TFShotgun_Pyro
#define CTFScatterGun C_TFScatterGun
#define CTFShotgun_Revenge C_TFShotgun_Revenge
#define CTFSodaPopper C_TFSodaPopper
#define CTFPEPBrawlerBlaster C_TFPEPBrawlerBlaster
#define CTFShotgunBuildingRescue C_TFShotgunBuildingRescue
#define CTFLeech C_TFLeech
#endif

// Reload Modes
enum
{
	TF_WEAPON_SHOTGUN_RELOAD_START = 0,
	TF_WEAPON_SHOTGUN_RELOAD_SHELL,
	TF_WEAPON_SHOTGUN_RELOAD_CONTINUE,
	TF_WEAPON_SHOTGUN_RELOAD_FINISH
};

//=============================================================================
//
// Shotgun class.
//
class CTFShotgun : public CTFWeaponBaseGun
{
public:

	DECLARE_CLASS( CTFShotgun, CTFWeaponBaseGun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	CTFShotgun();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SHOTGUN_PRIMARY; }
	virtual void	PrimaryAttack();
	virtual void	PlayWeaponShootSound( void );

#ifdef GAME_DLL
	virtual CDmgAccumulator	*GetDmgAccumulator( void ) { return &m_Accumulator; }
#endif // GAME_DLL
	
protected:

	void		Fire( CTFPlayer *pPlayer );
	void		UpdatePunchAngles( CTFPlayer *pPlayer );

private:

	CTFShotgun( const CTFShotgun & ) {}

#ifdef GAME_DLL
	CDmgAccumulator m_Accumulator;
#endif // GAME_DLL
};

// Engineer's revenge shotgun.
class CTFShotgun_Revenge : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFShotgun_Revenge, CTFShotgun );
	DECLARE_NETWORKCLASS();
	DECLARE_PREDICTABLE();

	CTFShotgun_Revenge();

	virtual int			GetWeaponID( void ) const		{ return TF_WEAPON_SENTRY_REVENGE; }

	void				Precache();
	virtual void		PrimaryAttack();
	virtual void		SentryKilled( int iKills );
	virtual bool		Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
	virtual bool		Deploy( void );
	virtual int         GetCustomDamageType() const;
	int					GetCount( void );
	float				GetProgress( void ) { return 0.f; }
	const char*			GetEffectLabelText( void ) { return "#TF_REVENGE"; }

#ifdef CLIENT_DLL
	virtual void		SetWeaponVisible( bool visible );
	virtual int			GetWorldModelIndex( void );
#else
	virtual void		Detach();
#endif
};

// Scout version. Different models, possibly different behaviour later on
class CTFScatterGun : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFScatterGun, CTFShotgun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SCATTERGUN; }
	virtual bool	Reload( void );
	virtual void	FireBullet( CTFPlayer *pPlayer );
	virtual void	ApplyPostHitEffects( const CTakeDamageInfo &inputInfo, CTFPlayer *pPlayer );
	virtual void	FinishReload( void );
	virtual bool	HasKnockback( void );
	virtual bool	SendWeaponAnim( int iActivity );

#ifdef GAME_DLL
	virtual void	Equip( CBaseCombatCharacter *pOwner );
#endif // GAME_DLL
};

class CTFShotgun_Soldier : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFShotgun_Soldier, CTFShotgun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SHOTGUN_SOLDIER; }
};

// Secondary version. Different weapon slot, different ammo
class CTFShotgun_HWG : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFShotgun_HWG, CTFShotgun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SHOTGUN_HWG; }
};

class CTFShotgun_Pyro : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFShotgun_Pyro, CTFShotgun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SHOTGUN_PYRO; }
};

class CTFSodaPopper : public CTFScatterGun
{
public:
	DECLARE_CLASS( CTFSodaPopper, CTFScatterGun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SODA_POPPER; }

	virtual void	ItemBusyFrame( void );
	virtual void	SecondaryAttack( void );

	const char*		GetEffectLabelText( void )			{ return "#TF_HYPE"; }
	float			GetProgress( void );
};

class CTFPEPBrawlerBlaster : public CTFScatterGun
{
public:
	DECLARE_CLASS( CTFPEPBrawlerBlaster, CTFScatterGun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_PEP_BRAWLER_BLASTER; }

	const char*		GetEffectLabelText( void )			{ return "#TF_Boost"; }
	float			GetProgress( void );
};

class CTFShotgunBuildingRescue : public CTFShotgun
{
public:
	DECLARE_CLASS( CTFShotgunBuildingRescue, CTFShotgun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual int		GetWeaponID( void ) const			{ return TF_WEAPON_SHOTGUN_BUILDING_RESCUE; }
	virtual float	GetProjectileSpeed( void );
	virtual float   GetProjectileGravity( void );
	virtual bool	IsViewModelFlipped( void );
};

#endif // TF_WEAPON_SHOTGUN_H