Source:NetHack 3.1.0/sp lev.h

Below is the full text to sp_lev.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.0/sp_lev.h#line123 ]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

1.   /*	SCCS Id: @(#)sp_lev.h	3.1	92/04/19	*/ 2.   /* Copyright (c) 1989 by Jean-Christophe Collet			  */ 3.   /* NetHack may be freely redistributed. See license for details. */ 4.     5.    #ifndef SP_LEV_H 6.   #define SP_LEV_H 7.    8.        /* wall directions */ 9.   #define W_NORTH     1 10.  #define W_SOUTH     2 11.  #define W_EAST	    4 12.  #define W_WEST	    8 13.  #define W_ANY	    (W_NORTH|W_SOUTH|W_EAST|W_WEST) 14.   15.       /* MAP limits */ 16.  #define MAP_X_LIM  76 17.  #define MAP_Y_LIM  21 18.   19.       /* Per level flags */ 20.  #define NOTELEPORT   1 21.  #define HARDFLOOR    2 22.  #define NOMMAP	     4 23.  #define SHORTSIGHTED 8 24.   25.       /* special level types */ 26.  #define SP_LEV_ROOMS	1 27.  #define SP_LEV_MAZE	2 28.   29.   /*  30.    * Structures manipulated by the special levels loader & compiler 31.   */  32.    33.   typedef struct { 34.  	boolean	init_present; 35.  	char	fg, bg; 36.  	boolean	smoothed, joined; 37.  	xchar   lit, walled; 38.  } lev_init; 39.   40.   typedef struct { 41.  	xchar x, y, mask; 42.  } door; 43.   44.   typedef struct { 45.  	xchar wall, pos, secret, mask; 46.  } room_door; 47.   48.   typedef struct { 49.  	xchar x, y, type; 50.  } trap; 51.   52.   typedef struct { 53.  	xchar x, y, class, appear; 54.  	schar peaceful, asleep; 55.  	aligntyp	align; 56.  	short id; 57.  	char  *name; 58.  	char  *appear_as; 59.  } monster; 60.   61.   typedef struct { 62.  	xchar x, y, class; 63.  	xchar curse_state; 64.  	short id; 65.  	short spe; 66.  	int   corpsenm; 67.  	char  *name; 68.  } object; 69.   70.   #include "align.h"  71. 72.  typedef struct { 73.  	xchar		x, y;  74. aligntyp	align; 75.  	xchar		shrine; 76.  } altar; 77.   78.   typedef struct { 79.  	xchar x, y, dir, db_open; 80.  } drawbridge; 81.   82.   typedef struct { 83.  	xchar x, y, dir; 84.  } walk; 85.   86.   typedef struct { 87.  	xchar x1, y1, x2, y2; 88.  } digpos; 89.   90.   typedef struct { 91.  	xchar x, y, up; 92.  } lad; 93.   94.   typedef struct { 95.  	xchar x, y, up; 96.  } stair; 97.   98.   typedef struct { 99.  	xchar x1, y1, x2, y2; 100. 	xchar rtype, rlit, rirreg; 101. } region; 102.  103.  /* values for rtype are defined in dungeon.h */ 104. typedef struct { 105. 	struct { xchar x1, y1, x2, y2; } inarea; 106. 	struct { xchar x1, y1, x2, y2; } delarea; 107. 	boolean in_islev, del_islev; 108. 	xchar rtype; 109. 	char *rname; 110. } lev_region; 111.  112.  typedef struct { 113. 	xchar x, y;  114. int  amount; 115. } gold; 116.  117.  typedef struct { 118. 	xchar x, y;  119. union { 120. 	int length; 121. 	char  *text; 122.     } e;  123. xchar etype; 124. } engraving; 125.  126.  typedef struct { 127. 	xchar x,y; 128. } fountain; 129.  130.  typedef struct { 131. 	xchar x,y; 132. } sink; 133.  134.  typedef struct { 135. 	xchar x,y; 136. } pool; 137.  138.  typedef struct { 139. 	char halign, valign; 140. 	char xsize, ysize; 141. 	char **map; 142. 	char nrobjects; 143. 	char *robjects; 144. 	char nloc; 145. 	char *rloc_x; 146. 	char *rloc_y; 147. 	char nrmonst; 148. 	char *rmonst; 149. 	char nreg; 150. 	region **regions; 151. 	char nlreg; 152. 	lev_region **lregions; 153. 	char ndoor; 154. 	door **doors; 155. 	char ntrap; 156. 	trap **traps; 157. 	char nmonster; 158. 	monster **monsters; 159. 	char nobject; 160. 	object **objects; 161. 	char ndrawbridge; 162. 	drawbridge **drawbridges; 163. 	char nwalk; 164. 	walk **walks; 165. 	char ndig; 166. 	digpos **digs; 167. 	char nlad; 168. 	lad **lads; 169. 	char nstair; 170. 	stair **stairs; 171. 	char naltar; 172. 	altar **altars; 173. 	char ngold; 174. 	gold **golds; 175. 	char nengraving; 176. 	engraving **engravings; 177. 	char nfountain; 178. 	fountain **fountains; 179. } mazepart; 180.  181.  typedef struct { 182. 	long flags; 183. 	lev_init init_lev; 184. 	short filling; 185. 	char numpart; 186. 	mazepart **parts; 187. } specialmaze; 188.  189.  typedef struct _room { 190. 	char  *name; 191. 	char  *parent; 192. 	xchar x, y, w, h;  193. xchar xalign, yalign; 194. 	xchar rtype, chance, rlit, filled; 195. 	char ndoor; 196. 	room_door **doors; 197. 	char ntrap; 198. 	trap **traps; 199. 	char nmonster; 200. 	monster **monsters; 201. 	char nobject; 202. 	object **objects; 203. 	char naltar; 204. 	altar **altars; 205. 	char nstair; 206. 	stair **stairs; 207. 	char ngold; 208. 	gold **golds; 209. 	char nengraving; 210. 	engraving **engravings; 211. 	char nfountain; 212. 	fountain **fountains; 213. 	char nsink; 214. 	sink **sinks; 215. 	char npool; 216. 	pool **pools; 217. 	/* These three fields are only used when loading the level... */ 218.  	int nsubroom; 219. 	struct _room *subrooms[MAX_SUBROOMS]; 220. 	struct mkroom *mkr; 221. } room; 222.  223.  typedef struct { 224. 	struct { 225. 		xchar room; 226. 		xchar wall; 227. 		xchar door; 228. 	} src, dest; 229. } corridor; 230.  231.  typedef struct { 232. 	long flags; 233. 	lev_init init_lev; 234. 	char nrobjects; 235. 	char *robjects; 236. 	char nrmonst; 237. 	char *rmonst; 238. 	xchar nroom; 239. 	room **rooms; 240. 	xchar ncorr; 241. 	corridor **corrs; 242. } splev; 243.  244.  #endif /* SP_LEV_H */