From: <gi...@cr...> - 2015-11-26 04:45:13
|
via a9d907f954fc31037dfbbe375955a8bc29e2cf8b (commit) from 1bbd46e91bf1c2e57bf9edda08082f3ace9061ac (commit) ----------------------------------------------------------------------- commit a9d907f954fc31037dfbbe375955a8bc29e2cf8b Author: Nicholas Feinberg <ple...@gm...> Date: Wed Nov 25 20:38:47 2015 -0800 Don't misreport hex chances for high ench power Specifically, when the power would be over the 200-power cap. Not sure if this happened in practice. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/describe.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 304c36b..c89ff55 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2720,8 +2720,11 @@ string get_skill_description(skill_type skill, bool need_title) */ int hex_chance(const spell_type spell, const int hd) { + const int cap = 200; const int pow = mons_power_for_hd(spell, hd, false) / ENCH_POW_FACTOR; - const int chance = hex_success_chance(you.res_magic(), pow, 100, true); + const int capped_pow = min(cap, pow); + const int chance = hex_success_chance(you.res_magic(), capped_pow, + 100, true); if (spell == SPELL_STRIP_RESISTANCE) return chance + (100 - chance) / 3; // ignores mr 1/3rd of the time return chance; -- Dungeon Crawl Stone Soup |