1 /* SCCS Id: @(#)decl.c 3.2 2001/12/10 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
8 int (*occupation
)(void);
11 const char *hname
= 0; /* name of the game (argv[0] of main) */
12 int hackpid
= 0; /* current process id */
13 #if defined(UNIX) || defined(VMS)
14 int locknum
= 0; /* max num of simultaneous users */
17 char *catmore
= 0; /* default pager */
20 NEARDATA
int bases
[MAXOCLASSES
] = DUMMY
;
22 NEARDATA
int multi
= 0;
23 char multi_txt
[BUFSZ
] = DUMMY
;
24 NEARDATA boolean multi_one
= FALSE
; /* used by dofire() and throw_the_obj() */
26 NEARDATA
int warnlevel
= 0; /* used by movemon and dochugw */
28 NEARDATA
int nroom
= 0;
29 NEARDATA
int nsubroom
= 0;
30 NEARDATA
int occtime
= 0;
32 int x_maze_max
, y_maze_max
; /* initialized in main, used in mkmaze.c */
33 int otg_temp
; /* used by object_to_glyph() [otg] */
35 NEARDATA
int in_doagain
= 0;
38 * The following structure will be initialized at startup time with
39 * the level numbers of some "important" things in the game.
41 struct dgn_topology dungeon_topology
= {DUMMY
};
44 struct q_score quest_status
= DUMMY
;
46 NEARDATA
int smeq
[MAXNROFROOMS
+1] = DUMMY
;
47 NEARDATA
int doorindex
= 0;
49 NEARDATA
char *save_cm
= 0;
50 NEARDATA
int killer_format
= 0;
51 const char *killer
= 0;
52 const char *delayed_killer
= 0;
54 NEARDATA
long done_money
= 0;
56 char killer_buf
[BUFSZ
] = DUMMY
;
57 const char *nomovemsg
= 0;
58 const char nul
[40] = DUMMY
; /* contains zeros */
59 NEARDATA
char plname
[PL_NSIZ
] = DUMMY
; /* player name */
60 NEARDATA
char plalias
[PL_NSIZ
] = DUMMY
; /* player alias */
61 NEARDATA
char pl_character
[PL_CSIZ
] = DUMMY
;
62 NEARDATA
char pl_race
= '\0';
64 NEARDATA
char pl_fruit
[PL_FSIZ
] = DUMMY
;
65 NEARDATA
int current_fruit
= 0;
66 NEARDATA
struct fruit
*ffruit
= (struct fruit
*)0;
68 NEARDATA
char tune
[6] = DUMMY
;
70 const char *occtxt
= DUMMY
;
71 const char quitchars
[] = " \r\n\033";
72 const char vowels
[] = "aeiouAEIOU";
73 const char ynchars
[] = "yn";
74 const char ynqchars
[] = "ynq";
75 const char ynaqchars
[] = "ynaq";
76 const char ynNaqchars
[] = "yn#aq";
77 NEARDATA
long yn_number
= 0L;
79 const char disclosure_options
[] = "iavgc";
81 #if defined(MICRO) || defined(WIN32)
82 char hackdir
[PATHLEN
]; /* where rumors, help, record are */
84 char levels
[PATHLEN
]; /* where levels are */
86 #endif /* MICRO || WIN32 */
90 char permbones
[PATHLEN
]; /* where permanent copy of bones go */
91 int ramdisk
= FALSE
; /* whether to copy bones to levels or not */
92 int saveprompt
= TRUE
;
93 const char *alllevels
= "levels.*";
94 const char *allbones
= "bones*.*";
97 struct linfo level_info
[MAXLINFO
];
99 NEARDATA
struct sinfo program_state
;
101 /* 'rogue'-like direction commands (cmd.c) */
102 const char qykbd_dir
[] = "hykulnjb><"; /* qwerty layout */
103 const char qzkbd_dir
[] = "hzkulnjb><"; /* qwertz layout */
104 char const *sdir
=qykbd_dir
;
105 const char ndir
[] = "47896321><"; /* number pad mode */
106 const schar xdir
[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 };
107 const schar ydir
[10] = { 0,-1,-1,-1, 0, 1, 1, 1, 0, 0 };
108 const schar zdir
[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1,-1 };
109 char misc_cmds
[] = {'g', 'G', 'F', 'm', 'M', '\033', '\001' };
111 NEARDATA schar tbx
= 0, tby
= 0; /* mthrowu: target */
113 /* for xname handling of multiple shot missile volleys:
114 number of shots, index of current one, validity check, shoot vs throw */
115 NEARDATA
struct multishot m_shot
= { 0, 0, STRANGE_OBJECT
, FALSE
};
117 NEARDATA
struct dig_info digging
;
119 NEARDATA dungeon dungeons
[MAXDUNGEON
]; /* ini'ed by init_dungeon() */
120 NEARDATA s_level
*sp_levchn
;
121 NEARDATA stairway upstair
= { 0, 0 }, dnstair
= { 0, 0 };
122 NEARDATA stairway upladder
= { 0, 0 }, dnladder
= { 0, 0 };
123 NEARDATA stairway sstairs
= { 0, 0 };
124 NEARDATA dest_area updest
= { 0, 0, 0, 0, 0, 0, 0, 0 };
125 NEARDATA dest_area dndest
= { 0, 0, 0, 0, 0, 0, 0, 0 };
126 NEARDATA coord inv_pos
= { 0, 0 };
128 NEARDATA boolean defer_see_monsters
= FALSE
;
129 NEARDATA boolean in_mklev
= FALSE
;
130 NEARDATA boolean stoned
= FALSE
; /* done to monsters hit by 'c' */
131 NEARDATA boolean unweapon
= FALSE
;
132 NEARDATA boolean mrg_to_wielded
= FALSE
;
133 /* weapon picked is merged with wielded one */
134 NEARDATA
struct obj
*current_wand
= 0; /* wand currently zapped/applied */
136 NEARDATA boolean in_steed_dismounting
= FALSE
;
138 NEARDATA coord bhitpos
= DUMMY
;
139 NEARDATA
struct door doors
[DOORMAX
] = {DUMMY
};
141 NEARDATA
struct mkroom rooms
[(MAXNROFROOMS
+1)*2] = {DUMMY
};
142 NEARDATA
struct mkroom
* subrooms
= &rooms
[MAXNROFROOMS
+1];
143 struct mkroom
*upstairs_room
, *dnstairs_room
, *sstairs_room
;
145 dlevel_t level
; /* level map */
146 struct trap
*ftrap
= (struct trap
*)0;
147 NEARDATA
struct monst youmonst
= DUMMY
;
148 NEARDATA
struct permonst upermonst
= DUMMY
;
149 NEARDATA
struct flag flags
= DUMMY
;
150 NEARDATA
struct instance_flags iflags
= DUMMY
;
151 NEARDATA
struct you u
= DUMMY
;
153 NEARDATA
struct obj
*invent
= (struct obj
*)0,
154 *uwep
= (struct obj
*)0, *uarm
= (struct obj
*)0,
155 *uswapwep
= (struct obj
*)0,
156 *uquiver
= (struct obj
*)0, /* quiver */
157 *uarmu
= (struct obj
*)0, /* under-wear, so to speak */
158 *uskin
= (struct obj
*)0, /* dragon armor, if a dragon */
159 *uarmc
= (struct obj
*)0, *uarmh
= (struct obj
*)0,
160 *uarms
= (struct obj
*)0, *uarmg
= (struct obj
*)0,
161 *uarmf
= (struct obj
*)0, *uamul
= (struct obj
*)0, *uimplant
= (struct obj
*)0,
162 *uright
= (struct obj
*)0,
163 *uleft
= (struct obj
*)0,
164 *ublindf
= (struct obj
*)0,
165 *usaddle
= (struct obj
*)0,
166 *uchain
= (struct obj
*)0,
167 *uball
= (struct obj
*)0;
171 * This must be the same order as used for buzz() in zap.c.
173 const int zapcolors
[NUM_ZAP
] = {
174 HI_ZAP
, /* 0 - missile */
175 CLR_ORANGE
, /* 1 - fire */
176 CLR_WHITE
, /* 2 - frost */
177 HI_ZAP
, /* 3 - sleep */
178 CLR_BLACK
, /* 4 - death */
179 CLR_WHITE
, /* 5 - lightning */
180 CLR_YELLOW
, /* 6 - poison gas */
181 CLR_GREEN
, /* 7 - acid */
182 CLR_BRIGHT_CYAN
, /* 8 - solar beam */
183 CLR_MAGENTA
, /* 9 - psybeam */
185 #endif /* text color */
187 /* const int shield_static[SHIELD_COUNT] = {
188 S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, 7 per row
189 S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
190 S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
192 const int shield_static
[SHIELD_COUNT
] = {
193 S_ss1
, S_ss2
, S_ss3
, S_ss2
, S_ss1
, S_ss2
, S_ss4
,
196 NEARDATA
struct spell spl_book
[MAXSPELL
+ 1] = {DUMMY
};
198 NEARDATA
struct tech tech_list
[MAXTECH
+ 1] = {DUMMY
};
200 NEARDATA
long moves
= 1L, monstermoves
= 1L;
201 /* These diverge when player is Fast or Very_fast */
202 NEARDATA
long wailmsg
= 0L;
204 /* objects that are moving to another dungeon level */
205 NEARDATA
struct obj
*migrating_objs
= (struct obj
*)0;
206 /* objects not yet paid for */
207 NEARDATA
struct obj
*billobjs
= (struct obj
*)0;
209 /* used to zero all elements of a struct obj */
210 NEARDATA
struct obj zeroobj
= DUMMY
;
212 /* used as an address returned by getobj() */
213 NEARDATA
struct obj thisplace
= DUMMY
;
215 /* originally from dog.c */
216 NEARDATA
char dogname
[PL_PSIZ
] = DUMMY
;
217 NEARDATA
char dragonname
[PL_PSIZ
] = DUMMY
;
218 NEARDATA
char monkeyname
[PL_PSIZ
] = DUMMY
;
219 NEARDATA
char parrotname
[PL_PSIZ
] = DUMMY
;
220 NEARDATA
char girlname
[PL_PSIZ
] = DUMMY
;
221 NEARDATA
char boyname
[PL_PSIZ
] = DUMMY
;
222 NEARDATA
char ravenname
[PL_PSIZ
] = DUMMY
;
223 NEARDATA
char catname
[PL_PSIZ
] = DUMMY
;
224 NEARDATA
char ghoulname
[PL_PSIZ
] = DUMMY
;
225 NEARDATA
char horsename
[PL_PSIZ
] = DUMMY
;
226 NEARDATA
char ratname
[PL_PSIZ
] = DUMMY
;
227 NEARDATA
char wolfname
[PL_PSIZ
] = DUMMY
;
228 /*NEARDATA char lichenname[PL_PSIZ] = DUMMY;
229 NEARDATA char coinsname[PL_PSIZ] = DUMMY;
230 NEARDATA char rothename[PL_PSIZ] = DUMMY;*/
232 NEARDATA
char batname
[PL_PSIZ
] = DUMMY
;
233 NEARDATA
char snakename
[PL_PSIZ
] = DUMMY
;
234 NEARDATA
char ratname
[PL_PSIZ
] = DUMMY
;
235 NEARDATA
char badgername
[PL_PSIZ
] = DUMMY
;
236 NEARDATA
char reddragonname
[PL_PSIZ
] = DUMMY
;
237 NEARDATA
char whitedragonname
[PL_PSIZ
] = DUMMY
;
239 char preferred_pet
; /* '\0', 'c', 'd', 'n' (none) */
240 /* monsters that went down/up together with @ */
241 NEARDATA
struct monst
*mydogs
= (struct monst
*)0;
242 /* monsters that are moving to another dungeon level */
243 NEARDATA
struct monst
*migrating_mons
= (struct monst
*)0;
245 NEARDATA
struct mvitals mvitals
[NUMMONS
];
247 /* originally from end.c */
250 char dump_fn
[] = DUMP_FN
;
252 char dump_fn
[PL_PSIZ
] = DUMMY
;
254 #endif /* DUMP_LOG */
256 NEARDATA
struct c_color_names c_color_names
= {
257 "black", "amber", "golden",
258 "light blue", "red", "green",
259 "silver", "blue", "purple",
263 const char *c_obj_colors
[] = {
264 "black", /* CLR_BLACK */
266 "green", /* CLR_GREEN */
267 "brown", /* CLR_BROWN */
268 "blue", /* CLR_BLUE */
269 "magenta", /* CLR_MAGENTA */
270 "cyan", /* CLR_CYAN */
271 "gray", /* CLR_GRAY */
272 "transparent", /* no_color */
273 "orange", /* CLR_ORANGE */
274 "bright green", /* CLR_BRIGHT_GREEN */
275 "yellow", /* CLR_YELLOW */
276 "bright blue", /* CLR_BRIGHT_BLUE */
277 "bright magenta", /* CLR_BRIGHT_MAGENTA */
278 "bright cyan", /* CLR_BRIGHT_CYAN */
279 "white", /* CLR_WHITE */
283 struct menucoloring
*menu_colorings
= 0;
286 struct c_common_strings c_common_strings
= {
287 "Nothing happens.", "That's enough tries!",
288 "That is a silly thing to %s.", "shudder for a moment.",
289 "something", "Something", "You can move again.", "Never mind.",
290 "vision quickly clears.", {"the", "your"}
293 /* NOTE: the order of these words exactly corresponds to the
294 order of oc_material values #define'd in objclass.h. */
295 /* Amy grepping target: "materialeffect" */
296 const char *materialnm
[] = {
297 "mysterious", "liquid", "wax", "organic", "flesh",
298 "paper", "cloth", "leather", "wooden", "bone", "dragonhide",
299 "iron", "metal", "copper", "silver", "gold", "platinum", "mithril",
300 "plastic", "glass", "gemstone", "stone",
301 "vivardoradorium", "elasthan", "tar", "silk",
302 "arcanium", "secree", "pourpoor", "compost",
303 "eternium", "ether", "brick", "sand", "shadowstuff",
304 "obsidian", "lead", "chrome", "ceramic",
305 "celestium", "conundrum", "pwn-bubble", "meteosteel",
306 "antidotium", "nanomachine", "foam", "scrap", "alloy",
307 "tinsel", "amber", "film", "alkaline", "mengetium",
308 "chitin", "shell", "green steel", "mercurial", "firmament",
309 "bamboo", "cobalt", "coral", "sinnum", "bronze",
310 "alumen", "mesh", "steel", "titanium", "adamantium",
311 "lacquer", "alimathium",
315 NEARDATA boolean vision_full_recalc
= 0;
316 NEARDATA
char **viz_array
= 0;/* used in cansee() and couldsee() macros */
318 /* Global windowing data, defined here for multi-window-system support */
319 NEARDATA winid WIN_MESSAGE
= WIN_ERR
, WIN_STATUS
= WIN_ERR
;
320 NEARDATA winid WIN_MAP
= WIN_ERR
, WIN_INVEN
= WIN_ERR
;
321 char toplines
[TBUFSZ
];
322 /* Windowing stuff that's really tty oriented, but present for all ports */
323 struct tc_gbl_data tc_gbl_data
= { 0,0, 0,0 }; /* AS,AE, LI,CO */
325 struct authentication authentication
= { "", "" };
327 struct tileset tilesets
[MAXNOTILESETS
];
329 struct tileset def_tilesets
[] = {
330 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GTK_GRAPHICS) || \
331 defined(GNOME_GRAPHICS) || defined(GL_GRAPHICS) || defined(SDL_GRAPHICS)
332 { "Small tiles", "x11tiles", 0 },
333 { "Big tiles", "x11bigtiles", TILESET_TRANSPARENT
},
335 #if defined(GTK_GRAPHICS)
336 { "Big 3D tiles", "x11big3dtiles", TILESET_TRANSPARENT
| TILESET_PSEUDO3D
},
338 #if defined(GEM_GRAPHICS)
339 { "Monochrome tiles", "nh2.img", 0 },
340 { "Colour tiles", "nh16.img", 0 },
343 { "Planer style tiles", "slashem1.tib", 0 },
345 #if defined(ALLEG_FX)
346 { "Small tiles", "slam16.bmp", 0 },
347 { "Big tiles", "slam32.bmp", TILESET_TRANSPARENT
},
348 { "Big 3D tiles", "slam3D.bmp", TILESET_TRANSPARENT
| TILESET_PSEUDO3D
},
353 char tileset
[PL_PSIZ
] = DUMMY
;
355 char *fqn_prefix
[PREFIX_COUNT
] = { (char *)0, (char *)0, (char *)0, (char *)0,
356 (char *)0, (char *)0, (char *)0, (char *)0, (char *)0 };
358 #ifdef PREFIXES_IN_USE
359 char *fqn_prefix_names
[PREFIX_COUNT
] = { "hackdir", "leveldir", "savedir",
360 "bonesdir", "datadir", "scoredir",
361 "lockdir", "configdir", "troubledir" };
364 #ifdef RECORD_ACHIEVE
365 struct u_achieve achieve
= DUMMY
;
366 struct u_achieveX achieveX
= DUMMY
;
369 #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL)
370 struct realtime_data realtime_data
= { 0, 0, 0 };
373 struct _plinemsg
*pline_msg
= NULL
;
375 /* FIXME: The curses windowport requires this stupid hack, in the
376 case where a game is in progress and the user is asked if he
377 wants to destroy old game.
378 Without this, curses tries to show the yn() question with pline()
379 ...but the message window isn't up yet.
381 boolean curses_stupid_hack
= 1;
383 /* dummy routine used to force linkage */