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