Skip to content

Commit

Permalink
new causes of death
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Jun 1, 2024
1 parent 1e14ef8 commit 2816c3c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/game/shared/swarm/rd_cause_of_death.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ const char *const g_szDeathCauseStatName[] =
"cause_of_death.bleed_out",
"cause_of_death.marineacademy_lava",
"cause_of_death.remote_turret",
"cause_of_death.cold",
"cause_of_death.fizzle",
"cause_of_death.plasma",
"cause_of_death.marine_charge",
};

#ifndef CLIENT_DLL
Expand Down Expand Up @@ -299,6 +303,11 @@ RD_Cause_of_Death_t GetCauseOfDeath( CBaseEntity *pVictim, const CTakeDamageInfo

if ( info.GetDamageType() & DMG_SHOCK )
{
if ( info.GetDamageType() & DMG_DISSOLVE )
{
return DEATHCAUSE_FIZZLE;
}

return DEATHCAUSE_ZAPPED;
}

Expand Down Expand Up @@ -559,6 +568,21 @@ RD_Cause_of_Death_t GetCauseOfDeath( CBaseEntity *pVictim, const CTakeDamageInfo
return DEATHCAUSE_BURN_OTHER;
}

if ( info.GetDamageType() & DMG_COLD )
{
return DEATHCAUSE_COLD;
}

if ( info.GetDamageType() & DMG_PLASMA )
{
return DEATHCAUSE_PLASMA;
}

if ( info.GetInflictor() && info.GetInflictor()->Classify() == CLASS_ASW_SPEED_BURST )
{
return DEATHCAUSE_MARINE_CHARGE;
}

Warning( "Could not determine cause of death from damage info:\n" );
Warning( " map %s\n", STRING( gpGlobals->mapname ) );
WarnEntityHelper( "victim", pVictim );
Expand Down
4 changes: 4 additions & 0 deletions src/game/shared/swarm/rd_cause_of_death.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ enum RD_Cause_of_Death_t
DEATHCAUSE_BLEED_OUT,
DEATHCAUSE_MARINEACADEMY_LAVA,
DEATHCAUSE_REMOTE_TURRET,
DEATHCAUSE_COLD,
DEATHCAUSE_FIZZLE,
DEATHCAUSE_PLASMA,
DEATHCAUSE_MARINE_CHARGE,
// ^^^ add new items here!

DEATHCAUSE_COUNT,
Expand Down

0 comments on commit 2816c3c

Please sign in to comment.