summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.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/player.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/player.cc')
-rw-r--r--crawl-ref/source/player.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 4340a1c6ab..e48b4a5422 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6364,6 +6364,14 @@ mon_holy_type player::holiness() const
return (MH_NATURAL);
}
+bool player::is_holy() const
+{
+ if (is_good_god(religion))
+ return (true);
+
+ return (false);
+}
+
bool player::is_unholy() const
{
const mon_holy_type holi = holiness();
@@ -6482,7 +6490,7 @@ int player::res_holy_energy(const actor *attacker) const
if (is_unholy())
return (-2);
- if (is_good_god(religion) || holiness() == MH_HOLY)
+ if (is_holy())
return (1);
return (0);