mimicking a corpse

Noticed while looking over mimic hiding.  When on an object, a mimic
will hide as that type of object.  But for a corpse, it picked a random
monster type and could choose one that doesn't leave a corpse.  Also as
a tin it would always be an empty one, but there doesn't seem to be any
way for a player to learn that.
This commit is contained in:
PatR
2019-04-20 16:00:29 -07:00
parent ab4625a6bf
commit cd6b5ef933
2 changed files with 20 additions and 9 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.306 $ $NHDT-Date: 1555720351 2019/04/20 00:32:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.307 $ $NHDT-Date: 1555801218 2019/04/20 23:00:18 $
This fixes36.2 file is here to capture information about updates in the 3.6.x This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however, lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -414,6 +414,8 @@ if hero throws a pick-axe into a shop and shopkeeper catches it, shk will say
a quantum mechanic hit that teleported the target could also kill it at the a quantum mechanic hit that teleported the target could also kill it at the
destination; make sure that the small amount of physical damage isn't destination; make sure that the small amount of physical damage isn't
fatal unless the teleport is negated by cancellation (magic or armor) fatal unless the teleport is negated by cancellation (magic or armor)
if a mimic concealed itself as a corpse, it could pick a monster type which
never leaves a corpse
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+17 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1550524560 2019/02/18 21:16:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */ /* NetHack 3.6 makemon.c $NHDT-Date: 1555801218 2019/04/20 23:00:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.133 $ */
/* 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. */
@@ -1083,7 +1083,7 @@ coord *cc;
} }
} }
} else { } else {
gotgood: gotgood:
cc->x = nx; cc->x = nx;
cc->y = ny; cc->y = ny;
return TRUE; return TRUE;
@@ -2208,7 +2208,7 @@ register struct monst *mtmp;
} }
} else { } else {
s_sym = syms[rn2((int) sizeof(syms))]; s_sym = syms[rn2((int) sizeof(syms))];
assign_sym: assign_sym:
if (s_sym == MAXOCLASSES || s_sym == MAXOCLASSES + 1) { if (s_sym == MAXOCLASSES || s_sym == MAXOCLASSES + 1) {
ap_type = M_AP_FURNITURE; ap_type = M_AP_FURNITURE;
appear = (s_sym == MAXOCLASSES) ? S_upstair : S_dnstair; appear = (s_sym == MAXOCLASSES) ? S_upstair : S_dnstair;
@@ -2228,12 +2228,21 @@ register struct monst *mtmp;
} }
mtmp->m_ap_type = ap_type; mtmp->m_ap_type = ap_type;
mtmp->mappearance = appear; mtmp->mappearance = appear;
if (ap_type == M_AP_OBJECT && (appear == STATUE || appear == CORPSE /* when appearing as an object based on a monster type, pick a shape */
|| appear == FIGURINE || appear == EGG)) { if (ap_type == M_AP_OBJECT
&& (appear == STATUE || appear == FIGURINE
|| appear == CORPSE || appear == EGG || appear == TIN)) {
int mndx = rndmonnum(),
nocorpse_ndx = (mvitals[mndx].mvflags & G_NOCORPSE) != 0;
if (appear == CORPSE && nocorpse_ndx)
mndx = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST);
else if ((appear == EGG && !can_be_hatched(mndx))
|| (appear == TIN && nocorpse_ndx))
mndx = NON_PM; /* revert to generic egg or empty tin */
newmcorpsenm(mtmp); newmcorpsenm(mtmp);
MCORPSENM(mtmp) = rndmonnum(); MCORPSENM(mtmp) = mndx;
if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp)))
MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */
} }
if (does_block(mx, my, &levl[mx][my])) if (does_block(mx, my, &levl[mx][my]))