OSDN Git Service

[Refactor] #37353 inkey_* を util.c/h へ移動.
[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 s16b signal_count;              /* Hack -- Count interupts */
34
35 bool get_com_no_macros = FALSE; /* Expand macros in "get_com" or not */
36
37 OBJECT_SUBTYPE_VALUE coin_type; /* Hack -- force coin type */
38
39 bool repair_monsters;   /* Hack -- optimize detect monsters */
40 bool repair_objects;    /* Hack -- optimize detect objects */
41
42 MONSTER_IDX hack_m_idx = 0;     /* Hack -- see "process_monsters()" */
43 MONSTER_IDX hack_m_idx_ii = 0;
44
45 bool multi_rew = FALSE;
46
47 int total_friends = 0;
48 int leaving_quest = 0;
49 bool reinit_wilderness = FALSE;
50
51 /*
52  * Dungeon size info
53  */
54
55 POSITION panel_row_min, panel_row_max;
56 POSITION panel_col_min, panel_col_max;
57 POSITION panel_col_prt, panel_row_prt;
58
59
60 /*
61  * Targetting variables
62  */
63 MONSTER_IDX target_who;
64 POSITION target_col;
65 POSITION target_row;
66
67
68 /*
69  * User info
70  */
71 int player_uid;
72 int player_euid;
73 int player_egid;
74
75 /*
76  * Stripped version of "player_name"
77  */
78 char player_base[32];
79
80
81 /*
82  * Buffer to hold the current savefile name
83  * 'savefile' holds full path name. 'savefile_base' holds only base name.
84  */
85 char savefile[1024];
86 char savefile_base[40];
87
88
89 pos_list tmp_pos;
90
91
92 /*
93  * Number of active macros.
94  */
95 s16b macro__num;
96
97 /*
98  * Array of macro patterns [MACRO_MAX]
99  */
100 concptr *macro__pat;
101
102 /*
103  * Array of macro actions [MACRO_MAX]
104  */
105 concptr *macro__act;
106
107 /*
108  * Array of macro types [MACRO_MAX]
109  */
110 bool *macro__cmd;
111
112 /*
113  * Current macro action [1024]
114  */
115 char *macro__buf;
116
117
118 /*
119  * The number of quarks
120  */
121 STR_OFFSET quark__num;
122
123 /*
124  * The pointers to the quarks [QUARK_MAX]
125  */
126 concptr *quark__str;
127
128 /*
129  * The array of window pointers
130  */
131 term *angband_term[8];
132
133 /*
134  * Sign for current process used in temporal files.
135  * Actually it is the start time of current process.
136  */
137 u32b saved_floor_file_sign;
138
139
140 /*
141  * Keymaps for each "mode" associated with each keypress.
142  */
143 concptr keymap_act[KEYMAP_MODES][256];
144
145
146
147 /*** Player information ***/
148
149 /*
150  * Static player info record
151  */
152 player_type p_body;
153
154 /*
155  * Pointer to the player info
156  */
157 player_type *p_ptr = &p_body;
158
159
160 /*
161  * Here is a "pseudo-hook" used during calls to "get_item()" and
162  * "show_inven()" and "show_equip()", and the choice window routines.
163  */
164 OBJECT_TYPE_VALUE item_tester_tval;
165
166
167 /*
168  * Here is a "hook" used during calls to "get_item()" and
169  * "show_inven()" and "show_equip()", and the choice window routines.
170  */
171 bool (*item_tester_hook)(object_type*);
172
173
174
175
176 /*
177  * Hack -- function hooks to restrict "get_mon_num_prep()" function
178  */
179 monsterrace_hook_type get_mon_num_hook;
180 monsterrace_hook_type get_mon_num2_hook;
181
182
183 /*
184  * Hack -- function hook to restrict "get_obj_num_prep()" function
185  */
186 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
187
188
189 /*
190  * The "highscore" file descriptor, if available.
191  */
192 int highscore_fd = -1;
193
194 bool can_save = FALSE;        /* Game can be saved */
195
196
197 MONSTER_IDX pet_t_m_idx;
198 MONSTER_IDX riding_t_m_idx;
199
200 MONSTER_IDX today_mon;
201
202 u32b start_time;
203
204 bool sukekaku;
205 bool new_mane;
206
207 /*
208  * Which dungeon ?
209  */
210 DEPTH *max_dlv;
211
212 COMMAND_CODE now_message;
213 bool use_menu;
214
215 #ifdef CHUUKEI
216 bool chuukei_server;
217 bool chuukei_client;
218 char *server_name;
219 int server_port;
220 #endif
221
222 /* for movie */
223 bool browsing_movie;
224
225
226 /* for snipers */
227 bool reset_concent = FALSE;   /* Concentration reset flag */
228
229