Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-27 23:07:29 -05:00
10 changed files with 119 additions and 48 deletions
+23 -10
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1573934698 2019/11/16 20:04:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.107 $ */
/* NetHack 3.6 display.c $NHDT-Date: 1574882660 2019/11/27 19:24:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.108 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -123,6 +123,7 @@
*/
#include "hack.h"
static void FDECL(show_mon_or_warn, (int, int, int));
static void FDECL(display_monster,
(XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P));
static int FDECL(swallow_to_glyph, (int, int));
@@ -361,6 +362,25 @@ int x, y, show;
_map_location(x, y, show);
}
/* display something on monster layer; may need to fixup object layer */
static void
show_mon_or_warn(x, y, monglyph)
int x, y, monglyph;
{
struct obj *o;
/* "remembered, unseen monster" is tracked by object layer so if we're
putting something on monster layer at same spot, stop remembering
that; if an object is in view there, start remembering it instead */
if (glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
if (cansee(x, y) && (o = vobj_at(x, y)) != 0)
map_object(o, FALSE);
}
show_glyph(x, y, monglyph);
}
#define DETECTED 2
#define PHYSICALLY_SEEN 1
#define is_worm_tail(mon) ((mon) && ((x != (mon)->mx) || (y != (mon)->my)))
@@ -477,7 +497,7 @@ xchar worm_tail; /* mon is actually a worm tail */
else
num = mon_to_glyph(mon, rn2_on_display_rng);
}
show_glyph(x, y, num);
show_mon_or_warn(x, y, num);
}
}
@@ -507,14 +527,7 @@ register struct monst *mon;
impossible("display_warning did not match warning type?");
return;
}
/* warning glyph is drawn on the monster layer; unseen
monster glyph is drawn on the object/trap/floor layer;
if we see a 'warning' move onto 'remembered, unseen' we
need to explicitly remove that in order for it to not
reappear when the warned-of monster moves off that spot */
if (glyph_is_invisible(levl[x][y].glyph))
unmap_object(x, y);
show_glyph(x, y, glyph);
show_mon_or_warn(x, y, glyph);
}
int