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 mhitm.c $NHDT-Date: 1698939796 2023/11/02 15:43:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.244 $ */
/* NetHack 3.7 mhitm.c $NHDT-Date: 1732979463 2024/11/30 07:11:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.253 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1209,6 +1209,12 @@ paralyze_monst(struct monst *mon, int amt)
int
sleep_monst(struct monst *mon, int amt, int how)
{
/* reveal mimic unless already asleep or paralyzed (won't be 'busy') */
if (how >= 0 && !mon->msleeping && !mon->mfrozen
&& mon->data->mlet == S_MIMIC && (M_AP_TYPE(mon) == M_AP_FURNITURE
|| M_AP_TYPE(mon) == M_AP_OBJECT))
seemimic(mon);
if (resists_sleep(mon) || defended(mon, AD_SLEE)
|| (how >= 0 && resist(mon, (char) how, 0, NOTELL))) {
shieldeff(mon->mx, mon->my);