'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();