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.

85 lines
2.2 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef ENTITYFLAME_H
  7. #define ENTITYFLAME_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "ai_planesolver.h"
  12. #define FLAME_DAMAGE_INTERVAL 0.2f // How often to deal damage.
  13. #define FLAME_DIRECT_DAMAGE_PER_SEC 5.0f
  14. #define FLAME_RADIUS_DAMAGE_PER_SEC 4.0f
  15. #define FLAME_DIRECT_DAMAGE ( FLAME_DIRECT_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
  16. #define FLAME_RADIUS_DAMAGE ( FLAME_RADIUS_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
  17. #define FLAME_MAX_LIFETIME_ON_DEAD_NPCS 10.0f
  18. class CAI_Link;
  19. class CEntityFlame : public CBaseEntity
  20. {
  21. DECLARE_SERVERCLASS();
  22. DECLARE_CLASS( CEntityFlame, CBaseEntity );
  23. DECLARE_DATADESC();
  24. public:
  25. static CEntityFlame *Create( CBaseEntity *pTarget, float flLifetime, float flSize = 0.0f, bool bUseHitboxes = true );
  26. CEntityFlame( void );
  27. void AttachToEntity( CBaseEntity *pTarget );
  28. void SetLifetime( float lifetime );
  29. void SetUseHitboxes( bool use );
  30. void SetNumHitboxFires( int iNumHitBoxFires );
  31. void SetHitboxFireScale( float flHitboxFireScale );
  32. float GetRemainingLife( void ) const;
  33. int GetNumHitboxFires( void );
  34. float GetHitboxFireScale( void );
  35. virtual void Precache();
  36. virtual void UpdateOnRemove();
  37. virtual void Spawn();
  38. virtual void Activate();
  39. void UseCheapEffect( bool bCheap );
  40. void SetSize( float size ) { m_flSize = size; }
  41. void SetAttacker( CBaseEntity *pAttacker ) { m_hAttacker = pAttacker; }
  42. CBaseEntity *GetAttacker( void ) const;
  43. protected:
  44. void FlameThink( void );
  45. CNetworkHandle( CBaseEntity, m_hEntAttached ); // The entity that we are burning (attached to).
  46. CNetworkVar( bool, m_bCheapEffect );
  47. CNetworkVar( float, m_flSize );
  48. CNetworkVar( bool, m_bUseHitboxes );
  49. CNetworkVar( int, m_iNumHitboxFires );
  50. CNetworkVar( float, m_flHitboxFireScale );
  51. CNetworkVar( float, m_flLifetime );
  52. string_t m_iszPlayingSound; // Track the sound so we can StopSound later
  53. EHANDLE m_hAttacker;
  54. int m_iDangerSound;
  55. bool m_bPlayingSound;
  56. CUtlVector< CAI_Link * > m_DangerLinks;
  57. Obstacle_t m_hObstacle;
  58. };
  59. #endif // ENTITYFLAME_H