mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Added a "damagetype" argument to P_ShieldDamage. We don't use MT_NULL to hack in damage for sector specials anymore, after all.
Must have forgotten to do this back when I originally implemented damage types, oh well.
This commit is contained in:
parent
175561cc7f
commit
31b2919847
1 changed files with 5 additions and 5 deletions
|
@ -2686,7 +2686,7 @@ void P_RemoveShield(player_t *player)
|
||||||
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
// Must do pain first to set flashing -- P_RemoveShield can cause damage
|
// Must do pain first to set flashing -- P_RemoveShield can cause damage
|
||||||
P_DoPlayerPain(player, source, inflictor);
|
P_DoPlayerPain(player, source, inflictor);
|
||||||
|
@ -2695,7 +2695,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
|
|
||||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||||
|
|
||||||
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
|
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes
|
||||||
S_StartSound(player->mo, sfx_spkdth);
|
S_StartSound(player->mo, sfx_spkdth);
|
||||||
else
|
else
|
||||||
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
||||||
|
@ -2971,7 +2971,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false; // Metal Sonic walk through flame !!
|
return false; // Metal Sonic walk through flame !!
|
||||||
else
|
else
|
||||||
{ // Oh no! Metal Sonic is hit !!
|
{ // Oh no! Metal Sonic is hit !!
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2997,7 +2997,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
#endif
|
#endif
|
||||||
else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield
|
else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield
|
||||||
{
|
{
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
damage = 0;
|
damage = 0;
|
||||||
}
|
}
|
||||||
else if (player->rings > 0) // No shield but have rings.
|
else if (player->rings > 0) // No shield but have rings.
|
||||||
|
@ -3019,7 +3019,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue