'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

@@ -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;