mention_decor vs Underwater or drowning escape
Avoid redundant |You are on solid land again. |You are back on floor. when walking or teleporting out of water with the mention_decor option on.
This commit is contained in:
@@ -446,7 +446,9 @@ enum plnmsg_types {
|
||||
PLNMSG_CAUGHT_IN_EXPLOSION, /* explode() feedback */
|
||||
PLNMSG_OBJ_GLOWS, /* "the <obj> glows <color>" */
|
||||
PLNMSG_OBJNAM_ONLY, /* xname/doname only, for #tip */
|
||||
PLNMSG_OK_DONT_DIE /* overriding death in explore/wizard mode */
|
||||
PLNMSG_OK_DONT_DIE, /* overriding death in explore/wizard mode */
|
||||
PLNMSG_BACK_ON_GROUND, /* leaving water */
|
||||
PLNMSG_enum /* allows inserting new entries with unconditional trailing comma */
|
||||
};
|
||||
|
||||
/* runmode options */
|
||||
|
||||
@@ -2106,13 +2106,15 @@ boolean newspot; /* true if called by spoteffects */
|
||||
boolean still_inwater = FALSE; /* assume we're getting out */
|
||||
|
||||
if (!is_pool(u.ux, u.uy)) {
|
||||
if (Is_waterlevel(&u.uz))
|
||||
if (Is_waterlevel(&u.uz)) {
|
||||
You("pop into an air bubble.");
|
||||
else if (is_lava(u.ux, u.uy))
|
||||
} else if (is_lava(u.ux, u.uy)) {
|
||||
You("leave the %s...", hliquid("water")); /* oops! */
|
||||
else
|
||||
} else {
|
||||
You("are on solid %s again.",
|
||||
is_ice(u.ux, u.uy) ? "ice" : "land");
|
||||
iflags.last_msg = PLNMSG_BACK_ON_GROUND;
|
||||
}
|
||||
} else if (Is_waterlevel(&u.uz)) {
|
||||
still_inwater = TRUE;
|
||||
} else if (Levitation) {
|
||||
|
||||
13
src/pickup.c
13
src/pickup.c
@@ -332,10 +332,15 @@ describe_decor()
|
||||
if ((IS_POOL(iflags.prev_decor)
|
||||
|| iflags.prev_decor == LAVAPOOL
|
||||
|| iflags.prev_decor == ICE)) {
|
||||
pline("%s %s %s.",
|
||||
flags.verbose ? "You are back" : "Back",
|
||||
(Levitation || Flying) ? "over" : "on",
|
||||
surface(u.ux, u.uy));
|
||||
const char *ground = surface(u.ux, u.uy);
|
||||
|
||||
if (iflags.last_msg != PLNMSG_BACK_ON_GROUND
|
||||
|| (strcmpi(ground, "floor") && strcmpi(ground, "ground")
|
||||
&& strcmpi(ground, "ice")))
|
||||
pline("%s %s %s.",
|
||||
flags.verbose ? "You are back" : "Back",
|
||||
(Levitation || Flying) ? "over" : "on",
|
||||
ground);
|
||||
}
|
||||
}
|
||||
iflags.prev_decor = ltyp;
|
||||
|
||||
@@ -5361,6 +5361,7 @@ lava_effects()
|
||||
pline("You're still burning.");
|
||||
}
|
||||
You("find yourself back on solid %s.", surface(u.ux, u.uy));
|
||||
iflags.last_msg = PLNMSG_BACK_ON_GROUND;
|
||||
return TRUE;
|
||||
} else if (!Wwalking && (!u.utrap || u.utraptype != TT_LAVA)) {
|
||||
boil_away = !Fire_resistance;
|
||||
|
||||
Reference in New Issue
Block a user