From 8bb770637637850f522fdeb873e2d0b05eb0be24 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 9 Nov 2009 09:41:40 -0600 Subject: 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. --- crawl-ref/source/player.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/player.cc') 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); -- cgit v1.2.3-54-g00ecf