summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-goditem.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-18 18:23:56 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-18 18:23:56 -0700
commit46f8a764047701062b2bdfc5a116449cfeee2054 (patch)
tree1cea8a7736e8808421bd2337d8afd1fd097024b3 /crawl-ref/source/spl-goditem.cc
parentfd3010e7d3e9bd5aaf5189135b7fb5dace197dc5 (diff)
downloadcrawl-ref-46f8a764047701062b2bdfc5a116449cfeee2054.tar.gz
crawl-ref-46f8a764047701062b2bdfc5a116449cfeee2054.zip
Don't instakill the player with antimagic
Flight gets a 11-aut respite from debuff_player(); this is... a hack, but it's something. Forms didn't get this; this meant that dispel-breath effects could instakill players in flying/floating forms, or a player drinking !cancellation in the wrong place would die instantly, without as much as a prompt. This gives transformations the same delay as flight; all transformations, since special-casing would confuse players. Better solutions welcomed!
Diffstat (limited to 'crawl-ref/source/spl-goditem.cc')
-rw-r--r--crawl-ref/source/spl-goditem.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/crawl-ref/source/spl-goditem.cc b/crawl-ref/source/spl-goditem.cc
index eca9fbd565..d3478a9ff9 100644
--- a/crawl-ref/source/spl-goditem.cc
+++ b/crawl-ref/source/spl-goditem.cc
@@ -340,8 +340,6 @@ spret_type cast_healing(int pow, int max_pow, bool divine_ability,
*
* Forms, buffs, debuffs, contamination, probably a few other things.
* Flight gets an extra 11 aut before going away to minimize instadeaths.
- * Flying/floating forms currently don't; XXX standardize this & make it less
- * hacky?
*/
void debuff_player()
{
@@ -350,8 +348,7 @@ void debuff_player()
DUR_INVIS, DUR_CONF, DUR_PARALYSIS, DUR_HASTE, DUR_SLOW,
DUR_MIGHT, DUR_AGILITY, DUR_BRILLIANCE, DUR_CONFUSING_TOUCH,
DUR_SURE_BLADE, DUR_CORONA, DUR_FIRE_SHIELD, DUR_ICY_ARMOUR,
- DUR_SWIFTNESS, DUR_CONTROL_TELEPORT,
- DUR_TRANSFORMATION, DUR_DEATH_CHANNEL,
+ DUR_SWIFTNESS, DUR_CONTROL_TELEPORT, DUR_DEATH_CHANNEL,
DUR_PHASE_SHIFT, DUR_WEAPON_BRAND, DUR_SILENCE,
DUR_CONDENSATION_SHIELD, DUR_STONESKIN, DUR_RESISTANCE,
DUR_STEALTH, DUR_MAGIC_SHIELD, DUR_PETRIFIED, DUR_LIQUEFYING,
@@ -364,11 +361,21 @@ void debuff_player()
bool need_msg = false;
- if (!you.permanent_flight()
- && you.duration[DUR_FLIGHT] > 11)
+ // don't instakill the player by removing flight
+ if (!you.permanent_flight())
{
- you.duration[DUR_FLIGHT] = 11;
- need_msg = true;
+ if (you.duration[DUR_FLIGHT] > 11)
+ {
+ you.duration[DUR_FLIGHT] = 11;
+ need_msg = true;
+ }
+
+ // too many forms; confusing to players & devs both to special case.
+ if (you.duration[DUR_TRANSFORMATION] > 11)
+ {
+ you.duration[DUR_TRANSFORMATION] = 11;
+ need_msg = true;
+ }
}
if (you.duration[DUR_TELEPORT] > 0)