Home | History | Annotate | Line # | Download | only in hack
def.rm.h revision 1.1
      1  1.1  cgd /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
      2  1.1  cgd /* def.rm.h - version 1.0.2 */
      3  1.1  cgd 
      4  1.1  cgd /* Level location types */
      5  1.1  cgd #define	HWALL 1
      6  1.1  cgd #define	VWALL 2
      7  1.1  cgd #define	SDOOR 3
      8  1.1  cgd #define	SCORR 4
      9  1.1  cgd #define	LDOOR 5
     10  1.1  cgd #define	POOL	6	/* not yet fully implemented */
     11  1.1  cgd 			/* this should in fact be a bit like lit */
     12  1.1  cgd #define	DOOR 7
     13  1.1  cgd #define	CORR 8
     14  1.1  cgd #define	ROOM 9
     15  1.1  cgd #define	STAIRS 10
     16  1.1  cgd 
     17  1.1  cgd /*
     18  1.1  cgd  * Avoid using the level types in inequalities:
     19  1.1  cgd  *  these types are subject to change.
     20  1.1  cgd  * Instead, use one of the macros below.
     21  1.1  cgd  */
     22  1.1  cgd #define	IS_WALL(typ)	((typ) <= VWALL)
     23  1.1  cgd #define IS_ROCK(typ)	((typ) < POOL)		/* absolutely nonaccessible */
     24  1.1  cgd #define	ACCESSIBLE(typ)	((typ) >= DOOR)			/* good position */
     25  1.1  cgd #define	IS_ROOM(typ)		((typ) >= ROOM)		/* ROOM or STAIRS */
     26  1.1  cgd #define	ZAP_POS(typ)		((typ) > DOOR)
     27  1.1  cgd 
     28  1.1  cgd /*
     29  1.1  cgd  * A few of the associated symbols are not hardwired.
     30  1.1  cgd  */
     31  1.1  cgd #ifdef QUEST
     32  1.1  cgd #define	CORR_SYM	':'
     33  1.1  cgd #else
     34  1.1  cgd #define	CORR_SYM	'#'
     35  1.1  cgd #endif QUEST
     36  1.1  cgd #define	POOL_SYM	'}'
     37  1.1  cgd 
     38  1.1  cgd #define	ERRCHAR	'{'
     39  1.1  cgd 
     40  1.1  cgd /*
     41  1.1  cgd  * The structure describing a coordinate position.
     42  1.1  cgd  * Before adding fields, remember that this will significantly affect
     43  1.1  cgd  * the size of temporary files and save files.
     44  1.1  cgd  */
     45  1.1  cgd struct rm {
     46  1.1  cgd 	char scrsym;
     47  1.1  cgd 	unsigned typ:5;
     48  1.1  cgd 	unsigned new:1;
     49  1.1  cgd 	unsigned seen:1;
     50  1.1  cgd 	unsigned lit:1;
     51  1.1  cgd };
     52  1.1  cgd extern struct rm levl[COLNO][ROWNO];
     53