diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-13 19:53:41 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-13 19:53:41 +0000 |
commit | efa261989c118090a430f48c76d50d248c6c60f2 (patch) | |
tree | 0a85202f7ab30b812259c4b6d077bd3347776975 /crawl-ref/source/spells2.cc | |
parent | 82f5dc3055d25affb028f5e08ea834da326cb683 (diff) | |
download | crawl-ref-efa261989c118090a430f48c76d50d248c6c60f2.tar.gz crawl-ref-efa261989c118090a430f48c76d50d248c6c60f2.zip |
Fix inconsistencies between Vampiric Draining and Yred's Drain Life: the
former no longer gives 1 HP minimum, but no longer displays the "life
coursing into your body" message if you don't gain any HP; and the
latter no longer works on summoned monsters.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9436 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 2204706c08..3579d68b03 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -681,14 +681,13 @@ void drain_life(int pow) { monsters* monster = &menv[i]; - if (monster->type == -1) - continue; - - if (mons_holiness(monster) != MH_NATURAL) - continue; - - if (mons_res_negative_energy(monster)) + if (!monster->alive() + || mons_holiness(monster) != MH_NATURAL + || mons_res_negative_energy(monster) + || mons_is_summoned(monster)) + { continue; + } if (mons_near(monster)) { @@ -743,16 +742,20 @@ bool vampiric_drain(int pow, const dist &vmove) if (success) { - if (mons_is_unholy(monster)) + if (!monster->alive() + || (mons_holiness(monster) != MH_NATURAL + && !mons_is_unholy(monster)) + || mons_res_negative_energy(monster) + || mons_is_summoned(monster)) { - mpr("Aaaarggghhhhh!"); - dec_hp(random2avg(39, 2) + 10, false, "vampiric drain backlash"); + canned_msg(MSG_NOTHING_HAPPENS); return (false); } - if (mons_res_negative_energy(monster) || mons_is_summoned(monster)) + if (mons_is_unholy(monster)) { - canned_msg(MSG_NOTHING_HAPPENS); + mpr("Aaaarggghhhhh!"); + dec_hp(random2avg(39, 2) + 10, false, "vampiric drain backlash"); return (false); } |