From: nethack.rankin Date: Thu, 3 Feb 2011 21:10:17 +0000 (+0000) Subject: stumble_onto_mimic while blind, #untrap vs mimic X-Git-Tag: MOVE2GIT~270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5632b4c456b54d8da64d976241d5f381661c5abb;p=nethack stumble_onto_mimic while blind, #untrap vs mimic Noticed while testing a forthcoming mimic patch: when blind, some actions (open, close, #untrap, applying a key [as of a month ago], possibly others) taken against a mimic posing as a door would yield "Wait! That's a monster!" but leave the map showing the door instead of replacing it with the unseen monster glyph. Similarly, using #untrap towards a known trap location covered by a concealed mimic could yield "It is in the way." or "It isn't trapped.", depending upon the type of trap present, and not reveal the mimic. Same thing happened when not blind, except the message would refer to "the mimic" rather than "it". Now it will expose the mimic, regardless of the type of trap. --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 6ee51cc27..fde31027e 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -394,6 +394,10 @@ blanking items in pools while blind shouldn't reveal new obj description avoid infinite loop in topten output when killed by long-named monster grid bug could move diagonally 1 step using travel command unpaid shop items stolen from hero by a monster remained on hero's shop bill +some actions taken when blind would yield "Wait! That's a monster!" (for a + mimic posing as a door) but not display the unseen monster glyph +#untrap toward known trap location containing concealed mimic would yield + "{The mimic|It} {is in the way|isn't trapped}." but not reveal mimic Platform- and/or Interface-Specific Fixes diff --git a/src/trap.c b/src/trap.c index eb8f38162..7f25e967d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3935,6 +3935,12 @@ boolean force; (x == u.ux && y == u.uy) ? " in it" : ""); return 1; } + if ((mtmp = m_at(x, y)) != 0 && + (mtmp->m_ap_type == M_AP_FURNITURE || + mtmp->m_ap_type == M_AP_OBJECT)) { + stumble_onto_mimic(mtmp); + return 1; + } switch(ttmp->ttyp) { case BEAR_TRAP: case WEB: @@ -3953,7 +3959,7 @@ boolean force; You("are already on the edge of the pit."); return 0; } - if (!(mtmp = m_at(x,y))) { + if (!mtmp) { pline("Try filling the pit instead."); return 0; } diff --git a/src/uhitm.c b/src/uhitm.c index a69f98272..c5aa4e292 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2560,6 +2560,11 @@ struct monst *mtmp; if (what) pline(fmt, what); wakeup(mtmp); /* clears mimicking */ + /* if hero is blind, wakeup() won't display the monster even though + it's no longer concealed */ + if (!canspotmon(mtmp) && + !glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) + map_invisible(mtmp->mx, mtmp->my); } STATIC_OVL void