OSDN Git Service

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