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.

66 lines
1.7 KiB

  1. //========= Copyright 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. #define FLAME_DAMAGE_INTERVAL 0.2f // How often to deal damage.
  12. #define FLAME_DIRECT_DAMAGE_PER_SEC 5.0f
  13. #define FLAME_RADIUS_DAMAGE_PER_SEC 4.0f
  14. #define FLAME_DIRECT_DAMAGE ( FLAME_DIRECT_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
  15. #define FLAME_RADIUS_DAMAGE ( FLAME_RADIUS_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
  16. #define FLAME_MAX_LIFETIME_ON_DEAD_NPCS 10.0f
  17. class CEntityFlame : public CBaseEntity
  18. {
  19. public:
  20. DECLARE_SERVERCLASS();
  21. DECLARE_CLASS( CEntityFlame, CBaseEntity );
  22. CEntityFlame( void );
  23. static CEntityFlame *Create( CBaseEntity *pTarget, bool useHitboxes = true );
  24. void AttachToEntity( CBaseEntity *pTarget );
  25. void SetLifetime( float lifetime );
  26. void SetUseHitboxes( bool use );
  27. void SetNumHitboxFires( int iNumHitBoxFires );
  28. void SetHitboxFireScale( float flHitboxFireScale );
  29. float GetRemainingLife( void );
  30. int GetNumHitboxFires( void );
  31. float GetHitboxFireScale( void );
  32. virtual void Precache();
  33. virtual void UpdateOnRemove();
  34. void SetSize( float size ) { m_flSize = size; }
  35. DECLARE_DATADESC();
  36. protected:
  37. void InputIgnite( inputdata_t &inputdata );
  38. void FlameThink( void );
  39. CNetworkHandle( CBaseEntity, m_hEntAttached ); // The entity that we are burning (attached to).
  40. CNetworkVar( float, m_flSize );
  41. CNetworkVar( bool, m_bUseHitboxes );
  42. CNetworkVar( int, m_iNumHitboxFires );
  43. CNetworkVar( float, m_flHitboxFireScale );
  44. CNetworkVar( float, m_flLifetime );
  45. bool m_bPlayingSound;
  46. };
  47. #endif // ENTITYFLAME_H