Skip to content

Commit

Permalink
fix #H254 - stethocoping mimics (trunk only)
Browse files Browse the repository at this point in the history
     From a bug report, applying a stetoscope to
a mimic which was hiding would report that mimic's stats but not bring it
out of hiding, unlike the behavior for other types of hiding monsters.
  • Loading branch information
nethack.rankin committed Mar 8, 2007
1 parent 2867248 commit b8a51d3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ scatter piles of kicked gold rather than move the entire pile at once
if normal game save file is restored via `nethack -X', restore in normal
mode--with save file deletion--and require confirmation ala 'X'
command to make deferred switch into explore mode
stethoscope applied to hiding mimic will bring it out of hiding


Platform- and/or Interface-Specific Fixes
Expand Down
31 changes: 27 additions & 4 deletions src/apply.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)apply.c 3.5 2007/02/03 */
/* SCCS Id: @(#)apply.c 3.5 2007/03/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -344,11 +344,34 @@ use_stethoscope(obj)
return 0;
}
if ((mtmp = m_at(rx,ry)) != 0) {
mstatusline(mtmp);
const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *)0,
SUPPRESS_IT|SUPPRESS_INVISIBLE, FALSE);

if (mtmp->mundetected) {
mtmp->mundetected = 0;
if (cansee(rx,ry)) newsym(mtmp->mx,mtmp->my);
if (!canspotmon(mtmp))
There("is %s hidden there.", mnm);
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
} else if (mtmp->mappearance) {
const char *what = "thing";

switch (mtmp->m_ap_type) {
case M_AP_OBJECT:
what = simple_typename(mtmp->mappearance);
break;
case M_AP_MONSTER: /* ignore Hallucination here */
what = mons[mtmp->mappearance].mname;
break;
case M_AP_FURNITURE:
what = defsyms[mtmp->mappearance].explanation;
break;
}
seemimic(mtmp);
pline("That %s is really %s", what, mnm);
} else if (flags.verbose && !canspotmon(mtmp)) {
There("is %s there.", mnm);
}
mstatusline(mtmp);
if (!canspotmon(mtmp))
map_invisible(rx,ry);
return res;
Expand Down

0 comments on commit b8a51d3

Please sign in to comment.