diff options
-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, |