OSDN Git Service

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