OSDN Git Service

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