diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-08 21:58:39 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-08 21:58:39 +0000 |
commit | 85d53ad6b83dc723746a1b0ab00ebf05d98cb9c2 (patch) | |
tree | f6f926586025fda45d9d21abda2dd67316c9b05e /crawl-ref/source | |
parent | 97e171351b793c4e02a0e8423f7dacb0f22fea3b (diff) | |
download | crawl-ref-85d53ad6b83dc723746a1b0ab00ebf05d98cb9c2.tar.gz crawl-ref-85d53ad6b83dc723746a1b0ab00ebf05d98cb9c2.zip |
For consistency with Zin's Recite, allow Elyvilon's healing to work on
undead and demonic monsters (although not as often).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4151 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/spells1.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 9ba23622d2..2cc4264396 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -597,22 +597,29 @@ static bool _can_pacify_monster(const monsters *mon, const int healed) if (mons_friendly(mon) || mons_neutral(mon)) return false; - // Ely only cares about natural/holy monsters - if (mons_holiness(mon) != MH_NATURAL && mons_holiness(mon) != MH_HOLY) - return false; - if (mons_intel(mon->type) <= I_PLANT) // no self-awareness 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) // same species - || mons_holiness(mon) == MH_HOLY) ? 2 // holy beings + (is_player_same_species(mon->type)) ? 2 // same species : 1; // other - const int random_factor = random2(you.skills[SK_INVOCATIONS] * healed/3); + int divisor = 3; + + if (holiness == MH_HOLY) + divisor--; + else if (holiness == MH_UNDEAD) + divisor++; + else if (holiness == MH_DEMONIC) + divisor += 2; + + const int random_factor = random2(you.skills[SK_INVOCATIONS] * healed / + divisor); #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, |