summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 16:28:20 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 16:28:20 +0000
commitd6e0b68b50226f511107801bb2c11f6b358fbbc7 (patch)
tree66a4150b0b5e10a36db18ab2617693bfe31db384 /crawl-ref/source/spells2.cc
parent20e1e61ec9150b594e8478cac1d7932ecc14300b (diff)
downloadcrawl-ref-d6e0b68b50226f511107801bb2c11f6b358fbbc7.tar.gz
crawl-ref-d6e0b68b50226f511107801bb2c11f6b358fbbc7.zip
1989842: freezing weapons can now slow cold-blooded monsters.
Infrastructure available for unified element damage to creatures. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6964 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc12
1 files changed, 5 insertions, 7 deletions
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;
}
}