[Hide Content]From 054a1fcdbb46d58177d3715caf4e8a0caeb6fef1 Mon Sep 17 00:00:00 2001
From: Edward Randtke <erandtke@gmail.com>
Date: Thu, 27 Apr 2017 23:41:34 -0700
Subject: [PATCH] reordered events during Ozocubu's Refrigeration and Drain
Life to fix bug 0010972
---
crawl-ref/source/spl-damage.cc | 40 ++++++++++++++++++----------------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index 7195c217c2..01cd45e3a0 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -473,26 +473,25 @@ static int _refrigerate_monster(const actor* agent, monster* target, int pow,
if (actual)
{
- target->hurt(agent, hurted, BEAM_COLD);
-
- if (target->alive())
+ if (hurted)
{
- behaviour_event(target, ME_ANNOY, agent, // ME_WHACK?
- agent ? agent->pos() : coord_def(0, 0));
- }
+ behaviour_event(target, ME_ANNOY, agent, // ME_WHACK?
+ agent ? agent->pos() : coord_def(0, 0));
+ target->hurt(agent, hurted, BEAM_COLD);
- if (target->alive() && you.can_see(*target))
- print_wounds(*target);
+ if (target->alive() && you.can_see(*target))
+ print_wounds(*target);
- if (agent && agent->is_player()
- && (is_sanctuary(you.pos()) || is_sanctuary(target->pos())))
- {
- remove_sanctuary(true);
- }
+ if (agent && agent->is_player()
+ && (is_sanctuary(you.pos()) || is_sanctuary(target->pos())))
+ {
+ remove_sanctuary(true);
+ }
- // Cold-blooded creatures can be slowed.
- if (target->alive())
- target->expose_to_element(BEAM_COLD, 5);
+ // Cold-blooded creatures can be slowed.
+ if (target->alive())
+ target->expose_to_element(BEAM_COLD, 5);
+ }
}
return hurted;
@@ -541,6 +540,8 @@ static int _drain_monster(const actor* agent, monster* target, int pow,
{
if (hurted)
{
+ behaviour_event(target, ME_ANNOY, agent,
+ agent ? agent->pos() : coord_def(0, 0));
if (agent && agent->is_player())
{
mprf("You draw life from %s.",
@@ -549,12 +550,6 @@ static int _drain_monster(const actor* agent, monster* target, int pow,
target->hurt(agent, hurted);
}
- if (target->alive())
- {
- behaviour_event(target, ME_ANNOY, agent,
- agent ? agent->pos() : coord_def(0, 0));
- }
-
if (target->alive() && you.can_see(*target))
print_wounds(*target);
}
@@ -719,6 +714,7 @@ static spret_type _cast_los_attack_spell(spell_type spell, int pow, const
beam.foe_info.power += (m->get_hit_dice() * this_damage / hurted);
}
}
+
}
*damage_done = total_damage;
--
2.11.0 (Apple Git-81)