'urgent' messages

Follow up on some old groundwork.  For tty, if the core has designated
a message as 'urgent', override any message suppression taking place
because of ESC typed at the --More-- prompt.  Right now, "You die"
messages, feedback about having something stolen, feedback for
"amorous demon" interaction (mainly in case of armor removal), and
exploding a bag of holding are treated as urgent.

The "You die" case is already handled by a hack in top-line handling;
I left that in place so the conversion of 3 or 4 pline("You die.*")
to custompline(URGENT_MESSAGE, "You die.*") was redundant.  There
are probably various non-You_die messages which precede done() which
should be marked urgent too.

Other interfaces might want to do something similar.  And we ought to
implement MSGTYPE=force or MSGTYPE=urgent to allow players to indicate
other messages that they want have to override suppression.  But I'm
not intending to work on either of those.  I mainly wanted to force
the magic bag explosion message to be shown since a sequence of "You
put <foo> into <bag>." messages is a likely candidate for --More--ESC.
This commit is contained in:
PatR
2021-12-17 17:46:49 -08:00
parent 420afb6b1f
commit 420d121f93
9 changed files with 55 additions and 38 deletions

View File

@@ -3252,7 +3252,7 @@ maybe_wail(void)
}
void
losehp(register int n, register const char *knam, boolean k_format)
losehp(int n, const char *knam, boolean k_format)
{
#if 0 /* code below is prepared to handle negative 'loss' so don't add this
* until we've verified that no callers intentionally rely on that */
@@ -3281,7 +3281,7 @@ losehp(register int n, register const char *knam, boolean k_format)
g.killer.format = k_format;
if (g.killer.name != knam) /* the thing that killed you */
Strcpy(g.killer.name, knam ? knam : "");
You("die...");
custompline(URGENT_MESSAGE, "You die...");
done(DIED);
} else if (n > 0 && u.uhp * 10 < u.uhpmax) {
maybe_wail();

View File

@@ -1838,11 +1838,12 @@ doseduce(struct monst *mon)
}
naked = (!uarmc && !uarmf && !uarmg && !uarms && !uarmh && !uarmu);
pline("%s %s%s.", Who,
Deaf ? "seems to murmur into your ear"
: naked ? "murmurs sweet nothings into your ear"
: "murmurs in your ear",
naked ? "" : ", while helping you undress");
custompline(URGENT_MESSAGE,
"%s %s%s.", Who,
Deaf ? "seems to murmur into your ear"
: naked ? "murmurs sweet nothings into your ear"
: "murmurs in your ear",
naked ? "" : ", while helping you undress");
mayberem(mon, Who, uarmc, cloak_simple_name(uarmc));
if (!uarmc)
mayberem(mon, Who, uarm, suit_simple_name(uarm));
@@ -1878,7 +1879,8 @@ doseduce(struct monst *mon)
verbalize("Well, then you owe me %s%s!",
yourgloves ? yname(yourgloves)
: "twelve pairs of gloves",
yourgloves ? " and eleven more pairs of gloves" : "");
yourgloves ? " and eleven more pairs of gloves"
: "");
}
} else if (seewho)
pline("%s appears to sigh.", Monnam(mon));
@@ -1892,8 +1894,9 @@ doseduce(struct monst *mon)
adjalign(1);
/* by this point you have discovered mon's identity, blind or not... */
pline("Time stands still while you and %s lie in each other's arms...",
noit_mon_nam(mon));
custompline(URGENT_MESSAGE,
"Time stands still while you and %s lie in each other's arms...",
noit_mon_nam(mon));
/* 3.6.1: a combined total for charisma plus intelligence of 35-1
used to guarantee successful outcome; now total maxes out at 32
as far as deciding what will happen; chance for bad outcome when

View File

@@ -2392,8 +2392,9 @@ in_container(struct obj *obj)
}
} else if (Is_mbag(g.current_container) && mbag_explodes(obj, 0)) {
/* explicitly mention what item is triggering the explosion */
pline("As you put %s inside, you are blasted by a magical explosion!",
doname(obj));
custompline(URGENT_MESSAGE,
"As you put %s inside, you are blasted by a magical explosion!",
doname(obj));
/* did not actually insert obj yet */
if (was_unpaid)
addtobill(obj, FALSE, FALSE, TRUE);

View File

@@ -2467,7 +2467,7 @@ do_class_genocide(void)
u.mh = -1;
if (Unchanging) {
if (!feel_dead++)
You("die.");
custompline(URGENT_MESSAGE, "You die.");
/* finish genociding this class of
monsters before ultimately dying */
gameover = TRUE;
@@ -2484,7 +2484,7 @@ do_class_genocide(void)
You_feel("%s inside.", udeadinside());
} else {
if (!feel_dead++)
You("die.");
custompline(URGENT_MESSAGE, "You die.");
gameover = TRUE;
}
}

View File

@@ -428,22 +428,23 @@ steal(struct monst* mtmp, char* objnambuf)
unmul((char *) 0);
slowly = (armordelay >= 1 || g.multi < 0);
if (flags.female)
pline("%s charms you. You gladly %s your %s.",
!seen ? "She" : Monnam(mtmp),
curssv ? "let her take"
: !slowly ? "hand over"
: was_doffing ? "continue removing"
: "start removing",
equipname(otmp));
custompline(URGENT_MESSAGE,
"%s charms you. You gladly %s your %s.",
!seen ? "She" : Monnam(mtmp),
curssv ? "let her take"
: !slowly ? "hand over"
: was_doffing ? "continue removing"
: "start removing",
equipname(otmp));
else
pline("%s seduces you and %s off your %s.",
!seen ? "She" : Adjmonnam(mtmp, "beautiful"),
curssv
? "helps you to take"
: !slowly ? "you take"
: was_doffing ? "you continue taking"
: "you start taking",
equipname(otmp));
custompline(URGENT_MESSAGE,
"%s seduces you and %s off your %s.",
!seen ? "She" : Adjmonnam(mtmp, "beautiful"),
curssv ? "helps you to take"
: !slowly ? "you take"
: was_doffing ? "you continue taking"
: "you start taking",
equipname(otmp));
named++;
/* the following is to set multi for later on */
nomul(-armordelay);
@@ -478,9 +479,10 @@ steal(struct monst* mtmp, char* objnambuf)
subfrombill(otmp, shop_keeper(*u.ushops));
freeinv(otmp);
/* if attached ball was taken, uball and uchain are now Null */
pline("%s%s stole %s.", named ? "She" : Monnam(mtmp),
(was_punished && !Punished) ? " removed your chain and" : "",
doname(otmp));
custompline(URGENT_MESSAGE,
"%s%s stole %s.", named ? "She" : Monnam(mtmp),
(was_punished && !Punished) ? " removed your chain and" : "",
doname(otmp));
could_petrify = (otmp->otyp == CORPSE
&& touch_petrifies(&mons[otmp->corpsenm]));
(void) mpickobj(mtmp, otmp); /* may free otmp */

View File

@@ -2635,7 +2635,7 @@ zapyourself(struct obj *obj, boolean ordinary)
Sprintf(g.killer.name, "shot %sself with a death ray", uhim());
g.killer.format = NO_KILLER_PREFIX;
You("irradiate yourself with pure energy!");
You("die.");
custompline(URGENT_MESSAGE, "You die.");
/* They might survive with an amulet of life saving */
done(DIED);
break;