3 #include "player-ability/player-ability-types.h"
4 #include "player/player-race-types.h"
5 #include "player/player-class-types.h"
6 #include "player/player-personality-types.h"
7 #include "system/angband.h"
8 #include "system/system-variables.h"
9 #include "util/flag-group.h"
15 enum class RF_ABILITY;
17 typedef struct floor_type floor_type;
18 typedef struct object_type object_type;
19 typedef struct player_type {
24 floor_type *current_floor_ptr{};
25 POSITION oldpy{}; /* Previous player location -KMW- */
26 POSITION oldpx{}; /* Previous player location -KMW- */
28 SEX_IDX psex{}; /* Sex index */
29 player_race_type prace{}; /* Race index */
30 player_class_type pclass{}; /* Class index */
31 player_personality_type pseikaku{}; /* Seikaku index */
32 REALM_IDX realm1{}; /* First magic realm */
33 REALM_IDX realm2{}; /* Second magic realm */
34 REALM_IDX element{}; //!< 元素使い領域番号 / Elementalist system index
35 player_personality_type oops{}; /* Unused */
37 DICE_SID hitdie{}; /* Hit dice (sides) */
38 u16b expfact{}; /* Experience factor
39 * Note: was byte, causing overflow for Amberite
40 * characters (such as Amberite Paladins)
43 s16b age{}; /* Characters age */
44 s16b ht{}; /* Height */
45 s16b wt{}; /* Weight */
46 s16b sc{}; /* Social Class */
48 PRICE au{}; /* Current Gold */
50 EXP max_max_exp{}; /* Max max experience (only to calculate score) */
51 EXP max_exp{}; /* Max experience */
52 EXP exp{}; /* Cur experience */
53 u32b exp_frac{}; /* Cur exp frac (times 2^16) */
55 PLAYER_LEVEL lev{}; /* Level */
57 TOWN_IDX town_num{}; /* Current town number */
58 s16b arena_number{}; /* monster number in on_defeat_arena_monster -KMW- */
59 bool phase_out{}; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
61 DUNGEON_IDX dungeon_idx{}; /* current dungeon index */
62 POSITION wilderness_x{}; /* Coordinates in the wilderness */
63 POSITION wilderness_y{};
66 HIT_POINT mhp{}; /* Max hit pts */
67 HIT_POINT chp{}; /* Cur hit pts */
68 u32b chp_frac{}; /* Cur hit frac (times 2^16) */
69 PERCENTAGE mutant_regenerate_mod{};
71 MANA_POINT msp{}; /* Max mana pts */
72 MANA_POINT csp{}; /* Cur mana pts */
73 u32b csp_frac{}; /* Cur mana frac (times 2^16) */
75 s16b max_plv{}; /* Max Player Level */
77 BASE_STATUS stat_max[A_MAX]{}; /* Current "maximal" stat values */
78 BASE_STATUS stat_max_max[A_MAX]{}; /* Maximal "maximal" stat values */
79 BASE_STATUS stat_cur[A_MAX]{}; /* Current "natural" stat values */
81 s16b learned_spells{};
86 TIME_EFFECT fast{}; /* Timed -- Fast */
87 TIME_EFFECT slow{}; /* Timed -- Slow */
88 TIME_EFFECT blind{}; /* Timed -- Blindness */
89 TIME_EFFECT paralyzed{}; /* Timed -- Paralysis */
90 TIME_EFFECT confused{}; /* Timed -- Confusion */
91 TIME_EFFECT afraid{}; /* Timed -- Fear */
92 TIME_EFFECT image{}; /* Timed -- Hallucination */
93 TIME_EFFECT poisoned{}; /* Timed -- Poisoned */
94 TIME_EFFECT cut{}; /* Timed -- Cut */
95 TIME_EFFECT stun{}; /* Timed -- Stun */
97 TIME_EFFECT protevil{}; /* Timed -- Protection */
98 TIME_EFFECT invuln{}; /* Timed -- Invulnerable */
99 TIME_EFFECT ult_res{}; /* Timed -- Ultimate Resistance */
100 TIME_EFFECT hero{}; /* Timed -- Heroism */
101 TIME_EFFECT shero{}; /* Timed -- Super Heroism */
102 TIME_EFFECT shield{}; /* Timed -- Shield Spell */
103 TIME_EFFECT blessed{}; /* Timed -- Blessed */
104 TIME_EFFECT tim_invis{}; /* Timed -- See Invisible */
105 TIME_EFFECT tim_infra{}; /* Timed -- Infra Vision */
106 TIME_EFFECT tsuyoshi{}; /* Timed -- Tsuyoshi Special */
107 TIME_EFFECT ele_attack{}; /* Timed -- Elemental Attack */
108 TIME_EFFECT ele_immune{}; /* Timed -- Elemental Immune */
110 TIME_EFFECT oppose_acid{}; /* Timed -- oppose acid */
111 TIME_EFFECT oppose_elec{}; /* Timed -- oppose lightning */
112 TIME_EFFECT oppose_fire{}; /* Timed -- oppose heat */
113 TIME_EFFECT oppose_cold{}; /* Timed -- oppose cold */
114 TIME_EFFECT oppose_pois{}; /* Timed -- oppose poison */
116 TIME_EFFECT tim_esp{}; /* Timed ESP */
117 TIME_EFFECT wraith_form{}; /* Timed wraithform */
119 TIME_EFFECT resist_magic{}; /* Timed Resist Magic (later) */
120 TIME_EFFECT tim_regen{};
121 TIME_EFFECT tim_pass_wall{};
122 TIME_EFFECT tim_stealth{};
123 TIME_EFFECT tim_levitation{};
124 TIME_EFFECT tim_sh_touki{};
125 TIME_EFFECT lightspeed{};
126 TIME_EFFECT tsubureru{};
127 TIME_EFFECT magicdef{};
128 TIME_EFFECT tim_res_nether{}; /* Timed -- Nether resistance */
129 TIME_EFFECT tim_res_time{}; /* Timed -- Time resistance */
130 MIMIC_RACE_IDX mimic_form{};
131 TIME_EFFECT tim_mimic{};
132 TIME_EFFECT tim_sh_fire{};
133 TIME_EFFECT tim_sh_holy{};
134 TIME_EFFECT tim_eyeeye{};
136 /* for mirror master */
137 TIME_EFFECT tim_reflect{}; /* Timed -- Reflect */
138 TIME_EFFECT multishadow{}; /* Timed -- Multi-shadow */
139 TIME_EFFECT dustrobe{}; /* Timed -- Robe of dust */
143 #define COMMAND_ARG_REST_UNTIL_DONE -2 /*!<休憩コマンド引数 … 必要な分だけ回復 */
144 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
145 GAME_TURN resting{}; /* Current counter for resting, if any */
147 PATRON_IDX chaos_patron{};
149 EnumClassFlagGroup<MUTA> muta{}; /*!< 突然変異 / mutations */
154 TIME_EFFECT word_recall{}; /* Word of recall counter */
155 TIME_EFFECT alter_reality{}; /* Alter reality counter */
156 DUNGEON_IDX recall_dungeon{}; /* Dungeon set to be recalled */
158 ENERGY energy_need{}; /* Energy needed for next move */
159 ENERGY enchant_energy_need{}; /* Energy needed for next upkeep effect */
161 FEED food{}; /* Current nutrition */
164 * p_ptr->special_attackによるプレイヤーの攻撃状態の定義 / Bit flags for the "p_ptr->special_attack" variable. -LM-
166 * Note: The elemental and poison attacks should be managed using the
167 * function "set_ele_attack", in spell2.c. This provides for timeouts and
168 * prevents the player from getting more than one at a time.
170 BIT_FLAGS special_attack{};
172 /* プレイヤーの防御状態の定義 / Bit flags for the "p_ptr->special_defense" variable. -LM- */
173 BIT_FLAGS special_defense{};
174 ACTION_IDX action{}; /* Currently action */
175 BIT_FLAGS spell_learned1{}; /* bit mask of spells learned */
176 BIT_FLAGS spell_learned2{}; /* bit mask of spells learned */
177 BIT_FLAGS spell_worked1{}; /* bit mask of spells tried and worked */
178 BIT_FLAGS spell_worked2{}; /* bit mask of spells tried and worked */
179 BIT_FLAGS spell_forgotten1{}; /* bit mask of spells learned but forgotten */
180 BIT_FLAGS spell_forgotten2{}; /* bit mask of spells learned but forgotten */
181 SPELL_IDX spell_order[64]{}; /* order spells learned/remembered/forgotten */
183 SUB_EXP spell_exp[64]{}; /* Proficiency of spells */
184 SUB_EXP weapon_exp[5][64]{}; /* Proficiency of weapons */
185 SUB_EXP skill_exp[MAX_SKILLS]{}; /* Proficiency of misc. skill */
187 MAGIC_NUM1 magic_num1[MAX_SPELLS]{}; /*!< Array for non-spellbook type magic */
188 MAGIC_NUM2 magic_num2[MAX_SPELLS]{}; /*!< 魔道具術師の取り込み済魔道具使用回数 / Flags for non-spellbook type magics */
190 RF_ABILITY mane_spell[MAX_MANE]{};
191 HIT_POINT mane_dam[MAX_MANE]{};
195 #define CONCENT_RADAR_THRESHOLD 2
196 #define CONCENT_TELE_THRESHOLD 5
197 s16b concent{}; /* Sniper's concentration level */
199 HIT_POINT player_hp[PY_MAX_LEVEL]{};
200 char died_from[MAX_MONSTER_NAME]{}; /* What killed the player */
201 concptr last_message{}; /* Last message on death or retirement */
202 char history[4][60]{}; /* Textual "history" for the Player */
204 u16b panic_save{}; /* Panic save */
206 bool wait_report_score{}; /* Waiting to report score */
207 bool is_dead{}; /* Player is dead */
210 BIT_FLAGS change_floor_mode{}; /*!<フロア移行処理に関するフラグ / Mode flags for changing floor */
212 bool reset_concent{}; /* Concentration reset flag */
214 MONSTER_IDX riding{}; /* Riding on a monster of this index */
216 #define KNOW_STAT 0x01
217 #define KNOW_HPRATE 0x02
218 BIT_FLAGS8 knowledge{}; /* Knowledge about yourself */
219 BIT_FLAGS visit{}; /* Visited towns */
221 player_race_type start_race{}; /* Race at birth */
222 BIT_FLAGS old_race1{}; /* Record of race changes */
223 BIT_FLAGS old_race2{}; /* Record of race changes */
224 s16b old_realm{}; /* Record of realm changes */
226 s16b pet_follow_distance{}; /* Length of the imaginary "leash" for pets */
227 s16b pet_extra_flags{}; /* Various flags for controling pets */
229 MONSTER_IDX today_mon{}; //!< 日替わり賞金首を知っていればそのモンスターID、知らなければ 0
231 bool dtrap{}; /* Whether you are on trap-safe grids */
232 FLOOR_IDX floor_id{}; /* Current floor location */
234 bool autopick_autoregister{}; /* auto register is in-use or not */
236 byte feeling{}; /* Most recent dungeon feeling */
237 s32b feeling_turn{}; /* The turn of the last dungeon feeling */
239 object_type *inventory_list{}; /* The player's inventory */
240 s16b inven_cnt{}; /* Number of items in inventory */
241 s16b equip_cnt{}; /* Number of items in equipment */
243 /*** Temporary fields ***/
245 bool select_ring_slot{};
247 bool playing{}; /* True if player is playing */
248 bool leaving{}; /* True if player is leaving */
250 bool monk_notify_aux{};
253 byte exit_bldg{}; /* Goal obtained in on_defeat_arena_monster? -KMW- */
255 bool leaving_dungeon{}; /* True if player is leaving the dungeon */
256 bool teleport_town{};
257 bool enter_dungeon{}; /* Just enter the dungeon */
259 IDX health_who{}; /* Health bar trackee */
261 MONRACE_IDX monster_race_idx{}; /* Monster race trackee */
263 KIND_OBJECT_IDX object_kind_idx{}; /* Object kind trackee */
265 s16b new_spells{}; /* Number of spells available */
268 s16b old_food_aux{}; /* Old value of food */
270 bool old_cumber_armor{};
271 bool old_cumber_glove{};
272 bool old_heavy_wield[2]{};
273 bool old_heavy_shoot{};
274 bool old_icky_wield[2]{};
275 bool old_riding_wield[2]{};
276 bool old_riding_ryoute{};
278 int extra_blows[2]{};
280 POSITION old_lite{}; /* Old radius of lite (if any) */
282 bool cumber_armor{}; /* Mana draining armor */
283 bool cumber_glove{}; /* Mana draining gloves */
284 bool heavy_wield[2]{}; /* Heavy weapon */
285 bool icky_wield[2]{}; /* Icky weapon */
286 bool riding_wield[2]{}; /* Riding weapon */
287 bool riding_ryoute{}; /* Riding weapon */
290 BIT_FLAGS easy_2weapon{};
291 BIT_FLAGS down_saving{};
293 POSITION cur_lite{}; /* Radius of lite (if any) */
295 BIT_FLAGS update{}; /* Pending Updates */
296 BIT_FLAGS redraw{}; /* Normal Redraws */
297 BIT_FLAGS window_flags{}; /* Window Redraws */
298 s16b stat_use[A_MAX]{}; /* Current modified stats */
299 s16b stat_top[A_MAX]{}; /* Maximal modified stats */
304 ALIGNMENT alignment{}; /* Good/evil/neutral */
307 DIRECTION fishing_dir{};
309 MONSTER_IDX pet_t_m_idx{};
310 MONSTER_IDX riding_t_m_idx{};
312 /*** Extracted fields ***/
314 s16b running{}; /* Current counter for running, if any */
315 bool suppress_multi_reward{}; /*!< 複数レベルアップ時のパトロンからの報酬多重受け取りを防止 */
317 s16b stat_add[A_MAX]{}; /* Modifiers to stat values */
318 s16b stat_index[A_MAX]{}; /* Indexes into stat tables */
320 bool hack_mutation{};
322 bool level_up_message{};
324 BIT_FLAGS anti_magic{}; /* Anti-magic */
325 BIT_FLAGS anti_tele{}; /* Prevent teleportation */
327 BIT_FLAGS cursed{}; /* Player is cursed */
329 bool can_swim{}; /* No damage falling */
330 BIT_FLAGS levitation{}; /* No damage falling */
331 BIT_FLAGS lite{}; /* Permanent light */
332 BIT_FLAGS free_act{}; /* Never paralyzed */
333 BIT_FLAGS see_inv{}; /* Can see invisible */
334 BIT_FLAGS regenerate{}; /* Regenerate hit pts */
335 BIT_FLAGS hold_exp{}; /* Resist exp draining */
337 BIT_FLAGS telepathy{}; /* Telepathy */
338 BIT_FLAGS esp_animal{};
339 BIT_FLAGS esp_undead{};
340 BIT_FLAGS esp_demon{};
342 BIT_FLAGS esp_troll{};
343 BIT_FLAGS esp_giant{};
344 BIT_FLAGS esp_dragon{};
345 BIT_FLAGS esp_human{};
346 BIT_FLAGS esp_evil{};
347 BIT_FLAGS esp_good{};
348 BIT_FLAGS esp_nonliving{};
349 BIT_FLAGS esp_unique{};
351 BIT_FLAGS slow_digest{}; /* Slower digestion */
352 BIT_FLAGS bless_blade{}; //!< 祝福された装備をしている / Blessed by inventory items
353 BIT_FLAGS xtra_might{}; /* Extra might bow */
354 BIT_FLAGS impact{}; //!< クリティカル率を上げる装備をしている / Critical blows
355 BIT_FLAGS earthquake{}; //!< 地震を起こす装備をしている / Earthquake blows
356 BIT_FLAGS dec_mana{};
357 BIT_FLAGS easy_spell{};
358 BIT_FLAGS heavy_spell{};
360 BIT_FLAGS mighty_throw{};
361 BIT_FLAGS see_nocto{}; /* Noctovision */
362 bool invoking_midnight_curse{};
364 DICE_NUMBER to_dd[2]{}; /* Extra dice/sides */
367 HIT_PROB dis_to_h[2]{}; /*!< 判明している現在の表記上の近接武器命中修正値 / Known bonus to hit (wield) */
368 HIT_PROB dis_to_h_b{}; /*!< 判明している現在の表記上の射撃武器命中修正値 / Known bonus to hit (bow) */
369 HIT_POINT dis_to_d[2]{}; /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
370 ARMOUR_CLASS dis_to_a{}; /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
371 ARMOUR_CLASS dis_ac{}; /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
373 s16b to_h[2]{}; /* Bonus to hit (wield) */
374 s16b to_h_b{}; /* Bonus to hit (bow) */
375 s16b to_h_m{}; /* Bonus to hit (misc) */
376 s16b to_d[2]{}; /* Bonus to dam (wield) */
377 s16b to_d_m{}; /* Bonus to dam (misc) */
378 ARMOUR_CLASS to_a{}; /* Bonus to ac */
380 s16b to_m_chance{}; /* Minusses to cast chance */
384 ARMOUR_CLASS ac{}; /*!< 装備無しの基本AC / Base ac */
386 ACTION_SKILL_POWER see_infra{}; /*!< 赤外線視能力の強さ /Infravision range */
387 ACTION_SKILL_POWER skill_dis{}; /*!< 行動技能値:解除能力 / Skill: Disarming */
388 ACTION_SKILL_POWER skill_dev{}; /*!< 行動技能値:魔道具使用 / Skill: Magic Devices */
389 ACTION_SKILL_POWER skill_sav{}; /*!< 行動技能値:魔法防御 / Skill: Saving throw */
390 ACTION_SKILL_POWER skill_stl{}; /*!< 行動技能値:隠密 / Skill: Stealth factor */
393 * 行動技能値:知覚 / Skill: Searching ability
394 * この値はsearch()による地形の隠し要素発見処理などで混乱、盲目、幻覚、無光源などの
395 * 状態異常がない限り、難易度修正などがないままそのままパーセンテージ値として使われる。
396 * 100以上ならば必ず全てのトラップなどを見つけることが出来る。
398 ACTION_SKILL_POWER skill_srh{};
400 ACTION_SKILL_POWER skill_fos{}; /*!< 行動技能値:探索 / Skill: Searching frequency */
401 ACTION_SKILL_POWER skill_thn{}; /*!< 行動技能値:打撃命中能力 / Skill: To hit (normal) */
402 ACTION_SKILL_POWER skill_thb{}; /*!< 行動技能値:射撃命中能力 / Skill: To hit (shooting) */
403 ACTION_SKILL_POWER skill_tht{}; /*!< 行動技能値:投射命中能力 / Skill: To hit (throwing) */
404 ACTION_SKILL_POWER skill_dig{}; /*!< 行動技能値:掘削 / Skill: Digging */
406 s16b num_blow[2]{}; /* Number of blows */
407 s16b num_fire{}; /* Number of shots */
409 byte tval_xtra{}; /* (Unused)Correct xtra tval */
410 byte tval_ammo{}; /* Correct ammo tval */
412 s16b pspeed{}; /*!< 現在の速度 / Current speed */
414 ENERGY energy_use{}; /*!< 直近のターンに消費したエネルギー / Energy use this turn */
416 POSITION y{}; /*!< ダンジョンの現在Y座標 / Player location in dungeon */
417 POSITION x{}; /*!< ダンジョンの現在X座標 / Player location in dungeon */
418 GAME_TEXT name[32]{}; /*!< 現在のプレイヤー名 / Current player's character name */
419 char base_name[32]{}; /*!< Stripped version of "player_name" */
422 extern player_type *p_ptr;