summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 09:41:40 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 09:41:40 -0600
commit8bb770637637850f522fdeb873e2d0b05eb0be24 (patch)
treed25013043122283a4df982d5113b90829eb4758c /crawl-ref/source/monstuff.cc
parent8b0bdcb6271b2ccad9cec8b4cf8b4a464946ed06 (diff)
downloadcrawl-ref-8bb770637637850f522fdeb873e2d0b05eb0be24.tar.gz
crawl-ref-8bb770637637850f522fdeb873e2d0b05eb0be24.zip
Add an is_holy() function to the actor interface.
This is consistent with similar functions in that it checks not only for MH_HOLY holiness, but whether the monster is a priest of a good god (currently, there are none) and whether it uses holy spells (currently, there are none after the changes described below). Minor and Major Healing are now enchantments rather than holy spells. The beam code treats them as such; wands of healing aren't holy items the way e.g. wands of draining are evil items; and unholy monsters (among others, Lom Lobon!) can cast these spells.
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a36b349a03..5f82495a9d 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -652,8 +652,8 @@ static bool _ely_protect_ally(monsters *monster)
if (you.religion != GOD_ELYVILON)
return (false);
- if (monster->holiness() != MH_NATURAL
- && monster->holiness() != MH_HOLY
+ if (!monster->is_holy()
+ && monster->holiness() != MH_NATURAL
|| !monster->friendly()
|| !you.can_see(monster) // for simplicity
|| !one_chance_in(20))
@@ -1666,7 +1666,7 @@ int monster_die(monsters *monster, killer_type killer,
}
// Holy kills are always noticed.
- if (targ_holy == MH_HOLY)
+ if (monster->is_holy())
{
did_god_conduct(DID_KILL_HOLY, monster->hit_dice,
true, monster);
@@ -1873,7 +1873,7 @@ int monster_die(monsters *monster, killer_type killer,
}
// Holy kills are always noticed.
- if (targ_holy == MH_HOLY)
+ if (monster->is_holy())
{
if (killer_holy == MH_UNDEAD)
{
@@ -3942,7 +3942,7 @@ std::string summoned_poof_msg(const monsters* monster, bool plural)
msg = "degenerate%s into a cloud of primal chaos";
}
- if (monster->holiness() == MH_HOLY
+ if (monster->is_holy()
&& summon_type != SPELL_SHADOW_CREATURES
&& summon_type != MON_SUMM_CHAOS)
{