'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

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