OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / variable.c
1 /*!
2  * @file variable.c
3  * @brief グローバル変数定義 / Angband variables
4  * @date 2014/10/05
5  * @author
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke<br>
7  * <br>
8  * This software may be copied and distributed for educational, research,<br>
9  * and not for profit purposes provided that this copyright and statement<br>
10  * are included in all such copies.  Other copyrights may also apply.<br>
11  */
12
13 #include "angband.h"
14
15 /*!
16  * コピーライト情報 /
17  * Hack -- Link a copyright message into the executable
18  */
19 const 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; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
31 cptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
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 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
37
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 bool arg_music;                         /* Command arg -- Request special musics */
75 byte arg_graphics;                      /* Command arg -- Request graphics mode */
76 bool arg_monochrome;            /* Command arg -- Request monochrome mode */
77 bool arg_force_original;        /* Command arg -- Request original keyset */
78 bool arg_force_roguelike;       /* Command arg -- Request roguelike keyset */
79 bool arg_bigtile = FALSE;       /* Command arg -- Request big tile mode */
80
81 /*
82  * Various things
83  */
84 bool character_generated;       /* The character exists */
85 bool character_dungeon;         /* The character has a dungeon */
86 bool character_loaded;          /* The character was loaded from a savefile */
87 bool character_saved;           /* The character was just saved to a savefile */
88
89 bool character_icky;            /* The game is in an icky full screen mode */
90 bool character_xtra;            /* The game is in an icky startup mode */
91
92 bool creating_savefile;         /* New savefile is currently created */
93
94 u32b seed_flavor;               /* Hack -- consistent object colors */
95 u32b seed_town;                 /* Hack -- consistent town layout */
96
97 s16b command_cmd;               /* Current "Angband Command" */
98
99 COMMAND_ARG command_arg;        /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
100 COMMAND_NUM command_rep;        /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
101 DIRECTION command_dir;          /*!< 各種コマンドの汎用的な方向値処理として扱う/ Gives direction of current command */
102
103 s16b command_see;               /* See "object1.c" */
104 s16b command_wrk;               /* See "object1.c" */
105
106 TERM_LEN command_gap = 999;         /* See "object1.c" */
107
108 s16b command_new;               /* Command chaining from inven/equip view */
109
110 bool msg_flag;                  /* Used in msg_print() for "buffering" */
111
112 s16b running;                   /* Current counter for running, if any */
113 GAME_TURN resting;                      /* Current counter for resting, if any */
114
115 POSITION cur_hgt;               /* Current dungeon height */
116 POSITION cur_wid;               /* Current dungeon width */
117 DEPTH dun_level;                /*!< 現在の実ダンジョン階層、base_levelの参照元となる / Current dungeon level */
118 MONSTER_NUMBER num_repro; /*!< Current reproducer count */
119 DEPTH base_level;               /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
120 DEPTH object_level;             /*!< アイテムの生成レベル、base_levelを起点に一時変更する時に参照 / Current object creation level */
121 DEPTH monster_level;    /*!< モンスターの生成レベル、base_levelを起点に一時変更する時に参照 / Current monster creation level */
122 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
123
124 GAME_TURN turn;                         /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
125 GAME_TURN turn_limit;           /*!< turnの最大値 / Limit of game turn */
126 GAME_TURN dungeon_turn;                 /*!< NASTY生成の計算に関わる内部ターン値 / Game turn in dungeon */
127 GAME_TURN dungeon_turn_limit;   /*!< dungeon_turnの最大値 / Limit of game turn in dungeon */
128 GAME_TURN old_turn;                     /* Turn when level began */
129 GAME_TURN old_battle;
130
131 bool use_sound;                 /* The "sound" mode is enabled */
132 bool use_music;                 /* The "music" mode is enabled */
133 bool use_graphics;              /* The "graphics" mode is enabled */
134 bool use_bigtile = FALSE;
135
136 s16b signal_count;              /* Hack -- Count interupts */
137
138 bool inkey_base;                /* See the "inkey()" function */
139 bool inkey_xtra;                /* See the "inkey()" function */
140 bool inkey_scan;                /* See the "inkey()" function */
141 bool inkey_flag;                /* See the "inkey()" function */
142 bool get_com_no_macros = FALSE; /* Expand macros in "get_com" or not */
143
144 OBJECT_SUBTYPE_VALUE coin_type; /* Hack -- force coin type */
145
146 bool opening_chest;             /* Hack -- prevent chest generation */
147
148 bool shimmer_monsters;  /* Hack -- optimize multi-hued monsters */
149 bool shimmer_objects;   /* Hack -- optimize multi-hued objects */
150
151 bool repair_monsters;   /* Hack -- optimize detect monsters */
152 bool repair_objects;    /* Hack -- optimize detect objects */
153
154 bool is_loading_now;    /*!< ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
155 bool hack_mutation;
156
157 s16b inven_cnt;                 /* Number of items in inventory */
158 s16b equip_cnt;                 /* Number of items in equipment */
159
160 s16b o_max = 1;                 /* Number of allocated objects */
161 s16b o_cnt = 0;                 /* Number of live objects */
162
163 MONSTER_IDX m_max = 1;                  /* Number of allocated monsters */
164 MONSTER_IDX m_cnt = 0;                  /* Number of live monsters */
165
166 MONSTER_IDX hack_m_idx = 0;     /* Hack -- see "process_monsters()" */
167 MONSTER_IDX hack_m_idx_ii = 0;
168 bool multi_rew = FALSE;
169 char summon_kin_type;   /* Hack, by Julian Lighton: summon 'relatives' */
170
171 int total_friends = 0;
172 s32b friend_align = 0;
173
174 int leaving_quest = 0;
175 bool reinit_wilderness = FALSE;
176
177
178
179 /*
180  * Dungeon variables
181  */
182
183 bool closing_flag;              /* Dungeon is closing */
184
185
186 /*
187  * Dungeon size info
188  */
189
190 POSITION panel_row_min, panel_row_max;
191 POSITION panel_col_min, panel_col_max;
192 POSITION panel_col_prt, panel_row_prt;
193
194
195 /*
196  * Targetting variables
197  */
198 IDX target_who;
199 POSITION target_col;
200 POSITION target_row;
201
202
203 /*
204  * User info
205  */
206 int player_uid;
207 int player_euid;
208 int player_egid;
209
210 /*
211  * Stripped version of "player_name"
212  */
213 char player_base[32];
214
215
216 /*
217  * Buffer to hold the current savefile name
218  * 'savefile' holds full path name. 'savefile_base' holds only base name.
219  */
220 char savefile[1024];
221 char savefile_base[40];
222
223 /*
224  * Array of grids lit by player lite (see "cave.c")
225  */
226 POSITION_IDX lite_n;
227 POSITION lite_y[LITE_MAX];
228 POSITION lite_x[LITE_MAX];
229
230 /*
231  * Array of grids lit by player lite (see "cave.c")
232  */
233 POSITION_IDX mon_lite_n;
234 POSITION mon_lite_y[MON_LITE_MAX];
235 POSITION mon_lite_x[MON_LITE_MAX];
236
237 /*
238  * Array of grids viewable to the player (see "cave.c")
239  */
240 POSITION_IDX view_n;
241 POSITION view_y[VIEW_MAX];
242 POSITION view_x[VIEW_MAX];
243
244 /*
245  * Array of grids for use by various functions (see "cave.c")
246  */
247 POSITION_IDX temp_n;
248 POSITION temp_y[TEMP_MAX];
249 POSITION temp_x[TEMP_MAX];
250
251 /*
252  * Array of grids for delayed visual updating (see "cave.c")
253  */
254 POSITION_IDX redraw_n = 0;
255 POSITION redraw_y[REDRAW_MAX];
256 POSITION redraw_x[REDRAW_MAX];
257
258
259 /*
260  * Number of active macros.
261  */
262 s16b macro__num;
263
264 /*
265  * Array of macro patterns [MACRO_MAX]
266  */
267 cptr *macro__pat;
268
269 /*
270  * Array of macro actions [MACRO_MAX]
271  */
272 cptr *macro__act;
273
274 /*
275  * Array of macro types [MACRO_MAX]
276  */
277 bool *macro__cmd;
278
279 /*
280  * Current macro action [1024]
281  */
282 char *macro__buf;
283
284
285 /*
286  * The number of quarks
287  */
288 STR_OFFSET quark__num;
289
290 /*
291  * The pointers to the quarks [QUARK_MAX]
292  */
293 cptr *quark__str;
294
295
296 /*
297  * The next "free" index to use
298  */
299 u32b message__next;
300
301 /*
302  * The index of the oldest message (none yet)
303  */
304 u32b message__last;
305
306 /*
307  * The next "free" offset
308  */
309 u32b message__head;
310
311 /*
312  * The offset to the oldest used char (none yet)
313  */
314 u32b message__tail;
315
316 /*
317  * The array of offsets, by index [MESSAGE_MAX]
318  */
319 u32b *message__ptr;
320
321 /*
322  * The array of chars, by offset [MESSAGE_BUF]
323  */
324 char *message__buf;
325
326 BIT_FLAGS option_flag[8]; //!< The array of normal options
327 BIT_FLAGS option_mask[8]; //!< The array of normal options
328 BIT_FLAGS window_flag[8]; //!< The array of window options
329 BIT_FLAGS window_mask[8]; //!< The array of window options
330
331 /*
332  * The array of window pointers
333  */
334 term *angband_term[8];
335
336 /*
337  * Standard window names
338  */
339 const char angband_term_name[8][16] =
340 {
341         "Hengband",
342         "Term-1",
343         "Term-2",
344         "Term-3",
345         "Term-4",
346         "Term-5",
347         "Term-6",
348         "Term-7"
349 };
350
351
352 /*
353  * Global table of color definitions
354  */
355 byte angband_color_table[256][4] =
356 {
357         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
358         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
359         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
360         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
361         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
362         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
363         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
364         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
365         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
366         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
367         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
368         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
369         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
370         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
371         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
372         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
373 };
374
375
376 /*
377  * Standard sound names
378  */
379 const cptr angband_sound_name[SOUND_MAX] =
380 {
381         "dummy",
382         "hit",
383         "miss",
384         "flee",
385         "drop",
386         "kill",
387         "level",
388         "death",
389         "study",
390         "teleport",
391         "shoot",
392         "quaff",
393         "zap",
394         "walk",
395         "tpother",
396         "hitwall",
397         "eat",
398         "store1",
399         "store2",
400         "store3",
401         "store4",
402         "dig",
403         "opendoor",
404         "shutdoor",
405         "tplevel",
406         "scroll",
407         "buy",
408         "sell",
409         "warn",
410         "rocket",
411         "n_kill",
412         "u_kill",
413         "quest",
414         "heal",
415         "x_heal",
416         "bite",
417         "claw",
418         "m_spell",
419         "summon",
420         "breath",
421         "ball",
422         "m_heal",
423         "atkspell",
424         "evil",
425         "touch",
426         "sting",
427         "crush",
428         "slime",
429         "wail",
430         "winner",
431         "fire",
432         "acid",
433         "elec",
434         "cold",
435         "illegal",
436         "fail",
437         "wakeup",
438         "invuln",
439         "fall",
440         "pain",
441         "destitem",
442         "moan",
443         "show",
444         "unused",
445         "explode",
446         "glass",
447         "reflect",
448 };
449
450 /*
451  * Standard music names
452  */
453 const cptr angband_music_basic_name[MUSIC_BASIC_MAX] =
454 {
455         "default",
456         "gameover",
457         "exit",
458         "town",
459         "field1",
460         "field2",
461         "field3",
462         "dun_low",
463         "dun_med",
464         "dun_high",
465         "feel1",
466         "feel2",
467         "winner",
468         "build",
469         "wild",
470         "quest",
471         "arena",
472         "battle",
473         "quest_clear",
474         "final_quest_clear",
475         "ambush",
476 };
477
478
479 /*
480  * The array of "cave grids" [MAX_WID][MAX_HGT].
481  * Not completely allocated, that would be inefficient
482  * Not completely hardcoded, that would overflow memory
483  */
484 cave_type *cave[MAX_HGT];
485
486
487 /*
488  * The array of saved floors
489  */
490 saved_floor_type saved_floors[MAX_SAVED_FLOORS];
491
492
493 /*
494  * Number of floor_id used from birth
495  */
496 s16b max_floor_id;
497
498
499 /*
500  * Sign for current process used in temporal files.
501  * Actually it is the start time of current process.
502  */
503 u32b saved_floor_file_sign;
504
505
506 /*
507  * The array of dungeon items [max_o_idx]
508  */
509 object_type *o_list;
510
511 /*
512  * The array of dungeon monsters [max_m_idx]
513  */
514 monster_type *m_list;
515
516 /*
517  * The array to process dungeon monsters [max_m_idx]
518  */
519 s16b *mproc_list[MAX_MTIMED];
520 s16b mproc_max[MAX_MTIMED]; /* Number of monsters to be processed */
521
522
523 /*
524  * Maximum number of towns
525  */
526 u16b max_towns;
527
528 /*
529  * The towns [max_towns]
530  */
531 town_type *town;
532
533
534 /*
535  * The player's inventory [INVEN_TOTAL]
536  */
537 object_type *inventory;
538
539
540 /*
541  * The size of "alloc_kind_table" (at most max_k_idx * 4)
542  */
543 s16b alloc_kind_size;
544
545 /*
546  * The entries in the "kind allocator table"
547  */
548 alloc_entry *alloc_kind_table;
549
550
551 /*
552  * The size of "alloc_race_table" (at most max_r_idx)
553  */
554 s16b alloc_race_size;
555
556 /*
557  * The entries in the "race allocator table"
558  */
559 alloc_entry *alloc_race_table;
560
561
562 /*
563  * Specify attr/char pairs for visual special effects
564  * Be sure to use "index & 0x7F" to avoid illegal access
565  */
566 TERM_COLOR misc_to_attr[256];
567 char misc_to_char[256];
568
569
570 /*
571  * Specify attr/char pairs for inventory items (by tval)
572  * Be sure to use "index & 0x7F" to avoid illegal access
573  */
574 TERM_COLOR tval_to_attr[128];
575 char tval_to_char[128];
576
577
578 /*
579  * Keymaps for each "mode" associated with each keypress.
580  */
581 cptr keymap_act[KEYMAP_MODES][256];
582
583
584
585 /*** Player information ***/
586
587 /*
588  * Static player info record
589  */
590 player_type p_body;
591
592 /*
593  * Pointer to the player info
594  */
595 player_type *p_ptr = &p_body;
596
597 /*
598  * Pointer to the player tables
599  * (sex, race, class, magic)
600  */
601 const player_sex *sp_ptr;
602 const player_race *rp_ptr;
603 const player_class *cp_ptr;
604 const player_seikaku *ap_ptr;
605 const player_magic *mp_ptr;
606
607
608 /*
609  * The last character rolled,
610  * holded for quick start
611  */
612 birther previous_char;
613
614
615 /*
616  * The vault generation arrays
617  */
618 vault_type *v_info;
619 char *v_name;
620 char *v_text;
621
622 /*
623  * The skill table
624  */
625 skill_table *s_info;
626
627 /*
628  * The magic info
629  */
630 player_magic *m_info;
631
632 /*
633  * The terrain feature arrays
634  */
635 feature_type *f_info;
636 char *f_name;
637 char *f_tag;
638
639 /*
640  * The object kind arrays
641  */
642 object_kind *k_info;
643 char *k_name;
644 char *k_text;
645
646 /*
647  * The artifact arrays
648  */
649 artifact_type *a_info;
650 char *a_name;
651 char *a_text;
652
653 /*
654  * The ego-item arrays
655  */
656 ego_item_type *e_info;
657 char *e_name;
658 char *e_text;
659
660
661 /*
662  * The monster race arrays
663  */
664 monster_race *r_info;
665 char *r_name;
666 char *r_text;
667
668
669 /*
670  * The dungeon arrays
671  */
672 dungeon_info_type *d_info;
673 char *d_name;
674 char *d_text;
675
676
677 cptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
678
679
680 #ifdef JP
681 cptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
682 #else
683 cptr ANGBAND_KEYBOARD = "0";
684 #endif
685
686 cptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
687 cptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
688 cptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
689 cptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
690 cptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
691 cptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
692 cptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
693 cptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
694 cptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
695 cptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
696 cptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
697 cptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
698 cptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
699 cptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
700 bool item_tester_full; //!< Total Hack -- allow all items to be listed (even empty ones) This is only used by "do_cmd_inven_e()" and is cleared there.
701
702 bool item_tester_no_ryoute = FALSE;
703
704 /*
705  * Here is a "pseudo-hook" used during calls to "get_item()" and
706  * "show_inven()" and "show_equip()", and the choice window routines.
707  */
708 OBJECT_TYPE_VALUE item_tester_tval;
709
710
711 /*
712  * Here is a "hook" used during calls to "get_item()" and
713  * "show_inven()" and "show_equip()", and the choice window routines.
714  */
715 bool (*item_tester_hook)(object_type*);
716
717
718
719 /*
720  * Current "comp" function for ang_sort()
721  */
722 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
723
724
725 /*
726  * Current "swap" function for ang_sort()
727  */
728 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
729
730
731
732 /*
733  * Hack -- function hooks to restrict "get_mon_num_prep()" function
734  */
735 monster_hook_type get_mon_num_hook;
736 monster_hook_type get_mon_num2_hook;
737
738
739 /*
740  * Hack -- function hook to restrict "get_obj_num_prep()" function
741  */
742 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
743
744
745 /* Hack, monk armour */
746 bool monk_armour_aux;
747 bool monk_notify_aux;
748
749
750 /*
751  * Wilderness
752  */
753 wilderness_type **wilderness;
754
755
756 /*
757  * Buildings
758  */
759 building_type building[MAX_BLDG];
760
761
762 /*
763  * Maximum number of quests
764  */
765 QUEST_IDX max_q_idx;
766
767 /*
768  * Maximum number of monsters in r_info.txt
769  */
770 MONRACE_IDX max_r_idx;
771
772 /*
773  * Maximum number of items in k_info.txt
774  */
775 KIND_OBJECT_IDX max_k_idx;
776
777 /*
778  * Maximum number of vaults in v_info.txt
779  */
780 IDX max_v_idx;
781
782 /*
783  * Maximum number of terrain features in f_info.txt
784  */
785 IDX max_f_idx;
786
787 /*
788  * Maximum number of artifacts in a_info.txt
789  */
790 ARTIFACT_IDX max_a_idx;
791
792 /*
793  * Maximum number of ego-items in e_info.txt
794  */
795 IDX max_e_idx;
796
797 /*
798  * Maximum number of dungeon in e_info.txt
799  */
800 DUNGEON_IDX max_d_idx;
801
802 /*
803  * Maximum number of objects in the level
804  */
805 OBJECT_IDX max_o_idx;
806
807 /*
808  * Maximum number of monsters in the level
809  */
810 MONSTER_IDX max_m_idx;
811
812 /*
813  * Maximum size of the wilderness
814  */
815 POSITION max_wild_x;
816 POSITION max_wild_y;
817
818 /*
819  * Quest info
820  */
821 quest_type *quest;
822
823 /*
824  * Quest text
825  */
826 char quest_text[10][80];
827
828 /*
829  * Current line of the quest text
830  */
831 int quest_text_line;
832
833 /*
834  * Default spell color table (quark index)
835  */
836 s16b gf_color[MAX_GF];
837
838 /*
839  * Flags for initialization
840  */
841 int init_flags;
842
843
844 /*
845  * The "highscore" file descriptor, if available.
846  */
847 int highscore_fd = -1;
848
849 int mutant_regenerate_mod = 100;
850
851 bool can_save = FALSE;        /* Game can be saved */
852
853 s16b world_monster;
854 bool world_player;
855
856 int cap_mon;
857 int cap_mspeed;
858 HIT_POINT cap_hp;
859 HIT_POINT cap_maxhp;
860 STR_OFFSET cap_nickname;
861
862 MONRACE_IDX battle_mon[4];
863 int sel_monster;
864 int battle_odds;
865 PRICE kakekin;
866 u32b mon_odds[4];
867
868 MONSTER_IDX pet_t_m_idx;
869 MONSTER_IDX riding_t_m_idx;
870
871 MONSTER_IDX kubi_r_idx[MAX_KUBI];
872 MONSTER_IDX today_mon;
873
874 bool write_level;
875
876 u32b playtime;
877 u32b start_time;
878
879 int tsuri_dir;
880
881 bool sukekaku;
882 bool new_mane;
883
884 bool mon_fight;
885
886 bool ambush_flag;
887 bool generate_encounter;
888
889 cptr screen_dump = NULL;
890
891 /*** Terrain feature variables ***/
892
893 /* Nothing */
894 FEAT_IDX feat_none;
895
896 /* Floor */
897 FEAT_IDX feat_floor;
898
899 /* Objects */
900 FEAT_IDX feat_glyph;
901 FEAT_IDX feat_explosive_rune;
902 FEAT_IDX feat_mirror;
903
904 /* Doors */
905 door_type feat_door[MAX_DOOR_TYPES];
906
907 /* Stairs */
908 FEAT_IDX feat_up_stair;
909 FEAT_IDX feat_down_stair;
910 FEAT_IDX feat_entrance;
911
912 /* Special traps */
913 FEAT_IDX feat_trap_open;
914 FEAT_IDX feat_trap_armageddon;
915 FEAT_IDX feat_trap_piranha;
916
917 /* Rubble */
918 FEAT_IDX feat_rubble;
919
920 /* Seams */
921 FEAT_IDX feat_magma_vein;
922 FEAT_IDX feat_quartz_vein;
923
924 /* Walls */
925 FEAT_IDX feat_granite;
926 FEAT_IDX feat_permanent;
927
928 /* Glass floor */
929 FEAT_IDX feat_glass_floor;
930
931 /* Glass walls */
932 FEAT_IDX feat_glass_wall;
933 FEAT_IDX feat_permanent_glass_wall;
934
935 /* Pattern */
936 FEAT_IDX feat_pattern_start;
937 FEAT_IDX feat_pattern_1;
938 FEAT_IDX feat_pattern_2;
939 FEAT_IDX feat_pattern_3;
940 FEAT_IDX feat_pattern_4;
941 FEAT_IDX feat_pattern_end;
942 FEAT_IDX feat_pattern_old;
943 FEAT_IDX feat_pattern_exit;
944 FEAT_IDX feat_pattern_corrupted;
945
946 /* Various */
947 FEAT_IDX feat_black_market;
948 FEAT_IDX feat_town;
949
950 /* Terrains */
951 FEAT_IDX feat_deep_water;
952 FEAT_IDX feat_shallow_water;
953 FEAT_IDX feat_deep_lava;
954 FEAT_IDX feat_shallow_lava;
955 FEAT_IDX feat_dirt;
956 FEAT_IDX feat_grass;
957 FEAT_IDX feat_flower;
958 FEAT_IDX feat_brake;
959 FEAT_IDX feat_tree;
960 FEAT_IDX feat_mountain;
961 FEAT_IDX feat_swamp;
962
963 /* Unknown grid (not detected) */
964 FEAT_IDX feat_undetected;
965
966 /*
967  * Which dungeon ?
968  */
969 DUNGEON_IDX dungeon_type;
970 DEPTH *max_dlv;
971
972 FEAT_IDX feat_wall_outer;
973 FEAT_IDX feat_wall_inner;
974 FEAT_IDX feat_wall_solid;
975 FEAT_IDX floor_type[100], fill_type[100];
976
977 bool now_damaged;
978 COMMAND_CODE now_message;
979 bool use_menu;
980
981 #ifdef CHUUKEI
982 bool chuukei_server;
983 bool chuukei_client;
984 char *server_name;
985 int server_port;
986 #endif
987
988 /* for movie */
989 bool browsing_movie;
990
991 #ifdef TRAVEL
992 /* for travel */
993 travel_type travel;
994 #endif
995
996 /* for snipers */
997 int snipe_type = SP_NONE;
998 bool reset_concent = FALSE;   /* Concentration reset flag */
999 bool is_fired = FALSE;
1000