diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/sdk/weapon_basesdkgrenade.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/sdk/weapon_basesdkgrenade.h')
| -rw-r--r-- | game/shared/sdk/weapon_basesdkgrenade.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/game/shared/sdk/weapon_basesdkgrenade.h b/game/shared/sdk/weapon_basesdkgrenade.h new file mode 100644 index 0000000..3eaa26c --- /dev/null +++ b/game/shared/sdk/weapon_basesdkgrenade.h @@ -0,0 +1,79 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef WEAPON_BASESDKGRENADE_H +#define WEAPON_BASESDKGRENADE_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "weapon_sdkbase.h" + + +#ifdef CLIENT_DLL + + #define CBaseSDKGrenade C_BaseSDKGrenade + +#endif + + +class CBaseSDKGrenade : public CWeaponSDKBase +{ +public: + DECLARE_CLASS( CBaseSDKGrenade, CWeaponSDKBase ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + CBaseSDKGrenade(); + + virtual void Precache(); + + bool Deploy(); + bool Holster( CBaseCombatWeapon *pSwitchingTo ); + + void PrimaryAttack(); + void SecondaryAttack(); + + bool Reload(); + + virtual void ItemPostFrame(); + + void DecrementAmmo( CBaseCombatCharacter *pOwner ); + virtual void StartGrenadeThrow(); + virtual void ThrowGrenade(); + virtual void DropGrenade(); + + bool IsPinPulled() const; + +#ifndef CLIENT_DLL + DECLARE_DATADESC(); + + virtual bool AllowsAutoSwitchFrom( void ) const; + + int CapabilitiesGet(); + + // Each derived grenade class implements this. + virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer ); +#endif + +protected: + CNetworkVar( 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( float, m_fThrowTime ); // the time at which the grenade will be thrown. If this value is 0 then the time hasn't been set yet. + +private: + CBaseSDKGrenade( const CBaseSDKGrenade & ) {} +}; + + +inline bool CBaseSDKGrenade::IsPinPulled() const +{ + return m_bPinPulled; +} + + +#endif // WEAPON_BASESDKGRENADE_H |