Add alternate "Full" mode for PowerIronFeet that prevents leaky damage.

# Conflicts:
#	src/playsim/p_spec.cpp
This commit is contained in:
Marisa Kirisame 2021-01-16 16:50:08 +01:00 committed by drfrag
parent 753f101bd9
commit a7fb96eec5
3 changed files with 17 additions and 6 deletions

View file

@ -27,6 +27,10 @@ xx(Spray)
xx(Ghost) xx(Ghost)
xx(Reflective) xx(Reflective)
// Iron Feet types
//xx(Normal) // defined below
xx(Full)
// Invisibility types // Invisibility types
xx(Additive) xx(Additive)
xx(Cumulative) xx(Cumulative)

View file

@ -455,8 +455,6 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
} }
// Has hit ground. // Has hit ground.
AActor *ironfeet;
if (sector->damageinterval <= 0) if (sector->damageinterval <= 0)
sector->damageinterval = 32; // repair invalid damageinterval values sector->damageinterval = 32; // repair invalid damageinterval values
@ -466,14 +464,22 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
// Allow subclasses. Better would be to implement it as armor and let that reduce // Allow subclasses. Better would be to implement it as armor and let that reduce
// the damage as part of the normal damage procedure. Unfortunately, I don't have // the damage as part of the normal damage procedure. Unfortunately, I don't have
// different damage types yet, so that's not happening for now. // different damage types yet, so that's not happening for now.
for (ironfeet = player->mo->Inventory; ironfeet != NULL; ironfeet = ironfeet->Inventory) // [MK] account for subclasses that may have "Full" protection (i.e.: prevent leaky damage)
int ironfeet = 0;
for (auto i = player->mo->Inventory; i != NULL; i = i->Inventory)
{ {
if (ironfeet->IsKindOf(NAME_PowerIronFeet)) if (i->IsKindOf(NAME_PowerIronFeet))
break; {
FName mode = i->NameVar(NAME_Mode);
if ( ironfeet < 2 && mode == NAME_Full )
ironfeet = 2;
else if ( ironfeet < 1 && mode == NAME_Normal )
ironfeet = 1;
}
} }
if (sector->Flags & SECF_ENDGODMODE) player->cheats &= ~CF_GODMODE; if (sector->Flags & SECF_ENDGODMODE) player->cheats &= ~CF_GODMODE;
if ((ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage)) if (ironfeet == 0 || (ironfeet < 2 && pr_playerinspecialsector() < sector->leakydamage))
{ {
if (sector->Flags & SECF_HAZARD) if (sector->Flags & SECF_HAZARD)
{ {

View file

@ -763,6 +763,7 @@ class PowerIronFeet : Powerup
{ {
Powerup.Duration -60; Powerup.Duration -60;
Powerup.Color "00 ff 00", 0.125; Powerup.Color "00 ff 00", 0.125;
Powerup.Mode "Normal";
} }
override void AbsorbDamage (int damage, Name damageType, out int newdamage, Actor inflictor, Actor source, int flags) override void AbsorbDamage (int damage, Name damageType, out int newdamage, Actor inflictor, Actor source, int flags)