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