Skip to content

Commit

Permalink
separate burn grace period per incendiary weapon type
Browse files Browse the repository at this point in the history
fix incendiary mines not properly handling friendly fire sometimes

make rolling through mines actually do something
  • Loading branch information
BenLubar committed Aug 2, 2024
1 parent 77ffb5a commit 9e4e35d
Show file tree
Hide file tree
Showing 29 changed files with 104 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/game/server/ai_basenpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ class CAI_BaseNPC : public CBaseCombatCharacter,
void SelectDeathPose( const CTakeDamageInfo &info );
virtual bool ShouldPickADeathPose( void ) { return true; }

virtual bool AllowedToIgnite( void ) { return false; }
virtual bool AllowedToIgnite( CBaseEntity *pAttacker, CBaseEntity *pWeapon, CBaseEntity *pInflictor ) { return false; }

protected:
virtual float GetGoalRepathTolerance( CBaseEntity *pGoalEnt, GoalType_t type, const Vector &curGoal, const Vector &curTargetPos );
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/baseanimating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3684,7 +3684,7 @@ void CBaseAnimating::Ignite( float flFlameLifetime, bool bNPCOnly, float flSize,
{
CAI_BaseNPC *pNPC = MyNPCPointer();

if ( pNPC && pNPC->AllowedToIgnite() == false )
if ( pNPC && pNPC->AllowedToIgnite( NULL, NULL, NULL ) == false )
return;
}

Expand Down
2 changes: 0 additions & 2 deletions src/game/server/hl2/npc_BaseZombie.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ abstract_class CNPC_BaseZombie : public CASW_Alien

bool OnInsufficientStopDist( AILocalMoveGoal_t *pMoveGoal, float distClear, AIMoveResult_t *pResult );

virtual bool AllowedToIgnite( void ) { return m_bFlammable; }

public:
CAI_ActBusyBehavior m_ActBusyBehavior;

Expand Down
2 changes: 0 additions & 2 deletions src/game/server/hl2/npc_combines.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class CNPC_CombineS : public CNPC_Combine

bool m_fIsBlocking;

virtual bool AllowedToIgnite( void ) { return true; }

private:
bool ShouldHitPlayer( const Vector &targetDir, float targetDist );

Expand Down
2 changes: 0 additions & 2 deletions src/game/server/hl2/npc_headcrab.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ abstract_class CBaseHeadcrab : public CASW_Alien_Jumper

void CrawlFromCanister();

virtual bool AllowedToIgnite( void ) { return m_bFlammable; }

virtual bool CanBeAnEnemyOf( CBaseEntity *pEnemy );

bool IsHangingFromCeiling( void )
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/props.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ void CBreakableProp::BreakablePropTouch( CBaseEntity *pOther )
{
CAI_BaseNPC *pNPC = pOther->MyNPCPointer();

if ( pNPC && pNPC->AllowedToIgnite() && pNPC->IsOnFire() == false )
if ( pNPC && pNPC->AllowedToIgnite( NULL, NULL, NULL ) && pNPC->IsOnFire() == false )
{
pNPC->Ignite( 25.0f );
KillFlare( this, m_hFlareEnt, PROP_FLARE_IGNITE_SUBSTRACT );
Expand Down
6 changes: 3 additions & 3 deletions src/game/server/swarm/asw_buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ int CASW_Buzzer::OnTakeDamage_Alive( const CTakeDamageInfo &info )
if (nRetVal > 0 &&
( ((info.GetDamageType() & DMG_BURN) || (info.GetDamageType() & DMG_BLAST)) && m_bFlammable )
)
ASW_Ignite(30.0f, 0, pAttacker, info.GetWeapon() );
ASW_Ignite(30.0f, 0, pAttacker, info.GetWeapon(), info.GetInflictor() );
}

return nRetVal;
Expand Down Expand Up @@ -3024,9 +3024,9 @@ int CASW_Buzzer::SelectSchedule( void )
return BaseClass::SelectSchedule();
}

void CASW_Buzzer::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon /*= NULL */ )
void CASW_Buzzer::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor )
{
if (AllowedToIgnite())
if ( AllowedToIgnite( pAttacker, pDamagingWeapon, pInflictor ) )
{
if( IsOnFire() )
return;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_buzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ DECLARE_SERVERCLASS();
virtual bool IsAlien(void) const { return true; }

virtual void MoveAside() { }
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon = NULL );
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor );
virtual void Extinguish();
virtual void OnSwarmSensed(int iDistance);

Expand Down
6 changes: 3 additions & 3 deletions src/game/server/swarm/asw_colonist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ int CASW_Colonist::OnTakeDamage_Alive( const CTakeDamageInfo &info )
{
if ( !IsOnFire() )
{
ASW_Ignite( 10, 0, info.GetAttacker(), info.GetWeapon() );
ASW_Ignite( 10, 0, info.GetAttacker(), info.GetWeapon(), info.GetInflictor() );
}
}
else if ( info.GetDamage() > 0 )
Expand All @@ -433,9 +433,9 @@ int CASW_Colonist::OnTakeDamage_Alive( const CTakeDamageInfo &info )
return BaseClass::OnTakeDamage_Alive( info );
}

void CASW_Colonist::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon )
void CASW_Colonist::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor )
{
if ( AllowedToIgnite() )
if ( AllowedToIgnite( pAttacker, pDamagingWeapon, pInflictor ) )
{
bool bFriendlyFire = IRelationType( pAttacker ) == D_LI;

Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_colonist.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CASW_Colonist : public CASW_Inhabitable_NPC, public IASW_Server_Usable_Ent
Class_T Classify() { return (Class_T) CLASS_ASW_COLONIST; }
Activity NPC_TranslateActivity( Activity eNewActivity );
int OnTakeDamage_Alive( const CTakeDamageInfo &info );
void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon );
void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor ) override;
virtual void MeleeBleed(CTakeDamageInfo* info);
bool IsPlayerAlly( CBasePlayer *pPlayer = NULL );
void PainSound( const CTakeDamageInfo &info );
Expand Down
8 changes: 4 additions & 4 deletions src/game/server/swarm/asw_egg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void CASW_Egg::Hatch(CBaseEntity* pOther)
CBaseEntity *pBurner = m_hBurner.Get();
if (!pBurner)
pBurner = this;
GetParasite()->ASW_Ignite( 30, 0, pBurner, m_hBurnerWeapon.Get() );
GetParasite()->ASW_Ignite( 30, 0, pBurner, m_hBurnerWeapon.Get(), pBurner );
}
else
{
Expand Down Expand Up @@ -547,7 +547,7 @@ int CASW_Egg::OnTakeDamage( const CTakeDamageInfo &info )

if ( ( info.GetDamageType() & DMG_BURN ) || ( info.GetDamageType() & DMG_BLAST ) )
{
ASW_Ignite( 30.0f, 0, pAttacker, info.GetWeapon() );
ASW_Ignite( 30.0f, 0, pAttacker, info.GetWeapon(), info.GetInflictor() );
}
}
return result;
Expand Down Expand Up @@ -642,7 +642,7 @@ void CASW_Egg::ParasiteDied(CASW_Parasite* pParasite)
m_hParasite = NULL;
}

void CASW_Egg::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon /*= NULL */ )
void CASW_Egg::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor )
{
if( IsOnFire() )
return;
Expand All @@ -660,7 +660,7 @@ void CASW_Egg::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAt

void CASW_Egg::Ignite( float flFlameLifetime, bool bNPCOnly, float flSize, bool bCalledByLevelDesigner )
{
return; // use ASW_Ignite instead
Assert( 0 ); // use ASW_Ignite instead
}

CASW_Parasite* CASW_Egg::GetParasite()
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_egg.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CASW_Egg : public CBaseFlex
// damage related
virtual int OnTakeDamage( const CTakeDamageInfo &info );
virtual void Event_Killed( const CTakeDamageInfo &info );
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon = NULL );
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor );
virtual void Ignite( float flFlameLifetime, bool bNPCOnly = true, float flSize = 0.0f, bool bCalledByLevelDesigner = false );
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
virtual void Bleed( const CTakeDamageInfo &info, const Vector &vecPos, const Vector &vecDir, trace_t *ptr );
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_extinguisher_projectile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IMPLEMENT_SERVERCLASS_ST( CASW_Extinguisher_Projectile, DT_ASW_Extinguisher_Proj
END_SEND_TABLE()

BEGIN_DATADESC( CASW_Extinguisher_Projectile )
DEFINE_FUNCTION( ProjectileTouch ),
DEFINE_ENTITYFUNC( ProjectileTouch ),
DEFINE_FIELD( m_hFirer, FIELD_EHANDLE ),
DEFINE_FIELD( m_hFirerWeapon, FIELD_EHANDLE ),
DEFINE_FIELD( m_flDamage, FIELD_FLOAT ),
Expand Down
6 changes: 5 additions & 1 deletion src/game/server/swarm/asw_extinguisher_projectile.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "rd_inventory_shared.h"

class CASW_Extinguisher_Projectile : public CBaseCombatCharacter
class CASW_Extinguisher_Projectile : public CBaseCombatCharacter, public IRD_Has_Projectile_Data
{
DECLARE_CLASS( CASW_Extinguisher_Projectile, CBaseCombatCharacter );
DECLARE_SERVERCLASS();
Expand Down Expand Up @@ -32,6 +32,10 @@ class CASW_Extinguisher_Projectile : public CBaseCombatCharacter
EHANDLE m_hFirerWeapon;

CNetworkVarEmbedded( CRD_ProjectileData, m_ProjectileData );
const CRD_ProjectileData *GetProjectileData() const override
{
return &m_ProjectileData;
}

float m_flDamage;
float m_flFreezeAmount;
Expand Down
6 changes: 3 additions & 3 deletions src/game/server/swarm/asw_fire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,13 +1806,13 @@ void CFire::ASWFireTouch( CBaseEntity *pOther )
}

// Burn for 1/3rd the time decided by difficulty
pMarine->ASW_Ignite( ( m_nFireType == FIRE_WALL_MINE ) ? 0.5f : 1.0f, 0, pOwner ? pOwner : this, m_hCreatorWeapon );
pMarine->ASW_Ignite( ( m_nFireType == FIRE_WALL_MINE ) ? 0.5f : 1.0f, 0, pOwner ? pOwner : this, m_hCreatorWeapon, this );
//Msg("OUCH OUCH BURNING MARINE\n");
}
else if ( pOther->Classify() == CLASS_ASW_COLONIST )
{
CASW_Colonist *pColonist = assert_cast<CASW_Colonist*>(pOther);
pColonist->ASW_Ignite( ( m_nFireType == FIRE_WALL_MINE ) ? 5 : 10, 0, pOwner ? pOwner : this, m_hCreatorWeapon );
pColonist->ASW_Ignite( ( m_nFireType == FIRE_WALL_MINE ) ? 5 : 10, 0, pOwner ? pOwner : this, m_hCreatorWeapon, this );
}
else if ( IASW_Spawnable_NPC *pSpawnable = dynamic_cast< IASW_Spawnable_NPC * >( pOther ) )
{
Expand All @@ -1828,7 +1828,7 @@ void CFire::ASWFireTouch( CBaseEntity *pOther )
}
}
}
pSpawnable->ASW_Ignite( 10.0f, 0, pOwner ? pOwner : this, m_hCreatorWeapon );
pSpawnable->ASW_Ignite( 10.0f, 0, pOwner ? pOwner : this, m_hCreatorWeapon, this );

if ( m_nFireType == FIRE_WALL_MINE && pSpawnable->GetNPC() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_harvester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ void CASW_Harvester::Event_Killed( const CTakeDamageInfo &info )

if ( IsOnFire() )
{
pParasite->ASW_Ignite( 30.0f, 0, info.GetAttacker(), info.GetWeapon() );
pParasite->ASW_Ignite( 30.0f, 0, info.GetAttacker(), info.GetWeapon(), info.GetInflictor() );
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/game/server/swarm/asw_inhabitable_npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ int CASW_Inhabitable_NPC::OnTakeDamage_Alive( const CTakeDamageInfo &info )
// if we take fire damage (but not afterburn damage), catch on fire
if ( result > 0 && ( newInfo.GetDamageType() & DMG_BURN ) && m_bFlammable && newInfo.GetWeapon() && !( newInfo.GetDamageType() & DMG_DIRECT ) )
{
ASW_Ignite( asw_alien_burn_duration.GetFloat(), 0, pAttacker, newInfo.GetWeapon() );
ASW_Ignite( asw_alien_burn_duration.GetFloat(), 0, pAttacker, newInfo.GetWeapon(), newInfo.GetInflictor() );
}

// make the alien move slower for 0.5 seconds
Expand Down Expand Up @@ -738,9 +738,9 @@ void CASW_Inhabitable_NPC::Event_Killed( const CTakeDamageInfo &info )
BaseClass::Event_Killed( info );
}

void CASW_Inhabitable_NPC::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon )
void CASW_Inhabitable_NPC::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor )
{
if ( AllowedToIgnite() )
if ( AllowedToIgnite( pAttacker, pDamagingWeapon, pInflictor ) )
{
if ( IsOnFire() )
{
Expand All @@ -765,7 +765,7 @@ void CASW_Inhabitable_NPC::Ignite( float flFlameLifetime, bool bNPCOnly, float f

void CASW_Inhabitable_NPC::ScriptIgnite( float flFlameLifetime )
{
ASW_Ignite( flFlameLifetime, 0, NULL, NULL );
ASW_Ignite( flFlameLifetime, 0, NULL, NULL, NULL );
}

void CASW_Inhabitable_NPC::Extinguish()
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/swarm/asw_inhabitable_npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class CASW_Inhabitable_NPC : public CAI_PlayerAlly, public IASW_Spawnable_NPC
virtual void Event_Killed( const CTakeDamageInfo &info ) override;

// burning
virtual bool AllowedToIgnite( void ) override { return m_bFlammable; }
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon = NULL ) override;
virtual bool AllowedToIgnite( CBaseEntity *pAttacker, CBaseEntity *pWeapon, CBaseEntity *pInflictor ) override { return m_bFlammable; }
virtual void ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor ) override;
virtual void Ignite( float flFlameLifetime, bool bNPCOnly = true, float flSize = 0.0f, bool bCalledByLevelDesigner = false ) override;
virtual void ScriptIgnite( float flFlameLifetime );
virtual void Extinguish() override;
Expand Down
51 changes: 43 additions & 8 deletions src/game/server/swarm/asw_marine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,17 @@ ConVar asw_marine_burn_time_normal( "asw_marine_burn_time_normal", "8", FCVAR_CH
ConVar asw_marine_burn_time_hard( "asw_marine_burn_time_hard", "12", FCVAR_CHEAT, "Amount of time marine burns for when ignited on hard difficulty" );
ConVar asw_marine_burn_time_insane( "asw_marine_burn_time_insane", "15", FCVAR_CHEAT, "Amount of time marine burns for when ignited on insane difficulty" );
ConVar asw_marine_time_until_ignite_expire( "asw_marine_time_until_ignite_expire", "2.0", FCVAR_CHEAT, "Amount of time until repeated burn damage counter expires" );
ConVar asw_marine_time_until_ignite( "asw_marine_time_until_ignite", "0.0", FCVAR_CHEAT, "Amount of time before a marine ignites from taking repeated burn damage" );
ConVar asw_marine_time_until_ignite_hcff( "asw_marine_time_until_ignite_hcff", "0.0", FCVAR_CHEAT, "Amount of time before a marine ignites from taking repeated burn damage (hardcore ff)" );
ConVar asw_marine_time_until_ignite( "asw_marine_time_until_ignite", "0.7", FCVAR_CHEAT, "Amount of time before a marine ignites from taking repeated burn damage" );
ConVar asw_marine_time_until_ignite_hcff( "asw_marine_time_until_ignite_hcff", "0.2", FCVAR_CHEAT, "Amount of time before a marine ignites from taking repeated burn damage (hardcore ff)" );
ConVar asw_marine_time_until_ignite_flamer( "asw_marine_time_until_ignite_flamer", "0.0", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite for the M868 Flamer Unit" );
ConVar asw_marine_time_until_ignite_hcff_flamer( "asw_marine_time_until_ignite_hcff_flamer", "0.0", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite_hcff for the M868 Flamer Unit" );
ConVar asw_marine_time_until_ignite_grenade( "asw_marine_time_until_ignite_grenade", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite for M42 Vindicator grenades and NA-23 Incendiary Grenades" );
ConVar asw_marine_time_until_ignite_hcff_grenade( "asw_marine_time_until_ignite_hcff_grenade", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite_hcff for M42 Vindicator grenades and NA-23 Incendiary Grenades" );
ConVar asw_marine_time_until_ignite_mines( "asw_marine_time_until_ignite_mines", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite for M478 Proximity Incendiary Mines" );
ConVar asw_marine_time_until_ignite_hcff_mines( "asw_marine_time_until_ignite_hcff_mines", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite_hcff for M478 Proximity Incendiary Mines" );
ConVar asw_marine_time_until_ignite_plasma( "asw_marine_time_until_ignite_plasma", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite for the G521 Plasma Thrower" );
ConVar asw_marine_time_until_ignite_hcff_plasma( "asw_marine_time_until_ignite_hcff_plasma", "-1", FCVAR_CHEAT, "If non-negative, overrides asw_marine_time_until_ignite_hcff for the G521 Plasma Thrower" );
ConVar asw_marine_roll_through_firewall( "asw_marine_roll_through_firewall", "1", FCVAR_CHEAT, "If set, marines cannot be ignited by M478 Proximity Incendiary Mines while rolling" );
ConVar asw_mad_firing_break( "asw_mad_firing_break", "4", FCVAR_CHEAT, "Point at which the mad firing counter triggers the mad firing speech" );
ConVar asw_mad_firing_decay( "asw_mad_firing_decay", "0.15", FCVAR_CHEAT, "Tick down rate of the mad firing counter" );
ConVar asw_marine_special_idle_chatter_chance( "asw_marine_special_idle_chatter_chance", "0.25", FCVAR_CHEAT, "Chance of marine doing a special idle chatter" );
Expand Down Expand Up @@ -1874,9 +1883,9 @@ int CASW_Marine::OnTakeDamage_Alive( const CTakeDamageInfo &info )
// if we take fire damage, catch on fire
float fPainInterval = 0.7f;

if ( info.GetDamageType() & DMG_BURN )
if ( ( info.GetDamageType() & DMG_BURN ) && !( info.GetDamageType() & DMG_DIRECT ) )
{
ASW_Ignite( 1.0f, 0, pAttacker, info.GetWeapon() );
ASW_Ignite( 1.0f, 0, pAttacker, info.GetWeapon(), info.GetInflictor() );
}

if ( info.GetDamageType() & DMG_POISON )
Expand Down Expand Up @@ -5058,7 +5067,7 @@ void CASW_Marine::ScriptIgnite( float flFlameLifetime )
m_flLastBurnTime = gpGlobals->curtime;
}

void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon /*= NULL */ )
void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon, CBaseEntity *pInflictor )
{
if (!ASWGameRules())
return;
Expand All @@ -5081,7 +5090,7 @@ void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *
// if this is an env_fire trying to burn us, ignore the grace period that the AllowedToIgnite function does
// we want env_fires to always ignite the marine immediately so they can be used as dangerous blockers in levels
CFire *pFire = dynamic_cast< CFire * >( pAttacker );
if ( AllowedToIgnite( pAttacker, pDamagingWeapon ) || ( pFire && !pFire->m_bPlacedByMarine ) || rd_marine_ignite_immediately.GetBool() )
if ( AllowedToIgnite( pAttacker, pDamagingWeapon, pInflictor ) || ( pFire && !pFire->m_bPlacedByMarine ) || rd_marine_ignite_immediately.GetBool() )
{
if ( IsOnFire() )
return;
Expand Down Expand Up @@ -5113,7 +5122,7 @@ void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *

void CASW_Marine::Ignite( float flFlameLifetime, bool bNPCOnly, float flSize, bool bCalledByLevelDesigner )
{
return; // use ASW_Ignite instead;
Assert( 0 ); // use ASW_Ignite instead;
}

void CASW_Marine::Extinguish( CBaseEntity *pHealer, CBaseEntity *pWeapon )
Expand Down Expand Up @@ -5147,12 +5156,38 @@ void CASW_Marine::Extinguish()
Extinguish( NULL, NULL );
}

bool CASW_Marine::AllowedToIgnite( CBaseEntity *pAttacker, CBaseEntity *pWeapon )
bool CASW_Marine::AllowedToIgnite( CBaseEntity *pAttacker, CBaseEntity *pWeapon, CBaseEntity *pInflictor )
{
if ( m_iJumpJetting.Get() != 0 )
return false;

float flBurnTime = ( asw_marine_ff_absorption.GetInt() > 0 ) ? asw_marine_time_until_ignite.GetFloat() : asw_marine_time_until_ignite_hcff.GetFloat();
#define CHECK_BURN_TIME( suffix ) \
if ( asw_marine_ff_absorption.GetInt() > 0 && asw_marine_time_until_ignite_##suffix.GetFloat() >= 0 ) \
flBurnTime = asw_marine_time_until_ignite_##suffix.GetFloat(); \
else if ( asw_marine_ff_absorption.GetInt() <= 0 && asw_marine_time_until_ignite_hcff_##suffix.GetFloat() >= 0 ) \
flBurnTime = asw_marine_time_until_ignite_hcff_##suffix.GetFloat()
if ( pWeapon && pWeapon->Classify() == CLASS_ASW_FLAMER )
{
CHECK_BURN_TIME( flamer );
}
else if ( pWeapon && pWeapon->Classify() == CLASS_ASW_PLASMA_THROWER )
{
CHECK_BURN_TIME( plasma );
}
else if ( pInflictor && pInflictor->Classify() == CLASS_ASW_GRENADE_VINDICATOR )
{
CHECK_BURN_TIME( grenade );
}
else if ( pInflictor && pInflictor->Classify() == CLASS_ASW_FIRE && assert_cast< CFire * >( pInflictor )->m_bPlacedByMarine )
{
if ( m_iMeleeAttackID == CASW_Melee_System::s_nRollAttackID && asw_marine_roll_through_firewall.GetBool() )
return false;

CHECK_BURN_TIME( mines );
}
#undef CHECK_BURN_TIME

if ( flBurnTime <= 0.0f || ( m_flFirstBurnTime > 0 && ( gpGlobals->curtime - m_flFirstBurnTime ) >= flBurnTime ) )
return true;

Expand Down
Loading

0 comments on commit 9e4e35d

Please sign in to comment.