Unaware; fix #H202 and extend the fix for #H179 (trunk only)
Turn being unconscious (via several reasons, including fainted from hunger) into a pseudo-property named `Unaware' and use it in several places where only being asleep was checked. #H202 was about a stunned character who got the recovery message when it timed out while fainted. This suppresses messages for several difficulties when they begin or end while hero is Unaware. Messages about fatal illness, sliming, or petrification aren't suppressed; they're too important to hide from the player. "You feel ..." messages come out as "You dream that you feel ..." when Unaware; fairly lame but hopefully adequate.
This commit is contained in:
@@ -157,6 +157,7 @@ if shopkeeper or priest gets teleported while inside his shop or temple,
|
||||
give locations inside that room preference when choosing destination
|
||||
tame/peaceful grabber/engulfer will release hero after conflict ends
|
||||
make changes in hallucination be reflected by changes in mimickery feedback
|
||||
add Unaware pseudo-property to suppress various messages while unconscious
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)youprop.h 3.5 1999/07/02 */
|
||||
/* SCCS Id: @(#)youprop.h 3.5 2006/09/01 */
|
||||
/* Copyright (c) 1989 Mike Threepoint */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -359,5 +359,8 @@
|
||||
|
||||
#define Lifesaved u.uprops[LIFESAVED].extrinsic
|
||||
|
||||
/* unconscious() includes u.usleep but not is_fainted(); the multi test is
|
||||
redundant but allows the function calls to be skipped most of the time */
|
||||
#define Unaware (multi < 0 && (unconscious() || is_fainted()))
|
||||
|
||||
#endif /* YOUPROP_H */
|
||||
|
||||
@@ -327,7 +327,7 @@ mattackm(magr, mdef)
|
||||
mdef->mundetected = 0;
|
||||
newsym(mdef->mx, mdef->my);
|
||||
if(canseemon(mdef) && !sensemon(mdef)) {
|
||||
if (u.usleep) You("dream of %s.",
|
||||
if (Unaware) You("dream of %s.",
|
||||
(mdef->data->geno & G_UNIQ) ?
|
||||
a_monnam(mdef) : makeplural(m_monnam(mdef)));
|
||||
else pline("Suddenly, you notice %s.", a_monnam(mdef));
|
||||
|
||||
@@ -119,7 +119,7 @@ struct monst *mon;
|
||||
boolean is_you = (mon == &youmonst);
|
||||
struct obj *o;
|
||||
|
||||
if (is_you ? (Blind || u.usleep || is_fainted()) :
|
||||
if (is_you ? (Blind || Unaware) :
|
||||
(mon->mblinded || !mon->mcansee || !haseyes(ptr) ||
|
||||
/* BUG: temporary sleep sets mfrozen, but since
|
||||
paralysis does too, we can't check it */
|
||||
@@ -185,7 +185,7 @@ struct obj *obj; /* aatyp == AT_WEAP, AT_SPIT */
|
||||
break;
|
||||
|
||||
case AT_ENGL:
|
||||
if (is_you && (Blindfolded || u.usleep || u.ucreamed))
|
||||
if (is_you && (Blindfolded || Unaware || u.ucreamed))
|
||||
return FALSE;
|
||||
if (!is_you && mdef->msleeping)
|
||||
return FALSE;
|
||||
|
||||
@@ -21,7 +21,7 @@ mb_trapped(mtmp)
|
||||
register struct monst *mtmp;
|
||||
{
|
||||
if (flags.verbose) {
|
||||
if (cansee(mtmp->mx, mtmp->my) && !u.usleep)
|
||||
if (cansee(mtmp->mx, mtmp->my) && !Unaware)
|
||||
pline("KABOOM!! You see a door explode.");
|
||||
else if (!Deaf)
|
||||
You_hear("a distant explosion.");
|
||||
|
||||
12
src/pline.c
12
src/pline.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)pline.c 3.5 2006/02/20 */
|
||||
/* SCCS Id: @(#)pline.c 3.5 2006/08/30 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -134,7 +134,11 @@ You_feel VA_DECL(const char *,line)
|
||||
char *tmp;
|
||||
VA_START(line);
|
||||
VA_INIT(line, const char *);
|
||||
vpline(YouMessage(tmp, "You feel ", line), VA_ARGS);
|
||||
if (Unaware)
|
||||
YouPrefix(tmp, "You dream that you feel ", line);
|
||||
else
|
||||
YouPrefix(tmp, "You feel ", line);
|
||||
vpline(strcat(tmp, line), VA_ARGS);
|
||||
VA_END();
|
||||
}
|
||||
|
||||
@@ -179,7 +183,7 @@ You_hear VA_DECL(const char *,line)
|
||||
VA_INIT(line, const char *);
|
||||
if (Underwater)
|
||||
YouPrefix(tmp, "You barely hear ", line);
|
||||
else if (u.usleep)
|
||||
else if (Unaware)
|
||||
YouPrefix(tmp, "You dream that you hear ", line);
|
||||
else
|
||||
YouPrefix(tmp, "You hear ", line);
|
||||
@@ -194,7 +198,7 @@ You_see VA_DECL(const char *,line)
|
||||
|
||||
VA_START(line);
|
||||
VA_INIT(line, const char *);
|
||||
if (u.usleep)
|
||||
if (Unaware)
|
||||
YouPrefix(tmp, "You dream that you see ", line);
|
||||
else if (Blind) /* caller should have caught this... */
|
||||
YouPrefix(tmp, "You sense ", line);
|
||||
|
||||
28
src/potion.c
28
src/potion.c
@@ -59,6 +59,8 @@ boolean talk;
|
||||
{
|
||||
long old = HConfusion;
|
||||
|
||||
if (Unaware) talk = FALSE;
|
||||
|
||||
if (!xtime && old) {
|
||||
if (talk)
|
||||
You_feel("less %s now.",
|
||||
@@ -76,6 +78,8 @@ boolean talk;
|
||||
{
|
||||
long old = HStun;
|
||||
|
||||
if (Unaware) talk = FALSE;
|
||||
|
||||
if (!xtime && old) {
|
||||
if (talk)
|
||||
You_feel("%s now.",
|
||||
@@ -105,6 +109,10 @@ int type;
|
||||
{
|
||||
long old = Sick;
|
||||
|
||||
#if 0
|
||||
if (Unaware) talk = FALSE;
|
||||
#endif
|
||||
|
||||
if (xtime > 0L) {
|
||||
if (Sick_resistance) return;
|
||||
if (!old) {
|
||||
@@ -125,7 +133,7 @@ int type;
|
||||
if (talk) You_feel("somewhat better.");
|
||||
set_itimeout(&Sick, Sick * 2); /* approximation */
|
||||
} else {
|
||||
if (talk) pline("What a relief!");
|
||||
if (talk) You_feel("cured. What a relief!");
|
||||
Sick = 0L; /* set_itimeout(&Sick, 0L) */
|
||||
}
|
||||
context.botl = TRUE;
|
||||
@@ -145,6 +153,10 @@ const char *msg;
|
||||
{
|
||||
long old = Slimed;
|
||||
|
||||
#if 0
|
||||
if (Unaware) msg = 0;
|
||||
#endif
|
||||
|
||||
if ((!xtime && old) || (xtime && !old)) {
|
||||
if (msg) pline("%s", msg);
|
||||
context.botl = 1;
|
||||
@@ -163,6 +175,10 @@ const char *killername;
|
||||
{
|
||||
long old = Stoned;
|
||||
|
||||
#if 0
|
||||
if (Unaware) msg = 0;
|
||||
#endif
|
||||
|
||||
if ((!xtime && old) || (xtime && !old)) {
|
||||
if (msg) pline("%s", msg);
|
||||
/* context.botl = 1; --- Stoned is not a status line item */
|
||||
@@ -179,6 +195,8 @@ boolean talk;
|
||||
{
|
||||
long old = Vomiting;
|
||||
|
||||
if (Unaware) talk = FALSE;
|
||||
|
||||
if(!xtime && old)
|
||||
if(talk) You_feel("much less nauseated now.");
|
||||
|
||||
@@ -205,7 +223,7 @@ boolean talk;
|
||||
can_see_now = !Blind;
|
||||
Blinded = old; /* restore */
|
||||
|
||||
if (u.usleep) talk = FALSE;
|
||||
if (Unaware) talk = FALSE;
|
||||
|
||||
if (can_see_now && !u_could_see) { /* regaining sight */
|
||||
if (talk) {
|
||||
@@ -283,6 +301,8 @@ long mask; /* nonzero if resistance status should change by mask */
|
||||
boolean changed = 0;
|
||||
const char *message, *verb;
|
||||
|
||||
if (Unaware) talk = FALSE;
|
||||
|
||||
message = (!xtime) ? "Everything %s SO boring now." :
|
||||
"Oh wow! Everything %s so cosmic!";
|
||||
verb = (!Blind) ? "looks" : "feels";
|
||||
@@ -1431,12 +1451,12 @@ register struct obj *obj;
|
||||
exercise(A_DEX, TRUE);
|
||||
break;
|
||||
case POT_BLINDNESS:
|
||||
if (!Blind && !u.usleep) {
|
||||
if (!Blind && !Unaware) {
|
||||
kn++;
|
||||
pline("It suddenly gets dark.");
|
||||
}
|
||||
make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
|
||||
if (!Blind && !u.usleep) Your(vision_clears);
|
||||
if (!Blind && !Unaware) Your(vision_clears);
|
||||
break;
|
||||
case POT_WATER:
|
||||
if(u.umonnum == PM_GREMLIN) {
|
||||
|
||||
@@ -3092,7 +3092,7 @@ drown()
|
||||
return(FALSE);
|
||||
}
|
||||
if ((Teleportation || can_teleport(youmonst.data)) &&
|
||||
!u.usleep && (Teleport_control || rn2(3) < Luck+2)) {
|
||||
!Unaware && (Teleport_control || rn2(3) < Luck+2)) {
|
||||
You("attempt a teleport spell."); /* utcsri!carroll */
|
||||
if (!level.flags.noteleport) {
|
||||
(void) dotele();
|
||||
@@ -3113,6 +3113,8 @@ drown()
|
||||
while still asleep; we can't do that the same way that waking
|
||||
due to combat is handled; note unmul() clears u.usleep */
|
||||
if (u.usleep) unmul("Suddenly you wake up!");
|
||||
/* being doused will revive from fainting */
|
||||
if (is_fainted()) reset_faint();
|
||||
/* can't crawl if unable to move (crawl_ok flag stays false) */
|
||||
if (multi < 0 || (Upolyd && !youmonst.data->mmove)) goto crawl;
|
||||
/* look around for a place to crawl to */
|
||||
|
||||
Reference in New Issue
Block a user