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 CWeaponRifleGrenadeGER_Live C_WeaponRifleGrenadeGER_Live
  10. #else
  11. #include "dod_riflegrenade_ger.h" //the thing that we throw
  12. #endif
  13. class CWeaponRifleGrenadeGER_Live : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponRifleGrenadeGER_Live, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponRifleGrenadeGER_Live() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_RIFLEGREN_GER_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. CDODRifleGrenadeGER::Create( vecSrc, vecNewAngles, vecVel, angNewImpulse, pPlayer, flLifeTime, GetWeaponID() );
  28. }
  29. #endif
  30. virtual bool IsArmed( void ) { return true; }
  31. private:
  32. CWeaponRifleGrenadeGER_Live( const CWeaponRifleGrenadeGER_Live & );
  33. };
  34. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponRifleGrenadeGER_Live, DT_WeaponRifleGrenadeGER_Live )
  35. BEGIN_NETWORK_TABLE(CWeaponRifleGrenadeGER_Live, DT_WeaponRifleGrenadeGER_Live)
  36. END_NETWORK_TABLE()
  37. BEGIN_PREDICTION_DATA( CWeaponRifleGrenadeGER_Live )
  38. END_PREDICTION_DATA()
  39. LINK_ENTITY_TO_CLASS( weapon_riflegren_ger_live, CWeaponRifleGrenadeGER_Live );
  40. PRECACHE_WEAPON_REGISTER( weapon_riflegren_ger_live );