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 * Information about "ego-items".
59 typedef struct ego_item_type ego_item_type;
63 STR_OFFSET name; /* Name (offset) */
64 STR_OFFSET text; /* Text (offset) */
66 INVENTORY_IDX slot; /*!< 装備部位 / Standard slot value */
67 PRICE rating; /*!< ベースアイテムからの価値加速 / Rating boost */
69 DEPTH level; /* Minimum level */
70 RARITY rarity; /* Object rarity */
72 HIT_PROB max_to_h; /* Maximum to-hit bonus */
73 HIT_POINT max_to_d; /* Maximum to-dam bonus */
74 ARMOUR_CLASS max_to_a; /* Maximum to-ac bonus */
76 PARAMETER_VALUE max_pval; /* Maximum pval */
78 PRICE cost; /* Ego-item "cost" */
80 BIT_FLAGS flags[TR_FLAG_SIZE]; /* Ego-Item Flags */
81 BIT_FLAGS gen_flags; /* flags for generate */
83 IDX act_idx; /* Activative ability index */
87 typedef struct mbe_info_type mbe_info_type;
91 int power; /* The attack "power" */
92 int explode_type; /* Explosion effect */
97 * An entry for the object/monster allocation functions
99 * Pass 1 is determined from allocation information
100 * Pass 2 is determined from allocation restriction
101 * Pass 3 is determined from allocation calculation
104 typedef struct alloc_entry alloc_entry;
108 KIND_OBJECT_IDX index; /* The actual index */
110 DEPTH level; /* Base dungeon level */
111 PROB prob1; /* Probability, pass 1 */
112 PROB prob2; /* Probability, pass 2 */
113 PROB prob3; /* Probability, pass 3 */
115 u16b total; /* Unused for now */
121 * A store, with an owner, various state flags, a current stock
122 * of items, and a table of items that are often purchased.
124 typedef struct store_type store_type;
128 byte type; /* Store type */
130 byte owner; /* Owner index */
131 byte extra; /* Unused for now */
133 s16b insult_cur; /* Insult counter */
135 s16b good_buy; /* Number of "good" buys */
136 s16b bad_buy; /* Number of "bad" buys */
138 s32b store_open; /* Closed until this current_world_ptr->game_turn */
140 s32b last_visit; /* Last visited on this current_world_ptr->game_turn */
142 s16b table_num; /* Table -- Number of entries */
143 s16b table_size; /* Table -- Total Size of Array */
144 s16b *table; /* Table -- Legal item kinds */
146 s16b stock_num; /* Stock -- Number of entries */
147 s16b stock_size; /* Stock -- Total Size of Array */
148 object_type *stock; /* Stock -- Actual stock items */
153 * The "name" of spell 'N' is stored as spell_names[X][N],
154 * where X is 0 for mage-spells and 1 for priest-spells.
156 typedef struct magic_type magic_type;
160 PLAYER_LEVEL slevel; /* Required level (to learn) */
161 MANA_POINT smana; /* Required mana (to cast) */
162 PERCENTAGE sfail; /* Minimum chance of failure */
163 EXP sexp; /* Encoded experience bonus */
171 typedef struct player_sex player_sex;
175 concptr title; /* Type of sex */
176 concptr winner; /* Name of winner */
178 concptr E_title; /* 英語性別 */
179 concptr E_winner; /* 英語性別 */
188 typedef struct player_race player_race;
192 concptr title; /* Type of race */
195 concptr E_title; /* 英語種族 */
197 s16b r_adj[6]; /* Racial stat bonuses */
199 s16b r_dis; /* disarming */
200 s16b r_dev; /* magic devices */
201 s16b r_sav; /* saving throw */
202 s16b r_stl; /* stealth */
203 s16b r_srh; /* search ability */
204 s16b r_fos; /* search frequency */
205 s16b r_thn; /* combat (normal) */
206 s16b r_thb; /* combat (shooting) */
208 byte r_mhp; /* Race hit-dice modifier */
209 byte r_exp; /* Race experience factor */
211 byte b_age; /* base age */
212 byte m_age; /* mod age */
214 byte m_b_ht; /* base height (males) */
215 byte m_m_ht; /* mod height (males) */
216 byte m_b_wt; /* base weight (males) */
217 byte m_m_wt; /* mod weight (males) */
219 byte f_b_ht; /* base height (females) */
220 byte f_m_ht; /* mod height (females) */
221 byte f_b_wt; /* base weight (females) */
222 byte f_m_wt; /* mod weight (females) */
224 byte infra; /* Infra-vision range */
226 u32b choice; /* Legal class choices */
227 /* byte choice_xtra; */
231 typedef struct player_seikaku player_seikaku;
232 struct player_seikaku
234 concptr title; /* Type of seikaku */
237 concptr E_title; /* 英語性格 */
240 s16b a_adj[6]; /* seikaku stat bonuses */
242 s16b a_dis; /* seikaku disarming */
243 s16b a_dev; /* seikaku magic devices */
244 s16b a_sav; /* seikaku saving throw */
245 s16b a_stl; /* seikaku stealth */
246 s16b a_srh; /* seikaku search ability */
247 s16b a_fos; /* seikaku search frequency */
248 s16b a_thn; /* seikaku combat (normal) */
249 s16b a_thb; /* seikaku combat (shooting) */
251 s16b a_mhp; /* Race hit-dice modifier */
254 byte sex; /* seibetu seigen */
260 * A structure to hold "rolled" information
262 typedef struct birther birther;
266 SEX_IDX psex; /* Sex index */
267 RACE_IDX prace; /* Race index */
268 CLASS_IDX pclass; /* Class index */
269 CHARACTER_IDX pseikaku; /* Seikaku index */
270 REALM_IDX realm1; /* First magic realm */
271 REALM_IDX realm2; /* Second magic realm */
278 PRICE au; /*!< 初期の所持金 */
280 BASE_STATUS stat_max[6]; /* Current "maximal" stat values */
281 BASE_STATUS stat_max_max[6]; /* Maximal "maximal" stat values */
282 HIT_POINT player_hp[PY_MAX_LEVEL];
284 PATRON_IDX chaos_patron;
294 /* For Monk martial arts */
296 typedef struct martial_arts martial_arts;
300 concptr desc; /* A verbose attack description */
301 PLAYER_LEVEL min_level; /* Minimum level to use */
302 int chance; /* Chance of 'success' */
303 int dd; /* Damage dice */
304 int ds; /* Damage sides */
305 int effect; /* Special effects */
308 typedef struct kamae kamae;
312 concptr desc; /* A verbose kamae description */
313 PLAYER_LEVEL min_level; /* Minimum level to use */
320 typedef struct monster_power monster_power;
334 * A structure describing a town with
335 * stores and buildings
337 typedef struct town_type town_type;
341 u32b seed; /* Seed for RNG */
342 store_type *store; /* The stores [MAX_STORES] */
349 typedef struct tag_type tag_type;
357 typedef bool (*monsterrace_hook_type)(MONRACE_IDX r_idx);
361 * This seems like a pretty standard "typedef"
363 typedef int (*inven_func)(object_type *);
368 FEAT_IDX feat; /* Feature tile */
369 PERCENTAGE percent; /* Chance of type */