Accessibility: give a message when teleporting a monster

Teleporting a monster only updated the map. Give a message
so blind players can get the same information.
Making a monster invisible gives the same message, if you
cannot detect invisible.
Several other places where monsters teleported themselves
now also give the same message.
This commit is contained in:
Pasi Kallinen
2021-12-07 00:06:17 +02:00
parent e25f8ec6e3
commit f6b7be49f4
27 changed files with 146 additions and 92 deletions

View File

@@ -507,7 +507,8 @@ use_magic_whistle(struct obj *obj)
if (M_AP_TYPE(mtmp))
seemimic(mtmp);
omx = mtmp->mx, omy = mtmp->my;
mnexto(mtmp);
if (distu(omx, omy) > 2)
mnexto(mtmp, RLOC_MSG);
if (mtmp->mx != omx || mtmp->my != omy) {
mtmp->mundetected = 0; /* reveal non-mimic hider */
if (canspotmon(mtmp))
@@ -732,7 +733,7 @@ next_to_u(void)
continue;
if (mtmp->mleashed) {
if (distu(mtmp->mx, mtmp->my) > 2)
mnexto(mtmp);
mnexto(mtmp, RLOC_NOMSG);
if (distu(mtmp->mx, mtmp->my) > 2) {
for (otmp = g.invent; otmp; otmp = otmp->nobj)
if (otmp->otyp == LEASH
@@ -994,7 +995,7 @@ use_mirror(struct obj *obj)
freeinv(obj);
(void) mpickobj(mtmp, obj);
if (!tele_restrict(mtmp))
(void) rloc(mtmp, TRUE);
(void) rloc(mtmp, RLOC_MSG);
} else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
&& (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
boolean do_react = TRUE;