summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc27
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);
}