]> granicus.if.org Git - nethack/commitdiff
open/close/loot while confused or stunned (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 2 Feb 2010 23:10:01 +0000 (23:10 +0000)
committernethack.rankin <nethack.rankin>
Tue, 2 Feb 2010 23:10:01 +0000 (23:10 +0000)
     Fix a bug From a bug report:  while stunned he tried to close
an adjacent open door and when his choice of direction got changed to
some non-door spot, no time elapsed so he could just keep repeating the
attempt until eventually getting the correct direction.  Trying to open
an adjacent closed door and trying to remove the saddle from an adjacent
monster via #loot behaved similarly.  Applying keys and lock-picks also
did so in 3.4.3, but had already been changed to use up time in the dev
code.  There may be other actions which need fixing.

doc/fixes35.0
src/lock.c
src/pickup.c

index 72ac336cecd154ed179100ba1e58b9ee3d823880..d4ddd9979cb2395b5da04f8547e5ad8571864249 100644 (file)
@@ -201,9 +201,9 @@ stethoscope applied to hiding mimic will bring it out of hiding
 rephrase "<artifact> evades your grasp" message if artifact is already held
 artifacts which subsequently evade your grasp/control after already being
        worn or wielded become unworn/unwielded
-hero with lycanthropy is vulnerable to silver in human form as well as beast
+hero with lycanthropy is vulnerable to silver in both human and beast form
 changing alignment or shape triggers a check for equipment evading hero's grasp
-passive fire effects can damage attackers weapons
+passive fire effects can damage attackers' weapons
 wielded bow shouldn't affect outcome of kicked arrows
 ranged polearm hit can divide puddings and can use confuse monster effect
 charge for kicked shop-owned food if it gets used up taming a monster
@@ -283,7 +283,7 @@ wizard mode #monpolycontrol prompting asked about "it" when monster was unseen
 reprompt if player fails to make a menu choice during inventory identification
 seen eels who were stuck in isolated pools would never re-hide
 can no longer get both strength and resistance from eating one giant corpse
-aborting key/lock pick usage via ESC at direction prompt no longer use a move
+aborting key/lock pick usage via ESC at direction prompt no longer uses a move
 when probing from inside an engulfer, "not carrying anything" overlooked hero
 wearing or removing an amulet of restful sleep clobbered permanent sleepiness
 if attempt to select a co-aligned artifact for first divine gift fails because
@@ -325,6 +325,8 @@ spell attack by low-Int hero could inflict negative damage
 some wand/spell/breath zaps that hit a secret door failed to reveal it
 wand explosion feedback about adjacent door was phrased as if for a wand zap
 improve the message sequencing when a thrown poisoned weapon loses is poison
+attempting to open, close, or lock/unlock a door while confused or stunned
+       uses up a move regardless of whether direction choice finds a door
 
 
 Platform- and/or Interface-Specific Fixes
index ee269726b73c00cc6c650488a6d45d40fddaa709..037253d0c455c5c887461578a86761e55a764347 100644 (file)
@@ -561,6 +561,10 @@ doopen()           /* try to open a door */
            return(1);
        }
 
+       /* when choosing a direction is impaired, use a turn
+          regardless of whether a door is successfully targetted */
+       if (Confusion || Stunned) res = 1;
+
        door = &levl[cc.x][cc.y];
        portcullis = (is_drawbridge_wall(cc.x, cc.y) >= 0);
        if (Blind) {
@@ -689,6 +693,10 @@ doclose()          /* try to close a door */
            return(1);
        }
 
+       /* when choosing a direction is impaired, use a turn
+          regardless of whether a door is successfully targetted */
+       if (Confusion || Stunned) res = 1;
+
        door = &levl[x][y];
        portcullis = (is_drawbridge_wall(x, y) >= 0);
        if (Blind) {
index 6ff003f584b941313a708244026855f80589d51f..7ad1d21c53dc1ad89073cc98d40cad8a233effd9 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 pickup.c        $Date$  $Revision$ */
-/*     SCCS Id: @(#)pickup.c   3.5     2008/10/09      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1638,8 +1637,9 @@ lootcont:
      * 3.3.1 introduced directional looting for some things.
      */
     if (c != 'y' && mon_beside(u.ux, u.uy)) {
-       if (!get_adjacent_loc("Loot in what direction?", "Invalid loot location",
-                       u.ux, u.uy, &cc)) return 0;
+       if (!get_adjacent_loc("Loot in what direction?",
+                             "Invalid loot location",
+                             u.ux, u.uy, &cc)) return 0;
        if (cc.x == u.ux && cc.y == u.uy) {
            underfoot = TRUE;
            if (container_at(cc.x, cc.y, FALSE))
@@ -1654,6 +1654,10 @@ lootcont:
        }
        mtmp = m_at(cc.x, cc.y);
        if (mtmp) timepassed = loot_mon(mtmp, &prev_inquiry, &prev_loot);
+       /* always use a turn when choosing a direction is impaired,
+          even if you've successfully targetted a saddled creature
+          and then answered "no" to the "remove its saddle?" prompt */
+       if (Confusion || Stunned) timepassed = 1;
 
        /* Preserve pre-3.3.1 behaviour for containers.
         * Adjust this if-block to allow container looting