improve messaging on vampire bat to fog cloud transition in Vlad's

Bug 271 - #H4167: vampires being fog clouds show up as bats on telepathy

A bug reporter wrote:
> In top level of Vlad's, the vampires hiding as fog clouds in the closets show
> up on telepathy as B, when far-looked as vampire bat.  once the door opens they
> are fog clouds.
>
> I currently have telepathy from the PYEC.

The vampire /was/ shapeshifted into a vampire bat, but once the secret door
was revealed, it shifted into a fog cloud in order to pass under the door.

If you were to blast the door with a wand of striking from a distance,
you would have encountered the vampire bat.

This clarifies the situation through better messaging.

--------
Original debug call stack trace:
     NetHack.exe!newcham(monst * mtmp, permonst * mdat, char polyspot, char msg) Line 3140
     NetHack.exe!vamp_shift(monst * mon, permonst * ptr) Line 1598
     NetHack.exe!m_move(monst * mtmp, int after) Line 1219
     NetHack.exe!dochug(monst * mtmp) Line 566
     NetHack.exe!dochugw(monst * mtmp) Line 100
     NetHack.exe!movemon(...) Line 707
     NetHack.exe!moveloop(char resuming) Line 105
     NetHack.exe!main(int argc, char * * argv) Line 105
This commit is contained in:
nhmall
2016-01-01 11:17:57 -05:00
parent 9a5340a3bf
commit fce9f1131d
3 changed files with 28 additions and 8 deletions

View File

@@ -77,6 +77,8 @@ change "unlockable chest" to "broken chest" so that it won't be misunderstood
use doname instead of xname when using '/' or ';' to look at objects on map
when a pet moves reluctantly, name the top item of the pile it is reluctant
to step on if the hero sees or remembers any object(s) at that spot
ensure sufficient messages are given to clarify the transition from detected
vampire bats to fog clouds in Vlad's tower
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1451176552 2015/12/27 00:35:52 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.202 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1451664800 2016/01/01 16:13:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.203 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3141,7 +3141,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
int hpn, hpd;
int mndx, tryct;
struct permonst *olddata = mtmp->data;
char oldname[BUFSZ], newname[BUFSZ];
char oldname[BUFSZ], l_oldname[BUFSZ], newname[BUFSZ];
/* Riders are immune to polymorph and green slime */
if (is_rider(mtmp->data))
@@ -3153,6 +3153,9 @@ boolean msg; /* "The oldmon turns into a newmon!" */
SUPPRESS_SADDLE, FALSE));
oldname[0] = highc(oldname[0]);
}
/* we need this one whether msg is true or not */
Strcpy(l_oldname, x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE));
/* mdat = 0 -> caller wants a random monster shape */
if (mdat == 0) {
@@ -3246,14 +3249,19 @@ boolean msg; /* "The oldmon turns into a newmon!" */
char msgtrail[BUFSZ];
if (is_vampshifter(mtmp)) {
Strcpy(msgtrail, " that had been shapeshifted");
Sprintf(msgtrail, " which was a shapeshifted %s",
m_monnam(mtmp));
} else if (is_animal(mdat)) {
Strcpy(msgtrail, "'s stomach");
} else {
msgtrail[0] = '\0';
}
You("break out of %s%s!", mon_nam(mtmp), msgtrail);
/* Do this even if msg is FALSE */
You("%s %s%s!",
(amorphous(olddata) || is_whirly(olddata)) ?
"emerge from" : "break out of",
l_oldname, msgtrail);
mtmp->mhp = 1; /* almost dead */
}
expels(mtmp, olddata, FALSE);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1446808446 2015/11/06 11:14:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.78 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1451664819 2016/01/01 16:13:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.79 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -14,7 +14,7 @@ STATIC_DCL void FDECL(release_hero, (struct monst *));
STATIC_DCL void FDECL(distfleeck, (struct monst *, int *, int *, int *));
STATIC_DCL int FDECL(m_arrival, (struct monst *));
STATIC_DCL boolean FDECL(stuff_prevents_passage, (struct monst *));
STATIC_DCL int FDECL(vamp_shift, (struct monst *, struct permonst *));
STATIC_DCL int FDECL(vamp_shift, (struct monst *, struct permonst *, BOOLEAN_P));
/* True if mtmp died */
boolean
@@ -1216,7 +1216,7 @@ postmov:
if (here->doormask & (D_LOCKED | D_CLOSED)
&& (amorphous(ptr)
|| (!amorphous(ptr) && can_fog(mtmp)
&& vamp_shift(mtmp, &mons[PM_FOG_CLOUD])))) {
&& vamp_shift(mtmp, &mons[PM_FOG_CLOUD],canspotmon(mtmp))))) {
if (flags.verbose && canseemon(mtmp))
pline("%s %s under the door.", Monnam(mtmp),
(ptr == &mons[PM_FOG_CLOUD]
@@ -1586,12 +1586,19 @@ struct monst *mtmp;
}
STATIC_OVL int
vamp_shift(mon, ptr)
vamp_shift(mon, ptr, domsg)
struct monst *mon;
struct permonst *ptr;
boolean domsg;
{
int reslt = 0;
char fmtstr[BUFSZ];
if (domsg) {
Sprintf(fmtstr, "You %s %%s where %s was.",
sensemon(mon) ? "now detect" : "observe",
an(m_monnam(mon)));
}
if (mon->cham >= LOW_PM) {
if (ptr == &mons[mon->cham])
mon->cham = NON_PM;
@@ -1600,6 +1607,9 @@ struct permonst *ptr;
mon->cham = monsndx(mon->data);
reslt = newcham(mon, ptr, FALSE, FALSE);
}
if (reslt && domsg) {
pline(fmtstr, an(m_monnam(mon)));
}
return reslt;
}