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.

85 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: TF Emp Grenade.
  4. //
  5. //=============================================================================//
  6. #ifndef TF_WEAPON_GRENADE_EMP_H
  7. #define TF_WEAPON_GRENADE_EMP_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_grenade.h"
  12. #include "tf_weaponbase_grenadeproj.h"
  13. // Client specific.
  14. #ifdef CLIENT_DLL
  15. #define CTFGrenadeEmp C_TFGrenadeEmp
  16. #endif
  17. //=============================================================================
  18. //
  19. // TF Emp Grenade
  20. //
  21. class CTFGrenadeEmp : public CTFWeaponBaseGrenade
  22. {
  23. public:
  24. DECLARE_CLASS( CTFGrenadeEmp, CTFWeaponBaseGrenade );
  25. DECLARE_NETWORKCLASS();
  26. DECLARE_PREDICTABLE();
  27. // DECLARE_ACTTABLE();
  28. CTFGrenadeEmp() {}
  29. // Unique identifier.
  30. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_EMP; }
  31. // Server specific.
  32. #ifdef GAME_DLL
  33. DECLARE_DATADESC();
  34. virtual CTFWeaponBaseGrenadeProj *EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flTime, int iflags = 0 );
  35. #endif
  36. CTFGrenadeEmp( const CTFGrenadeEmp & ) {}
  37. };
  38. //=============================================================================
  39. //
  40. // TF Emp Grenade Projectile (Server specific.)
  41. //
  42. #ifdef GAME_DLL
  43. class CTFGrenadeEmpProjectile : public CTFWeaponBaseGrenadeProj
  44. {
  45. public:
  46. DECLARE_CLASS( CTFGrenadeEmpProjectile, CTFWeaponBaseGrenadeProj );
  47. // Unique identifier.
  48. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_EMP; }
  49. // Creation.
  50. static CTFGrenadeEmpProjectile *Create( const Vector &position, const QAngle &angles, const Vector &velocity,
  51. const AngularImpulse &angVelocity, CBaseCombatCharacter *pOwner, const CTFWeaponInfo &weaponInfo, float timer, int iFlags = 0 );
  52. // Overrides.
  53. virtual void Spawn();
  54. virtual void Precache();
  55. virtual void BounceSound( void );
  56. virtual void Detonate();
  57. void DetonateThink( void );
  58. DECLARE_DATADESC();
  59. private:
  60. bool m_bPlayedLeadIn;
  61. };
  62. #endif
  63. #endif // TF_WEAPON_GRENADE_EMP_H