]> granicus.if.org Git - nethack/commitdiff
M29 - unconscious effects when not unconscious
authorcohrs <cohrs>
Fri, 25 Mar 2005 20:30:24 +0000 (20:30 +0000)
committercohrs <cohrs>
Fri, 25 Mar 2005 20:30:24 +0000 (20:30 +0000)
While auditing nomul() I noticed unconscious() treats (multi < 0 && !nomovemsg)
as unconscious.  This explains the behavior in M29 (unconscious message
while performing #turn).  I checked all the places with this combination,
and found a few that did not appear to fall under the "unconscious" category.
Most I changed to use You_can_move_again to ensure the same display w/o the
unconscious behavior. Also:
- found another string that unconscious() should have considered
- vomit() now sets nomovemsg, one caller was also doing this redundantly
- vomiting_dialogue() was calling stop_occupation() after vomit(), which can
  reset multi.  I reversed the order and removed a doubly-redundant nomul call.

tele() still has a problem: some cases where multi < 0 should probably take
a branch like the unconscious() branch but with a different message.
doturn()'s behavior - turn then wait - is also less than perfect, but I
think this is a known problem.

doc/fixes34.4
src/dothrow.c
src/eat.c
src/mhitu.c
src/pray.c
src/timeout.c
src/trap.c
src/uhitm.c

index 07d2016c9a943e729a83ec7ab0777c9f9024d936..ddde661b13a22ad5fdd39afb25c88d640bff39d7 100644 (file)
@@ -104,6 +104,7 @@ monster's aggravation spell now affects meditating monsters
 busy pet won't miss out upon ascension
 fix various places that "finally finished" could be displayed after the hero
        stopped doing something other than eating
+fix some cases where movement was disallowed by the hero was still conscious
 
 
 Platform- and/or Interface-Specific Fixes
index 9a735236a4968bcbb22515816a1900e4b1097fdb..32b52c4c4b4bdcfc0e3bc11ad871f83b33e96882 100644 (file)
@@ -633,7 +633,7 @@ hurtle(dx, dy, range, verbose)
     if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */
 
     nomul(-range);
-    nomovemsg = 0;
+    nomovemsg = "";                    /* it just happens */
     if (verbose)
        You("%s in the opposite direction.", range > 1 ? "hurtle" : "float");
     /* if we're in the midst of shooting multiple projectiles, stop */
index ebd74e276ea03972f5ea96d805cce9d3a9ff6d33..5368ceb9a9529ad64346ab75ecf2219e00fa1567 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -213,7 +213,6 @@ choke(food) /* To a full belly all food is bad. (It.) */
            }
            You("stuff yourself and then vomit voluminously.");
            morehungry(1000);   /* you just got *very* sick! */
-           nomovemsg = 0;
            vomit();
        } else {
            killer.format = KILLED_BY_AN;
@@ -2575,7 +2574,7 @@ vomit()           /* A good idea from David Neves */
 {
        make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE);
        nomul(-2);
-       nomovemsg = 0;
+       nomovemsg = You_can_move_again;
 }
 
 int
index 661bdd112d6696e73bcc5843744c25b79d1b5e72..67c892057c8508003072871bfc2196c947b021df 100644 (file)
@@ -1108,7 +1108,7 @@ dopois:
                    } else {
                        if (Blind) You("are frozen!");
                        else You("are frozen by %s!", mon_nam(mtmp));
-                       nomovemsg = 0;  /* default: "you can move again" */
+                       nomovemsg = You_can_move_again;
                        nomul(-rnd(10));
                        exercise(A_DEX, FALSE);
                    }
index 5c3d772bb7f296092648b1f3e03b4749dd417a02..e150a47cb27df724e3eab50369a9829b446c05fd 100644 (file)
@@ -1738,7 +1738,7 @@ doturn()
            }
        }
        nomul(-5);
-       nomovemsg = 0;
+       nomovemsg = You_can_move_again;
        return(1);
 }
 
index b712a03fafab766dae636623e77965fecaa7db19..373daa5b335b65ee2a772edfce4ecdc0425d5e3e 100644 (file)
@@ -44,7 +44,7 @@ stoned_dialogue()
        case 3:         /* limbs turned to stone */
                stop_occupation();
                nomul(-3);      /* can't move anymore */
-               nomovemsg = 0;
+               nomovemsg = You_can_move_again; /* not unconscious */
                break;
        default:
                break;
@@ -72,10 +72,9 @@ vomiting_dialogue()
 
        switch ((int) i) {
        case 0:
-               vomit();
-               morehungry(20);
                stop_occupation();
-               if (multi > 0) nomul(0);
+               morehungry(20);
+               vomit();
                break;
        case 2:
                make_stunned(HStun + d(2,4), FALSE);
index 082284a86bfdf8706497bb9810cb1473bf485bef..b29395ff3bd1890fcdfccf255992d8966cfc1472 100644 (file)
@@ -2210,7 +2210,7 @@ glovecheck:                   target = which_armor(mtmp, W_ARMG);
                        if (mtmp->mhp <= 0) trapkilled = TRUE;
                        if (unconscious()) {
                                multi = -1;
-                               nomovemsg="The explosion awakens you!";
+                               nomovemsg = "The explosion awakens you!";
                        }
                        break;
 
@@ -4066,6 +4066,7 @@ unconscious()
 {
        return((boolean)(multi < 0 && (!nomovemsg ||
                u.usleep ||
+               !strncmp(nomovemsg,"You awake", 9) ||
                !strncmp(nomovemsg,"You regain con", 14) ||
                !strncmp(nomovemsg,"You are consci", 14))));
 }
index ac3405a3b8c143f351c2d4604b27331799208a1d..0d9a031b9861e401ea42d818c117e4a5b8ca8877 100644 (file)
@@ -2328,7 +2328,7 @@ boolean wep_was_destroyed;
                    You("momentarily stiffen.");
                } else { /* gelatinous cube */
                    You("are frozen by %s!", mon_nam(mon));
-                   nomovemsg = 0;      /* default: "you can move again" */
+                   nomovemsg = You_can_move_again;
                    nomul(-tmp);
                    exercise(A_DEX, FALSE);
                }