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.

51 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodbasegrenade.h"
  8. #ifdef CLIENT_DLL
  9. #define CWeaponExplodingHandGrenade C_WeaponExplodingHandGrenade
  10. #else
  11. #include "dod_handgrenade.h" //the thing that we throw
  12. #endif
  13. class CWeaponExplodingHandGrenade : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponExplodingHandGrenade, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponExplodingHandGrenade() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_FRAG_US_LIVE; }
  21. #ifndef CLIENT_DLL
  22. virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH )
  23. {
  24. CDODHandGrenade::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer, flLifeTime, GetWeaponID() );
  25. }
  26. #endif
  27. virtual bool IsArmed( void ) { return true; }
  28. private:
  29. CWeaponExplodingHandGrenade( const CWeaponExplodingHandGrenade & );
  30. };
  31. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponExplodingHandGrenade, DT_WeaponExplodingHandGrenade )
  32. BEGIN_NETWORK_TABLE(CWeaponExplodingHandGrenade, DT_WeaponExplodingHandGrenade)
  33. END_NETWORK_TABLE()
  34. BEGIN_PREDICTION_DATA( CWeaponExplodingHandGrenade ) //MATTTODO: are these necessary?
  35. END_PREDICTION_DATA()
  36. LINK_ENTITY_TO_CLASS( weapon_frag_us_live, CWeaponExplodingHandGrenade );
  37. PRECACHE_WEAPON_REGISTER( weapon_frag_us_live );