From 6afd76e5dbeaaf1caba244de6d735a6b5710334c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 6 Jan 2016 13:36:22 +0100 Subject: [PATCH] - enable damage types for Strife's delayed damage. It will always use the type of damage that was last encountered. --- src/d_player.h | 1 + src/p_spec.cpp | 5 +++-- src/p_user.cpp | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 11611cded..dc5b27a2b 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 + FName hazardtype; // Damage type of last hazardous damage encounter. int poisoncount; // screen flash for poison damage FName poisontype; // type of poison damage to apply FName poisonpaintype; // type of Pain state to enter for poison damage diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 58679e3e6..aa6e0235b 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -458,6 +458,7 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector) if (sector->Flags & SECF_HAZARD) { player->hazardcount += sector->damageamount; + player->hazardtype = sector->damagetype; } else { @@ -1231,7 +1232,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers) break; case sDamage_Hellslime: - P_SetupSectorDamage(sector, 2, 1, 0, NAME_None, SECF_HAZARD); + P_SetupSectorDamage(sector, 2, 1, 0, NAME_Slime, SECF_HAZARD); break; case Damage_InstantDeath: @@ -1240,7 +1241,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers) break; case sDamage_SuperHellslime: - P_SetupSectorDamage(sector, 4, 1, 0, NAME_None, SECF_HAZARD); + P_SetupSectorDamage(sector, 4, 1, 0, NAME_Slime, SECF_HAZARD); break; case Sector_Hidden: diff --git a/src/p_user.cpp b/src/p_user.cpp index 922cc2a1c..e60b82039 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -362,6 +362,7 @@ player_t &player_t::operator=(const player_t &p) damagecount = p.damagecount; bonuscount = p.bonuscount; hazardcount = p.hazardcount; + hazardtype = p.hazardtype; poisoncount = p.poisoncount; poisontype = p.poisontype; poisonpaintype = p.poisonpaintype; @@ -2599,7 +2600,7 @@ void P_PlayerThink (player_t *player) { player->hazardcount--; if (!(level.time & 31) && player->hazardcount > 16*TICRATE) - P_DamageMobj (player->mo, NULL, NULL, 5, NAME_Slime); + P_DamageMobj (player->mo, NULL, NULL, 5, player->hazardtype); } if (player->poisoncount && !(level.time & 15)) @@ -3012,7 +3013,11 @@ void player_t::Serialize (FArchive &arc) << air_finished << turnticks << oldbuttons; - bool IsBot; + if (SaveVersion >= 4929) + { + arc << hazardtype; + } + bool IsBot = false; if (SaveVersion >= 4514) { arc << Bot;