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.

50 lines
1.4 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 CWeaponSmokeGrenadeUS C_WeaponSmokeGrenadeUS
  10. #else
  11. #include "dod_smokegrenade_us.h" //the thing that we throw
  12. #endif
  13. class CWeaponSmokeGrenadeUS : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponSmokeGrenadeUS, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponSmokeGrenadeUS() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_SMOKE_US; }
  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. CDODSmokeGrenadeUS::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer );
  25. }
  26. #endif
  27. virtual float GetDetonateTimerLength( void ) { return 10; }
  28. private:
  29. CWeaponSmokeGrenadeUS( const CWeaponSmokeGrenadeUS & ) {}
  30. };
  31. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponSmokeGrenadeUS, DT_WeaponSmokeGrenadeUS )
  32. BEGIN_NETWORK_TABLE(CWeaponSmokeGrenadeUS, DT_WeaponSmokeGrenadeUS)
  33. END_NETWORK_TABLE()
  34. BEGIN_PREDICTION_DATA( CWeaponSmokeGrenadeUS )
  35. END_PREDICTION_DATA()
  36. LINK_ENTITY_TO_CLASS( weapon_smoke_us, CWeaponSmokeGrenadeUS );
  37. PRECACHE_WEAPON_REGISTER( weapon_smoke_us );