source-engine/game/server/EntityFlame.h

86 lines
2.2 KiB
C
Raw Normal View History

2023-10-03 17:23:56 +03:00
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
2020-04-22 12:56:21 -04:00
//
// Purpose:
//
2023-10-03 17:23:56 +03:00
//===========================================================================//
2020-04-22 12:56:21 -04:00
#ifndef ENTITYFLAME_H
#define ENTITYFLAME_H
#ifdef _WIN32
#pragma once
#endif
2023-10-03 17:23:56 +03:00
#include "ai_planesolver.h"
2020-04-22 12:56:21 -04:00
#define FLAME_DAMAGE_INTERVAL 0.2f // How often to deal damage.
#define FLAME_DIRECT_DAMAGE_PER_SEC 5.0f
#define FLAME_RADIUS_DAMAGE_PER_SEC 4.0f
#define FLAME_DIRECT_DAMAGE ( FLAME_DIRECT_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
#define FLAME_RADIUS_DAMAGE ( FLAME_RADIUS_DAMAGE_PER_SEC * FLAME_DAMAGE_INTERVAL )
#define FLAME_MAX_LIFETIME_ON_DEAD_NPCS 10.0f
2023-10-03 17:23:56 +03:00
class CAI_Link;
2020-04-22 12:56:21 -04:00
class CEntityFlame : public CBaseEntity
{
DECLARE_SERVERCLASS();
DECLARE_CLASS( CEntityFlame, CBaseEntity );
2023-10-03 17:23:56 +03:00
DECLARE_DATADESC();
2020-04-22 12:56:21 -04:00
2023-10-03 17:23:56 +03:00
public:
static CEntityFlame *Create( CBaseEntity *pTarget, float flLifetime, float flSize = 0.0f, bool bUseHitboxes = true );
2020-04-22 12:56:21 -04:00
2023-10-03 17:23:56 +03:00
CEntityFlame( void );
2020-04-22 12:56:21 -04:00
void AttachToEntity( CBaseEntity *pTarget );
void SetLifetime( float lifetime );
void SetUseHitboxes( bool use );
2023-10-03 17:23:56 +03:00
2020-04-22 12:56:21 -04:00
void SetNumHitboxFires( int iNumHitBoxFires );
void SetHitboxFireScale( float flHitboxFireScale );
2023-10-03 17:23:56 +03:00
float GetRemainingLife( void ) const;
2020-04-22 12:56:21 -04:00
int GetNumHitboxFires( void );
float GetHitboxFireScale( void );
virtual void Precache();
virtual void UpdateOnRemove();
2023-10-03 17:23:56 +03:00
virtual void Spawn();
virtual void Activate();
2020-04-22 12:56:21 -04:00
2023-10-03 17:23:56 +03:00
void UseCheapEffect( bool bCheap );
2020-04-22 12:56:21 -04:00
2023-10-03 17:23:56 +03:00
void SetSize( float size ) { m_flSize = size; }
void SetAttacker( CBaseEntity *pAttacker ) { m_hAttacker = pAttacker; }
CBaseEntity *GetAttacker( void ) const;
2020-04-22 12:56:21 -04:00
2023-10-03 17:23:56 +03:00
protected:
2020-04-22 12:56:21 -04:00
void FlameThink( void );
CNetworkHandle( CBaseEntity, m_hEntAttached ); // The entity that we are burning (attached to).
2023-10-03 17:23:56 +03:00
CNetworkVar( bool, m_bCheapEffect );
2020-04-22 12:56:21 -04:00
CNetworkVar( float, m_flSize );
CNetworkVar( bool, m_bUseHitboxes );
CNetworkVar( int, m_iNumHitboxFires );
CNetworkVar( float, m_flHitboxFireScale );
CNetworkVar( float, m_flLifetime );
2023-10-03 17:23:56 +03:00
string_t m_iszPlayingSound; // Track the sound so we can StopSound later
EHANDLE m_hAttacker;
int m_iDangerSound;
bool m_bPlayingSound;
CUtlVector< CAI_Link * > m_DangerLinks;
Obstacle_t m_hObstacle;
2020-04-22 12:56:21 -04:00
};
#endif // ENTITYFLAME_H