From: David L. R. <dol...@us...> - 2010-05-30 23:26:38
|
via 8de2a769873479b10727c0295c7dacc274239e53 (commit) via d7d7047dc1ff063d43c985ca568c137888409d3c (commit) from 2392c498381a7a09eedff244aaab9447c0ab5dbb (commit) ----------------------------------------------------------------------- commit 8de2a769873479b10727c0295c7dacc274239e53 Author: David Lawrence Ramsey <dol...@us...> Date: Sun May 30 18:22:52 2010 -0500 Attempt to fix Mantis 1597: Elyvilon should be able to block any attack. commit d7d7047dc1ff063d43c985ca568c137888409d3c Author: David Lawrence Ramsey <dol...@us...> Date: Sun May 30 18:21:08 2010 -0500 Add minor cosmetic fixes. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/fight.cc | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 9207e0c..1872ac5 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1193,9 +1193,7 @@ bool melee_attack::player_aux_test_hit() } if (to_hit >= evasion || auto_hit) - { return (true); - } else { mprf("Your %s misses %s.", aux_attack.c_str(), @@ -1429,20 +1427,30 @@ void melee_attack::player_warn_miss() bool melee_attack::player_hits_monster() { const int evasion = defender->melee_evasion(attacker); - const int evasion_helpful - = defender->melee_evasion(attacker, EV_IGNORE_HELPLESS); + const int helpful_evasion = + defender->melee_evasion(attacker, EV_IGNORE_HELPLESS); dprf("your to-hit: %d; defender effective EV: %d", to_hit, evasion); - if (to_hit >= evasion_helpful || one_chance_in(20)) + // No monster Phase Shift yet + if (you.religion != GOD_ELYVILON + && you.penance[GOD_ELYVILON] + && god_hates_your_god(GOD_ELYVILON, you.religion) + && to_hit >= evasion + && one_chance_in(20)) { - return (true); + simple_god_message(" blocks your attack.", GOD_ELYVILON); + dec_penance(GOD_ELYVILON, 1 + random2(to_hit - evasion)); + return (false); } + if (to_hit >= helpful_evasion || one_chance_in(20)) + return (true); + if (to_hit >= evasion || ((defender->cannot_act() || defender->asleep()) && !one_chance_in(10 + you.skills[SK_STABBING])) || defender->as_monster()->petrifying() - && !one_chance_in(2 + you.skills[SK_STABBING])) + && !one_chance_in(2 + you.skills[SK_STABBING])) { if (defender_visible) msg::stream << "Helpless, " << defender->name(DESC_NOCAP_THE) -- Dungeon Crawl Stone Soup |