Wikihack
Advertisement

Below is the full text to dgn_file.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/dgn_file.h#line123]], for example.

The latest source code for vanilla NetHack is at Source code.


The NetHack General Public License applies to screenshots, source code and other content from NetHack.
1.    /*	SCCS Id: @(#)dgn_file.h 3.4	1993/01/17	*/
2.    /* Copyright (c) 1989 by M. Stephenson				  */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef DGN_FILE_H
6.    #define DGN_FILE_H
7.    
8.    #ifndef ALIGN_H
9.    #include "align.h"
10.   #endif
11.   
12.   /*
13.    * Structures manipulated by the dungeon loader & compiler
14.    */
15.   
16.   struct	couple {
17.   	short	base, rand;
18.   };
19.   
20.   struct tmpdungeon {
21.   	char	name[24],
22.   		protoname[24];
23.   	struct	couple	lev;
24.   	int	flags,
25.   		chance,
26.   		levels,
27.   		branches;
28.   	char	boneschar;
29.   };
30.   
31.   struct tmplevel {
32.   	char	name[24];
33.   	struct	couple	lev;
34.   	int	chance, rndlevs, chain, flags;
35.   	char	boneschar;
36.   };
37.   
38.   struct tmpbranch {
39.   	char	name[24];	/* destination dungeon name */
40.   	struct	couple	lev;
41.   	int	chain;		/* index into tmplevel array (chained branch)*/
42.   	int	type;		/* branch type (see below) */
43.   	int	up;		/* branch is up or down */
44.   	int	entry_lev;	/* entry level in target dungeon */
45.   };
46.   
47.   /*
48.    *	Values for type for tmpbranch structure.
49.    */
50.   #define TBR_STAIR   0	/* connection with both ends having a staircase */
51.   #define TBR_NO_UP   1	/* connection with no up staircase */
52.   #define TBR_NO_DOWN 2	/* connection with no down staircase */
53.   #define TBR_PORTAL  3	/* portal connection */
54.   
55.   /*
56.    *	Flags that map into the dungeon flags bitfields.
57.    */
58.   #define TOWN		  1	/* levels only */
59.   #define HELLISH		  2
60.   #define MAZELIKE	  4
61.   #define ROGUELIKE	  8
62.   
63.   #define D_ALIGN_NONE	0
64.   #define D_ALIGN_CHAOTIC	(AM_CHAOTIC << 4)
65.   #define D_ALIGN_NEUTRAL	(AM_NEUTRAL << 4)
66.   #define D_ALIGN_LAWFUL	(AM_LAWFUL << 4)
67.   
68.   #define D_ALIGN_MASK	0x70
69.   
70.   /*
71.    *	Max number of prototype levels and branches.
72.    */
73.   #define LEV_LIMIT	99
74.   #define BRANCH_LIMIT	32
75.   
76.   #endif /* DGN_FILE_H */
Advertisement