Source:NetHack 3.4.3/include/sp lev.h

From NetHackWiki
Jump to: navigation, search

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

  1. /*	SCCS Id: @(#)sp_lev.h	3.4	1996/05/08	*/
  2. /* Copyright (c) 1989 by Jean-Christophe Collet			  */
  3. /* NetHack may be freely redistributed.  See license for details. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

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