5 * @brief グローバルな構造体の定義 / global type declarations
9 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
10 * This software may be copied and distributed for educational, research,
11 * and not for profit purposes provided that this copyright and statement
12 * are included in all such copies. Other copyrights may also apply.
16 * このファイルはangband.hでのみインクルードすること。
17 * This file should ONLY be included by "angband.h"
19 * Note that "char" may or may not be signed, and that "signed char"
20 * may or may not work on all machines. So always use "s16b" or "s32b"
21 * for signed values. Also, note that unsigned values cause math problems
22 * in many cases, so try to only use "u16b" and "u32b" for "bit flags",
23 * unless you really need the extra bit of information, or you really
24 * need to restrict yourself to a single byte for storage reasons.
26 * Also, if possible, attempt to restrict yourself to sub-fields of
27 * known size (use "s16b" or "s32b" instead of "int", and "byte" instead
28 * of "bool"), and attempt to align all fields along four-byte words, to
29 * optimize storage issues on 32-bit machines. Also, avoid "bit flags"
30 * since these increase the code size and slow down execution. When
31 * you need to store bit flags, use one byte per flag, or, where space
32 * is an issue, use a "byte" or "u16b" or "u32b", and add special code
33 * to access the various bit flags.
35 * Many of these structures were developed to reduce the number of global
36 * variables, facilitate structured program design, allow the use of ascii
37 * template files, simplify access to indexed data, or facilitate efficient
38 * clearing of many variables at once.
40 * Certain data is saved in multiple places for efficient access, currently,
41 * this includes the tval/sval/weight fields in "object_type", various fields
42 * in "header_type", and the "m_idx" and "o_idx" fields in "grid_type". All
43 * of these could be removed, but this would, in general, slow down the game
44 * and increase the complexity of the code.
52 //#include "player-skill.h"
56 typedef struct mbe_info_type mbe_info_type;
60 int power; /* The attack "power" */
61 int explode_type; /* Explosion effect */
66 * An entry for the object/monster allocation functions
68 * Pass 1 is determined from allocation information
69 * Pass 2 is determined from allocation restriction
70 * Pass 3 is determined from allocation calculation
73 typedef struct alloc_entry alloc_entry;
77 KIND_OBJECT_IDX index; /* The actual index */
79 DEPTH level; /* Base dungeon level */
80 PROB prob1; /* Probability, pass 1 */
81 PROB prob2; /* Probability, pass 2 */
82 PROB prob3; /* Probability, pass 3 */
84 u16b total; /* Unused for now */
90 * A store, with an owner, various state flags, a current stock
91 * of items, and a table of items that are often purchased.
93 typedef struct store_type store_type;
97 byte type; /* Store type */
99 byte owner; /* Owner index */
100 byte extra; /* Unused for now */
102 s16b insult_cur; /* Insult counter */
104 s16b good_buy; /* Number of "good" buys */
105 s16b bad_buy; /* Number of "bad" buys */
107 s32b store_open; /* Closed until this current_world_ptr->game_turn */
109 s32b last_visit; /* Last visited on this current_world_ptr->game_turn */
111 s16b table_num; /* Table -- Number of entries */
112 s16b table_size; /* Table -- Total Size of Array */
113 s16b *table; /* Table -- Legal item kinds */
115 s16b stock_num; /* Stock -- Number of entries */
116 s16b stock_size; /* Stock -- Total Size of Array */
117 object_type *stock; /* Stock -- Actual stock items */
122 * The "name" of spell 'N' is stored as spell_names[X][N],
123 * where X is 0 for mage-spells and 1 for priest-spells.
125 typedef struct magic_type magic_type;
129 PLAYER_LEVEL slevel; /* Required level (to learn) */
130 MANA_POINT smana; /* Required mana (to cast) */
131 PERCENTAGE sfail; /* Minimum chance of failure */
132 EXP sexp; /* Encoded experience bonus */
140 typedef struct player_sex player_sex;
144 concptr title; /* Type of sex */
145 concptr winner; /* Name of winner */
147 concptr E_title; /* 英語性別 */
148 concptr E_winner; /* 英語性別 */
157 typedef struct player_race player_race;
161 concptr title; /* Type of race */
164 concptr E_title; /* 英語種族 */
166 s16b r_adj[6]; /* Racial stat bonuses */
168 s16b r_dis; /* disarming */
169 s16b r_dev; /* magic devices */
170 s16b r_sav; /* saving throw */
171 s16b r_stl; /* stealth */
172 s16b r_srh; /* search ability */
173 s16b r_fos; /* search frequency */
174 s16b r_thn; /* combat (normal) */
175 s16b r_thb; /* combat (shooting) */
177 byte r_mhp; /* Race hit-dice modifier */
178 byte r_exp; /* Race experience factor */
180 byte b_age; /* base age */
181 byte m_age; /* mod age */
183 byte m_b_ht; /* base height (males) */
184 byte m_m_ht; /* mod height (males) */
185 byte m_b_wt; /* base weight (males) */
186 byte m_m_wt; /* mod weight (males) */
188 byte f_b_ht; /* base height (females) */
189 byte f_m_ht; /* mod height (females) */
190 byte f_b_wt; /* base weight (females) */
191 byte f_m_wt; /* mod weight (females) */
193 byte infra; /* Infra-vision range */
195 u32b choice; /* Legal class choices */
196 /* byte choice_xtra; */
200 typedef struct player_seikaku player_seikaku;
201 struct player_seikaku
203 concptr title; /* Type of seikaku */
206 concptr E_title; /* 英語性格 */
209 s16b a_adj[6]; /* seikaku stat bonuses */
211 s16b a_dis; /* seikaku disarming */
212 s16b a_dev; /* seikaku magic devices */
213 s16b a_sav; /* seikaku saving throw */
214 s16b a_stl; /* seikaku stealth */
215 s16b a_srh; /* seikaku search ability */
216 s16b a_fos; /* seikaku search frequency */
217 s16b a_thn; /* seikaku combat (normal) */
218 s16b a_thb; /* seikaku combat (shooting) */
220 s16b a_mhp; /* Race hit-dice modifier */
223 byte sex; /* seibetu seigen */
229 * A structure to hold "rolled" information
231 typedef struct birther birther;
235 SEX_IDX psex; /* Sex index */
236 RACE_IDX prace; /* Race index */
237 CLASS_IDX pclass; /* Class index */
238 CHARACTER_IDX pseikaku; /* Seikaku index */
239 REALM_IDX realm1; /* First magic realm */
240 REALM_IDX realm2; /* Second magic realm */
247 PRICE au; /*!< 初期の所持金 */
249 BASE_STATUS stat_max[6]; /* Current "maximal" stat values */
250 BASE_STATUS stat_max_max[6]; /* Maximal "maximal" stat values */
251 HIT_POINT player_hp[PY_MAX_LEVEL];
253 PATRON_IDX chaos_patron;
263 /* For Monk martial arts */
265 typedef struct martial_arts martial_arts;
269 concptr desc; /* A verbose attack description */
270 PLAYER_LEVEL min_level; /* Minimum level to use */
271 int chance; /* Chance of 'success' */
272 int dd; /* Damage dice */
273 int ds; /* Damage sides */
274 int effect; /* Special effects */
277 typedef struct kamae kamae;
281 concptr desc; /* A verbose kamae description */
282 PLAYER_LEVEL min_level; /* Minimum level to use */
289 typedef struct monster_power monster_power;
305 typedef struct tag_type tag_type;
313 typedef bool (*monsterrace_hook_type)(MONRACE_IDX r_idx);
317 * This seems like a pretty standard "typedef"
319 typedef int (*inven_func)(object_type *);
324 FEAT_IDX feat; /* Feature tile */
325 PERCENTAGE percent; /* Chance of type */