OSDN Git Service

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