Counter Strike : Global Offensive Source Code
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.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef SMOKEGRENADE_PROJECTILE_H
  7. #define SMOKEGRENADE_PROJECTILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basecsgrenade_projectile.h"
  12. #if defined( CLIENT_DLL )
  13. class C_SmokeGrenadeProjectile : public C_BaseCSGrenadeProjectile
  14. {
  15. public:
  16. DECLARE_CLASS( C_SmokeGrenadeProjectile, C_BaseCSGrenadeProjectile );
  17. DECLARE_NETWORKCLASS();
  18. C_SmokeGrenadeProjectile() {}
  19. virtual ~C_SmokeGrenadeProjectile();
  20. virtual void PostDataUpdate( DataUpdateType_t updateType ) OVERRIDE;
  21. virtual void OnDataChanged( DataUpdateType_t updateType ) OVERRIDE;
  22. virtual GrenadeType_t GetGrenadeType( void ) { return GRENADE_TYPE_SMOKE; }
  23. void SpawnSmokeEffect();
  24. CNetworkVar( int, m_nSmokeEffectTickBegin );
  25. CNetworkVar( bool, m_bDidSmokeEffect );
  26. bool m_bSmokeEffectSpawned;
  27. };
  28. #else // GAME_DLL
  29. class CSmokeGrenadeProjectile : public CBaseCSGrenadeProjectile
  30. {
  31. public:
  32. DECLARE_CLASS( CSmokeGrenadeProjectile, CBaseCSGrenadeProjectile );
  33. DECLARE_NETWORKCLASS();
  34. public:
  35. DECLARE_DATADESC();
  36. // Overrides.
  37. public:
  38. virtual void Spawn();
  39. virtual void Precache();
  40. virtual void Detonate();
  41. virtual void OnBounced( void );
  42. virtual void BounceSound( void );
  43. void Think_Detonate();
  44. void Think_Fade();
  45. void Think_Remove();
  46. void SmokeDetonate( void );
  47. void RemoveGrenadeFromLists( void );
  48. virtual GrenadeType_t GetGrenadeType( void ) { return GRENADE_TYPE_SMOKE; }
  49. virtual int UpdateTransmitState() { return SetTransmitState( FL_EDICT_ALWAYS ); }
  50. // Grenade stuff.
  51. public:
  52. static CSmokeGrenadeProjectile* Create(
  53. const Vector &position,
  54. const QAngle &angles,
  55. const Vector &velocity,
  56. const AngularImpulse &angVelocity,
  57. CBaseCombatCharacter *pOwner,
  58. const CCSWeaponInfo& weaponInfo );
  59. void SetTimer( float timer );
  60. CNetworkVar( int, m_nSmokeEffectTickBegin );
  61. CNetworkVar( bool, m_bDidSmokeEffect );
  62. Vector m_vSmokeColor;
  63. float m_flLastBounce;
  64. };
  65. #endif // GAME_DLL
  66. #endif // SMOKEGRENADE_PROJECTILE_H