From efa261989c118090a430f48c76d50d248c6c60f2 Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 13 Mar 2009 19:53:41 +0000 Subject: 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 --- crawl-ref/source/spells2.cc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/spells2.cc') 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); } -- cgit v1.2.3-54-g00ecf