From 4b806f77ff9f7da60fd0faf201b8ab83f76ce457 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 17 Jul 2009 20:52:54 +0000 Subject: A number of small bug fixes: * 2811005: unknown mimics being stabbable * 2818709: restrict monsters picking up stuff to 2 items per turn * 2820097: reintroduce prompts for firing _in the direction_ of allies and fix message * 2821462: returning from tutorial screen swallowing a keypress * 2822771: fire elementals could be placed in shallow water Also, Azrael is no longer generated in the Shoals/Swamp Also, implement the second part of FR 2820876: Xom will no longer confuse the player if there's adjacent deep water or lava. This restriction doesn't apply if Xom is feeling nasty (penance or bored) and there's also no checks for water/lava further away. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10255 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index ebb45c0720..d024e025a7 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -567,7 +567,7 @@ bool melee_attack::attack() if (attacker->atype() == ACT_PLAYER && defender->atype() == ACT_MONSTER) { - if (stop_attack_prompt(defender_as_monster(), false, false)) + if (stop_attack_prompt(defender_as_monster(), false, attacker->pos())) { cancel_attack = true; return (false); @@ -1180,7 +1180,7 @@ bool melee_attack::player_aux_unarmed() continue; } // no biting with visored helmet - if (you.equip[EQ_HELMET] != -1 + if (you.equip[EQ_HELMET] != -1 && (get_helmet_desc((you.inv[you.equip[EQ_HELMET]])) == THELM_DESC_VISORED)) { continue; @@ -3751,6 +3751,14 @@ int melee_attack::player_to_hit(bool random_factor) void melee_attack::player_stab_check() { + // Unknown mimics cannot be stabbed. + if (mons_is_unknown_mimic(defender_as_monster())) + { + stab_attempt = false; + stab_bonus = 0; + return; + } + const unchivalric_attack_type uat = is_unchivalric_attack(&you, defender); stab_attempt = (uat != UCAT_NO_ATTACK); const bool roll_needed = (uat != UCAT_SLEEPING && uat != UCAT_PARALYSED); @@ -3761,7 +3769,9 @@ void melee_attack::player_stab_check() switch (uat) { - case UCAT_NO_ATTACK: stab_bonus = 0; break; + case UCAT_NO_ATTACK: + stab_bonus = 0; + break; case UCAT_HELD_IN_NET: case UCAT_PETRIFYING: case UCAT_PETRIFIED: @@ -3774,7 +3784,9 @@ void melee_attack::player_stab_check() case UCAT_FLEEING: stab_bonus = 2; break; - case UCAT_DISTRACTED: stab_bonus = 3; break; + case UCAT_DISTRACTED: + stab_bonus = 3; + break; } // See if we need to roll against dexterity / stabbing. -- cgit v1.2.3-54-g00ecf