Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_BASESDKGRENADE_H
  7. #define WEAPON_BASESDKGRENADE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_sdkbase.h"
  12. #ifdef CLIENT_DLL
  13. #define CBaseSDKGrenade C_BaseSDKGrenade
  14. #endif
  15. class CBaseSDKGrenade : public CWeaponSDKBase
  16. {
  17. public:
  18. DECLARE_CLASS( CBaseSDKGrenade, CWeaponSDKBase );
  19. DECLARE_NETWORKCLASS();
  20. DECLARE_PREDICTABLE();
  21. CBaseSDKGrenade();
  22. virtual void Precache();
  23. bool Deploy();
  24. bool Holster( CBaseCombatWeapon *pSwitchingTo );
  25. void PrimaryAttack();
  26. void SecondaryAttack();
  27. bool Reload();
  28. virtual void ItemPostFrame();
  29. void DecrementAmmo( CBaseCombatCharacter *pOwner );
  30. virtual void StartGrenadeThrow();
  31. virtual void ThrowGrenade();
  32. virtual void DropGrenade();
  33. bool IsPinPulled() const;
  34. #ifndef CLIENT_DLL
  35. DECLARE_DATADESC();
  36. virtual bool AllowsAutoSwitchFrom( void ) const;
  37. int CapabilitiesGet();
  38. // Each derived grenade class implements this.
  39. virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer );
  40. #endif
  41. protected:
  42. CNetworkVar( bool, m_bRedraw ); // Draw the weapon again after throwing a grenade
  43. CNetworkVar( bool, m_bPinPulled ); // Set to true when the pin has been pulled but the grenade hasn't been thrown yet.
  44. 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.
  45. private:
  46. CBaseSDKGrenade( const CBaseSDKGrenade & ) {}
  47. };
  48. inline bool CBaseSDKGrenade::IsPinPulled() const
  49. {
  50. return m_bPinPulled;
  51. }
  52. #endif // WEAPON_BASESDKGRENADE_H