diff --git a/src/d_player.h b/src/d_player.h index dc5b27a2b5..38879a63a4 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -422,6 +422,7 @@ public: int killcount, itemcount, secretcount; // for intermission int damagecount, bonuscount;// for screen flashing int hazardcount; // for delayed Strife damage + int hazardinterval; // Frequency of damage infliction FName hazardtype; // Damage type of last hazardous damage encounter. int poisoncount; // screen flash for poison damage FName poisontype; // type of poison damage to apply diff --git a/src/p_spec.cpp b/src/p_spec.cpp index aa6e0235bc..1013096518 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -453,14 +453,15 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector) } if (sector->Flags & SECF_ENDGODMODE) player->cheats &= ~CF_GODMODE; - if (level.time % sector->damageinterval == 0 && (ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage)) + if ((ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage)) { if (sector->Flags & SECF_HAZARD) { player->hazardcount += sector->damageamount; player->hazardtype = sector->damagetype; + player->hazardinterval = sector->damageinterval; } - else + else if (level.time % sector->damageinterval == 0) { P_DamageMobj(player->mo, NULL, NULL, sector->damageamount, sector->damagetype); if ((sector->Flags & SECF_ENDLEVEL) && player->health <= 10 && (!deathmatch || !(dmflags & DF_NO_EXIT))) @@ -1232,7 +1233,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers) break; case sDamage_Hellslime: - P_SetupSectorDamage(sector, 2, 1, 0, NAME_Slime, SECF_HAZARD); + P_SetupSectorDamage(sector, 2, 32, 0, NAME_Slime, SECF_HAZARD); break; case Damage_InstantDeath: @@ -1241,7 +1242,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers) break; case sDamage_SuperHellslime: - P_SetupSectorDamage(sector, 4, 1, 0, NAME_Slime, SECF_HAZARD); + P_SetupSectorDamage(sector, 4, 32, 0, NAME_Slime, SECF_HAZARD); break; case Sector_Hidden: diff --git a/src/p_user.cpp b/src/p_user.cpp index e60b82039e..ba987d3930 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -363,6 +363,7 @@ player_t &player_t::operator=(const player_t &p) bonuscount = p.bonuscount; hazardcount = p.hazardcount; hazardtype = p.hazardtype; + hazardinterval = p.hazardinterval; poisoncount = p.poisoncount; poisontype = p.poisontype; poisonpaintype = p.poisonpaintype; @@ -2599,7 +2600,7 @@ void P_PlayerThink (player_t *player) if (player->hazardcount) { player->hazardcount--; - if (!(level.time & 31) && player->hazardcount > 16*TICRATE) + if (!(level.time % player->hazardinterval) && player->hazardcount > 16*TICRATE) P_DamageMobj (player->mo, NULL, NULL, 5, player->hazardtype); } @@ -3015,7 +3016,8 @@ void player_t::Serialize (FArchive &arc) << oldbuttons; if (SaveVersion >= 4929) { - arc << hazardtype; + arc << hazardtype + << hazardinterval; } bool IsBot = false; if (SaveVersion >= 4514)