summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-10 21:12:28 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-10 22:04:08 -0600
commit42876e1c49d03e594d7d129bd96fd9874ebe0106 (patch)
treee87fb003057c93dd3d10f195efd5b2d69a324c9d /crawl-ref/source/monster.cc
parent46a9a48fae192feb0ee6440bee0623a8c026163c (diff)
downloadcrawl-ref-42876e1c49d03e594d7d129bd96fd9874ebe0106.tar.gz
crawl-ref-42876e1c49d03e594d7d129bd96fd9874ebe0106.zip
Add actor::undead_or_demonic() to check for those holiness types.
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index ae61c51364..e102e81615 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2981,6 +2981,13 @@ mon_holy_type monsters::holiness() const
return (mons_class_holiness(type));
}
+bool monsters::undead_or_demonic() const
+{
+ const mon_holy_type holi = holiness();
+
+ return (holi == MH_UNDEAD || holi == MH_DEMONIC);
+}
+
bool monsters::is_holy() const
{
if (holiness() == MH_HOLY)