1 /* NetHack 3.6 decl.h $NHDT-Date: 1573869061 2019/11/16 01:51:01 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.165 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Michael Allison, 2007. */
4 /* NetHack may be freely redistributed. See license for details. */
11 E int NDECL((*occupation));
12 E int NDECL((*afternmv));
16 #if defined(UNIX) || defined(VMS)
21 #endif /* DEF_PAGER */
28 /* max size of a windowtype option */
30 E char chosen_windowtype[WINTYPELEN];
32 E NEARDATA int bases[MAXOCLASSES];
35 E const char *multi_reason;
37 E NEARDATA int nsubroom;
38 E NEARDATA int occtime;
40 #define WARNCOUNT 6 /* number of different warning levels */
41 E nhsym warnsyms[WARNCOUNT];
42 E NEARDATA int warn_obj_cnt; /* count of monsters meeting criteria */
44 E int x_maze_max, y_maze_max;
47 E NEARDATA int in_doagain;
49 E struct dgn_topology { /* special dungeon levels for speed */
50 d_level d_oracle_level;
51 d_level d_bigroom_level; /* unused */
52 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;
75 d_level d_mineend_level;
76 d_level d_sokoend_level;
78 /* macros for accessing the dungeon levels by their old names */
79 /* clang-format off */
80 #define oracle_level (dungeon_topology.d_oracle_level)
81 #define bigroom_level (dungeon_topology.d_bigroom_level)
82 #define rogue_level (dungeon_topology.d_rogue_level)
83 #define medusa_level (dungeon_topology.d_medusa_level)
84 #define stronghold_level (dungeon_topology.d_stronghold_level)
85 #define valley_level (dungeon_topology.d_valley_level)
86 #define wiz1_level (dungeon_topology.d_wiz1_level)
87 #define wiz2_level (dungeon_topology.d_wiz2_level)
88 #define wiz3_level (dungeon_topology.d_wiz3_level)
89 #define juiblex_level (dungeon_topology.d_juiblex_level)
90 #define orcus_level (dungeon_topology.d_orcus_level)
91 #define baalzebub_level (dungeon_topology.d_baalzebub_level)
92 #define asmodeus_level (dungeon_topology.d_asmodeus_level)
93 #define portal_level (dungeon_topology.d_portal_level)
94 #define sanctum_level (dungeon_topology.d_sanctum_level)
95 #define earth_level (dungeon_topology.d_earth_level)
96 #define water_level (dungeon_topology.d_water_level)
97 #define fire_level (dungeon_topology.d_fire_level)
98 #define air_level (dungeon_topology.d_air_level)
99 #define astral_level (dungeon_topology.d_astral_level)
100 #define tower_dnum (dungeon_topology.d_tower_dnum)
101 #define sokoban_dnum (dungeon_topology.d_sokoban_dnum)
102 #define mines_dnum (dungeon_topology.d_mines_dnum)
103 #define quest_dnum (dungeon_topology.d_quest_dnum)
104 #define qstart_level (dungeon_topology.d_qstart_level)
105 #define qlocate_level (dungeon_topology.d_qlocate_level)
106 #define nemesis_level (dungeon_topology.d_nemesis_level)
107 #define knox_level (dungeon_topology.d_knox_level)
108 #define mineend_level (dungeon_topology.d_mineend_level)
109 #define sokoend_level (dungeon_topology.d_sokoend_level)
110 /* clang-format on */
112 E NEARDATA stairway dnstair, upstair; /* stairs up and down */
113 #define xdnstair (dnstair.sx)
114 #define ydnstair (dnstair.sy)
115 #define xupstair (upstair.sx)
116 #define yupstair (upstair.sy)
118 E NEARDATA stairway dnladder, upladder; /* ladders up and down */
119 #define xdnladder (dnladder.sx)
120 #define ydnladder (dnladder.sy)
121 #define xupladder (upladder.sx)
122 #define yupladder (upladder.sy)
124 E NEARDATA stairway sstairs;
126 E NEARDATA dest_area updest, dndest; /* level-change destination areas */
128 E NEARDATA coord inv_pos;
129 E NEARDATA dungeon dungeons[];
130 E NEARDATA s_level *sp_levchn;
131 #define dunlev_reached(x) (dungeons[(x)->dnum].dunlev_ureached)
134 E struct q_score quest_status;
136 E NEARDATA char pl_character[PL_CSIZ];
137 E NEARDATA char pl_race; /* character's race */
139 E NEARDATA char pl_fruit[PL_FSIZ];
140 E NEARDATA struct fruit *ffruit;
142 E NEARDATA char tune[6];
144 #define MAXLINFO (MAXDUNGEON * MAXLEVEL)
145 E struct linfo level_info[MAXLINFO];
147 E NEARDATA struct sinfo {
148 int gameover; /* self explanatory? */
149 int stopprint; /* inhibit further end of game disclosure */
150 #ifdef HANGUPHANDLING
151 volatile int done_hup; /* SIGHUP or moral equivalent received
152 * -- no more screen output */
153 int preserve_locks; /* don't remove level files prior to exit */
155 int something_worth_saving; /* in case of panic */
156 int panicking; /* `panic' is in progress */
157 int exiting; /* an exit handler is executing */
169 E const char quitchars[];
170 E const char vowels[];
171 E const char ynchars[];
172 E const char ynqchars[];
173 E const char ynaqchars[];
174 E const char ynNaqchars[];
175 E NEARDATA long yn_number;
177 E const char disclosure_options[];
179 E NEARDATA int smeq[];
180 E NEARDATA int doorindex;
181 E NEARDATA char *save_cm;
183 E NEARDATA struct kinfo {
184 struct kinfo *next; /* chain of delayed killers */
185 int id; /* uprop keys to ID a delayed killer */
186 int format; /* one of the killer formats */
187 #define KILLED_BY_AN 0
189 #define NO_KILLER_PREFIX 2
191 #define KILLED_SUFFIX 3
193 char name[BUFSZ]; /* actual killer name */
197 E NEARDATA char plname[PL_NSIZ];
198 E NEARDATA char dogname[];
199 E NEARDATA char catname[];
200 E NEARDATA char horsename[];
201 E char preferred_pet;
202 E const char *occtxt; /* defined when occupation != NULL */
203 E const char *nomovemsg;
206 E const schar xdir[], ydir[], zdir[];
208 E NEARDATA schar tbx, tby; /* set in mthrowu.c */
210 E NEARDATA struct multishot {
216 E NEARDATA long moves, monstermoves;
217 E NEARDATA long wailmsg;
219 E NEARDATA boolean in_mklev;
220 E NEARDATA boolean stoned;
221 E NEARDATA boolean unweapon;
222 E NEARDATA boolean mrg_to_wielded;
223 E NEARDATA boolean defer_see_monsters;
225 E NEARDATA boolean in_steed_dismounting;
226 E NEARDATA boolean has_strong_rngseed;
228 E const int shield_static[];
231 E NEARDATA struct spell spl_book[]; /* sized in decl.c */
235 E const int zapcolors[];
238 E const struct class_sym def_oc_syms[MAXOCLASSES]; /* default class symbols */
239 E uchar oc_syms[MAXOCLASSES]; /* current class symbols */
240 E const struct class_sym def_monsyms[MAXMCLASSES]; /* default class symbols */
241 E uchar monsyms[MAXMCLASSES]; /* current class symbols */
244 E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
245 *uarmu, /* under-wear, so to speak */
246 *uskin, *uamul, *uleft, *uright, *ublindf, *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 *current_wand, *thrownobj, *kickedobj;
254 E NEARDATA const struct obj zeroobj; /* for init; also, &zeroobj is used
255 * as special value */
257 E NEARDATA const anything zeroany; /* init'd and defined in decl.c */
260 E NEARDATA struct you u;
261 E NEARDATA time_t ubirthday;
262 E NEARDATA struct u_realtime urealtime;
265 #ifndef PM_H /* (pm.h has already been included via youprop.h) */
269 E NEARDATA const struct monst zeromonst; /* for init of new or temp monsters */
270 E NEARDATA struct monst youmonst; /* monster details when hero is poly'd */
271 E NEARDATA struct monst *mydogs, *migrating_mons;
273 E NEARDATA struct mvitals {
279 E NEARDATA long domove_attempting;
280 E NEARDATA long domove_succeeded;
281 #define DOMOVE_WALK 0x00000001
282 #define DOMOVE_RUSH 0x00000002
284 E NEARDATA struct c_color_names {
285 const char *const c_black, *const c_amber, *const c_golden,
286 *const c_light_blue, *const c_red, *const c_green, *const c_silver,
287 *const c_blue, *const c_purple, *const c_white, *const c_orange;
289 #define NH_BLACK c_color_names.c_black
290 #define NH_AMBER c_color_names.c_amber
291 #define NH_GOLDEN c_color_names.c_golden
292 #define NH_LIGHT_BLUE c_color_names.c_light_blue
293 #define NH_RED c_color_names.c_red
294 #define NH_GREEN c_color_names.c_green
295 #define NH_SILVER c_color_names.c_silver
296 #define NH_BLUE c_color_names.c_blue
297 #define NH_PURPLE c_color_names.c_purple
298 #define NH_WHITE c_color_names.c_white
299 #define NH_ORANGE c_color_names.c_orange
301 /* The names of the colors used for gems, etc. */
302 E const char *c_obj_colors[];
304 E struct c_common_strings {
305 const char *const c_nothing_happens, *const c_thats_enough_tries,
306 *const c_silly_thing_to, *const c_shudder_for_moment,
307 *const c_something, *const c_Something, *const c_You_can_move_again,
308 *const c_Never_mind, *c_vision_clears, *const c_the_your[2],
309 *const c_fakename[2];
311 #define nothing_happens c_common_strings.c_nothing_happens
312 #define thats_enough_tries c_common_strings.c_thats_enough_tries
313 #define silly_thing_to c_common_strings.c_silly_thing_to
314 #define shudder_for_moment c_common_strings.c_shudder_for_moment
315 #define something c_common_strings.c_something
316 #define Something c_common_strings.c_Something
317 #define You_can_move_again c_common_strings.c_You_can_move_again
318 #define Never_mind c_common_strings.c_Never_mind
319 #define vision_clears c_common_strings.c_vision_clears
320 #define the_your c_common_strings.c_the_your
321 /* fakename[] used occasionally so vtense() won't be fooled by an assigned
322 name ending in 's' */
323 #define fakename c_common_strings.c_fakename
325 /* material strings */
326 E const char *materialnm[];
328 /* Monster name articles */
329 #define ARTICLE_NONE 0
330 #define ARTICLE_THE 1
332 #define ARTICLE_YOUR 3
334 /* Monster name suppress masks */
335 #define SUPPRESS_IT 0x01
336 #define SUPPRESS_INVISIBLE 0x02
337 #define SUPPRESS_HALLUCINATION 0x04
338 #define SUPPRESS_SADDLE 0x08
339 #define EXACT_NAME 0x0F
340 #define SUPPRESS_NAME 0x10
343 E NEARDATA boolean vision_full_recalc; /* TRUE if need vision recalc */
344 E NEARDATA char **viz_array; /* could see/in sight row pointers */
346 /* Window system stuff */
347 E NEARDATA winid WIN_MESSAGE;
348 E NEARDATA winid WIN_STATUS;
349 E NEARDATA winid WIN_MAP, WIN_INVEN;
351 /* pline (et al) for a single string argument (suppress compiler warning) */
352 #define pline1(cstr) pline("%s", cstr)
353 #define Your1(cstr) Your("%s", cstr)
354 #define You1(cstr) You("%s", cstr)
355 #define verbalize1(cstr) verbalize("%s", cstr)
356 #define You_hear1(cstr) You_hear("%s", cstr)
357 #define Sprintf1(buf, cstr) Sprintf(buf, "%s", cstr)
358 #define panic1(cstr) panic("%s", cstr)
362 E struct tc_gbl_data { /* also declared in tcap.h */
363 char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */
364 int tc_LI, tc_CO; /* lines and columns */
366 #define AS tc_gbl_data.tc_AS
367 #define AE tc_gbl_data.tc_AE
368 #define LI tc_gbl_data.tc_LI
369 #define CO tc_gbl_data.tc_CO
372 /* xxxexplain[] is in drawing.c */
373 E const char *const monexplain[], invisexplain[], *const oclass_names[];
375 /* Some systems want to use full pathnames for some subsets of file names,
376 * rather than assuming that they're all in the current directory. This
377 * provides all the subclasses that seem reasonable, and sets up for all
378 * prefixes being null. Port code can set those that it wants.
381 #define LEVELPREFIX 1
383 #define BONESPREFIX 3
384 #define DATAPREFIX 4 /* this one must match hardcoded value in dlb.c */
385 #define SCOREPREFIX 5
387 #define SYSCONFPREFIX 7
388 #define CONFIGPREFIX 8
389 #define TROUBLEPREFIX 9
390 #define PREFIX_COUNT 10
391 /* used in files.c; xxconf.h can override if needed */
392 #ifndef FQN_MAX_FILENAME
393 #define FQN_MAX_FILENAME 512
396 #if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
397 /* the bare-bones stuff is unconditional above to simplify coding; for
398 * ports that actually use prefixes, add some more localized things
400 #define PREFIXES_IN_USE
403 E char *fqn_prefix[PREFIX_COUNT];
405 E boolean fqn_prefix_locked[PREFIX_COUNT];
407 #ifdef PREFIXES_IN_USE
408 E const char *fqn_prefix_names[PREFIX_COUNT];
411 E NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo;
414 xchar spovartyp; /* one of SPOVAR_foo */
421 struct autopickup_exception {
422 struct nhregex *regex;
425 struct autopickup_exception *next;
427 E struct autopickup_exception *apelist;
429 struct plinemsg_type {
430 xchar msgtype; /* one of MSGTYP_foo */
431 struct nhregex *regex;
433 struct plinemsg_type *next;
436 #define MSGTYP_NORMAL 0
437 #define MSGTYP_NOREP 1
438 #define MSGTYP_NOSHOW 2
439 #define MSGTYP_STOP 3
440 /* bitmask for callers of hide_unhide_msgtypes() */
441 #define MSGTYP_MASK_REP_SHOW ((1 << MSGTYP_NOREP) | (1 << MSGTYP_NOSHOW))
443 E struct plinemsg_type *plinemsg_types;
445 enum bcargs {override_restriction = -1};
456 enum earlyarg {ARG_DEBUG, ARG_VERSION, ARG_SHOWPATHS
473 const char *particle;
477 /* hcolor()
\82Í
\8c`
\97e
\8e\8c\82ð
\95Ô
\82·
\82Ì
\82Å
\95\9b\8e\8c\82É
\95Ï
\8a·
\82·
\82é */
478 #define hcolor_adv(x) jconj_adj(hcolor((x)))
479 /*
\8cÅ
\92è
\95¶
\8e\9a\97ñ
\97pstrncmp */
480 #define STRNCMP2(x, y) strncmp(x, y, strlen(y))