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.

54 lines
1.6 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 CWeaponSmokeGrenadeGER C_WeaponSmokeGrenadeGER
  10. #else
  11. #include "dod_smokegrenade_ger.h" //the thing that we throw
  12. #endif
  13. class CWeaponSmokeGrenadeGER : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponSmokeGrenadeGER, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponSmokeGrenadeGER() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_SMOKE_GER; }
  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 stickgrenade vertically and spin end over end
  25. QAngle vecNewAngles = QAngle(45,pPlayer->EyeAngles().y,0);
  26. AngularImpulse angNewImpulse = AngularImpulse( 0, 600, 0 );
  27. CDODSmokeGrenadeGER::Create( vecSrc, vecNewAngles, vecVel, angNewImpulse, pPlayer );
  28. }
  29. #endif
  30. virtual float GetDetonateTimerLength( void ) { return 10; }
  31. private:
  32. CWeaponSmokeGrenadeGER( const CWeaponSmokeGrenadeGER & ) {}
  33. };
  34. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponSmokeGrenadeGER, DT_WeaponSmokeGrenadeGER )
  35. BEGIN_NETWORK_TABLE(CWeaponSmokeGrenadeGER, DT_WeaponSmokeGrenadeGER)
  36. END_NETWORK_TABLE()
  37. BEGIN_PREDICTION_DATA( CWeaponSmokeGrenadeGER )
  38. END_PREDICTION_DATA()
  39. LINK_ENTITY_TO_CLASS( weapon_smoke_ger, CWeaponSmokeGrenadeGER );
  40. PRECACHE_WEAPON_REGISTER( weapon_smoke_ger );