]> granicus.if.org Git - nethack/commitdiff
stumble_onto_mimic while blind, #untrap vs mimic
authornethack.rankin <nethack.rankin>
Thu, 3 Feb 2011 21:10:17 +0000 (21:10 +0000)
committernethack.rankin <nethack.rankin>
Thu, 3 Feb 2011 21:10:17 +0000 (21:10 +0000)
     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 <size> mimic" rather than
"it".  Now it will expose the mimic, regardless of the type of trap.

doc/fixes34.4
src/trap.c
src/uhitm.c

index 6ee51cc27724aec453ca5ad9231255d8b36051bc..fde31027eb4ce9fd2394c05c564b54607efc153d 100644 (file)
@@ -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
index eb8f381623f1436450d260676fe7ae955f25cc9a..7f25e967d546cbaef44fe80be016d8ac70e71f7a 100644 (file)
@@ -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;
                                }
index a69f98272d556bf1531b4d99facb49bfb76d1faa..c5aa4e2920118d75dfe38f96b00a49e7e21703f3 100644 (file)
@@ -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