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.

119 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: TF Gas Grenade.
  4. //
  5. //=============================================================================//
  6. #ifndef TF_WEAPON_GRENADE_GAS_H
  7. #define TF_WEAPON_GRENADE_GAS_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 CTFGrenadeGas C_TFGrenadeGas
  16. #endif
  17. //=============================================================================
  18. //
  19. // TF Gas Grenade
  20. //
  21. class CTFGrenadeGas : public CTFWeaponBaseGrenade
  22. {
  23. public:
  24. DECLARE_CLASS( CTFGrenadeGas, CTFWeaponBaseGrenade );
  25. DECLARE_NETWORKCLASS();
  26. DECLARE_PREDICTABLE();
  27. // DECLARE_ACTTABLE();
  28. CTFGrenadeGas() {}
  29. // Unique identifier.
  30. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_GAS; }
  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. CTFGrenadeGas( const CTFGrenadeGas & ) {}
  37. };
  38. #ifdef CLIENT_DLL
  39. #define CTFGasGrenadeEffect C_TFGasGrenadeEffect
  40. #endif
  41. class CTFGasGrenadeEffect : public CBaseEntity
  42. {
  43. public:
  44. DECLARE_CLASS( CTFGasGrenadeEffect, CBaseEntity );
  45. DECLARE_NETWORKCLASS();
  46. #ifndef CLIENT_DLL
  47. virtual int UpdateTransmitState( void );
  48. #else
  49. CTFGasGrenadeEffect()
  50. {
  51. m_pGasEffect = NULL;
  52. }
  53. virtual void OnDataChanged( DataUpdateType_t updateType );
  54. CNewParticleEffect *m_pGasEffect;
  55. #endif
  56. };
  57. //=============================================================================
  58. //
  59. // TF Gase Grenade Projectile (Server specific.)
  60. //
  61. #ifdef GAME_DLL
  62. class CTFGrenadeGasProjectile : public CTFWeaponBaseGrenadeProj
  63. {
  64. public:
  65. DECLARE_CLASS( CTFGrenadeGasProjectile, CTFWeaponBaseGrenadeProj );
  66. DECLARE_DATADESC();
  67. ~CTFGrenadeGasProjectile();
  68. // Unique identifier.
  69. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_GAS; }
  70. // Creation.
  71. static CTFGrenadeGasProjectile *Create( const Vector &position, const QAngle &angles, const Vector &velocity,
  72. const AngularImpulse &angVelocity, CBaseCombatCharacter *pOwner, const CTFWeaponInfo &weaponInfo, float timer, int iFlags = 0 );
  73. // Overrides.
  74. virtual void Spawn();
  75. virtual void Precache();
  76. virtual void BounceSound( void );
  77. virtual void Detonate();
  78. virtual void DetonateThink( void );
  79. void Think_Emit( void );
  80. void Think_Fade( void );
  81. private:
  82. int m_nPulses;
  83. CHandle<CTFGasGrenadeEffect> m_hGasEffect;
  84. };
  85. #endif
  86. #endif // TF_WEAPON_GRENADE_GAS_H