summaryrefslogtreecommitdiffstats
path: root/crawl-ref
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
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')
-rw-r--r--crawl-ref/source/delay.cc8
-rw-r--r--crawl-ref/source/spells1.cc14
2 files changed, 16 insertions, 6 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 2755730b45..66b3c95ef1 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -61,7 +61,13 @@ static void _finish_delay(const delay_queue_item &delay);
// note that berserk monsters are also hasted.)
static bool _recite_mons_useless(const monsters *mon)
{
+ const mon_holy_type holiness = mons_holiness(mon);
+
return (mons_intel(mon->type) < I_NORMAL
+ || holiness != MH_HOLY
+ || holiness != MH_NATURAL
+ || holiness != MH_UNDEAD
+ || holiness != MH_DEMONIC
|| mons_is_stationary(mon)
|| mons_is_fleeing(mon)
|| mons_is_sleeping(mon)
@@ -103,8 +109,6 @@ static int _recite_to_monsters(int x, int y, int pow, int unused)
pow -= 2 + random2(3);
else if (holiness == MH_DEMONIC)
pow -= 3 + random2(5);
- else if (holiness != MH_NATURAL)
- return (0);
}
pow -= resist;
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);