howmonseen - monster visibility (trunk only)

Pull some code out of lookat() so that it can be used elsewhere.
howmonseen(mon) returns a bitmask of the ways that hero can see mon.
This commit is contained in:
nethack.rankin
2007-05-12 01:30:00 +00:00
parent b805ba7bc3
commit 24f3e005f1
4 changed files with 103 additions and 79 deletions

View File

@@ -2402,6 +2402,7 @@ E void FDECL(unblock_point, (int,int));
E boolean FDECL(clear_path, (int,int,int,int));
E void FDECL(do_clear_area, (int,int,int,
void (*)(int,int,genericptr_t),genericptr_t));
E unsigned FDECL(howmonseen, (struct monst *));
#ifdef VMS

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)vision.h 3.5 1995/01/26 */
/* SCCS Id: @(#)vision.h 3.5 2007/05/11 */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -55,4 +55,13 @@ extern char *viz_rmax; /* max could see indices */
/* Use this macro to get a list of distances of the edges (see vision.c). */
#define circle_ptr(z) (&circle_data[(int)circle_start[z]])
/* howmonseen() bitmask values */
#define MONSEEN_NORMAL 0x0001 /* normal vision */
#define MONSEEN_SEEINVIS 0x0002 /* seeing invisible */
#define MONSEEN_INFRAVIS 0x0004 /* via infravision */
#define MONSEEN_TELEPAT 0x0008 /* via telepathy */
#define MONSEEN_XRAYVIS 0x0010 /* via Xray vision */
#define MONSEEN_DETECT 0x0020 /* via extended monster detection */
#define MONSEEN_WARNMON 0x0040 /* via type-specific warning */
#endif /* VISION_H */