OSDN Git Service

空腹充足の巻物と狂戦士の空腹充足レイシャル廃止。
[hengband/hengband.git] / src / variable.c
1 /* File: variable.c */
2
3 /* Purpose: Angband variables */
4
5 /*
6  * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
7  *
8  * This software may be copied and distributed for educational, research, and
9  * not for profit purposes provided that this copyright and statement are
10  * included in all such copies.
11  */
12
13 #include "angband.h"
14
15
16 /*
17  * Hack -- Link a copyright message into the executable
18  */
19 cptr copyright[5] =
20 {
21         "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke",
22         "",
23         "This software may be copied and distributed for educational, research,",
24         "and not for profit purposes provided that this copyright and statement",
25         "are included in all such copies."
26 };
27
28
29 int max_macrotrigger = 0;
30 char *macro_template = NULL;
31 char *macro_modifier_chr;
32 char *macro_modifier_name[MAX_MACRO_MOD];
33 char *macro_trigger_name[MAX_MACRO_TRIG];
34 char *macro_trigger_keycode[2][MAX_MACRO_TRIG];
35
36 /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ë¾å¾ºÎ̤òɽ¼¨¤¹¤ë¤Î¤Ë»È¤¦ */
37 int level_up = 0;
38
39 /* 
40  *  List for auto-picker/destroyer entries
41  */
42 int max_autopick = 0;
43 autopick_type autopick_list[MAX_AUTOPICK];
44
45 /*
46  * Savefile version
47  */
48 byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
49 byte h_ver_minor;
50 byte h_ver_patch;
51 byte h_ver_extra;
52
53 byte sf_extra;          /* Savefile's encoding key */
54
55 byte z_major;           /* Savefile version for Hengband */
56 byte z_minor;
57 byte z_patch;
58
59 /*
60  * Savefile information
61  */
62 u32b sf_system;                 /* Operating system info */
63 u32b sf_when;                   /* Time when savefile created */
64 u16b sf_lives;                  /* Number of past "lives" with this file */
65 u16b sf_saves;                  /* Number of "saves" during this life */
66
67 /*
68  * Run-time arguments
69  */
70 bool arg_fiddle;                        /* Command arg -- Request fiddle mode */
71 bool arg_wizard;                        /* Command arg -- Request wizard mode */
72 bool arg_sound;                         /* Command arg -- Request special sounds */
73 byte arg_graphics;                      /* Command arg -- Request graphics mode */
74 bool arg_monochrome;            /* Command arg -- Request monochrome mode */
75 bool arg_force_original;        /* Command arg -- Request original keyset */
76 bool arg_force_roguelike;       /* Command arg -- Request roguelike keyset */
77 bool arg_bigtile = FALSE;       /* Command arg -- Request big tile mode */
78
79 /*
80  * Various things
81  */
82 bool character_generated;       /* The character exists */
83 bool character_dungeon;         /* The character has a dungeon */
84 bool character_loaded;          /* The character was loaded from a savefile */
85 bool character_saved;           /* The character was just saved to a savefile */
86
87 bool character_icky;            /* The game is in an icky full screen mode */
88 bool character_xtra;            /* The game is in an icky startup mode */
89
90 u32b seed_flavor;               /* Hack -- consistent object colors */
91 u32b seed_town;                 /* Hack -- consistent town layout */
92
93 s16b command_cmd;               /* Current "Angband Command" */
94
95 s16b command_arg;               /* Gives argument of current command */
96 s16b command_rep;               /* Gives repetition of current command */
97 s16b command_dir;               /* Gives direction of current command */
98
99 s16b command_see;               /* See "object1.c" */
100 s16b command_wrk;               /* See "object1.c" */
101
102 s16b command_gap = 999;         /* See "object1.c" */
103
104 s16b command_new;               /* Command chaining from inven/equip view */
105
106 s16b energy_use;                /* Energy use this turn */
107
108 byte create_up_stair;   /* Auto-create "up stairs" */
109 byte create_down_stair; /* Auto-create "down stairs" */
110
111 bool msg_flag;                  /* Used in msg_print() for "buffering" */
112
113 s16b running;                   /* Current counter for running, if any */
114 s16b resting;                   /* Current counter for resting, if any */
115
116 s16b cur_hgt;                   /* Current dungeon height */
117 s16b cur_wid;                   /* Current dungeon width */
118 s16b dun_level;                 /* Current dungeon level */
119 s16b num_repro;                 /* Current reproducer count */
120 s16b object_level;              /* Current object creation level */
121 s16b monster_level;             /* Current monster creation level */
122 s16b base_level;        /* Base dungeon level */
123
124 s32b turn;                              /* Current game turn */
125 s32b dungeon_turn;                      /* Game turn in dungeon */
126 s32b old_turn;                  /* Turn when level began (feelings) */
127 s32b old_battle;
128
129 bool use_sound;                 /* The "sound" mode is enabled */
130 bool use_graphics;              /* The "graphics" mode is enabled */
131 bool use_bigtile = FALSE;
132
133 s16b signal_count;              /* Hack -- Count interupts */
134
135 bool inkey_base;                /* See the "inkey()" function */
136 bool inkey_xtra;                /* See the "inkey()" function */
137 bool inkey_scan;                /* See the "inkey()" function */
138 bool inkey_flag;                /* See the "inkey()" function */
139 bool inkey_special;             /* See the "inkey()" function */
140
141 s16b coin_type;                 /* Hack -- force coin type */
142
143 bool opening_chest;             /* Hack -- prevent chest generation */
144
145 bool shimmer_monsters;  /* Hack -- optimize multi-hued monsters */
146 bool shimmer_objects;   /* Hack -- optimize multi-hued objects */
147
148 bool repair_monsters;   /* Hack -- optimize detect monsters */
149 bool repair_objects;    /* Hack -- optimize detect objects */
150
151 s16b inven_nxt;                 /* Hack -- unused */
152 bool hack_mind;
153 bool hack_mutation;
154
155 s16b inven_cnt;                 /* Number of items in inventory */
156 s16b equip_cnt;                 /* Number of items in equipment */
157
158 s16b o_max = 1;                 /* Number of allocated objects */
159 s16b o_cnt = 0;                 /* Number of live objects */
160
161 s16b m_max = 1;                 /* Number of allocated monsters */
162 s16b m_cnt = 0;                 /* Number of live monsters */
163
164 s16b hack_m_idx = 0;    /* Hack -- see "process_monsters()" */
165 s16b hack_m_idx_ii = 0;
166 bool multi_rew = FALSE;
167 char summon_kin_type;   /* Hack, by Julian Lighton: summon 'relatives' */
168
169 int total_friends = 0;
170 s32b total_friend_levels = 0;
171 s32b friend_align = 0;
172
173 int leaving_quest = 0;
174 bool reinit_wilderness = FALSE;
175
176
177 /*
178  * Software options (set via the '=' command).  See "tables.c"
179  */
180
181
182 /* Option Set 1 -- User Interface */
183
184 bool rogue_like_commands;       /* Rogue-like commands */
185 bool quick_messages;            /* Activate quick messages */
186 bool auto_more;
187 bool command_menu;
188 bool other_query_flag;          /* Prompt for various information */
189 bool carry_query_flag;          /* Prompt before picking things up */
190 bool use_old_target;            /* Use old target by default */
191 bool always_pickup;                     /* Pick things up by default */
192 bool always_repeat;                     /* Repeat obvious commands */
193 bool depth_in_feet;                     /* Show dungeon level in feet */
194
195 bool stack_force_notes;         /* Merge inscriptions when stacking */
196 bool stack_force_costs;         /* Merge discounts when stacking */
197
198 bool show_labels;                       /* Show labels in object listings */
199 bool show_weights;                      /* Show weights in object listings */
200 bool show_choices;                      /* Show choices in certain sub-windows */
201
202 bool ring_bell;                         /* Ring the bell (on errors, etc) */
203
204 bool show_item_graph;
205
206
207 /* Option Set 2 -- Disturbance */
208
209 bool find_ignore_stairs;        /* Run past stairs */
210 bool find_ignore_doors;         /* Run through open doors */
211 bool find_cut;                          /* Run past known corners */
212 bool find_examine;                      /* Run into potential corners */
213
214 bool disturb_move;                      /* Disturb whenever any monster moves */
215 bool disturb_near;                      /* Disturb whenever viewable monster moves */
216 bool disturb_high;                      /* Disturb whenever high-level monster moves */
217 bool disturb_panel;                     /* Disturb whenever map panel changes */
218 bool disturb_state;                     /* Disturn whenever player state changes */
219 bool disturb_minor;                     /* Disturb whenever boring things happen */
220
221 bool alert_hitpoint;            /* Alert user to critical hitpoints */
222 bool disturb_trap_detect;       /* Disturb when leaving trap detected area */
223 bool alert_trap_detect;         /* Alert when leaving trap detected area */
224 bool last_words;                /* Get last words upon dying */
225 bool over_exert;
226 bool small_levels;              /* Allow unusually small dungeon levels */
227 bool always_small_levels;               /* Use always unusually small dungeon levels */
228 bool empty_levels;              /* Allow empty 'arena' levels */
229 bool player_symbols;            /* Use varying symbols for the player char */
230 bool equippy_chars;             /* Back by popular demand... */
231 bool display_mutations;         /* Skip mutations screen even if we have it */
232 bool plain_descriptions;        /* Plain object descriptions */
233 bool confirm_destroy;           /* Known worthless items are destroyed without confirmation */
234 bool confirm_stairs;            /* Prompt before staircases... */
235 bool confirm_wear;              /* Confirm before putting on known cursed items */
236 bool disturb_pets;              /* Pets moving nearby disturb us */
237
238
239
240 /* Option Set 3 -- Game-Play */
241
242 bool manual_haggle;                     /* Auto-haggle in stores */
243
244 bool auto_scum;                         /* Auto-scum for good levels */
245
246 bool stack_allow_items;         /* Allow weapons and armor to stack */
247
248 bool expand_look;                       /* Expand the power of the look command */
249 bool expand_list;                       /* Expand the power of the list commands */
250
251 bool view_perma_grids;          /* Map remembers all perma-lit grids */
252 bool view_torch_grids;          /* Map remembers all torch-lit grids */
253 bool view_unsafe_grids;         /* Map marked by detect traps */
254
255 bool dungeon_align;                     /* Generate dungeons with aligned rooms */
256 bool dungeon_stair;                     /* Generate dungeons with connected stairs */
257
258 bool track_follow;                      /* Monsters follow the player */
259 bool track_target;                      /* Monsters target the player */
260
261 bool smart_learn;                       /* Monsters learn from their mistakes */
262 bool smart_cheat;                       /* Monsters exploit player weaknesses */
263
264
265 /* Option Set 4 -- Efficiency */
266
267 bool view_reduce_lite;          /* Reduce lite-radius when running */
268 bool view_reduce_view;          /* Reduce view-radius in town */
269
270 bool check_abort;                       /* Avoid checking for user abort */
271
272 bool flush_failure;                     /* Flush input on any failure */
273 bool flush_disturb;                     /* Flush input on disturbance */
274
275 bool fresh_before;                      /* Flush output before normal commands */
276 bool fresh_after;                       /* Flush output after normal commands */
277 bool fresh_message;                     /* Flush output after all messages */
278
279 bool compress_savefile;         /* Compress messages in savefiles */
280
281 bool hilite_player;                     /* Hilite the player with the cursor */
282
283 bool view_yellow_lite;          /* Use special colors for torch-lit grids */
284 bool view_bright_lite;          /* Use special colors for 'viewable' grids */
285
286 bool view_granite_lite;         /* Use special colors for wall grids (slow) */
287 bool view_special_lite;         /* Use special colors for floor grids (slow) */
288 bool new_ascii_graphics;
289 bool display_path;
290 bool target_pet;
291 bool plain_pickup;
292
293 bool always_show_list;
294 bool powerup_home;
295 bool change_numeral;
296 bool send_score;
297 bool allow_debug_opts;   /* Allow use of debug/cheat options */
298
299 /* Cheating options */
300
301 bool cheat_peek;                /* Peek into object creation */
302 bool cheat_hear;                /* Peek into monster creation */
303 bool cheat_room;                /* Peek into dungeon creation */
304 bool cheat_xtra;                /* Peek into something else */
305 bool cheat_know;                /* Know complete monster info */
306 bool cheat_live;                /* Allow player to avoid death */
307 bool cheat_save;                /* Ask for saving death */
308
309
310 /* Special options */
311
312 byte hitpoint_warn;             /* Hitpoint warning (0 to 9) */
313
314 byte delay_factor;              /* Delay factor (0 to 9) */
315
316 bool autosave_l;        /* Autosave before entering new levels */
317 bool autosave_t;        /* Timed autosave */
318 s16b autosave_freq;     /* Autosave frequency */
319
320
321 /*
322  * Dungeon variables
323  */
324
325 byte feeling;                   /* Most recent feeling */
326 s16b rating;                    /* Level's current rating */
327
328 bool good_item_flag;            /* True if "Artifact" on this level */
329
330 bool closing_flag;              /* Dungeon is closing */
331
332
333 /*
334  * Dungeon size info
335  */
336
337 s16b panel_row_min, panel_row_max;
338 s16b panel_col_min, panel_col_max;
339 s16b panel_col_prt, panel_row_prt;
340
341 /*
342  * Player location in dungeon
343  */
344 int py;
345 int px;
346
347 /*
348  * Targetting variables
349  */
350 s16b target_who;
351 s16b target_col;
352 s16b target_row;
353
354
355 /*
356  * User info
357  */
358 int player_uid;
359 int player_euid;
360 int player_egid;
361
362 /*
363  * Current player's character name
364  */
365 char player_name[32];
366
367 /*
368  * Stripped version of "player_name"
369  */
370 char player_base[32];
371
372
373 /*
374  * Buffer to hold the current savefile name
375  * 'savefile' holds full path name. 'savefile_base' holds only base name.
376  */
377 char savefile[1024];
378 char savefile_base[40];
379
380 /*
381  * Array of grids lit by player lite (see "cave.c")
382  */
383 s16b lite_n;
384 s16b lite_y[LITE_MAX];
385 s16b lite_x[LITE_MAX];
386
387 /*
388  * Array of grids lit by player lite (see "cave.c")
389  */
390 s16b mon_lite_n;
391 s16b mon_lite_y[LITE_MAX];
392 s16b mon_lite_x[LITE_MAX];
393
394 /*
395  * Array of grids viewable to the player (see "cave.c")
396  */
397 s16b view_n;
398 byte view_y[VIEW_MAX];
399 byte view_x[VIEW_MAX];
400
401 /*
402  * Array of grids for use by various functions (see "cave.c")
403  */
404 s16b temp_n;
405 byte temp_y[TEMP_MAX];
406 byte temp_x[TEMP_MAX];
407
408
409 /*
410  * Number of active macros.
411  */
412 s16b macro__num;
413
414 /*
415  * Array of macro patterns [MACRO_MAX]
416  */
417 cptr *macro__pat;
418
419 /*
420  * Array of macro actions [MACRO_MAX]
421  */
422 cptr *macro__act;
423
424 /*
425  * Array of macro types [MACRO_MAX]
426  */
427 bool *macro__cmd;
428
429 /*
430  * Current macro action [1024]
431  */
432 char *macro__buf;
433
434
435 /*
436  * The number of quarks
437  */
438 s16b quark__num;
439
440 /*
441  * The pointers to the quarks [QUARK_MAX]
442  */
443 cptr *quark__str;
444
445
446 /*
447  * The next "free" index to use
448  */
449 u16b message__next;
450
451 /*
452  * The index of the oldest message (none yet)
453  */
454 u16b message__last;
455
456 /*
457  * The next "free" offset
458  */
459 u16b message__head;
460
461 /*
462  * The offset to the oldest used char (none yet)
463  */
464 u16b message__tail;
465
466 /*
467  * The array of offsets, by index [MESSAGE_MAX]
468  */
469 u16b *message__ptr;
470
471 /*
472  * The array of chars, by offset [MESSAGE_BUF]
473  */
474 char *message__buf;
475
476
477 /*
478  * The array of normal options
479  */
480 u32b option_flag[8];
481 u32b option_mask[8];
482
483
484 /*
485  * The array of window options
486  */
487 u32b window_flag[8];
488 u32b window_mask[8];
489
490
491 /*
492  * The array of window pointers
493  */
494 term *angband_term[8];
495
496
497 /*
498  * Standard window names
499  */
500 char angband_term_name[8][16] =
501 {
502         "Hengband",
503         "Term-1",
504         "Term-2",
505         "Term-3",
506         "Term-4",
507         "Term-5",
508         "Term-6",
509         "Term-7"
510 };
511
512
513 /*
514  * Global table of color definitions
515  */
516 byte angband_color_table[256][4] =
517 {
518         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
519         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
520         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
521         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
522         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
523         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
524         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
525         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
526         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
527         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
528         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
529         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
530         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
531         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
532         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
533         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
534 };
535
536
537 /*
538  * Standard sound names
539  */
540 char angband_sound_name[SOUND_MAX][16] =
541 {
542         "",
543         "hit",
544         "miss",
545         "flee",
546         "drop",
547         "kill",
548         "level",
549         "death",
550         "study",
551         "teleport",
552         "shoot",
553         "quaff",
554         "zap",
555         "walk",
556         "tpother",
557         "hitwall",
558         "eat",
559         "store1",
560         "store2",
561         "store3",
562         "store4",
563         "dig",
564         "opendoor",
565         "shutdoor",
566         "tplevel",
567         "scroll",
568         "buy",
569         "sell",
570         "warn",
571         "rocket",
572         "n_kill",
573         "u_kill",
574         "quest",
575         "heal",
576         "x_heal",
577         "bite",
578         "claw",
579         "m_spell",
580         "summon",
581         "breath",
582         "ball",
583         "m_heal",
584         "atkspell",
585         "evil",
586         "touch",
587         "sting",
588         "crush",
589         "slime",
590         "wail",
591         "winner",
592         "fire",
593         "acid",
594         "elec",
595         "cold",
596         "illegal",
597         "fail",
598         "wakeup",
599         "invuln",
600         "fall",
601         "pain",
602         "destitem",
603         "moan",
604         "show",
605         "unused",
606         "explode",
607 };
608
609
610 /*
611  * The array of "cave grids" [MAX_WID][MAX_HGT].
612  * Not completely allocated, that would be inefficient
613  * Not completely hardcoded, that would overflow memory
614  */
615 cave_type *cave[MAX_HGT];
616
617 /*
618  * The array of dungeon items [max_o_idx]
619  */
620 object_type *o_list;
621
622 /*
623  * The array of dungeon monsters [max_m_idx]
624  */
625 monster_type *m_list;
626
627
628 /*
629  * Maximum number of towns
630  */
631 u16b max_towns;
632
633 /*
634  * The towns [max_towns]
635  */
636 town_type *town;
637
638
639 /*
640  * The player's inventory [INVEN_TOTAL]
641  */
642 object_type *inventory;
643
644
645 /*
646  * The size of "alloc_kind_table" (at most max_k_idx * 4)
647  */
648 s16b alloc_kind_size;
649
650 /*
651  * The entries in the "kind allocator table"
652  */
653 alloc_entry *alloc_kind_table;
654
655
656 /*
657  * The size of "alloc_race_table" (at most max_r_idx)
658  */
659 s16b alloc_race_size;
660
661 /*
662  * The entries in the "race allocator table"
663  */
664 alloc_entry *alloc_race_table;
665
666
667 /*
668  * Specify attr/char pairs for visual special effects
669  * Be sure to use "index & 0x7F" to avoid illegal access
670  */
671 byte misc_to_attr[256];
672 char misc_to_char[256];
673
674
675 /*
676  * Specify attr/char pairs for inventory items (by tval)
677  * Be sure to use "index & 0x7F" to avoid illegal access
678  */
679 byte tval_to_attr[128];
680 char tval_to_char[128];
681
682
683 /*
684  * Keymaps for each "mode" associated with each keypress.
685  */
686 cptr keymap_act[KEYMAP_MODES][256];
687
688
689
690 /*** Player information ***/
691
692 /*
693  * Static player info record
694  */
695 player_type p_body;
696
697 /*
698  * Pointer to the player info
699  */
700 player_type *p_ptr = &p_body;
701
702 /*
703  * Pointer to the player tables
704  * (sex, race, class, magic)
705  */
706 player_sex *sp_ptr;
707 player_race *rp_ptr;
708 player_class *cp_ptr;
709 player_seikaku *ap_ptr;
710 player_magic *mp_ptr;
711
712
713 /*
714  * The last character rolled,
715  * holded for quick start
716  */
717 birther previous_char;
718
719
720 /*
721  * The vault generation arrays
722  */
723 vault_type *v_info;
724 char *v_name;
725 char *v_text;
726
727 /*
728  * The skill table
729  */
730 skill_table *s_info;
731 char *s_name;
732 char *s_text;
733
734 /*
735  * The magic info
736  */
737 player_magic *m_info;
738 char *m_name;
739 char *m_text;
740
741 /*
742  * The terrain feature arrays
743  */
744 feature_type *f_info;
745 char *f_name;
746 char *f_text;
747
748 /*
749  * The object kind arrays
750  */
751 object_kind *k_info;
752 char *k_name;
753 char *k_text;
754
755 /*
756  * The artifact arrays
757  */
758 artifact_type *a_info;
759 char *a_name;
760 char *a_text;
761
762 /*
763  * The ego-item arrays
764  */
765 ego_item_type *e_info;
766 char *e_name;
767 char *e_text;
768
769
770 /*
771  * The monster race arrays
772  */
773 monster_race *r_info;
774 char *r_name;
775 char *r_text;
776
777
778 /*
779  * The dungeon arrays
780  */
781 dungeon_info_type *d_info;
782 char *d_name;
783 char *d_text;
784
785
786 /*
787  * Hack -- The special Angband "System Suffix"
788  * This variable is used to choose an appropriate "pref-xxx" file
789  */
790 cptr ANGBAND_SYS = "xxx";
791
792 /*
793  * Hack -- The special Angband "Keyboard Suffix"
794  * This variable is used to choose an appropriate macro-trigger definition
795  */
796 #ifdef JP
797 cptr ANGBAND_KEYBOARD = "JAPAN";
798 #else
799 cptr ANGBAND_KEYBOARD = "0";
800 #endif
801
802 /*
803  * Hack -- The special Angband "Graphics Suffix"
804  * This variable is used to choose an appropriate "graf-xxx" file
805  */
806 cptr ANGBAND_GRAF = "ascii";
807
808 /*
809  * Path name: The main "lib" directory
810  * This variable is not actually used anywhere in the code
811  */
812 cptr ANGBAND_DIR;
813
814 /*
815  * High score files (binary)
816  * These files may be portable between platforms
817  */
818 cptr ANGBAND_DIR_APEX;
819
820 /*
821  * Bone files for player ghosts (ascii)
822  * These files are portable between platforms
823  */
824 cptr ANGBAND_DIR_BONE;
825
826 /*
827  * Binary image files for the "*_info" arrays (binary)
828  * These files are not portable between platforms
829  */
830 cptr ANGBAND_DIR_DATA;
831
832 /*
833  * Textual template files for the "*_info" arrays (ascii)
834  * These files are portable between platforms
835  */
836 cptr ANGBAND_DIR_EDIT;
837
838 /*
839  * Script files
840  * These files are portable between platforms.
841  */
842 cptr ANGBAND_DIR_SCRIPT;
843
844 /*
845  * Various extra files (ascii)
846  * These files may be portable between platforms
847  */
848 cptr ANGBAND_DIR_FILE;
849
850 /*
851  * Help files (normal) for the online help (ascii)
852  * These files are portable between platforms
853  */
854 cptr ANGBAND_DIR_HELP;
855
856 /*
857  * Help files (spoilers) for the online help (ascii)
858  * These files are portable between platforms
859  */
860 cptr ANGBAND_DIR_INFO;
861
862 /*
863  * Default user "preference" files (ascii)
864  * These files are rarely portable between platforms
865  */
866 cptr ANGBAND_DIR_PREF;
867
868 /*
869  * Savefiles for current characters (binary)
870  * These files are portable between platforms
871  */
872 cptr ANGBAND_DIR_SAVE;
873
874 /*
875  * User "preference" files (ascii)
876  * These files are rarely portable between platforms
877  */
878 cptr ANGBAND_DIR_USER;
879
880 /*
881  * Various extra files (binary)
882  * These files are rarely portable between platforms
883  */
884 cptr ANGBAND_DIR_XTRA;
885
886
887 /*
888  * Total Hack -- allow all items to be listed (even empty ones)
889  * This is only used by "do_cmd_inven_e()" and is cleared there.
890  */
891 bool item_tester_full;
892
893 bool item_tester_no_ryoute = FALSE;
894
895 /*
896  * Here is a "pseudo-hook" used during calls to "get_item()" and
897  * "show_inven()" and "show_equip()", and the choice window routines.
898  */
899 byte item_tester_tval;
900
901
902 /*
903  * Here is a "hook" used during calls to "get_item()" and
904  * "show_inven()" and "show_equip()", and the choice window routines.
905  */
906 bool (*item_tester_hook)(object_type*);
907
908
909
910 /*
911  * Current "comp" function for ang_sort()
912  */
913 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
914
915
916 /*
917  * Current "swap" function for ang_sort()
918  */
919 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
920
921
922
923 /*
924  * Hack -- function hooks to restrict "get_mon_num_prep()" function
925  */
926 monster_hook_type get_mon_num_hook;
927 monster_hook_type get_mon_num2_hook;
928
929
930 /*
931  * Hack -- function hook to restrict "get_obj_num_prep()" function
932  */
933 bool (*get_obj_num_hook)(int k_idx);
934
935
936 /* Hack, monk armour */
937 bool monk_armour_aux;
938 bool monk_notify_aux;
939
940 #ifdef ALLOW_EASY_OPEN /* TNB */
941 bool easy_open;
942 #endif /* ALLOW_EASY_OPEN -- TNB */
943
944 #ifdef ALLOW_EASY_DISARM /* TNB */
945 bool easy_disarm;
946 #endif /* ALLOW_EASY_DISARM -- TNB */
947
948 #ifdef ALLOW_EASY_FLOOR /* TNB */
949 bool easy_floor;
950 #endif /* ALLOW_EASY_FLOOR -- TNB */
951
952 bool use_command;
953 bool center_player;
954 bool center_running;
955
956 /* Auto-destruction options */
957 bool destroy_items;
958 bool destroy_feeling;
959 bool destroy_identify;
960 bool leave_worth;
961 bool leave_equip;
962 bool leave_wanted;
963 bool leave_corpse;
964 bool leave_junk;
965 bool leave_chest;
966 bool leave_special;
967
968 /* Nikki */
969 bool record_fix_art;
970 bool record_rand_art;
971 bool record_destroy_uniq;
972 bool record_fix_quest;
973 bool record_rand_quest;
974 bool record_maxdeapth;
975 bool record_stair;
976 bool record_buy;
977 bool record_sell;
978 bool record_danger;
979 bool record_arena;
980 bool record_ident;
981 bool record_named_pet;
982 char record_o_name[MAX_NLEN];
983 s32b record_turn;
984
985 /*
986  * Wilderness
987  */
988 wilderness_type **wilderness;
989
990
991 /*
992  * Buildings
993  */
994 building_type building[MAX_BLDG];
995
996
997 /*
998  * Maximum number of quests
999  */
1000 u16b max_quests;
1001
1002 /*
1003  * Maximum number of monsters in r_info.txt
1004  */
1005 u16b max_r_idx;
1006
1007 /*
1008  * Maximum number of items in k_info.txt
1009  */
1010 u16b max_k_idx;
1011
1012 /*
1013  * Maximum number of vaults in v_info.txt
1014  */
1015 u16b max_v_idx;
1016
1017 /*
1018  * Maximum number of terrain features in f_info.txt
1019  */
1020 u16b max_f_idx;
1021
1022 /*
1023  * Maximum number of artifacts in a_info.txt
1024  */
1025 u16b max_a_idx;
1026
1027 /*
1028  * Maximum number of ego-items in e_info.txt
1029  */
1030 u16b max_e_idx;
1031
1032 /*
1033  * Maximum number of dungeon in e_info.txt
1034  */
1035 u16b max_d_idx;
1036
1037 /*
1038  * Maximum number of objects in the level
1039  */
1040 u16b max_o_idx;
1041
1042 /*
1043  * Maximum number of monsters in the level
1044  */
1045 u16b max_m_idx;
1046
1047 /*
1048  * Maximum size of the wilderness
1049  */
1050 s32b max_wild_x;
1051 s32b max_wild_y;
1052
1053 /*
1054  * Quest info
1055  */
1056 quest_type *quest;
1057
1058 /*
1059  * Quest text
1060  */
1061 char quest_text[10][80];
1062
1063 /*
1064  * Current line of the quest text
1065  */
1066 int quest_text_line;
1067
1068 /*
1069  * Default spell color table (quark index)
1070  */
1071 s16b gf_color[MAX_GF];
1072
1073 /*
1074  * Flags for initialization
1075  */
1076 int init_flags;
1077
1078
1079 /*
1080  * The "highscore" file descriptor, if available.
1081  */
1082 int highscore_fd = -1;
1083
1084 int mutant_regenerate_mod = 100;
1085
1086 /*
1087  * Startup options
1088  */
1089 bool easy_band;
1090 bool vanilla_town;            /* Use "vanilla" town without set quests */
1091 bool ironman_shops;           /* Stores are permanently closed */
1092 bool ironman_small_levels;    /* Always create unusually small dungeon levels */
1093 bool ironman_downward;        /* Don't allow climbing upwards/recalling */
1094 bool ironman_autoscum;        /* Permanently enable the autoscummer */
1095 bool lite_town;               /* Use "lite" town without wilderness */
1096 bool ironman_empty_levels;    /* Always create empty 'arena' levels */
1097 bool ironman_rooms;           /* Always generate very unusual rooms */
1098 bool ironman_nightmare;                 /* Play the game in Nightmare mode */
1099 bool left_hander;
1100 bool preserve_mode;
1101 bool autoroller;
1102 bool autochara;
1103
1104
1105 bool can_save = FALSE;        /* Game can be saved */
1106
1107 bool world_monster;
1108 bool world_player;
1109
1110 int cap_mon;
1111 int cap_mspeed;
1112 int cap_hp;
1113 int cap_maxhp;
1114 u16b cap_nickname;
1115
1116 s16b battle_mon[4];
1117 int sel_monster;
1118 int battle_odds;
1119 int kakekin;
1120 u32b mon_odds[4];
1121
1122 int pet_t_m_idx;
1123 int riding_t_m_idx;
1124
1125 s16b kubi_r_idx[MAX_KUBI];
1126 s16b today_mon;
1127
1128 monster_type party_mon[21];
1129
1130 bool write_level;
1131
1132 u32b playtime;
1133 u32b start_time;
1134
1135 int tsuri_dir;
1136
1137 bool sukekaku;
1138 bool new_mane;
1139
1140 bool mon_fight;
1141
1142 bool ambush_flag;
1143 bool generate_encounter;
1144
1145 cptr screen_dump = NULL;
1146
1147 /*
1148  * Which dungeon ?
1149  */
1150 byte dungeon_type;
1151 s16b *max_dlv;
1152
1153 byte feat_wall_outer;
1154 byte feat_wall_inner;
1155 byte feat_wall_solid;
1156 byte floor_type[100], fill_type[100];
1157
1158 bool now_damaged;
1159 s16b now_message;
1160 bool use_menu;
1161
1162 #ifdef CHUUKEI
1163 bool chuukei_server;
1164 bool chuukei_client;
1165 char *server_name;
1166 int server_port;
1167 #endif