3 * @brief グローバル変数定義 / Angband variables
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke<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>
18 * Hack -- Link a copyright message into the executable
20 const concptr copyright[5] =
22 "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke",
24 "This software may be copied and distributed for educational, research,",
25 "and not for profit purposes provided that this copyright and statement",
26 "are included in all such copies."
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]; /*!< マクロの内容 */
36 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
42 byte h_ver_major; /* Savefile version for Hengband 1.1.1 and later */
47 byte sf_extra; /* Savefile's encoding key */
49 byte z_major; /* Savefile version for Hengband */
54 * Savefile information
56 u32b sf_system; /* Operating system info */
57 u32b sf_when; /* Time when savefile created */
58 u16b sf_lives; /* Number of past "lives" with this file */
59 u16b sf_saves; /* Number of "saves" during this life */
64 bool arg_fiddle; /* Command arg -- Request fiddle mode */
65 bool arg_wizard; /* Command arg -- Request wizard mode */
66 bool arg_sound; /* Command arg -- Request special sounds */
67 bool arg_music; /* Command arg -- Request special musics */
68 byte arg_graphics; /* Command arg -- Request graphics mode */
69 bool arg_monochrome; /* Command arg -- Request monochrome mode */
70 bool arg_force_original; /* Command arg -- Request original keyset */
71 bool arg_force_roguelike; /* Command arg -- Request roguelike keyset */
72 bool arg_bigtile = FALSE; /* Command arg -- Request big tile mode */
77 bool character_generated; /* The character exists */
78 bool character_dungeon; /* The character has a dungeon */
79 bool character_loaded; /* The character was loaded from a savefile */
80 bool character_saved; /* The character was just saved to a savefile */
82 bool character_icky; /* The game is in an icky full screen mode */
83 bool character_xtra; /* The game is in an icky startup mode */
85 bool creating_savefile; /* New savefile is currently created */
87 s16b command_cmd; /* Current "Angband Command" */
89 COMMAND_ARG command_arg; /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
90 COMMAND_NUM command_rep; /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
91 DIRECTION command_dir; /*!< 各種コマンドの汎用的な方向値処理として扱う/ Gives direction of current command */
93 s16b command_see; /* See "object1.c" */
94 s16b command_wrk; /* See "object1.c" */
96 TERM_LEN command_gap = 999; /* See "object1.c" */
98 s16b command_new; /* Command chaining from inven/equip view */
100 bool msg_flag; /* Used in msg_print() for "buffering" */
102 s16b running; /* Current counter for running, if any */
104 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
106 GAME_TURN old_battle;
108 bool use_sound; /* The "sound" mode is enabled */
109 bool use_music; /* The "music" mode is enabled */
110 bool use_graphics; /* The "graphics" mode is enabled */
111 bool use_bigtile = FALSE;
113 s16b signal_count; /* Hack -- Count interupts */
115 bool inkey_base; /* See the "inkey()" function */
116 bool inkey_xtra; /* See the "inkey()" function */
117 bool inkey_scan; /* See the "inkey()" function */
118 bool inkey_flag; /* See the "inkey()" function */
119 bool get_com_no_macros = FALSE; /* Expand macros in "get_com" or not */
121 OBJECT_SUBTYPE_VALUE coin_type; /* Hack -- force coin type */
123 bool opening_chest; /* Hack -- prevent chest generation */
125 bool shimmer_monsters; /* Hack -- optimize multi-hued monsters */
126 bool shimmer_objects; /* Hack -- optimize multi-hued objects */
128 bool repair_monsters; /* Hack -- optimize detect monsters */
129 bool repair_objects; /* Hack -- optimize detect objects */
131 bool is_loading_now; /*!< ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
133 MONSTER_IDX hack_m_idx = 0; /* Hack -- see "process_monsters()" */
134 MONSTER_IDX hack_m_idx_ii = 0;
136 bool multi_rew = FALSE;
137 char summon_kin_type; /* Hack, by Julian Lighton: summon 'relatives' */
139 int total_friends = 0;
140 int leaving_quest = 0;
141 bool reinit_wilderness = FALSE;
147 POSITION panel_row_min, panel_row_max;
148 POSITION panel_col_min, panel_col_max;
149 POSITION panel_col_prt, panel_row_prt;
153 * Targetting variables
155 MONSTER_IDX target_who;
168 * Stripped version of "player_name"
170 char player_base[32];
174 * Buffer to hold the current savefile name
175 * 'savefile' holds full path name. 'savefile_base' holds only base name.
178 char savefile_base[40];
185 * Number of active macros.
190 * Array of macro patterns [MACRO_MAX]
195 * Array of macro actions [MACRO_MAX]
200 * Array of macro types [MACRO_MAX]
205 * Current macro action [1024]
211 * The number of quarks
213 STR_OFFSET quark__num;
216 * The pointers to the quarks [QUARK_MAX]
222 * The next "free" index to use
227 * The index of the oldest message (none yet)
232 * The next "free" offset
237 * The offset to the oldest used char (none yet)
242 * The array of offsets, by index [MESSAGE_MAX]
247 * The array of chars, by offset [MESSAGE_BUF]
251 BIT_FLAGS option_flag[8]; //!< The array of normal options
252 BIT_FLAGS option_mask[8]; //!< The array of normal options
253 BIT_FLAGS window_flag[8]; //!< The array of window options
254 BIT_FLAGS window_mask[8]; //!< The array of window options
257 * The array of window pointers
259 term *angband_term[8];
262 * Standard window names
264 const char angband_term_name[8][16] =
278 * Global table of color definitions
280 byte angband_color_table[256][4] =
282 {0x00, 0x00, 0x00, 0x00}, /* TERM_DARK */
283 {0x00, 0xFF, 0xFF, 0xFF}, /* TERM_WHITE */
284 {0x00, 0x80, 0x80, 0x80}, /* TERM_SLATE */
285 {0x00, 0xFF, 0x80, 0x00}, /* TERM_ORANGE */
286 {0x00, 0xC0, 0x00, 0x00}, /* TERM_RED */
287 {0x00, 0x00, 0x80, 0x40}, /* TERM_GREEN */
288 {0x00, 0x00, 0x00, 0xFF}, /* TERM_BLUE */
289 {0x00, 0x80, 0x40, 0x00}, /* TERM_UMBER */
290 {0x00, 0x40, 0x40, 0x40}, /* TERM_L_DARK */
291 {0x00, 0xC0, 0xC0, 0xC0}, /* TERM_L_WHITE */
292 {0x00, 0xFF, 0x00, 0xFF}, /* TERM_VIOLET */
293 {0x00, 0xFF, 0xFF, 0x00}, /* TERM_YELLOW */
294 {0x00, 0xFF, 0x00, 0x00}, /* TERM_L_RED */
295 {0x00, 0x00, 0xFF, 0x00}, /* TERM_L_GREEN */
296 {0x00, 0x00, 0xFF, 0xFF}, /* TERM_L_BLUE */
297 {0x00, 0xC0, 0x80, 0x40} /* TERM_L_UMBER */
302 * Standard sound names
304 const concptr angband_sound_name[SOUND_MAX] =
376 * Standard music names
378 const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
405 * Number of floor_id used from birth
407 FLOOR_IDX max_floor_id;
410 * Sign for current process used in temporal files.
411 * Actually it is the start time of current process.
413 u32b saved_floor_file_sign;
416 * Specify attr/char pairs for visual special effects
417 * Be sure to use "index & 0x7F" to avoid illegal access
419 TERM_COLOR misc_to_attr[256];
420 SYMBOL_CODE misc_to_char[256];
424 * Specify attr/char pairs for p_ptr->inventory_list items (by tval)
425 * Be sure to use "index & 0x7F" to avoid illegal access
427 TERM_COLOR tval_to_attr[128];
428 SYMBOL_CODE tval_to_char[128];
432 * Keymaps for each "mode" associated with each keypress.
434 concptr keymap_act[KEYMAP_MODES][256];
438 /*** Player information ***/
441 * Static player info record
446 * Pointer to the player info
448 player_type *p_ptr = &p_body;
451 * Pointer to the player tables
452 * (sex, race, class, magic)
454 const player_sex *sp_ptr;
455 const player_race *rp_ptr;
456 const player_seikaku *ap_ptr;
459 concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
463 concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
465 concptr ANGBAND_KEYBOARD = "0";
468 concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
469 concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
470 concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
471 concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
472 concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
473 concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
474 concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
475 concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
476 concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
477 concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
478 concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
479 concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary)
480 concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms
481 concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
485 * Here is a "pseudo-hook" used during calls to "get_item()" and
486 * "show_inven()" and "show_equip()", and the choice window routines.
488 OBJECT_TYPE_VALUE item_tester_tval;
492 * Here is a "hook" used during calls to "get_item()" and
493 * "show_inven()" and "show_equip()", and the choice window routines.
495 bool (*item_tester_hook)(object_type*);
501 * Hack -- function hooks to restrict "get_mon_num_prep()" function
503 monsterrace_hook_type get_mon_num_hook;
504 monsterrace_hook_type get_mon_num2_hook;
508 * Hack -- function hook to restrict "get_obj_num_prep()" function
510 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
513 * Maximum number of quests
518 * Maximum number of monsters in r_info.txt
520 MONRACE_IDX max_r_idx;
523 * Maximum number of items in k_info.txt
525 KIND_OBJECT_IDX max_k_idx;
528 * Maximum number of vaults in v_info.txt
533 * Maximum number of terrain features in f_info.txt
538 * Maximum number of artifacts in a_info.txt
540 ARTIFACT_IDX max_a_idx;
543 * Maximum number of ego-items in e_info.txt
548 * Maximum number of dungeon in e_info.txt
550 DUNGEON_IDX max_d_idx;
556 char quest_text[10][80];
559 * Current line of the quest text
564 * Flags for initialization
570 * The "highscore" file descriptor, if available.
572 int highscore_fd = -1;
574 bool can_save = FALSE; /* Game can be saved */
581 STR_OFFSET cap_nickname;
583 MONRACE_IDX battle_mon[4];
589 MONSTER_IDX pet_t_m_idx;
590 MONSTER_IDX riding_t_m_idx;
592 MONSTER_IDX today_mon;
603 bool generate_encounter;
605 concptr screen_dump = NULL;
613 FEAT_IDX feat_wall_outer;
614 FEAT_IDX feat_wall_inner;
615 FEAT_IDX feat_wall_solid;
616 FEAT_IDX feat_ground_type[100], feat_wall_type[100];
618 COMMAND_CODE now_message;
633 bool reset_concent = FALSE; /* Concentration reset flag */
634 bool is_fired = FALSE;