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.

86 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: TF Caltrop Grenade.
  4. //
  5. //=============================================================================//
  6. #ifndef TF_WEAPON_GRENADE_CALTROP_H
  7. #define TF_WEAPON_GRENADE_CALTROP_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 CTFGrenadeCaltrop C_TFGrenadeCaltrop
  16. #define CTFGrenadeCaltropProjectile C_TFGrenadeCaltropProjectile
  17. #endif
  18. //=============================================================================
  19. //
  20. // TF Caltrop Grenade
  21. //
  22. class CTFGrenadeCaltrop : public CTFWeaponBaseGrenade
  23. {
  24. public:
  25. DECLARE_CLASS( CTFGrenadeCaltrop, CTFWeaponBaseGrenade );
  26. DECLARE_NETWORKCLASS();
  27. DECLARE_PREDICTABLE();
  28. // DECLARE_ACTTABLE();
  29. CTFGrenadeCaltrop() {}
  30. // Unique identifier.
  31. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_CALTROP; }
  32. // Server specific.
  33. #ifdef GAME_DLL
  34. DECLARE_DATADESC();
  35. virtual CTFWeaponBaseGrenadeProj *EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flTime, int iflags = 0 );
  36. #endif
  37. CTFGrenadeCaltrop( const CTFGrenadeCaltrop & ) {}
  38. };
  39. //=============================================================================
  40. //
  41. // TF Caltrop Grenade Projectile (Server specific.)
  42. //
  43. class CTFGrenadeCaltropProjectile : public CTFWeaponBaseGrenadeProj
  44. {
  45. public:
  46. DECLARE_CLASS( CTFGrenadeCaltropProjectile, CTFWeaponBaseGrenadeProj );
  47. DECLARE_NETWORKCLASS();
  48. // Unique identifier.
  49. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_CALTROP; }
  50. #ifdef GAME_DLL
  51. // Creation.
  52. static CTFGrenadeCaltropProjectile *Create( const Vector &position, const QAngle &angles, const Vector &velocity,
  53. const AngularImpulse &angVelocity, CBaseCombatCharacter *pOwner, const CTFWeaponInfo &weaponInfo, float timer, int iFlags = 0 );
  54. // Overrides.
  55. virtual void Spawn();
  56. virtual void Precache();
  57. virtual void BounceSound( void );
  58. virtual void Detonate();
  59. #endif
  60. virtual void Touch( CBaseEntity *pOther );
  61. #ifdef CLIENT_DLL
  62. virtual void OnDataChanged(DataUpdateType_t updateType);
  63. #endif
  64. private:
  65. float m_flDetonateTime;
  66. };
  67. #endif // TF_WEAPON_GRENADE_CALTROP_H