Skip to content

Commit

Permalink
Fix robogrunt damage reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Sep 12, 2024
1 parent dcbcbea commit 0fef0d6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dlls/rgrunt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class CRGrunt : public CHGrunt

void Killed( entvars_t *pevInflictor, entvars_t *pevAttacker, int iGib );
void BecomeDead();
int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
void TraceAttack( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);

float m_flSparkTime;
Expand Down Expand Up @@ -361,6 +362,15 @@ void CRGrunt::BecomeDead()

#define ROBOGRUNT_DAMAGE (DMG_ENERGYBEAM|DMG_CRUSH|DMG_MORTAR|DMG_BLAST|DMG_SHOCK|DMG_FREEZE|DMG_ACID)

int CRGrunt::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
{
if ((bitsDamageType & ROBOGRUNT_DAMAGE) == 0)
{
flDamage *= 0.2f;
}
return CHGrunt::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType );
}

void CRGrunt::TraceAttack(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{
if ((bitsDamageType & ROBOGRUNT_DAMAGE) == 0)
Expand All @@ -370,7 +380,6 @@ void CRGrunt::TraceAttack(entvars_t *pevInflictor, entvars_t *pevAttacker, float
UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2 ) );
pev->dmgtime = gpGlobals->time;
}
flDamage *= 0.2;
}
CSquadMonster::TraceAttack( pevInflictor, pevAttacker, flDamage, vecDir, ptr, bitsDamageType );
}
Expand Down

0 comments on commit 0fef0d6

Please sign in to comment.