Accessibility: Add location info to messages

Adds a new boolean option, accessiblemsg.  If on, some game messages
are prefixed with direction or location information, for example:

   (west): The newt bites!
   (northwest): You find a hidden door.

I added the info to the most common messages, but several are
still missing it.
This commit is contained in:
Pasi Kallinen
2024-01-01 18:19:17 +02:00
parent d86e6e9717
commit dc8d9d6cd0
18 changed files with 138 additions and 29 deletions

View File

@@ -35,7 +35,7 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
if same gender, "engagingly" for nymph, normal msg for others. */
if ((compat = could_seduce(mtmp, &gy.youmonst, mattk)) != 0
&& !mtmp->mcan && !mtmp->mspec_used) {
pline("%s %s you %s.", Monst_name,
pline_xy(mtmp->mx, mtmp->my, "%s %s you %s.", Monst_name,
!Blind ? "smiles at" : !Deaf ? "talks to" : "touches",
(compat == 2) ? "engagingly" : "seductively");
} else {
@@ -73,7 +73,7 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
&& gh.hitmsg_prev != NULL
&& mattk == gh.hitmsg_prev + 1
&& mattk->aatyp == gh.hitmsg_prev->aatyp) ? " again" : "";
pline("%s %s%s%s", Monst_name, verb, again, punct);
pline_xy(mtmp->mx, mtmp->my, "%s %s%s%s", Monst_name, verb, again, punct);
}
gh.hitmsg_mid = mtmp->m_id;
gh.hitmsg_prev = mattk;
@@ -90,9 +90,9 @@ missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
map_invisible(mtmp->mx, mtmp->my);
if (could_seduce(mtmp, &gy.youmonst, mattk) && !mtmp->mcan)
pline("%s pretends to be friendly.", Monnam(mtmp));
pline_xy(mtmp->mx, mtmp->my, "%s pretends to be friendly.", Monnam(mtmp));
else
pline("%s %smisses!", Monnam(mtmp),
pline_xy(mtmp->mx, mtmp->my, "%s %smisses!", Monnam(mtmp),
(nearmiss && flags.verbose) ? "just " : "");
stop_occupation();
@@ -132,7 +132,7 @@ mswings(
boolean bash) /* True: polearm used at too close range */
{
if (flags.verbose && !Blind && mon_visible(mtmp)) {
pline("%s %s %s%s %s.", Monnam(mtmp), mswings_verb(otemp, bash),
pline_xy(mtmp->mx, mtmp->my, "%s %s %s%s %s.", Monnam(mtmp), mswings_verb(otemp, bash),
(otemp->quan > 1L) ? "one of " : "", mhis(mtmp), xname(otemp));
}
}
@@ -198,6 +198,7 @@ wildmiss(struct monst *mtmp, struct attack *mattk)
? could_seduce(mtmp, &gy.youmonst, mattk) : 0);
Monst_name = Monnam(mtmp);
set_msg_xy(mtmp->mx, mtmp->my);
if (unotseen) { /* !mtmp->cansee || (Invis && !perceives(mtmp->data)) */
const char *swings = (mattk->aatyp == AT_BITE) ? "snaps"
: (mattk->aatyp == AT_KICK) ? "kicks"