OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[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
29 int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
30 concptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
31 concptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
32 concptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
33 concptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
34 concptr 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 POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "cave.c")
224 POSITION lite_y[LITE_MAX];
225 POSITION lite_x[LITE_MAX];
226
227 POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "cave.c")
228 POSITION mon_lite_y[MON_LITE_MAX];
229 POSITION mon_lite_x[MON_LITE_MAX];
230
231 POSITION_IDX view_n; //!< Array of grids viewable to the player (see "cave.c")
232 POSITION view_y[VIEW_MAX];
233 POSITION view_x[VIEW_MAX];
234
235 POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "cave.c")
236 POSITION temp_y[TEMP_MAX];
237 POSITION temp_x[TEMP_MAX];
238
239 POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "cave.c")
240 POSITION redraw_y[REDRAW_MAX];
241 POSITION redraw_x[REDRAW_MAX];
242
243
244 /*
245  * Number of active macros.
246  */
247 s16b macro__num;
248
249 /*
250  * Array of macro patterns [MACRO_MAX]
251  */
252 concptr *macro__pat;
253
254 /*
255  * Array of macro actions [MACRO_MAX]
256  */
257 concptr *macro__act;
258
259 /*
260  * Array of macro types [MACRO_MAX]
261  */
262 bool *macro__cmd;
263
264 /*
265  * Current macro action [1024]
266  */
267 char *macro__buf;
268
269
270 /*
271  * The number of quarks
272  */
273 STR_OFFSET quark__num;
274
275 /*
276  * The pointers to the quarks [QUARK_MAX]
277  */
278 concptr *quark__str;
279
280
281 /*
282  * The next "free" index to use
283  */
284 u32b message__next;
285
286 /*
287  * The index of the oldest message (none yet)
288  */
289 u32b message__last;
290
291 /*
292  * The next "free" offset
293  */
294 u32b message__head;
295
296 /*
297  * The offset to the oldest used char (none yet)
298  */
299 u32b message__tail;
300
301 /*
302  * The array of offsets, by index [MESSAGE_MAX]
303  */
304 u32b *message__ptr;
305
306 /*
307  * The array of chars, by offset [MESSAGE_BUF]
308  */
309 char *message__buf;
310
311 BIT_FLAGS option_flag[8]; //!< The array of normal options
312 BIT_FLAGS option_mask[8]; //!< The array of normal options
313 BIT_FLAGS window_flag[8]; //!< The array of window options
314 BIT_FLAGS window_mask[8]; //!< The array of window options
315
316 /*
317  * The array of window pointers
318  */
319 term *angband_term[8];
320
321 /*
322  * Standard window names
323  */
324 const char angband_term_name[8][16] =
325 {
326         "Hengband",
327         "Term-1",
328         "Term-2",
329         "Term-3",
330         "Term-4",
331         "Term-5",
332         "Term-6",
333         "Term-7"
334 };
335
336
337 /*
338  * Global table of color definitions
339  */
340 byte angband_color_table[256][4] =
341 {
342         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
343         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
344         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
345         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
346         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
347         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
348         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
349         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
350         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
351         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
352         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
353         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
354         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
355         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
356         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
357         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
358 };
359
360
361 /*
362  * Standard sound names
363  */
364 const concptr angband_sound_name[SOUND_MAX] =
365 {
366         "dummy",
367         "hit",
368         "miss",
369         "flee",
370         "drop",
371         "kill",
372         "level",
373         "death",
374         "study",
375         "teleport",
376         "shoot",
377         "quaff",
378         "zap",
379         "walk",
380         "tpother",
381         "hitwall",
382         "eat",
383         "store1",
384         "store2",
385         "store3",
386         "store4",
387         "dig",
388         "opendoor",
389         "shutdoor",
390         "tplevel",
391         "scroll",
392         "buy",
393         "sell",
394         "warn",
395         "rocket",
396         "n_kill",
397         "u_kill",
398         "quest",
399         "heal",
400         "x_heal",
401         "bite",
402         "claw",
403         "m_spell",
404         "summon",
405         "breath",
406         "ball",
407         "m_heal",
408         "atkspell",
409         "evil",
410         "touch",
411         "sting",
412         "crush",
413         "slime",
414         "wail",
415         "winner",
416         "fire",
417         "acid",
418         "elec",
419         "cold",
420         "illegal",
421         "fail",
422         "wakeup",
423         "invuln",
424         "fall",
425         "pain",
426         "destitem",
427         "moan",
428         "show",
429         "unused",
430         "explode",
431         "glass",
432         "reflect",
433 };
434
435 /*
436  * Standard music names
437  */
438 const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
439 {
440         "default",
441         "gameover",
442         "exit",
443         "town",
444         "field1",
445         "field2",
446         "field3",
447         "dun_low",
448         "dun_med",
449         "dun_high",
450         "feel1",
451         "feel2",
452         "winner",
453         "build",
454         "wild",
455         "quest",
456         "arena",
457         "battle",
458         "quest_clear",
459         "final_quest_clear",
460         "ambush",
461 };
462
463
464 /*
465  * The array of "cave grids" [MAX_WID][MAX_HGT].
466  * Not completely allocated, that would be inefficient
467  * Not completely hardcoded, that would overflow memory
468  */
469 cave_type *cave[MAX_HGT];
470
471
472 /*
473  * The array of saved floors
474  */
475 saved_floor_type saved_floors[MAX_SAVED_FLOORS];
476
477
478 /*
479  * Number of floor_id used from birth
480  */
481 s16b max_floor_id;
482
483
484 /*
485  * Sign for current process used in temporal files.
486  * Actually it is the start time of current process.
487  */
488 u32b saved_floor_file_sign;
489
490
491 /*
492  * The array of dungeon items [max_o_idx]
493  */
494 object_type *o_list;
495
496 /*
497  * The array of dungeon monsters [max_m_idx]
498  */
499 monster_type *m_list;
500
501 /*
502  * The array to process dungeon monsters [max_m_idx]
503  */
504 s16b *mproc_list[MAX_MTIMED];
505 s16b mproc_max[MAX_MTIMED]; /* Number of monsters to be processed */
506
507
508 /*
509  * Maximum number of towns
510  */
511 u16b max_towns;
512
513 /*
514  * The towns [max_towns]
515  */
516 town_type *town;
517
518
519 /*
520  * The player's inventory [INVEN_TOTAL]
521  */
522 object_type *inventory;
523
524
525 /*
526  * The size of "alloc_kind_table" (at most max_k_idx * 4)
527  */
528 s16b alloc_kind_size;
529
530 /*
531  * The entries in the "kind allocator table"
532  */
533 alloc_entry *alloc_kind_table;
534
535
536 /*
537  * The size of "alloc_race_table" (at most max_r_idx)
538  */
539 s16b alloc_race_size;
540
541 /*
542  * The entries in the "race allocator table"
543  */
544 alloc_entry *alloc_race_table;
545
546
547 /*
548  * Specify attr/char pairs for visual special effects
549  * Be sure to use "index & 0x7F" to avoid illegal access
550  */
551 TERM_COLOR misc_to_attr[256];
552 char misc_to_char[256];
553
554
555 /*
556  * Specify attr/char pairs for inventory items (by tval)
557  * Be sure to use "index & 0x7F" to avoid illegal access
558  */
559 TERM_COLOR tval_to_attr[128];
560 char tval_to_char[128];
561
562
563 /*
564  * Keymaps for each "mode" associated with each keypress.
565  */
566 concptr keymap_act[KEYMAP_MODES][256];
567
568
569
570 /*** Player information ***/
571
572 /*
573  * Static player info record
574  */
575 player_type p_body;
576
577 /*
578  * Pointer to the player info
579  */
580 player_type *p_ptr = &p_body;
581
582 /*
583  * Pointer to the player tables
584  * (sex, race, class, magic)
585  */
586 const player_sex *sp_ptr;
587 const player_race *rp_ptr;
588 const player_class *cp_ptr;
589 const player_seikaku *ap_ptr;
590 const player_magic *mp_ptr;
591
592
593 /*
594  * The last character rolled,
595  * holded for quick start
596  */
597 birther previous_char;
598
599
600 /*
601  * The vault generation arrays
602  */
603 vault_type *v_info;
604 char *v_name;
605 char *v_text;
606
607 /*
608  * The skill table
609  */
610 skill_table *s_info;
611
612 /*
613  * The magic info
614  */
615 player_magic *m_info;
616
617 /*
618  * The terrain feature arrays
619  */
620 feature_type *f_info;
621 char *f_name;
622 char *f_tag;
623
624 /*
625  * The object kind arrays
626  */
627 object_kind *k_info;
628 char *k_name;
629 char *k_text;
630
631 /*
632  * The artifact arrays
633  */
634 artifact_type *a_info;
635 char *a_name;
636 char *a_text;
637
638 /*
639  * The ego-item arrays
640  */
641 ego_item_type *e_info;
642 char *e_name;
643 char *e_text;
644
645
646 /*
647  * The monster race arrays
648  */
649 monster_race *r_info;
650 char *r_name;
651 char *r_text;
652
653
654 /*
655  * The dungeon arrays
656  */
657 dungeon_info_type *d_info;
658 char *d_name;
659 char *d_text;
660
661
662 concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
663
664
665 #ifdef JP
666 concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
667 #else
668 concptr ANGBAND_KEYBOARD = "0";
669 #endif
670
671 concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
672 concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
673 concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
674 concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
675 concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
676 concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
677 concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
678 concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
679 concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
680 concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
681 concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
682 concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
683 concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
684 concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
685
686
687 /*
688  * Here is a "pseudo-hook" used during calls to "get_item()" and
689  * "show_inven()" and "show_equip()", and the choice window routines.
690  */
691 OBJECT_TYPE_VALUE item_tester_tval;
692
693
694 /*
695  * Here is a "hook" used during calls to "get_item()" and
696  * "show_inven()" and "show_equip()", and the choice window routines.
697  */
698 bool (*item_tester_hook)(object_type*);
699
700
701
702 /*
703  * Current "comp" function for ang_sort()
704  */
705 bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
706
707
708 /*
709  * Current "swap" function for ang_sort()
710  */
711 void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
712
713
714
715 /*
716  * Hack -- function hooks to restrict "get_mon_num_prep()" function
717  */
718 monsterrace_hook_type get_mon_num_hook;
719 monsterrace_hook_type get_mon_num2_hook;
720
721
722 /*
723  * Hack -- function hook to restrict "get_obj_num_prep()" function
724  */
725 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
726
727
728 /* Hack, monk armour */
729 bool monk_armour_aux;
730 bool monk_notify_aux;
731
732
733 /*
734  * Wilderness
735  */
736 wilderness_type **wilderness;
737
738
739 /*
740  * Buildings
741  */
742 building_type building[MAX_BLDG];
743
744
745 /*
746  * Maximum number of quests
747  */
748 QUEST_IDX max_q_idx;
749
750 /*
751  * Maximum number of monsters in r_info.txt
752  */
753 MONRACE_IDX max_r_idx;
754
755 /*
756  * Maximum number of items in k_info.txt
757  */
758 KIND_OBJECT_IDX max_k_idx;
759
760 /*
761  * Maximum number of vaults in v_info.txt
762  */
763 IDX max_v_idx;
764
765 /*
766  * Maximum number of terrain features in f_info.txt
767  */
768 FEAT_IDX max_f_idx;
769
770 /*
771  * Maximum number of artifacts in a_info.txt
772  */
773 ARTIFACT_IDX max_a_idx;
774
775 /*
776  * Maximum number of ego-items in e_info.txt
777  */
778 IDX max_e_idx;
779
780 /*
781  * Maximum number of dungeon in e_info.txt
782  */
783 DUNGEON_IDX max_d_idx;
784
785 /*
786  * Maximum number of objects in the level
787  */
788 OBJECT_IDX max_o_idx;
789
790 /*
791  * Maximum number of monsters in the level
792  */
793 MONSTER_IDX max_m_idx;
794
795 /*
796  * Maximum size of the wilderness
797  */
798 POSITION max_wild_x;
799 POSITION max_wild_y;
800
801 /*
802  * Quest info
803  */
804 quest_type *quest;
805
806 /*
807  * Quest text
808  */
809 char quest_text[10][80];
810
811 /*
812  * Current line of the quest text
813  */
814 int quest_text_line;
815
816 /*
817  * Default spell color table (quark index)
818  */
819 s16b gf_color[MAX_GF];
820
821 /*
822  * Flags for initialization
823  */
824 int init_flags;
825
826
827 /*
828  * The "highscore" file descriptor, if available.
829  */
830 int highscore_fd = -1;
831
832 int mutant_regenerate_mod = 100;
833
834 bool can_save = FALSE;        /* Game can be saved */
835
836 s16b world_monster;
837 bool world_player;
838
839 int cap_mon;
840 int cap_mspeed;
841 HIT_POINT cap_hp;
842 HIT_POINT cap_maxhp;
843 STR_OFFSET cap_nickname;
844
845 MONRACE_IDX battle_mon[4];
846 int sel_monster;
847 int battle_odds;
848 PRICE kakekin;
849 u32b mon_odds[4];
850
851 MONSTER_IDX pet_t_m_idx;
852 MONSTER_IDX riding_t_m_idx;
853
854 MONSTER_IDX kubi_r_idx[MAX_KUBI];
855 MONSTER_IDX today_mon;
856
857 bool write_level;
858
859 u32b playtime;
860 u32b start_time;
861
862 bool sukekaku;
863 bool new_mane;
864
865 bool mon_fight;
866
867 bool ambush_flag;
868 bool generate_encounter;
869
870 concptr screen_dump = NULL;
871
872 /*** Terrain feature variables ***/
873
874 /* Nothing */
875 FEAT_IDX feat_none;
876
877 /* Floor */
878 FEAT_IDX feat_floor;
879
880 /* Objects */
881 FEAT_IDX feat_glyph;
882 FEAT_IDX feat_explosive_rune;
883 FEAT_IDX feat_mirror;
884
885 /* Doors */
886 door_type feat_door[MAX_DOOR_TYPES];
887
888 /* Stairs */
889 FEAT_IDX feat_up_stair;
890 FEAT_IDX feat_down_stair;
891 FEAT_IDX feat_entrance;
892
893 /* Special traps */
894 FEAT_IDX feat_trap_open;
895 FEAT_IDX feat_trap_armageddon;
896 FEAT_IDX feat_trap_piranha;
897
898 /* Rubble */
899 FEAT_IDX feat_rubble;
900
901 /* Seams */
902 FEAT_IDX feat_magma_vein;
903 FEAT_IDX feat_quartz_vein;
904
905 /* Walls */
906 FEAT_IDX feat_granite;
907 FEAT_IDX feat_permanent;
908
909 /* Glass floor */
910 FEAT_IDX feat_glass_floor;
911
912 /* Glass walls */
913 FEAT_IDX feat_glass_wall;
914 FEAT_IDX feat_permanent_glass_wall;
915
916 /* Pattern */
917 FEAT_IDX feat_pattern_start;
918 FEAT_IDX feat_pattern_1;
919 FEAT_IDX feat_pattern_2;
920 FEAT_IDX feat_pattern_3;
921 FEAT_IDX feat_pattern_4;
922 FEAT_IDX feat_pattern_end;
923 FEAT_IDX feat_pattern_old;
924 FEAT_IDX feat_pattern_exit;
925 FEAT_IDX feat_pattern_corrupted;
926
927 /* Various */
928 FEAT_IDX feat_black_market;
929 FEAT_IDX feat_town;
930
931 /* Terrains */
932 FEAT_IDX feat_deep_water;
933 FEAT_IDX feat_shallow_water;
934 FEAT_IDX feat_deep_lava;
935 FEAT_IDX feat_shallow_lava;
936 FEAT_IDX feat_heavy_cold_zone;
937 FEAT_IDX feat_cold_zone;
938 FEAT_IDX feat_heavy_electrical_zone;
939 FEAT_IDX feat_electrical_zone;
940 FEAT_IDX feat_deep_acid_puddle;
941 FEAT_IDX feat_shallow_acid_puddle;
942 FEAT_IDX feat_deep_poisonous_puddle;
943 FEAT_IDX feat_shallow_poisonous_puddle;
944 FEAT_IDX feat_dirt;
945 FEAT_IDX feat_grass;
946 FEAT_IDX feat_flower;
947 FEAT_IDX feat_brake;
948 FEAT_IDX feat_tree;
949 FEAT_IDX feat_mountain;
950 FEAT_IDX feat_swamp;
951
952 /* Unknown grid (not detected) */
953 FEAT_IDX feat_undetected;
954
955 /*
956  * Which dungeon ?
957  */
958 DUNGEON_IDX dungeon_type;
959 DEPTH *max_dlv;
960
961 FEAT_IDX feat_wall_outer;
962 FEAT_IDX feat_wall_inner;
963 FEAT_IDX feat_wall_solid;
964 FEAT_IDX floor_type[100], fill_type[100];
965
966 bool now_damaged;
967 COMMAND_CODE now_message;
968 bool use_menu;
969
970 #ifdef CHUUKEI
971 bool chuukei_server;
972 bool chuukei_client;
973 char *server_name;
974 int server_port;
975 #endif
976
977 /* for movie */
978 bool browsing_movie;
979
980 #ifdef TRAVEL
981 /* for travel */
982 travel_type travel;
983 #endif
984
985 /* for snipers */
986 int snipe_type = SP_NONE;
987 bool reset_concent = FALSE;   /* Concentration reset flag */
988 bool is_fired = FALSE;
989