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