quickmimic fixes

Reported by a beta tester four years ago:  if you telepathically
observed a pet eat a mimic corpse and temporarily change shape,
you were told that you sensed it happening but the map continued
to show its true form (because telepathy overrides mimicking).
Attempting to force the map to show the alternate shape in that
situation was hopeless, so give an alternate message instead.

While trying to fix this, I noticed my dog mimicking a throne
several times.  The list of alternate shapes for quickmimic
included SINK which happens to have the same value as S_throne.
Change that to S_sink.
This commit is contained in:
PatR
2021-01-02 11:59:40 -08:00
parent b815c470ec
commit b1d0943d6d
2 changed files with 34 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.413 $ $NHDT-Date: 1609442596 2020/12/31 19:23:16 $ NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.417 $ $NHDT-Date: 1609617569 2021/01/02 19:59:29 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -354,6 +354,12 @@ if a prefix key was bound to some character which ordinarily ran a regular
reqmenu (the request-a-menu prefix supported by a handful of non-movement reqmenu (the request-a-menu prefix supported by a handful of non-movement
commands) could be bound to some key other than 'm' but it only commands) could be bound to some key other than 'm' but it only
worked if the new key was also a movement prefix worked if the new key was also a movement prefix
when telepathically sensed pet ate a mimic corpse and temporarily took on
a different shape, you were told that you sensed it changing into
something but the map continued to show its true shape (telepathy
overrides mimic hiding); give a different message in that case
when a pet ate a mimic corpse and tried to temporarily look like a sink it
ended up looking like a throne (terrain type SINK == symbol S_throne)
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 dogmove.c $NHDT-Date: 1607374000 2020/12/07 20:46:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.94 $ */ /* NetHack 3.7 dogmove.c $NHDT-Date: 1609617569 2021/01/02 19:59:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.96 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1356,8 +1356,7 @@ static const struct qmchoices {
{ PM_HOUSECAT, 0, PM_DOG, M_AP_MONSTER }, { PM_HOUSECAT, 0, PM_DOG, M_AP_MONSTER },
{ PM_LARGE_CAT, 0, PM_LARGE_DOG, M_AP_MONSTER }, { PM_LARGE_CAT, 0, PM_LARGE_DOG, M_AP_MONSTER },
{ PM_HOUSECAT, 0, PM_GIANT_RAT, M_AP_MONSTER }, { PM_HOUSECAT, 0, PM_GIANT_RAT, M_AP_MONSTER },
{ 0, S_DOG, SINK, { 0, S_DOG, S_sink, M_AP_FURNITURE }, /* sorry, no fire hydrants */
M_AP_FURNITURE }, /* sorry, no fire hydrants in NetHack */
{ 0, 0, TRIPE_RATION, M_AP_OBJECT }, /* leave this at end */ { 0, 0, TRIPE_RATION, M_AP_OBJECT }, /* leave this at end */
}; };
@@ -1378,7 +1377,7 @@ static void
quickmimic(mtmp) quickmimic(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
int idx = 0, trycnt = 5, spotted; int idx = 0, trycnt = 5, spotted, seeloc;
char buf[BUFSZ]; char buf[BUFSZ];
if (Protection_from_shape_changers || !mtmp->meating) if (Protection_from_shape_changers || !mtmp->meating)
@@ -1407,34 +1406,35 @@ struct monst *mtmp;
Strcpy(buf, mon_nam(mtmp)); Strcpy(buf, mon_nam(mtmp));
spotted = canspotmon(mtmp); spotted = canspotmon(mtmp);
seeloc = cansee(mtmp->mx, mtmp->my);
mtmp->m_ap_type = qm[idx].m_ap_type; mtmp->m_ap_type = qm[idx].m_ap_type;
mtmp->mappearance = qm[idx].mappearance; mtmp->mappearance = qm[idx].mappearance;
if (spotted || cansee(mtmp->mx, mtmp->my) || canspotmon(mtmp)) { if (spotted || seeloc || canspotmon(mtmp)) {
/* this isn't quite right; if sensing a monster without being int prev_glyph = glyph_at(mtmp->mx, mtmp->my);
able to see its location, you really shouldn't be told you const char *what = (M_AP_TYPE(mtmp) == M_AP_FURNITURE)
sense it becoming furniture or an object that you can't see ? defsyms[mtmp->mappearance].explanation
(on the other hand, perhaps you're sensing a brief glimpse : (M_AP_TYPE(mtmp) == M_AP_OBJECT
of its mind as it changes form) */ && OBJ_DESCR(objects[mtmp->mappearance]))
? OBJ_DESCR(objects[mtmp->mappearance])
: (M_AP_TYPE(mtmp) == M_AP_OBJECT
&& OBJ_NAME(objects[mtmp->mappearance]))
? OBJ_NAME(objects[mtmp->mappearance])
: (M_AP_TYPE(mtmp) == M_AP_MONSTER)
? pmname(&mons[mtmp->mappearance],
Mgender(mtmp))
: something;
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
You("%s %s %sappear%s where %s was!", if (glyph_at(mtmp->mx, mtmp->my) != prev_glyph)
cansee(mtmp->mx, mtmp->my) ? "see" : "sense that", You("%s %s %s where %s was!",
(M_AP_TYPE(mtmp) == M_AP_FURNITURE) seeloc ? "see" : "sense that",
? an(defsyms[mtmp->mappearance].explanation) (what != something) ? an(what) : what,
: (M_AP_TYPE(mtmp) == M_AP_OBJECT seeloc ? "appear" : "has appeared", buf);
&& OBJ_DESCR(objects[mtmp->mappearance])) else
? an(OBJ_DESCR(objects[mtmp->mappearance])) You("sense that %s feels rather %s-ish.", buf, what);
: (M_AP_TYPE(mtmp) == M_AP_OBJECT
&& OBJ_NAME(objects[mtmp->mappearance]))
? an(OBJ_NAME(objects[mtmp->mappearance]))
: (M_AP_TYPE(mtmp) == M_AP_MONSTER)
? an(pmname(&mons[mtmp->mappearance],
Mgender(mtmp)))
: something,
cansee(mtmp->mx, mtmp->my) ? "" : "has ",
cansee(mtmp->mx, mtmp->my) ? "" : "ed",
buf);
display_nhwindow(WIN_MAP, TRUE); display_nhwindow(WIN_MAP, TRUE);
} }
} }