1 /* SCCS Id: @(#)decl.h 3.4 2001/12/10 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
10 E int NDECL((*occupation));
11 E int NDECL((*afternmv));
15 #if defined(UNIX) || defined(VMS)
20 #endif /* DEF_PAGER */
27 E NEARDATA int bases[MAXOCLASSES];
31 E NEARDATA int warnlevel;
34 E NEARDATA int nsubroom;
35 E NEARDATA int occtime;
37 #define WARNCOUNT 6 /* number of different warning levels */
38 E uchar warnsyms[WARNCOUNT];
40 E int x_maze_max, y_maze_max;
44 E NEARDATA int in_doagain;
47 E struct dgn_topology { /* special dungeon levels for speed */
48 d_level d_oracle_level;
49 d_level d_bigroom_level; /* unused */
51 d_level d_rogue_level;
53 d_level d_medusa_level;
54 d_level d_stronghold_level;
55 d_level d_valley_level;
59 d_level d_juiblex_level;
60 d_level d_orcus_level;
61 d_level d_baalzebub_level; /* unused */
62 d_level d_asmodeus_level; /* unused */
63 d_level d_portal_level; /* only in goto_level() [do.c] */
64 d_level d_sanctum_level;
65 d_level d_earth_level;
66 d_level d_water_level;
69 d_level d_astral_level;
72 xchar d_mines_dnum, d_quest_dnum;
73 d_level d_qstart_level, d_qlocate_level, d_nemesis_level;
76 /* macros for accesing the dungeon levels by their old names */
77 #define oracle_level (dungeon_topology.d_oracle_level)
78 #define bigroom_level (dungeon_topology.d_bigroom_level)
80 #define rogue_level (dungeon_topology.d_rogue_level)
82 #define medusa_level (dungeon_topology.d_medusa_level)
83 #define stronghold_level (dungeon_topology.d_stronghold_level)
84 #define valley_level (dungeon_topology.d_valley_level)
85 #define wiz1_level (dungeon_topology.d_wiz1_level)
86 #define wiz2_level (dungeon_topology.d_wiz2_level)
87 #define wiz3_level (dungeon_topology.d_wiz3_level)
88 #define juiblex_level (dungeon_topology.d_juiblex_level)
89 #define orcus_level (dungeon_topology.d_orcus_level)
90 #define baalzebub_level (dungeon_topology.d_baalzebub_level)
91 #define asmodeus_level (dungeon_topology.d_asmodeus_level)
92 #define portal_level (dungeon_topology.d_portal_level)
93 #define sanctum_level (dungeon_topology.d_sanctum_level)
94 #define earth_level (dungeon_topology.d_earth_level)
95 #define water_level (dungeon_topology.d_water_level)
96 #define fire_level (dungeon_topology.d_fire_level)
97 #define air_level (dungeon_topology.d_air_level)
98 #define astral_level (dungeon_topology.d_astral_level)
99 #define tower_dnum (dungeon_topology.d_tower_dnum)
100 #define sokoban_dnum (dungeon_topology.d_sokoban_dnum)
101 #define mines_dnum (dungeon_topology.d_mines_dnum)
102 #define quest_dnum (dungeon_topology.d_quest_dnum)
103 #define qstart_level (dungeon_topology.d_qstart_level)
104 #define qlocate_level (dungeon_topology.d_qlocate_level)
105 #define nemesis_level (dungeon_topology.d_nemesis_level)
106 #define knox_level (dungeon_topology.d_knox_level)
108 E NEARDATA stairway dnstair, upstair; /* stairs up and down */
109 #define xdnstair (dnstair.sx)
110 #define ydnstair (dnstair.sy)
111 #define xupstair (upstair.sx)
112 #define yupstair (upstair.sy)
114 E NEARDATA stairway dnladder, upladder; /* ladders up and down */
115 #define xdnladder (dnladder.sx)
116 #define ydnladder (dnladder.sy)
117 #define xupladder (upladder.sx)
118 #define yupladder (upladder.sy)
120 E NEARDATA stairway sstairs;
122 E NEARDATA dest_area updest, dndest; /* level-change destination areas */
124 E NEARDATA coord inv_pos;
125 E NEARDATA dungeon dungeons[];
126 E NEARDATA s_level *sp_levchn;
127 #define dunlev_reached(x) (dungeons[(x)->dnum].dunlev_ureached)
130 E struct q_score quest_status;
132 E NEARDATA char pl_character[PL_CSIZ];
133 E NEARDATA char pl_race; /* character's race */
135 E NEARDATA char pl_fruit[PL_FSIZ];
136 E NEARDATA int current_fruit;
137 E NEARDATA struct fruit *ffruit;
139 E NEARDATA char tune[6];
141 #define MAXLINFO (MAXDUNGEON * MAXLEVEL)
142 E struct linfo level_info[MAXLINFO];
144 E NEARDATA struct sinfo {
145 int gameover; /* self explanatory? */
146 int stopprint; /* inhibit further end of game disclosure */
147 #if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
148 int done_hup; /* SIGHUP or moral equivalent received
149 * -- no more screen output */
151 int something_worth_saving; /* in case of panic */
152 int panicking; /* `panic' is in progress */
153 #if defined(VMS) || defined(WIN32)
154 int exiting; /* an exit handler is executing */
164 E const char quitchars[];
165 E const char vowels[];
166 E const char ynchars[];
167 E const char ynqchars[];
168 E const char ynaqchars[];
169 E const char ynNaqchars[];
170 E NEARDATA long yn_number;
172 E const char disclosure_options[];
174 E NEARDATA int smeq[];
175 E NEARDATA int doorindex;
176 E NEARDATA char *save_cm;
177 #define KILLED_BY_AN 0
179 #define NO_KILLER_PREFIX 2
180 E NEARDATA int killer_format;
181 E const char *killer;
182 E const char *delayed_killer;
186 E char killer_buf[BUFSZ];
187 E const char *configfile;
188 E NEARDATA char plname[PL_NSIZ];
189 E NEARDATA char dogname[];
190 E NEARDATA char catname[];
191 E NEARDATA char horsename[];
192 E char preferred_pet;
193 E const char *occtxt; /* defined when occupation != NULL */
194 E const char *nomovemsg;
198 E const char sdir[], ndir[];
199 E const schar xdir[], ydir[], zdir[];
201 E NEARDATA schar tbx, tby; /* set in mthrowu.c */
203 E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
205 E NEARDATA struct dig_info { /* apply.c, hack.c */
210 boolean down, chew, warned, quiet;
213 E NEARDATA long moves, monstermoves;
214 E NEARDATA long wailmsg;
216 E NEARDATA boolean in_mklev;
217 E NEARDATA boolean stoned;
218 E NEARDATA boolean unweapon;
219 E NEARDATA boolean mrg_to_wielded;
220 E NEARDATA struct obj *current_wand;
222 E NEARDATA boolean in_steed_dismounting;
224 E const int shield_static[];
227 E NEARDATA struct spell spl_book[]; /* sized in decl.c */
231 E const int zapcolors[];
234 E const char def_oc_syms[MAXOCLASSES]; /* default class symbols */
235 E uchar oc_syms[MAXOCLASSES]; /* current class symbols */
236 E const char def_monsyms[MAXMCLASSES]; /* default class symbols */
237 E uchar monsyms[MAXMCLASSES]; /* current class symbols */
240 E NEARDATA struct obj *invent,
241 *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
243 *uarmu, /* under-wear, so to speak */
245 *uskin, *uamul, *uleft, *uright, *ublindf,
246 *uwep, *uswapwep, *uquiver;
248 E NEARDATA struct obj *uchain; /* defined only when punished */
249 E NEARDATA struct obj *uball;
250 E NEARDATA struct obj *migrating_objs;
251 E NEARDATA struct obj *billobjs;
252 E NEARDATA struct obj zeroobj; /* init'd and defined in decl.c */
255 E NEARDATA struct you u;
258 #ifndef PM_H /* (pm.h has already been included via youprop.h) */
262 E NEARDATA struct monst youmonst; /* init'd and defined in decl.c */
263 E NEARDATA struct monst *mydogs, *migrating_mons;
265 E NEARDATA struct mvitals {
271 E NEARDATA struct c_color_names {
272 const char *const c_black, *const c_amber, *const c_golden,
273 *const c_light_blue,*const c_red, *const c_green,
274 *const c_silver, *const c_blue, *const c_purple,
277 #define NH_BLACK c_color_names.c_black
278 #define NH_AMBER c_color_names.c_amber
279 #define NH_GOLDEN c_color_names.c_golden
280 #define NH_LIGHT_BLUE c_color_names.c_light_blue
281 #define NH_RED c_color_names.c_red
282 #define NH_GREEN c_color_names.c_green
283 #define NH_SILVER c_color_names.c_silver
284 #define NH_BLUE c_color_names.c_blue
285 #define NH_PURPLE c_color_names.c_purple
286 #define NH_WHITE c_color_names.c_white
288 /* The names of the colors used for gems, etc. */
289 E const char *c_obj_colors[];
291 E struct c_common_strings {
292 const char *const c_nothing_happens, *const c_thats_enough_tries,
293 *const c_silly_thing_to, *const c_shudder_for_moment,
294 *const c_something, *const c_Something,
295 *const c_You_can_move_again,
296 *const c_Never_mind, *c_vision_clears,
297 *const c_the_your[2];
299 #define nothing_happens c_common_strings.c_nothing_happens
300 #define thats_enough_tries c_common_strings.c_thats_enough_tries
301 #define silly_thing_to c_common_strings.c_silly_thing_to
302 #define shudder_for_moment c_common_strings.c_shudder_for_moment
303 #define something c_common_strings.c_something
304 #define Something c_common_strings.c_Something
305 #define You_can_move_again c_common_strings.c_You_can_move_again
306 #define Never_mind c_common_strings.c_Never_mind
307 #define vision_clears c_common_strings.c_vision_clears
308 #define the_your c_common_strings.c_the_your
310 /* material strings */
311 E const char *materialnm[];
313 /* Monster name articles */
314 #define ARTICLE_NONE 0
315 #define ARTICLE_THE 1
317 #define ARTICLE_YOUR 3
319 /* Monster name suppress masks */
320 #define SUPPRESS_IT 0x01
321 #define SUPPRESS_INVISIBLE 0x02
322 #define SUPPRESS_HALLUCINATION 0x04
323 #define SUPPRESS_SADDLE 0x08
324 #define EXACT_NAME 0x0F
327 E NEARDATA boolean vision_full_recalc; /* TRUE if need vision recalc */
328 E NEARDATA char **viz_array; /* could see/in sight row pointers */
330 /* Window system stuff */
331 E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
332 E NEARDATA winid WIN_MAP, WIN_INVEN;
335 E struct tc_gbl_data { /* also declared in tcap.h */
336 char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */
337 int tc_LI, tc_CO; /* lines and columns */
339 #define AS tc_gbl_data.tc_AS
340 #define AE tc_gbl_data.tc_AE
341 #define LI tc_gbl_data.tc_LI
342 #define CO tc_gbl_data.tc_CO
345 /* xxxexplain[] is in drawing.c */
346 E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[];
348 /* Some systems want to use full pathnames for some subsets of file names,
349 * rather than assuming that they're all in the current directory. This
350 * provides all the subclasses that seem reasonable, and sets up for all
351 * prefixes being null. Port code can set those that it wants.
354 #define LEVELPREFIX 1
356 #define BONESPREFIX 3
357 #define DATAPREFIX 4 /* this one must match hardcoded value in dlb.c */
358 #define SCOREPREFIX 5
360 #define CONFIGPREFIX 7
361 #define TROUBLEPREFIX 8
362 #define PREFIX_COUNT 9
363 /* used in files.c; xxconf.h can override if needed */
364 # ifndef FQN_MAX_FILENAME
365 #define FQN_MAX_FILENAME 512
368 #if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
369 /* the bare-bones stuff is unconditional above to simplify coding; for
370 * ports that actually use prefixes, add some more localized things
372 #define PREFIXES_IN_USE
375 E char *fqn_prefix[PREFIX_COUNT];
376 #ifdef PREFIXES_IN_USE
377 E char *fqn_prefix_names[PREFIX_COUNT];
380 #ifdef AUTOPICKUP_EXCEPTIONS
381 struct autopickup_exception {
384 struct autopickup_exception *next;
386 #endif /* AUTOPICKUP_EXCEPTIONS */