summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 18:23:19 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 18:23:19 +0000
commit549d9a53c2f7e7c08f717de066ee56efe0b67fb4 (patch)
tree865084ed8969826530c08288b2b9e644fdb242a0 /crawl-ref/source/spells1.cc
parent216ea74607c26d1706b43aa8fccb11e553a962e8 (diff)
downloadcrawl-ref-549d9a53c2f7e7c08f717de066ee56efe0b67fb4.tar.gz
crawl-ref-549d9a53c2f7e7c08f717de066ee56efe0b67fb4.zip
When pacifying, check holiness in the right places.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6086 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 00a3fde7f6..e52f5fb894 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -620,14 +620,22 @@ static bool _can_pacify_monster(const monsters *mon, const int healed)
if (mons_intel(mon->type) <= I_PLANT) // no self-awareness
return false;
+ const mon_holy_type holiness = mons_holiness(mon);
+
+ if (holiness != MH_HOLY
+ && holiness != MH_NATURAL
+ && holiness != MH_UNDEAD
+ && holiness != MH_DEMONIC)
+ {
+ return false;
+ }
+
if (mons_is_stationary(mon)) // not able to leave the level
return false;
if (mons_is_sleeping(mon)) // not aware of what is happening
return false;
- const mon_holy_type holiness = mons_holiness(mon);
-
const int factor = (mons_intel(mon->type) <= I_ANIMAL) ? 3 : // animals
(is_player_same_species(mon->type)) ? 2 // same species
: 1; // other
@@ -640,8 +648,6 @@ static bool _can_pacify_monster(const monsters *mon, const int healed)
divisor++;
else if (holiness == MH_DEMONIC)
divisor += 2;
- else if (holiness != MH_NATURAL)
- return false;
const int random_factor = random2(you.skills[SK_INVOCATIONS] * healed /
divisor);