summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc11
-rw-r--r--crawl-ref/source/spells2.cc12
2 files changed, 15 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 8b1afccdbb..3f2d8dbd81 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4699,8 +4699,17 @@ void monsters::go_berserk(bool /* intentional */)
simple_monster_message( this, " goes berserk!" );
}
-void monsters::expose_to_element(beam_type, int)
+void monsters::expose_to_element(beam_type flavour, int strength)
{
+ switch (flavour)
+ {
+ case BEAM_COLD:
+ if (mons_class_flag(this->type, M_COLD_BLOOD) && coinflip())
+ add_ench(ENCH_SLOW);
+ break;
+ default:
+ break;
+ }
}
void monsters::banish(const std::string &)
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 495f92fe42..7b28f4b04c 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -819,7 +819,7 @@ bool vampiric_drain(int pow, const dist &vmove)
return (true);
}
-bool burn_freeze(int pow, beam_type flavour, int targetmon )
+bool burn_freeze(int pow, beam_type flavour, int targetmon)
{
pow = std::min(25, pow);
@@ -862,23 +862,21 @@ bool burn_freeze(int pow, beam_type flavour, int targetmon )
beam.flavour = flavour;
beam.thrower = KILL_YOU;
- int hurted = roll_dice(1, 3 + pow / 3);
- hurted = mons_adjust_flavoured(monster, beam, hurted);
+ const int orig_hurted = roll_dice(1, 3 + pow / 3);
+ int hurted = mons_adjust_flavoured(monster, beam, orig_hurted);
monster->hurt(&you, hurted);
if (monster->alive())
{
+ monster->expose_to_element(flavour, orig_hurted);
print_wounds(monster);
if (flavour == BEAM_COLD)
{
- if (mons_class_flag(monster->type, M_COLD_BLOOD) && coinflip())
- monster->add_ench(ENCH_SLOW);
-
const int cold_res = mons_res_cold( monster );
if (cold_res <= 0)
{
- const int stun = (1 - cold_res) * random2( 2 + pow / 5 );
+ const int stun = (1 - cold_res) * random2(2 + pow/5);
monster->speed_increment -= stun;
}
}