M29 - unconscious effects when not unconscious

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.
This commit is contained in:
cohrs
2005-03-25 20:30:24 +00:00
parent bf8a5983ec
commit 2f497c620e
8 changed files with 11 additions and 11 deletions

View 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 */

View File

@@ -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

View 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);
}

View File

@@ -1738,7 +1738,7 @@ doturn()
}
}
nomul(-5);
nomovemsg = 0;
nomovemsg = You_can_move_again;
return(1);
}

View 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);

View 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))));
}

View 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);
}