-/* NetHack 3.6 display.c $NHDT-Date: 1525056598 2018/04/30 02:49:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.92 $ */
+/* NetHack 3.6 display.c $NHDT-Date: 1540502147 2018/10/25 21:15:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.94 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
struct monst *mon;
{
int wl = 0, tmp = 0;
+
if (mon_warning(mon)) {
tmp = (int) (mon->m_lev / 4); /* match display.h */
wl = (tmp > WARNCOUNT - 1) ? WARNCOUNT - 1 : tmp;
/* normal region shown only on accessible positions, but poison clouds
* also shown above lava, pools and moats.
*/
- if (reg != NULL && (ACCESSIBLE(lev->typ)
- || (reg->glyph == cmap_to_glyph(S_poisoncloud)
- && (lev->typ == LAVAPOOL || lev->typ == POOL
- || lev->typ == MOAT)))) {
+ if (reg && (ACCESSIBLE(lev->typ)
+ || (reg->glyph == cmap_to_glyph(S_poisoncloud)
+ && is_pool_or_lava(x, y)))) {
show_region(reg, x, y);
return;
}
+
if (x == u.ux && y == u.uy) {
- if (canspotself()) {
- _map_location(x, y, 0); /* map *under* self */
+ int see_self = canspotself();
+
+ /* update map information for <u.ux,u.uy> (remembered topology
+ and object/known trap/terrain glyph) but only display it if
+ hero can't see him/herself, then show self if appropriate */
+ _map_location(x, y, !see_self);
+ if (see_self)
display_self();
- } else
- /* we can see what is there */
- _map_location(x, y, 1);
} else {
mon = m_at(x, y);
worm_tail = is_worm_tail(mon);
- see_it =
- mon && (worm_tail ? (!mon->minvis || See_invisible)
- : (mon_visible(mon)) || tp_sensemon(mon)
- || MATCH_WARN_OF_MON(mon));
+ see_it = mon && (mon_visible(mon)
+ || (!worm_tail && (tp_sensemon(mon)
+ || MATCH_WARN_OF_MON(mon))));
if (mon && (see_it || (!worm_tail && Detect_monsters))) {
if (mon->mtrapped) {
struct trap *trap = t_at(x, y);
int tt = trap ? trap->ttyp : NO_TRAP;
- /* if monster is in a physical trap, you see the trap too
- */
- if (tt == BEAR_TRAP || is_pit(tt)
- || tt == WEB) {
- trap->tseen = TRUE;
- }
+ /* if monster is in a physical trap, you see trap too */
+ if (tt == BEAR_TRAP || is_pit(tt) || tt == WEB)
+ trap->tseen = 1;
}
_map_location(x, y, 0); /* map under the monster */
/* also gets rid of any invisibility glyph */
worm_tail);
} else if (mon && mon_warning(mon) && !is_worm_tail(mon)) {
display_warning(mon);
- } else if (glyph_is_invisible(levl[x][y].glyph)) {
+ } else if (glyph_is_invisible(lev->glyph)) {
map_invisible(x, y);
} else
_map_location(x, y, 1); /* map the location */\
if (canspotself())
display_self();
- } else if ((mon = m_at(x, y))
+ } else if ((mon = m_at(x, y)) != 0
&& ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)
|| (see_with_infrared(mon)
- && mon_visible(mon))))
+ && mon_visible(mon)))) != 0
|| Detect_monsters)) {
- /* Monsters are printed every time. */
- /* This also gets rid of any invisibility glyph */
+ /* Seen or sensed monsters are printed every time.
+ This also gets rid of any invisibility glyph. */
display_monster(x, y, mon, see_it ? 0 : DETECTED,
is_worm_tail(mon) ? TRUE : FALSE);
- } else if ((mon = m_at(x, y)) && mon_warning(mon)
- && !is_worm_tail(mon)) {
+ } else if (mon && mon_warning(mon) && !is_worm_tail(mon)) {
display_warning(mon);
- }
/*
* If the location is remembered as being both dark (waslit is false)
*
* (1) A dark location that the hero could see through night
* vision.
- *
* (2) Darkened while out of the hero's sight. This can happen
* when cursed scroll of light is read.
*
* These checks and changes must be here and not in back_to_glyph().
* They are dependent on the position being out of sight.
*/
- else if (Is_rogue_level(&u.uz)) {
+ } else if (Is_rogue_level(&u.uz)) {
if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_stone));
else
goto show_mem;
- }
- else if (!lev->waslit || (flags.dark_room && iflags.use_color)) {
+ } else if (!lev->waslit || (flags.dark_room && iflags.use_color)) {
if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM)