OSDN Git Service

自動拾いエディタで使っていたカーソル移動キーを読み取るHackを一般化して、
[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
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 always_show_list;
280 bool abbrev_extra;
281 bool abbrev_all;
282 bool target_pet;
283 bool plain_pickup;
284
285 bool powerup_home;
286 bool send_score;
287 bool allow_debug_opts;   /* Allow use of debug/cheat options */
288
289 /* Cheating options */
290
291 bool cheat_peek;                /* Peek into object creation */
292 bool cheat_hear;                /* Peek into monster creation */
293 bool cheat_room;                /* Peek into dungeon creation */
294 bool cheat_xtra;                /* Peek into something else */
295 bool cheat_know;                /* Know complete monster info */
296 bool cheat_live;                /* Allow player to avoid death */
297 bool cheat_save;                /* Ask for saving death */
298
299
300 /* Special options */
301
302 byte hitpoint_warn;             /* Hitpoint warning (0 to 9) */
303 byte mana_warn;                 /* Mana color (0 to 9) */
304
305 byte delay_factor;              /* Delay factor (0 to 9) */
306
307 bool autosave_l;        /* Autosave before entering new levels */
308 bool autosave_t;        /* Timed autosave */
309 s16b autosave_freq;     /* Autosave frequency */
310
311
312 /*
313  * Dungeon variables
314  */
315
316 byte feeling;                   /* Most recent feeling */
317 s16b rating;                    /* Level's current rating */
318
319 bool good_item_flag;            /* True if "Artifact" on this level */
320
321 bool closing_flag;              /* Dungeon is closing */
322
323
324 /*
325  * Dungeon size info
326  */
327
328 s16b panel_row_min, panel_row_max;
329 s16b panel_col_min, panel_col_max;
330 s16b panel_col_prt, panel_row_prt;
331
332 /*
333  * Player location in dungeon
334  */
335 int py;
336 int px;
337
338 /*
339  * Targetting variables
340  */
341 s16b target_who;
342 s16b target_col;
343 s16b target_row;
344
345
346 /*
347  * User info
348  */
349 int player_uid;
350 int player_euid;
351 int player_egid;
352
353 /*
354  * Current player's character name
355  */
356 char player_name[32];
357
358 /*
359  * Stripped version of "player_name"
360  */
361 char player_base[32];
362
363
364 /*
365  * Buffer to hold the current savefile name
366  * 'savefile' holds full path name. 'savefile_base' holds only base name.
367  */
368 char savefile[1024];
369 char savefile_base[40];
370
371 /*
372  * Array of grids lit by player lite (see "cave.c")
373  */
374 s16b lite_n;
375 s16b lite_y[LITE_MAX];
376 s16b lite_x[LITE_MAX];
377
378 /*
379  * Array of grids lit by player lite (see "cave.c")
380  */
381 s16b mon_lite_n;
382 s16b mon_lite_y[MON_LITE_MAX];
383 s16b mon_lite_x[MON_LITE_MAX];
384
385 /*
386  * Array of grids viewable to the player (see "cave.c")
387  */
388 s16b view_n;
389 byte view_y[VIEW_MAX];
390 byte view_x[VIEW_MAX];
391
392 /*
393  * Array of grids for use by various functions (see "cave.c")
394  */
395 s16b temp_n;
396 byte temp_y[TEMP_MAX];
397 byte temp_x[TEMP_MAX];
398
399 /*
400  * Array of grids for delayed visual updating (see "cave.c")
401  */
402 s16b redraw_n = 0;
403 byte redraw_y[REDRAW_MAX];
404 byte redraw_x[REDRAW_MAX];
405
406
407 /*
408  * Number of active macros.
409  */
410 s16b macro__num;
411
412 /*
413  * Array of macro patterns [MACRO_MAX]
414  */
415 cptr *macro__pat;
416
417 /*
418  * Array of macro actions [MACRO_MAX]
419  */
420 cptr *macro__act;
421
422 /*
423  * Array of macro types [MACRO_MAX]
424  */
425 bool *macro__cmd;
426
427 /*
428  * Current macro action [1024]
429  */
430 char *macro__buf;
431
432
433 /*
434  * The number of quarks
435  */
436 s16b quark__num;
437
438 /*
439  * The pointers to the quarks [QUARK_MAX]
440  */
441 cptr *quark__str;
442
443
444 /*
445  * The next "free" index to use
446  */
447 u16b message__next;
448
449 /*
450  * The index of the oldest message (none yet)
451  */
452 u16b message__last;
453
454 /*
455  * The next "free" offset
456  */
457 u16b message__head;
458
459 /*
460  * The offset to the oldest used char (none yet)
461  */
462 u16b message__tail;
463
464 /*
465  * The array of offsets, by index [MESSAGE_MAX]
466  */
467 u16b *message__ptr;
468
469 /*
470  * The array of chars, by offset [MESSAGE_BUF]
471  */
472 char *message__buf;
473
474
475 /*
476  * The array of normal options
477  */
478 u32b option_flag[8];
479 u32b option_mask[8];
480
481
482 /*
483  * The array of window options
484  */
485 u32b window_flag[8];
486 u32b window_mask[8];
487
488
489 /*
490  * The array of window pointers
491  */
492 term *angband_term[8];
493
494
495 /*
496  * Standard window names
497  */
498 char angband_term_name[8][16] =
499 {
500         "Hengband",
501         "Term-1",
502         "Term-2",
503         "Term-3",
504         "Term-4",
505         "Term-5",
506         "Term-6",
507         "Term-7"
508 };
509
510
511 /*
512  * Global table of color definitions
513  */
514 byte angband_color_table[256][4] =
515 {
516         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
517         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
518         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
519         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
520         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
521         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
522         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
523         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
524         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
525         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
526         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
527         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
528         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
529         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
530         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
531         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
532 };
533
534
535 /*
536  * Standard sound names
537  */
538 char angband_sound_name[SOUND_MAX][16] =
539 {
540         "",
541         "hit",
542         "miss",
543         "flee",
544         "drop",
545         "kill",
546         "level",
547         "death",
548         "study",
549         "teleport",
550         "shoot",
551         "quaff",
552         "zap",
553         "walk",
554         "tpother",
555         "hitwall",
556         "eat",
557         "store1",
558         "store2",
559         "store3",
560         "store4",
561         "dig",
562         "opendoor",
563         "shutdoor",
564         "tplevel",
565         "scroll",
566         "buy",
567         "sell",
568         "warn",
569         "rocket",
570         "n_kill",
571         "u_kill",
572         "quest",
573         "heal",
574         "x_heal",
575         "bite",
576         "claw",
577         "m_spell",
578         "summon",
579         "breath",
580         "ball",
581         "m_heal",
582         "atkspell",
583         "evil",
584         "touch",
585         "sting",
586         "crush",
587         "slime",
588         "wail",
589         "winner",
590         "fire",
591         "acid",
592         "elec",
593         "cold",
594         "illegal",
595         "fail",
596         "wakeup",
597         "invuln",
598         "fall",
599         "pain",
600         "destitem",
601         "moan",
602         "show",
603         "unused",
604         "explode",
605 };
606
607
608 /*
609  * The array of "cave grids" [MAX_WID][MAX_HGT].
610  * Not completely allocated, that would be inefficient
611  * Not completely hardcoded, that would overflow memory
612  */
613 cave_type *cave[MAX_HGT];
614
615
616 /*
617  * The array of saved floors
618  */
619 saved_floor_type saved_floors[MAX_SAVED_FLOORS];
620
621
622 /*
623  * Number of floor_id used from birth
624  */
625 s16b max_floor_id;
626
627
628 /*
629  * Sign for current process used in temporal files.
630  * Actually it is the start time of current process.
631  */
632 u32b saved_floor_file_sign;
633
634
635 /*
636  * The array of dungeon items [max_o_idx]
637  */
638 object_type *o_list;
639
640 /*
641  * The array of dungeon monsters [max_m_idx]
642  */
643 monster_type *m_list;
644
645
646 /*
647  * Maximum number of towns
648  */
649 u16b max_towns;
650
651 /*
652  * The towns [max_towns]
653  */
654 town_type *town;
655
656
657 /*
658  * The player's inventory [INVEN_TOTAL]
659  */
660 object_type *inventory;
661
662
663 /*
664  * The size of "alloc_kind_table" (at most max_k_idx * 4)
665  */
666 s16b alloc_kind_size;
667
668 /*
669  * The entries in the "kind allocator table"
670  */
671 alloc_entry *alloc_kind_table;
672
673
674 /*
675  * The size of "alloc_race_table" (at most max_r_idx)
676  */
677 s16b alloc_race_size;
678
679 /*
680  * The entries in the "race allocator table"
681  */
682 alloc_entry *alloc_race_table;
683
684
685 /*
686  * Specify attr/char pairs for visual special effects
687  * Be sure to use "index & 0x7F" to avoid illegal access
688  */
689 byte misc_to_attr[256];
690 char misc_to_char[256];
691
692
693 /*
694  * Specify attr/char pairs for inventory items (by tval)
695  * Be sure to use "index & 0x7F" to avoid illegal access
696  */
697 byte tval_to_attr[128];
698 char tval_to_char[128];
699
700
701 /*
702  * Keymaps for each "mode" associated with each keypress.
703  */
704 cptr keymap_act[KEYMAP_MODES][256];
705
706
707
708 /*** Player information ***/
709
710 /*
711  * Static player info record
712  */
713 player_type p_body;
714
715 /*
716  * Pointer to the player info
717  */
718 player_type *p_ptr = &p_body;
719
720 /*
721  * Pointer to the player tables
722  * (sex, race, class, magic)
723  */
724 player_sex *sp_ptr;
725 player_race *rp_ptr;
726 player_class *cp_ptr;
727 player_seikaku *ap_ptr;
728 player_magic *mp_ptr;
729
730
731 /*
732  * The last character rolled,
733  * holded for quick start
734  */
735 birther previous_char;
736
737
738 /*
739  * The vault generation arrays
740  */
741 vault_type *v_info;
742 char *v_name;
743 char *v_text;
744
745 /*
746  * The skill table
747  */
748 skill_table *s_info;
749
750 /*
751  * The magic info
752  */
753 player_magic *m_info;
754
755 /*
756  * The terrain feature arrays
757  */
758 feature_type *f_info;
759 char *f_name;
760
761 /*
762  * The object kind arrays
763  */
764 object_kind *k_info;
765 char *k_name;
766 char *k_text;
767
768 /*
769  * The artifact arrays
770  */
771 artifact_type *a_info;
772 char *a_name;
773 char *a_text;
774
775 /*
776  * The ego-item arrays
777  */
778 ego_item_type *e_info;
779 char *e_name;
780 char *e_text;
781
782
783 /*
784  * The monster race arrays
785  */
786 monster_race *r_info;
787 char *r_name;
788 char *r_text;
789
790
791 /*
792  * The dungeon arrays
793  */
794 dungeon_info_type *d_info;
795 char *d_name;
796 char *d_text;
797
798
799 /*
800  * Hack -- The special Angband "System Suffix"
801  * This variable is used to choose an appropriate "pref-xxx" file
802  */
803 cptr ANGBAND_SYS = "xxx";
804
805 /*
806  * Hack -- The special Angband "Keyboard Suffix"
807  * This variable is used to choose an appropriate macro-trigger definition
808  */
809 #ifdef JP
810 cptr ANGBAND_KEYBOARD = "JAPAN";
811 #else
812 cptr ANGBAND_KEYBOARD = "0";
813 #endif
814
815 /*
816  * Hack -- The special Angband "Graphics Suffix"
817  * This variable is used to choose an appropriate "graf-xxx" file
818  */
819 cptr ANGBAND_GRAF = "ascii";
820
821 /*
822  * Path name: The main "lib" directory
823  * This variable is not actually used anywhere in the code
824  */
825 cptr ANGBAND_DIR;
826
827 /*
828  * High score files (binary)
829  * These files may be portable between platforms
830  */
831 cptr ANGBAND_DIR_APEX;
832
833 /*
834  * Bone files for player ghosts (ascii)
835  * These files are portable between platforms
836  */
837 cptr ANGBAND_DIR_BONE;
838
839 /*
840  * Binary image files for the "*_info" arrays (binary)
841  * These files are not portable between platforms
842  */
843 cptr ANGBAND_DIR_DATA;
844
845 /*
846  * Textual template files for the "*_info" arrays (ascii)
847  * These files are portable between platforms
848  */
849 cptr ANGBAND_DIR_EDIT;
850
851 /*
852  * Script files
853  * These files are portable between platforms.
854  */
855 cptr ANGBAND_DIR_SCRIPT;
856
857 /*
858  * Various extra files (ascii)
859  * These files may be portable between platforms
860  */
861 cptr ANGBAND_DIR_FILE;
862
863 /*
864  * Help files (normal) for the online help (ascii)
865  * These files are portable between platforms
866  */
867 cptr ANGBAND_DIR_HELP;
868
869 /*
870  * Help files (spoilers) for the online help (ascii)
871  * These files are portable between platforms
872  */
873 cptr ANGBAND_DIR_INFO;
874
875 /*
876  * Default user "preference" files (ascii)
877  * These files are rarely portable between platforms
878  */
879 cptr ANGBAND_DIR_PREF;
880
881 /*
882  * Savefiles for current characters (binary)
883  * These files are portable between platforms
884  */
885 cptr ANGBAND_DIR_SAVE;
886
887 /*
888  * User "preference" files (ascii)
889  * These files are rarely portable between platforms
890  */
891 cptr ANGBAND_DIR_USER;
892
893 /*
894  * Various extra files (binary)
895  * These files are rarely portable between platforms
896  */
897 cptr ANGBAND_DIR_XTRA;
898
899
900 /*
901  * Total Hack -- allow all items to be listed (even empty ones)
902  * This is only used by "do_cmd_inven_e()" and is cleared there.
903  */
904 bool item_tester_full;
905
906 bool item_tester_no_ryoute = FALSE;
907
908 /*
909  * Here is a "pseudo-hook" used during calls to "get_item()" and
910  * "show_inven()" and "show_equip()", and the choice window routines.
911  */
912 byte item_tester_tval;
913
914
915 /*
916  * Here is a "hook" used during calls to "get_item()" and
917  * "show_inven()" and "show_equip()", and the choice window routines.
918  */
919 bool (*item_tester_hook)(object_type*);
920
921
922
923 /*
924  * Current "comp" function for ang_sort()
925  */
926 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
927
928
929 /*
930  * Current "swap" function for ang_sort()
931  */
932 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
933
934
935
936 /*
937  * Hack -- function hooks to restrict "get_mon_num_prep()" function
938  */
939 monster_hook_type get_mon_num_hook;
940 monster_hook_type get_mon_num2_hook;
941
942
943 /*
944  * Hack -- function hook to restrict "get_obj_num_prep()" function
945  */
946 bool (*get_obj_num_hook)(int k_idx);
947
948
949 /* Hack, monk armour */
950 bool monk_armour_aux;
951 bool monk_notify_aux;
952
953 #ifdef ALLOW_EASY_OPEN /* TNB */
954 bool easy_open;
955 #endif /* ALLOW_EASY_OPEN -- TNB */
956
957 #ifdef ALLOW_EASY_DISARM /* TNB */
958 bool easy_disarm;
959 #endif /* ALLOW_EASY_DISARM -- TNB */
960
961 #ifdef ALLOW_EASY_FLOOR /* TNB */
962 bool easy_floor;
963 #endif /* ALLOW_EASY_FLOOR -- TNB */
964
965 bool use_command;
966 bool center_player;
967 bool center_running;
968
969 /* Auto-destruction options */
970 bool destroy_items;
971 bool destroy_feeling;
972 bool destroy_identify;
973 bool leave_worth;
974 bool leave_equip;
975 bool leave_wanted;
976 bool leave_corpse;
977 bool leave_junk;
978 bool leave_chest;
979 bool leave_special;
980
981 /* Nikki */
982 bool record_fix_art;
983 bool record_rand_art;
984 bool record_destroy_uniq;
985 bool record_fix_quest;
986 bool record_rand_quest;
987 bool record_maxdeapth;
988 bool record_stair;
989 bool record_buy;
990 bool record_sell;
991 bool record_danger;
992 bool record_arena;
993 bool record_ident;
994 bool record_named_pet;
995 char record_o_name[MAX_NLEN];
996 s32b record_turn;
997
998 /*
999  * Wilderness
1000  */
1001 wilderness_type **wilderness;
1002
1003
1004 /*
1005  * Buildings
1006  */
1007 building_type building[MAX_BLDG];
1008
1009
1010 /*
1011  * Maximum number of quests
1012  */
1013 u16b max_quests;
1014
1015 /*
1016  * Maximum number of monsters in r_info.txt
1017  */
1018 u16b max_r_idx;
1019
1020 /*
1021  * Maximum number of items in k_info.txt
1022  */
1023 u16b max_k_idx;
1024
1025 /*
1026  * Maximum number of vaults in v_info.txt
1027  */
1028 u16b max_v_idx;
1029
1030 /*
1031  * Maximum number of terrain features in f_info.txt
1032  */
1033 u16b max_f_idx;
1034
1035 /*
1036  * Maximum number of artifacts in a_info.txt
1037  */
1038 u16b max_a_idx;
1039
1040 /*
1041  * Maximum number of ego-items in e_info.txt
1042  */
1043 u16b max_e_idx;
1044
1045 /*
1046  * Maximum number of dungeon in e_info.txt
1047  */
1048 u16b max_d_idx;
1049
1050 /*
1051  * Maximum number of objects in the level
1052  */
1053 u16b max_o_idx;
1054
1055 /*
1056  * Maximum number of monsters in the level
1057  */
1058 u16b max_m_idx;
1059
1060 /*
1061  * Maximum size of the wilderness
1062  */
1063 s32b max_wild_x;
1064 s32b max_wild_y;
1065
1066 /*
1067  * Quest info
1068  */
1069 quest_type *quest;
1070
1071 /*
1072  * Quest text
1073  */
1074 char quest_text[10][80];
1075
1076 /*
1077  * Current line of the quest text
1078  */
1079 int quest_text_line;
1080
1081 /*
1082  * Default spell color table (quark index)
1083  */
1084 s16b gf_color[MAX_GF];
1085
1086 /*
1087  * Flags for initialization
1088  */
1089 int init_flags;
1090
1091
1092 /*
1093  * The "highscore" file descriptor, if available.
1094  */
1095 int highscore_fd = -1;
1096
1097 int mutant_regenerate_mod = 100;
1098
1099 /*
1100  * Birth options
1101  */
1102 bool easy_band;
1103 bool vanilla_town;            /* Use "vanilla" town without set quests */
1104 bool ironman_shops;           /* Stores are permanently closed */
1105 bool ironman_small_levels;    /* Always create unusually small dungeon levels */
1106 bool ironman_downward;        /* Don't allow climbing upwards/recalling */
1107 bool ironman_autoscum;        /* Permanently enable the autoscummer */
1108 bool lite_town;               /* Use "lite" town without wilderness */
1109 bool ironman_empty_levels;    /* Always create empty 'arena' levels */
1110 bool ironman_rooms;           /* Always generate very unusual rooms */
1111 bool ironman_nightmare;                 /* Play the game in Nightmare mode */
1112 bool left_hander;
1113 bool preserve_mode;
1114 bool autoroller;
1115 bool autochara;
1116
1117
1118 bool can_save = FALSE;        /* Game can be saved */
1119
1120 s16b world_monster;
1121 bool world_player;
1122
1123 int cap_mon;
1124 int cap_mspeed;
1125 int cap_hp;
1126 int cap_maxhp;
1127 u16b cap_nickname;
1128
1129 s16b battle_mon[4];
1130 int sel_monster;
1131 int battle_odds;
1132 int kakekin;
1133 u32b mon_odds[4];
1134
1135 int pet_t_m_idx;
1136 int riding_t_m_idx;
1137
1138 s16b kubi_r_idx[MAX_KUBI];
1139 s16b today_mon;
1140
1141 monster_type party_mon[MAX_PARTY_MON];
1142
1143 bool write_level;
1144
1145 u32b playtime;
1146 u32b start_time;
1147
1148 int tsuri_dir;
1149
1150 bool sukekaku;
1151 bool new_mane;
1152
1153 bool mon_fight;
1154
1155 bool ambush_flag;
1156 bool generate_encounter;
1157
1158 cptr screen_dump = NULL;
1159
1160 /*
1161  * Which dungeon ?
1162  */
1163 byte dungeon_type;
1164 s16b *max_dlv;
1165
1166 byte feat_wall_outer;
1167 byte feat_wall_inner;
1168 byte feat_wall_solid;
1169 byte floor_type[100], fill_type[100];
1170
1171 bool now_damaged;
1172 s16b now_message;
1173 bool use_menu;
1174
1175 #ifdef CHUUKEI
1176 bool chuukei_server;
1177 bool chuukei_client;
1178 char *server_name;
1179 int server_port;
1180 #endif