github issue #1299 - sleeping mimics

Issue reported by elunna:  sleeping mimics can grab the hero, and
zapping a concealed mimic with a wand of sleep describes the target
as a mimic but doesn't bring it out of concealment.

The grab-when-asleep case is reasonable.  It's a reflexive counter-
attack by a magical creature.  And the mimic wakes up in the process.
But the mimic wasn't being brought out of concealment.  Do that.

Unconceal mimics hit by wand of sleep unless already sleeping.

Fixes #1299
This commit is contained in:
PatR
2024-11-29 23:30:04 -08:00
parent 689f6c4c82
commit 149cb96020
5 changed files with 77 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 pager.c $NHDT-Date: 1724094301 2024/08/19 19:05:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.279 $ */
/* NetHack 3.7 pager.c $NHDT-Date: 1732979463 2024/11/30 07:11:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.282 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -280,7 +280,10 @@ mhidden_description(
/* extracted from lookat(); also used by namefloorobj() */
boolean
object_from_map(int glyph, coordxy x, coordxy y, struct obj **obj_p)
object_from_map(
int glyph,
coordxy x, coordxy y,
struct obj **obj_p)
{
boolean fakeobj = FALSE, mimic_obj = FALSE;
struct monst *mtmp;
@@ -305,8 +308,10 @@ object_from_map(int glyph, coordxy x, coordxy y, struct obj **obj_p)
if (!otmp || otmp->otyp != glyphotyp) {
/* this used to exclude STRANGE_OBJECT; now caller deals with it */
otmp = mksobj(glyphotyp, FALSE, FALSE);
if (!otmp)
return FALSE;
/* even though we pass False for mksobj()'s 'init' arg, corpse-rot,
egg-hatch, and figurine-transform timers get initialized */
if (otmp->timed)
obj_stop_timers(otmp);
fakeobj = TRUE;
if (otmp->oclass == COIN_CLASS)
otmp->quan = 2L; /* to force pluralization */