OSDN Git Service

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