diff options
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 889bbe7552..4edc91c03f 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -343,6 +343,7 @@ melee_attack::melee_attack(actor *attk, actor *defn, bool allow_unarmed, int which_attack) : attacker(attk), defender(defn), atk(NULL), def(NULL), + cancel_attack(false), did_hit(false), perceived_attack(false), needs_message(false), attacker_visible(false), defender_visible(false), unarmed_ok(allow_unarmed), @@ -491,6 +492,9 @@ bool melee_attack::player_attack() player_apply_attack_delay(); player_stab_check(); + if (cancel_attack) + return (false); + if (player_hits_monster()) { did_hit = true; @@ -2119,6 +2123,15 @@ void melee_attack::player_stab_check() if (stab_attempt && roll_needed) stab_attempt = (random2(200) <= you.skills[SK_STABBING] + you.dex); + if (stab_attempt && you.religion == GOD_SHINING_ONE) + { + if (!yesno("Really attack this helpless creature?", false, 'n')) + { + stab_attempt = false; + cancel_attack = true; + } + } + // check for invisibility - no stabs on invisible monsters. if (!player_monster_visible( def )) { |