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.

55 lines
1.7 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 CWeaponRifleGrenadeUS_Live C_WeaponRifleGrenadeUS_Live
  10. #else
  11. #include "dod_riflegrenade_us.h" //the thing that we throw
  12. #endif
  13. class CWeaponRifleGrenadeUS_Live : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponRifleGrenadeUS_Live, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponRifleGrenadeUS_Live() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_RIFLEGREN_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. // align the grenade vertically and spin end over end
  25. QAngle vecNewAngles = QAngle(45,pPlayer->EyeAngles().y,0);
  26. AngularImpulse angNewImpulse = AngularImpulse( 0, 600, 0 );
  27. CDODRifleGrenadeUS::Create( vecSrc, vecNewAngles, vecVel, angNewImpulse, pPlayer, flLifeTime, GetWeaponID() );
  28. }
  29. #endif
  30. virtual bool IsArmed( void ) { return true; }
  31. private:
  32. CWeaponRifleGrenadeUS_Live( const CWeaponRifleGrenadeUS_Live & );
  33. };
  34. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponRifleGrenadeUS_Live, DT_WeaponRifleGrenadeUS_Live )
  35. BEGIN_NETWORK_TABLE(CWeaponRifleGrenadeUS_Live, DT_WeaponRifleGrenadeUS_Live)
  36. END_NETWORK_TABLE()
  37. BEGIN_PREDICTION_DATA( CWeaponRifleGrenadeUS_Live )
  38. END_PREDICTION_DATA()
  39. LINK_ENTITY_TO_CLASS( weapon_riflegren_us_live, CWeaponRifleGrenadeUS_Live );
  40. PRECACHE_WEAPON_REGISTER( weapon_riflegren_us_live );