blob: 9662fb35c3f16455dfc0a254fa1979c2ff482bae (
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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef WEAPON_DODBASEGRENADE_H
#define WEAPON_DODBASEGRENADE_H
#ifdef _WIN32
#pragma once
#endif
#include "weapon_dodbase.h"
#include "dod_shareddefs.h"
#ifdef CLIENT_DLL
#define CWeaponDODBaseGrenade C_WeaponDODBaseGrenade
#endif
class CWeaponDODBaseGrenade : public CWeaponDODBase
{
public:
DECLARE_CLASS( CWeaponDODBaseGrenade, CWeaponDODBase );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
DECLARE_ACTTABLE();
CWeaponDODBaseGrenade();
virtual void PrimaryAttack();
virtual bool CanHolster();
virtual bool IsArmed( void ) { return m_bArmed == true; }
void SetArmed( bool bArmed ) { m_bArmed = bArmed; }
virtual Activity GetIdleActivity( void );
virtual Activity GetPrimaryAttackActivity( void );
virtual Activity GetDrawActivity( void );
#ifdef CLIENT_DLL
#else
DECLARE_DATADESC();
virtual void Precache();
virtual void ItemPostFrame();
virtual bool AllowsAutoSwitchFrom( void ) const;
virtual bool Deploy();
virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
virtual bool Reload();
void DecrementAmmo( CBaseCombatCharacter *pOwner );
void StartThrow( int iThrowType );
void DropGrenade( void ); //forces the grenade to be dropped
virtual void ThrowGrenade( bool bDrop );
// Each derived grenade class implements this.
virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH );
void SetDetonateTime( float flDetonateTime )
{
m_flDetonateTime = flDetonateTime;
SetArmed( true );
}
void InputSetDetonateTime( inputdata_t &inputdata );
virtual float GetDetonateTimerLength( void ) { return GRENADE_FUSE_LENGTH; }
protected:
#endif
bool m_bRedraw; // Draw the weapon again after throwing a grenade
CNetworkVar( bool, m_bPinPulled ); // Set to true when the pin has been pulled but the grenade hasn't been thrown yet.
CNetworkVar( bool, m_bArmed ); // is the grenade armed?
float m_flDetonateTime; // what time the grenade will explode ( if > 0 )
CWeaponDODBaseGrenade( const CWeaponDODBaseGrenade & ) {}
};
#endif // WEAPON_DODBASEGRENADE_H
|