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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// TF Rocket Launcher
//
//=============================================================================
#ifndef TF_WEAPON_ROCKETLAUNCHER_H
#define TF_WEAPON_ROCKETLAUNCHER_H
#ifdef _WIN32
#pragma once
#endif
#include "tf_weaponbase_gun.h"
#include "tf_weaponbase_rocket.h"
#include "tf_weapon_sniperrifle.h"
#ifdef CLIENT_DLL
#include "particle_property.h"
#endif
// Client specific.
#ifdef CLIENT_DLL
#define CTFRocketLauncher C_TFRocketLauncher
#define CTFRocketLauncher_DirectHit C_TFRocketLauncher_DirectHit
#define CTFRocketLauncher_AirStrike C_TFRocketLauncher_AirStrike
#define CTFRocketLauncher_Mortar C_TFRocketLauncher_Mortar
#define CTFCrossbow C_TFCrossbow
#endif // CLIENT_DLL
//=============================================================================
//
// TF Weapon Rocket Launcher.
//
class CTFRocketLauncher : public CTFWeaponBaseGun
{
public:
DECLARE_CLASS( CTFRocketLauncher, CTFWeaponBaseGun );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
// Server specific.
#ifdef GAME_DLL
DECLARE_DATADESC();
#endif
CTFRocketLauncher();
~CTFRocketLauncher();
#ifndef CLIENT_DLL
virtual void Precache();
#endif
virtual void ModifyEmitSoundParams( EmitSound_t ¶ms );
virtual int GetWeaponID( void ) const { return TF_WEAPON_ROCKETLAUNCHER; }
virtual void Misfire( void );
virtual CBaseEntity *FireProjectile( CTFPlayer *pPlayer );
virtual void ItemPostFrame( void );
virtual bool DefaultReload( int iClipSize1, int iClipSize2, int iActivity );
virtual int GetWeaponProjectileType( void ) const OVERRIDE;
virtual bool IsBlastImpactWeapon( void ) const { return !IsEnergyWeapon(); }
virtual bool CheckReloadMisfire( void ) OVERRIDE;
virtual bool ShouldBlockPrimaryFire() OVERRIDE;
#ifdef CLIENT_DLL
virtual void CreateMuzzleFlashEffects( C_BaseEntity *pAttachEnt, int nIndex );
#endif
private:
float m_flShowReloadHintAt;
// Since the ammo in the clip can be predicted/networked out of order from when the reload sound happens
// We need to keep track of this invividually on client and server to modify the pitch
int m_nReloadPitchStep;
#ifdef GAME_DLL
int m_iConsecutiveCrits;
bool m_bIsOverloading;
#endif
CTFRocketLauncher( const CTFRocketLauncher & ) {}
};
// ------------------------------------------------------------------------------------------------------------------------
class CTFRocketLauncher_DirectHit : public CTFRocketLauncher
{
public:
DECLARE_CLASS( CTFRocketLauncher_DirectHit, CTFRocketLauncher );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
// Server specific.
#ifdef GAME_DLL
DECLARE_DATADESC();
#endif
virtual int GetWeaponID( void ) const { return TF_WEAPON_ROCKETLAUNCHER_DIRECTHIT; }
};
// ------------------------------------------------------------------------------------------------------------------------
class CTFRocketLauncher_AirStrike : public CTFRocketLauncher
{
public:
DECLARE_CLASS( CTFRocketLauncher_AirStrike, CTFRocketLauncher );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
// Server specific.
#ifdef GAME_DLL
DECLARE_DATADESC();
#endif
CTFRocketLauncher_AirStrike();
virtual int GetWeaponID( void ) const { return TF_WEAPON_ROCKETLAUNCHER; }
const char* GetEffectLabelText( void ) { return "#TF_KILLS"; }
virtual int GetCount( void );
#ifdef GAME_DLL
virtual void OnPlayerKill( CTFPlayer *pVictim, const CTakeDamageInfo &info );
#endif
};
// ------------------------------------------------------------------------------------------------------------------------
class CTFRocketLauncher_Mortar : public CTFRocketLauncher
{
public:
DECLARE_CLASS( CTFRocketLauncher_Mortar, CTFRocketLauncher );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
// Server specific.
#ifdef GAME_DLL
DECLARE_DATADESC();
#endif
//CTFRocketLauncher_Mortar();
virtual int GetWeaponID( void ) const { return TF_WEAPON_ROCKETLAUNCHER; }
virtual CBaseEntity *FireProjectile( CTFPlayer *pPlayer );
virtual void SecondaryAttack( void );
virtual void ItemPostFrame( void );
virtual void ItemBusyFrame( void );
private:
void RedirectRockets();
#ifdef GAME_DLL
CUtlVector< EHANDLE > m_vecRockets;
#endif // GAME_DLL
};
// ------------------------------------------------------------------------------------------------------------------------
class CTFCrossbow : public CTFRocketLauncher
{
public:
DECLARE_CLASS( CTFCrossbow, CTFRocketLauncher );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
// Server specific.
#ifdef GAME_DLL
DECLARE_DATADESC();
#endif
virtual bool Holster( CBaseCombatWeapon *pSwitchingTo ) OVERRIDE;
virtual int GetWeaponID( void ) const { return TF_WEAPON_CROSSBOW; }
virtual void SecondaryAttack( void );
virtual float GetProjectileSpeed( void );
virtual float GetProjectileGravity( void );
virtual bool IsViewModelFlipped( void );
virtual void ItemPostFrame( void );
virtual void ModifyProjectile( CBaseEntity* pProj );
virtual void WeaponRegenerate( void );
float GetProgress( void );
const char* GetEffectLabelText( void ) { return "#TF_BOLT"; }
CNetworkVar( float, m_flRegenerateDuration );
CNetworkVar( float, m_flLastUsedTimestamp );
private:
bool m_bMilkNextAttack;
};
#endif // TF_WEAPON_ROCKETLAUNCHER_H
|