magic mapping fixes

^F on Plane of Water didn't show the magic portal to Astral.  I spent
a lot of time looking at differences between current code and 3.4.3 to figure
out what had changed, then finally tried it on 3.4.3 and discovered that it
didn't work back then either.  ^F marks all floor and ceiling traps as seen
and explicitly maps them, but Water has level.flags.hero_memory clear, making
the mapped trap disappear when it isn't in line of sight.

     When fixing this, I changed magic mapping so that it shows furniture
(stairs, altars, fountains, &c) in preference to traps or objects, and known
traps in preference to objects, so hidden things can be spotted.  (Once
they're in line of sight, the precedence reverses to normal, showing objects
on top of traps on top of floor.)
This commit is contained in:
nethack.rankin
2012-04-16 02:05:40 +00:00
parent 19945b31b0
commit 084d2ab85d
2 changed files with 26 additions and 11 deletions

View File

@@ -829,6 +829,9 @@ fix message given when part of a stack of items in a monster's inventory is
add "Boing!" message when hero zaps resistant monster with striking/force bolt
adjust gaze reflection message when your scales are embedded in your skin
adjust turning-to-stone or -slime messages when you have no limbs
wizard mode ^F on Plane of Water marked portal as seen but didn't display it
magic mapping displays furniture in preference to known or remembered traps
or objects and known traps in preference to remembered objects
Platform- and/or Interface-Specific Fixes

View File

@@ -973,7 +973,9 @@ STATIC_OVL void
show_map_spot(x, y)
register int x, y;
{
register struct rm *lev;
struct rm *lev;
struct trap *t;
int oldglyph;
if (Confusion && rn2(7)) return;
lev = &levl[x][y];
@@ -986,16 +988,26 @@ register int x, y;
unblock_point(x,y);
}
/* if we don't remember an object or trap there, map it */
if (lev->typ == ROOM ?
(glyph_is_cmap(lev->glyph) && !glyph_is_trap(lev->glyph) &&
glyph_to_cmap(lev->glyph) != ROOM) :
(!glyph_is_object(lev->glyph) && !glyph_is_trap(lev->glyph))) {
if (level.flags.hero_memory) {
magic_map_background(x,y,0);
newsym(x,y); /* show it, if not blocked */
} else {
magic_map_background(x,y,1); /* display it */
/*
* Force the real background, then if it's not furniture and there's
* a known trap there, display the trap, else if there was an object
* shown there, redisplay the object. So during mapping, furniture
* takes precedence over traps, which take precedence over objects,
* opposite to how normal vision behaves.
*/
oldglyph = glyph_at(x, y);
if (level.flags.hero_memory) {
magic_map_background(x, y, 0);
newsym(x, y); /* show it, if not blocked */
} else {
magic_map_background(x, y, 1); /* display it */
}
if (!IS_FURNITURE(lev->typ)) {
if ((t = t_at(x, y)) != 0 && t->tseen) {
map_trap(t, 1);
} else if (glyph_is_trap(oldglyph) || glyph_is_object(oldglyph)) {
show_glyph(x, y, oldglyph);
if (level.flags.hero_memory) lev->glyph = oldglyph;
}
}
}