OSDN Git Service

[Refactor] #37353 angband_sound_name と angband_music_basic_name を main-win.c へ移動.
[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 #include "geometry.h"
15
16 s16b command_cmd;               /* Current "Angband Command" */
17
18 COMMAND_ARG command_arg;        /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
19 COMMAND_NUM command_rep;        /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
20 DIRECTION command_dir;          /*!< 各種コマンドの汎用的な方向値処理として扱う/ Gives direction of current command */
21
22 s16b command_see;               /* See "object1.c" */
23 s16b command_wrk;               /* See "object1.c" */
24
25 TERM_LEN command_gap = 999;         /* See "object1.c" */
26
27 s16b command_new;               /* Command chaining from inven/equip view */
28
29 bool msg_flag;                  /* Used in msg_print() for "buffering" */
30
31 s16b running;                   /* Current counter for running, if any */
32
33 GAME_TURN old_battle;
34
35 s16b signal_count;              /* Hack -- Count interupts */
36
37 bool inkey_base;                /* See the "inkey()" function */
38 bool inkey_xtra;                /* See the "inkey()" function */
39 bool inkey_scan;                /* See the "inkey()" function */
40 bool inkey_flag;                /* See the "inkey()" function */
41 bool get_com_no_macros = FALSE; /* Expand macros in "get_com" or not */
42
43 OBJECT_SUBTYPE_VALUE coin_type; /* Hack -- force coin type */
44
45 bool repair_monsters;   /* Hack -- optimize detect monsters */
46 bool repair_objects;    /* Hack -- optimize detect objects */
47
48 MONSTER_IDX hack_m_idx = 0;     /* Hack -- see "process_monsters()" */
49 MONSTER_IDX hack_m_idx_ii = 0;
50
51 bool multi_rew = FALSE;
52
53 int total_friends = 0;
54 int leaving_quest = 0;
55 bool reinit_wilderness = FALSE;
56
57 /*
58  * Dungeon size info
59  */
60
61 POSITION panel_row_min, panel_row_max;
62 POSITION panel_col_min, panel_col_max;
63 POSITION panel_col_prt, panel_row_prt;
64
65
66 /*
67  * Targetting variables
68  */
69 MONSTER_IDX target_who;
70 POSITION target_col;
71 POSITION target_row;
72
73
74 /*
75  * User info
76  */
77 int player_uid;
78 int player_euid;
79 int player_egid;
80
81 /*
82  * Stripped version of "player_name"
83  */
84 char player_base[32];
85
86
87 /*
88  * Buffer to hold the current savefile name
89  * 'savefile' holds full path name. 'savefile_base' holds only base name.
90  */
91 char savefile[1024];
92 char savefile_base[40];
93
94
95 pos_list tmp_pos;
96
97
98 /*
99  * Number of active macros.
100  */
101 s16b macro__num;
102
103 /*
104  * Array of macro patterns [MACRO_MAX]
105  */
106 concptr *macro__pat;
107
108 /*
109  * Array of macro actions [MACRO_MAX]
110  */
111 concptr *macro__act;
112
113 /*
114  * Array of macro types [MACRO_MAX]
115  */
116 bool *macro__cmd;
117
118 /*
119  * Current macro action [1024]
120  */
121 char *macro__buf;
122
123
124 /*
125  * The number of quarks
126  */
127 STR_OFFSET quark__num;
128
129 /*
130  * The pointers to the quarks [QUARK_MAX]
131  */
132 concptr *quark__str;
133
134 /*
135  * The array of window pointers
136  */
137 term *angband_term[8];
138
139 /*
140  * Standard window names
141  */
142 const char angband_term_name[8][16] =
143 {
144         "Hengband",
145         "Term-1",
146         "Term-2",
147         "Term-3",
148         "Term-4",
149         "Term-5",
150         "Term-6",
151         "Term-7"
152 };
153
154
155 /*
156  * Global table of color definitions
157  */
158 byte angband_color_table[256][4] =
159 {
160         {0x00, 0x00, 0x00, 0x00},       /* TERM_DARK */
161         {0x00, 0xFF, 0xFF, 0xFF},       /* TERM_WHITE */
162         {0x00, 0x80, 0x80, 0x80},       /* TERM_SLATE */
163         {0x00, 0xFF, 0x80, 0x00},       /* TERM_ORANGE */
164         {0x00, 0xC0, 0x00, 0x00},       /* TERM_RED */
165         {0x00, 0x00, 0x80, 0x40},       /* TERM_GREEN */
166         {0x00, 0x00, 0x00, 0xFF},       /* TERM_BLUE */
167         {0x00, 0x80, 0x40, 0x00},       /* TERM_UMBER */
168         {0x00, 0x40, 0x40, 0x40},       /* TERM_L_DARK */
169         {0x00, 0xC0, 0xC0, 0xC0},       /* TERM_L_WHITE */
170         {0x00, 0xFF, 0x00, 0xFF},       /* TERM_VIOLET */
171         {0x00, 0xFF, 0xFF, 0x00},       /* TERM_YELLOW */
172         {0x00, 0xFF, 0x00, 0x00},       /* TERM_L_RED */
173         {0x00, 0x00, 0xFF, 0x00},       /* TERM_L_GREEN */
174         {0x00, 0x00, 0xFF, 0xFF},       /* TERM_L_BLUE */
175         {0x00, 0xC0, 0x80, 0x40}        /* TERM_L_UMBER */
176 };
177
178 /*
179  * Number of floor_id used from birth
180  */
181 FLOOR_IDX max_floor_id;
182
183 /*
184  * Sign for current process used in temporal files.
185  * Actually it is the start time of current process.
186  */
187 u32b saved_floor_file_sign;
188
189
190 /*
191  * Keymaps for each "mode" associated with each keypress.
192  */
193 concptr keymap_act[KEYMAP_MODES][256];
194
195
196
197 /*** Player information ***/
198
199 /*
200  * Static player info record
201  */
202 player_type p_body;
203
204 /*
205  * Pointer to the player info
206  */
207 player_type *p_ptr = &p_body;
208
209
210 /*
211  * Here is a "pseudo-hook" used during calls to "get_item()" and
212  * "show_inven()" and "show_equip()", and the choice window routines.
213  */
214 OBJECT_TYPE_VALUE item_tester_tval;
215
216
217 /*
218  * Here is a "hook" used during calls to "get_item()" and
219  * "show_inven()" and "show_equip()", and the choice window routines.
220  */
221 bool (*item_tester_hook)(object_type*);
222
223
224
225
226 /*
227  * Hack -- function hooks to restrict "get_mon_num_prep()" function
228  */
229 monsterrace_hook_type get_mon_num_hook;
230 monsterrace_hook_type get_mon_num2_hook;
231
232
233 /*
234  * Hack -- function hook to restrict "get_obj_num_prep()" function
235  */
236 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
237
238 /*
239  * Flags for initialization
240  */
241 int init_flags;
242
243
244 /*
245  * The "highscore" file descriptor, if available.
246  */
247 int highscore_fd = -1;
248
249 bool can_save = FALSE;        /* Game can be saved */
250
251
252 MONSTER_IDX pet_t_m_idx;
253 MONSTER_IDX riding_t_m_idx;
254
255 MONSTER_IDX today_mon;
256
257 u32b start_time;
258
259 bool sukekaku;
260 bool new_mane;
261
262 /*
263  * Which dungeon ?
264  */
265 DEPTH *max_dlv;
266
267 COMMAND_CODE now_message;
268 bool use_menu;
269
270 #ifdef CHUUKEI
271 bool chuukei_server;
272 bool chuukei_client;
273 char *server_name;
274 int server_port;
275 #endif
276
277 /* for movie */
278 bool browsing_movie;
279
280
281 /* for snipers */
282 bool reset_concent = FALSE;   /* Concentration reset flag */
283
284