OSDN Git Service

[Fix] 元素使い系統を第一領域と共有したことによる不具合
[hengbandforosx/hengbandosx.git] / src / player / player-status.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 /* 人畜無害なenumヘッダを先に読み込む */
6 #include "mutation/mutation-flag-types.h"
7 #include "player-info/base-status-types.h"
8 #include "player/player-classes-types.h"
9 #include "player/player-personalities-types.h"
10 #include "player/player-race-types.h"
11 #include "spell/spells-util.h"
12 #include "util/flag-group.h"
13
14 /*
15  * Most of the "player" information goes here.
16  *
17  * This stucture gives us a large collection of player variables.
18  *
19  * This structure contains several "blocks" of information.
20  *   (1) the "permanent" info
21  *   (2) the "variable" info
22  *   (3) the "transient" info
23  *
24  * All of the "permanent" info, and most of the "variable" info,
25  * is saved in the savefile.  The "transient" info is recomputed
26  * whenever anything important changes.
27  */
28
29 /*
30  * Player constants
31  */
32 #define PY_MAX_EXP 99999999L /*!< プレイヤー経験値の最大値 / Maximum exp */
33 #define PY_MAX_GOLD 999999999L /*!< プレイヤー所持金の最大値 / Maximum gold */
34 #define PY_MAX_LEVEL 50 /*!< プレイヤーレベルの最大値 / Maximum level */
35
36 #define GINOU_MAX 10
37 #define MAX_MANE 16
38
39 #define MAGIC_GLOVE_REDUCE_MANA 0x0001
40 #define MAGIC_FAIL_5PERCENT 0x0002
41 #define MAGIC_GAIN_EXP 0x0004
42
43 /* no_flowed 判定対象となるスペル */
44 #define SPELL_DD_S 27
45 #define SPELL_DD_T 13
46 #define SPELL_SW 22
47 #define SPELL_WALL 20
48
49 /*!< Empty hand status */
50 enum empty_hand_status {
51     EMPTY_HAND_NONE = 0x0000, /*!<Both hands are used */
52     EMPTY_HAND_SUB = 0x0001, /*!<Sub hand is empty */
53     EMPTY_HAND_MAIN = 0x0002 /*!<Main hand is empty */
54 };
55
56 /*!< Weapon hand status */
57 enum player_hand { PLAYER_HAND_MAIN = 0x0000, PLAYER_HAND_SUB = 0x0001, PLAYER_HAND_OTHER = 0x0002 };
58
59 /*
60  * Player sex constants (hard-coded by save-files, arrays, etc)
61  */
62 #define SEX_FEMALE 0
63 #define SEX_MALE 1
64 #define MAX_SEXES 2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
65
66 typedef struct floor_type floor_type;
67 typedef struct object_type object_type;
68
69 enum class RF_ABILITY;
70
71 typedef struct player_type {
72     int player_uid{};
73     int player_euid{};
74     int player_egid{};
75
76     floor_type *current_floor_ptr{};
77     POSITION oldpy{}; /* Previous player location -KMW- */
78     POSITION oldpx{}; /* Previous player location -KMW- */
79
80     SEX_IDX psex{}; /* Sex index */
81     player_race_type prace{}; /* Race index */
82     player_class_type pclass{}; /* Class index */
83     player_personality_type pseikaku{}; /* Seikaku index */
84     REALM_IDX realm1{}; /* First magic realm */
85     REALM_IDX realm2{}; /* Second magic realm */
86     REALM_IDX element{}; //!< 元素使い領域番号 / Elementalist system index
87     player_personality_type oops{}; /* Unused */
88
89     DICE_SID hitdie{}; /* Hit dice (sides) */
90     u16b expfact{}; /* Experience factor
91                    * Note: was byte, causing overflow for Amberite
92                    * characters (such as Amberite Paladins)
93                    */
94
95     s16b age{}; /* Characters age */
96     s16b ht{}; /* Height */
97     s16b wt{}; /* Weight */
98     s16b sc{}; /* Social Class */
99
100     PRICE au{}; /* Current Gold */
101
102     EXP max_max_exp{}; /* Max max experience (only to calculate score) */
103     EXP max_exp{}; /* Max experience */
104     EXP exp{}; /* Cur experience */
105     u32b exp_frac{}; /* Cur exp frac (times 2^16) */
106
107     PLAYER_LEVEL lev{}; /* Level */
108
109     TOWN_IDX town_num{}; /* Current town number */
110     s16b arena_number{}; /* monster number in on_defeat_arena_monster -KMW- */
111     bool phase_out{}; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
112
113     DUNGEON_IDX dungeon_idx{}; /* current dungeon index */
114     POSITION wilderness_x{}; /* Coordinates in the wilderness */
115     POSITION wilderness_y{};
116     bool wild_mode{};
117
118     HIT_POINT mhp{}; /* Max hit pts */
119     HIT_POINT chp{}; /* Cur hit pts */
120     u32b chp_frac{}; /* Cur hit frac (times 2^16) */
121     PERCENTAGE mutant_regenerate_mod{};
122
123     MANA_POINT msp{}; /* Max mana pts */
124     MANA_POINT csp{}; /* Cur mana pts */
125     u32b csp_frac{}; /* Cur mana frac (times 2^16) */
126
127     s16b max_plv{}; /* Max Player Level */
128
129     BASE_STATUS stat_max[A_MAX]{}; /* Current "maximal" stat values */
130     BASE_STATUS stat_max_max[A_MAX]{}; /* Maximal "maximal" stat values */
131     BASE_STATUS stat_cur[A_MAX]{}; /* Current "natural" stat values */
132
133     s16b learned_spells{};
134     s16b add_spells{};
135
136     u32b count{};
137
138     TIME_EFFECT fast{}; /* Timed -- Fast */
139     TIME_EFFECT slow{}; /* Timed -- Slow */
140     TIME_EFFECT blind{}; /* Timed -- Blindness */
141     TIME_EFFECT paralyzed{}; /* Timed -- Paralysis */
142     TIME_EFFECT confused{}; /* Timed -- Confusion */
143     TIME_EFFECT afraid{}; /* Timed -- Fear */
144     TIME_EFFECT image{}; /* Timed -- Hallucination */
145     TIME_EFFECT poisoned{}; /* Timed -- Poisoned */
146     TIME_EFFECT cut{}; /* Timed -- Cut */
147     TIME_EFFECT stun{}; /* Timed -- Stun */
148
149     TIME_EFFECT protevil{}; /* Timed -- Protection */
150     TIME_EFFECT invuln{}; /* Timed -- Invulnerable */
151     TIME_EFFECT ult_res{}; /* Timed -- Ultimate Resistance */
152     TIME_EFFECT hero{}; /* Timed -- Heroism */
153     TIME_EFFECT shero{}; /* Timed -- Super Heroism */
154     TIME_EFFECT shield{}; /* Timed -- Shield Spell */
155     TIME_EFFECT blessed{}; /* Timed -- Blessed */
156     TIME_EFFECT tim_invis{}; /* Timed -- See Invisible */
157     TIME_EFFECT tim_infra{}; /* Timed -- Infra Vision */
158     TIME_EFFECT tsuyoshi{}; /* Timed -- Tsuyoshi Special */
159     TIME_EFFECT ele_attack{}; /* Timed -- Elemental Attack */
160     TIME_EFFECT ele_immune{}; /* Timed -- Elemental Immune */
161
162     TIME_EFFECT oppose_acid{}; /* Timed -- oppose acid */
163     TIME_EFFECT oppose_elec{}; /* Timed -- oppose lightning */
164     TIME_EFFECT oppose_fire{}; /* Timed -- oppose heat */
165     TIME_EFFECT oppose_cold{}; /* Timed -- oppose cold */
166     TIME_EFFECT oppose_pois{}; /* Timed -- oppose poison */
167
168     TIME_EFFECT tim_esp{}; /* Timed ESP */
169     TIME_EFFECT wraith_form{}; /* Timed wraithform */
170
171     TIME_EFFECT resist_magic{}; /* Timed Resist Magic (later) */
172     TIME_EFFECT tim_regen{};
173     TIME_EFFECT tim_pass_wall{};
174     TIME_EFFECT tim_stealth{};
175     TIME_EFFECT tim_levitation{};
176     TIME_EFFECT tim_sh_touki{};
177     TIME_EFFECT lightspeed{};
178     TIME_EFFECT tsubureru{};
179     TIME_EFFECT magicdef{};
180     TIME_EFFECT tim_res_nether{}; /* Timed -- Nether resistance */
181     TIME_EFFECT tim_res_time{}; /* Timed -- Time resistance */
182     MIMIC_RACE_IDX mimic_form{};
183     TIME_EFFECT tim_mimic{};
184     TIME_EFFECT tim_sh_fire{};
185     TIME_EFFECT tim_sh_holy{};
186     TIME_EFFECT tim_eyeeye{};
187
188     /* for mirror master */
189     TIME_EFFECT tim_reflect{}; /* Timed -- Reflect */
190     TIME_EFFECT multishadow{}; /* Timed -- Multi-shadow */
191     TIME_EFFECT dustrobe{}; /* Timed -- Robe of dust */
192
193     bool timewalk{};
194
195 #define COMMAND_ARG_REST_UNTIL_DONE -2 /*!<休憩コマンド引数 … 必要な分だけ回復 */
196 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
197     GAME_TURN resting{}; /* Current counter for resting, if any */
198
199     PATRON_IDX chaos_patron{};
200
201     FlagGroup<MUTA> muta{}; /*!< 突然変異 / mutations */
202
203     s16b virtues[8]{};
204     s16b vir_types[8]{};
205
206     TIME_EFFECT word_recall{}; /* Word of recall counter */
207     TIME_EFFECT alter_reality{}; /* Alter reality counter */
208     DUNGEON_IDX recall_dungeon{}; /* Dungeon set to be recalled */
209
210     ENERGY energy_need{}; /* Energy needed for next move */
211     ENERGY enchant_energy_need{}; /* Energy needed for next upkeep effect        */
212
213     FEED food{}; /* Current nutrition */
214
215     /*
216      * p_ptr->special_attackによるプレイヤーの攻撃状態の定義 / Bit flags for the "p_ptr->special_attack" variable. -LM-
217      *
218      * Note:  The elemental and poison attacks should be managed using the
219      * function "set_ele_attack", in spell2.c.  This provides for timeouts and
220      * prevents the player from getting more than one at a time.
221      */
222     BIT_FLAGS special_attack{};
223
224     /* プレイヤーの防御状態の定義 / Bit flags for the "p_ptr->special_defense" variable. -LM- */
225     BIT_FLAGS special_defense{};
226     ACTION_IDX action{}; /* Currently action */
227     BIT_FLAGS spell_learned1{}; /* bit mask of spells learned */
228     BIT_FLAGS spell_learned2{}; /* bit mask of spells learned */
229     BIT_FLAGS spell_worked1{}; /* bit mask of spells tried and worked */
230     BIT_FLAGS spell_worked2{}; /* bit mask of spells tried and worked */
231     BIT_FLAGS spell_forgotten1{}; /* bit mask of spells learned but forgotten */
232     BIT_FLAGS spell_forgotten2{}; /* bit mask of spells learned but forgotten */
233     SPELL_IDX spell_order[64]{}; /* order spells learned/remembered/forgotten */
234
235     SUB_EXP spell_exp[64]{}; /* Proficiency of spells */
236     SUB_EXP weapon_exp[5][64]{}; /* Proficiency of weapons */
237     SUB_EXP skill_exp[GINOU_MAX]{}; /* Proficiency of misc. skill */
238
239     MAGIC_NUM1 magic_num1[MAX_SPELLS]{}; /*!< Array for non-spellbook type magic */
240     MAGIC_NUM2 magic_num2[MAX_SPELLS]{}; /*!< 魔道具術師の取り込み済魔道具使用回数 / Flags for non-spellbook type magics */
241
242     RF_ABILITY mane_spell[MAX_MANE]{};
243     HIT_POINT mane_dam[MAX_MANE]{};
244     s16b mane_num{};
245     bool new_mane{};
246
247 #define CONCENT_RADAR_THRESHOLD 2
248 #define CONCENT_TELE_THRESHOLD 5
249     s16b concent{}; /* Sniper's concentration level */
250
251     HIT_POINT player_hp[PY_MAX_LEVEL]{};
252     char died_from[MAX_MONSTER_NAME]{}; /* What killed the player */
253     concptr last_message{}; /* Last message on death or retirement */
254     char history[4][60]{}; /* Textual "history" for the Player */
255
256     u16b panic_save{}; /* Panic save */
257
258     bool wait_report_score{}; /* Waiting to report score */
259     bool is_dead{}; /* Player is dead */
260     bool now_damaged{};
261     bool ambush_flag{};
262     BIT_FLAGS change_floor_mode{}; /*!<フロア移行処理に関するフラグ / Mode flags for changing floor */
263
264     bool reset_concent{}; /* Concentration reset flag */
265
266     MONSTER_IDX riding{}; /* Riding on a monster of this index */
267
268 #define KNOW_STAT 0x01
269 #define KNOW_HPRATE 0x02
270     BIT_FLAGS8 knowledge{}; /* Knowledge about yourself */
271     BIT_FLAGS visit{}; /* Visited towns */
272
273     player_race_type start_race{}; /* Race at birth */
274     BIT_FLAGS old_race1{}; /* Record of race changes */
275     BIT_FLAGS old_race2{}; /* Record of race changes */
276     s16b old_realm{}; /* Record of realm changes */
277
278     s16b pet_follow_distance{}; /* Length of the imaginary "leash" for pets */
279     s16b pet_extra_flags{}; /* Various flags for controling pets */
280
281     MONSTER_IDX today_mon{}; //!< 日替わり賞金首を知っていればそのモンスターID、知らなければ 0
282
283     bool dtrap{}; /* Whether you are on trap-safe grids */
284     FLOOR_IDX floor_id{}; /* Current floor location */
285
286     bool autopick_autoregister{}; /* auto register is in-use or not */
287
288     byte feeling{}; /* Most recent dungeon feeling */
289     s32b feeling_turn{}; /* The turn of the last dungeon feeling */
290
291     object_type *inventory_list{}; /* The player's inventory */
292     s16b inven_cnt{}; /* Number of items in inventory */
293     s16b equip_cnt{}; /* Number of items in equipment */
294
295     /*** Temporary fields ***/
296
297     bool select_ring_slot{};
298
299     bool playing{}; /* True if player is playing */
300     bool leaving{}; /* True if player is leaving */
301
302     bool monk_notify_aux{};
303
304     byte leave_bldg{};
305     byte exit_bldg{}; /* Goal obtained in on_defeat_arena_monster? -KMW- */
306
307     bool leaving_dungeon{}; /* True if player is leaving the dungeon */
308     bool teleport_town{};
309     bool enter_dungeon{}; /* Just enter the dungeon */
310
311     IDX health_who{}; /* Health bar trackee */
312
313     MONRACE_IDX monster_race_idx{}; /* Monster race trackee */
314
315     KIND_OBJECT_IDX object_kind_idx{}; /* Object kind trackee */
316
317     s16b new_spells{}; /* Number of spells available */
318     s16b old_spells{};
319
320     s16b old_food_aux{}; /* Old value of food */
321
322     bool old_cumber_armor{};
323     bool old_cumber_glove{};
324     bool old_heavy_wield[2]{};
325     bool old_heavy_shoot{};
326     bool old_icky_wield[2]{};
327     bool old_riding_wield[2]{};
328     bool old_riding_ryoute{};
329     bool old_monlite{};
330     int extra_blows[2]{};
331
332     POSITION old_lite{}; /* Old radius of lite (if any) */
333
334     bool cumber_armor{}; /* Mana draining armor */
335     bool cumber_glove{}; /* Mana draining gloves */
336     bool heavy_wield[2]{}; /* Heavy weapon */
337     bool icky_wield[2]{}; /* Icky weapon */
338     bool riding_wield[2]{}; /* Riding weapon */
339     bool riding_ryoute{}; /* Riding weapon */
340     bool monlite{};
341     BIT_FLAGS yoiyami{};
342     BIT_FLAGS easy_2weapon{};
343     BIT_FLAGS down_saving{};
344
345     POSITION cur_lite{}; /* Radius of lite (if any) */
346
347     BIT_FLAGS update{}; /* Pending Updates */
348     BIT_FLAGS redraw{}; /* Normal Redraws */
349     BIT_FLAGS window_flags{}; /* Window Redraws */
350     s16b stat_use[A_MAX]{}; /* Current modified stats */
351     s16b stat_top[A_MAX]{}; /* Maximal modified stats */
352
353     bool sutemi{};
354     bool counter{};
355
356     ALIGNMENT align{}; /* Good/evil/neutral */
357     POSITION run_py{};
358     POSITION run_px{};
359     DIRECTION fishing_dir{};
360
361     MONSTER_IDX pet_t_m_idx{};
362     MONSTER_IDX riding_t_m_idx{};
363
364     /*** Extracted fields ***/
365
366     s16b running{}; /* Current counter for running, if any */
367     bool suppress_multi_reward{}; /*!< 複数レベルアップ時のパトロンからの報酬多重受け取りを防止 */
368
369     s16b stat_add[A_MAX]{}; /* Modifiers to stat values */
370     s16b stat_index[A_MAX]{}; /* Indexes into stat tables */
371
372     bool hack_mutation{};
373     bool is_fired{};
374     bool level_up_message{};
375
376     BIT_FLAGS anti_magic{}; /* Anti-magic */
377     BIT_FLAGS anti_tele{}; /* Prevent teleportation */
378
379     BIT_FLAGS cursed{}; /* Player is cursed */
380
381     bool can_swim{}; /* No damage falling */
382     BIT_FLAGS levitation{}; /* No damage falling */
383     BIT_FLAGS lite{}; /* Permanent light */
384     BIT_FLAGS free_act{}; /* Never paralyzed */
385     BIT_FLAGS see_inv{}; /* Can see invisible */
386     BIT_FLAGS regenerate{}; /* Regenerate hit pts */
387     BIT_FLAGS hold_exp{}; /* Resist exp draining */
388
389     BIT_FLAGS telepathy{}; /* Telepathy */
390     BIT_FLAGS esp_animal{};
391     BIT_FLAGS esp_undead{};
392     BIT_FLAGS esp_demon{};
393     BIT_FLAGS esp_orc{};
394     BIT_FLAGS esp_troll{};
395     BIT_FLAGS esp_giant{};
396     BIT_FLAGS esp_dragon{};
397     BIT_FLAGS esp_human{};
398     BIT_FLAGS esp_evil{};
399     BIT_FLAGS esp_good{};
400     BIT_FLAGS esp_nonliving{};
401     BIT_FLAGS esp_unique{};
402
403     BIT_FLAGS slow_digest{}; /* Slower digestion */
404     BIT_FLAGS bless_blade{}; /* Blessed blade */
405     BIT_FLAGS xtra_might{}; /* Extra might bow */
406     BIT_FLAGS impact{}; /* Earthquake blows */
407     BIT_FLAGS dec_mana{};
408     BIT_FLAGS easy_spell{};
409     BIT_FLAGS heavy_spell{};
410     BIT_FLAGS warning{};
411     BIT_FLAGS mighty_throw{};
412     BIT_FLAGS see_nocto{}; /* Noctovision */
413     bool invoking_midnight_curse{};
414
415     DICE_NUMBER to_dd[2]{}; /* Extra dice/sides */
416     DICE_SID to_ds[2]{};
417
418     HIT_PROB dis_to_h[2]{}; /*!< 判明している現在の表記上の近接武器命中修正値 /  Known bonus to hit (wield) */
419     HIT_PROB dis_to_h_b{}; /*!< 判明している現在の表記上の射撃武器命中修正値 / Known bonus to hit (bow) */
420     HIT_POINT dis_to_d[2]{}; /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
421     ARMOUR_CLASS dis_to_a{}; /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
422     ARMOUR_CLASS dis_ac{}; /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
423
424     s16b to_h[2]{}; /* Bonus to hit (wield) */
425     s16b to_h_b{}; /* Bonus to hit (bow) */
426     s16b to_h_m{}; /* Bonus to hit (misc) */
427     s16b to_d[2]{}; /* Bonus to dam (wield) */
428     s16b to_d_m{}; /* Bonus to dam (misc) */
429     ARMOUR_CLASS to_a{}; /* Bonus to ac */
430
431     s16b to_m_chance{}; /* Minusses to cast chance */
432
433     bool no_flowed{};
434
435     ARMOUR_CLASS ac{}; /*!< 装備無しの基本AC / Base ac */
436
437     ACTION_SKILL_POWER see_infra{}; /*!< 赤外線視能力の強さ /Infravision range */
438     ACTION_SKILL_POWER skill_dis{}; /*!< 行動技能値:解除能力 / Skill: Disarming */
439     ACTION_SKILL_POWER skill_dev{}; /*!< 行動技能値:魔道具使用 / Skill: Magic Devices */
440     ACTION_SKILL_POWER skill_sav{}; /*!< 行動技能値:魔法防御 / Skill: Saving throw */
441     ACTION_SKILL_POWER skill_stl{}; /*!< 行動技能値:隠密 / Skill: Stealth factor */
442
443     /*!
444      * 行動技能値:知覚 / Skill: Searching ability
445      * この値はsearch()による地形の隠し要素発見処理などで混乱、盲目、幻覚、無光源などの
446      * 状態異常がない限り、難易度修正などがないままそのままパーセンテージ値として使われる。
447      * 100以上ならば必ず全てのトラップなどを見つけることが出来る。
448      */
449     ACTION_SKILL_POWER skill_srh{};
450
451     ACTION_SKILL_POWER skill_fos{}; /*!< 行動技能値:探索 / Skill: Searching frequency */
452     ACTION_SKILL_POWER skill_thn{}; /*!< 行動技能値:打撃命中能力 / Skill: To hit (normal) */
453     ACTION_SKILL_POWER skill_thb{}; /*!< 行動技能値:射撃命中能力 / Skill: To hit (shooting) */
454     ACTION_SKILL_POWER skill_tht{}; /*!< 行動技能値:投射命中能力 / Skill: To hit (throwing) */
455     ACTION_SKILL_POWER skill_dig{}; /*!< 行動技能値:掘削 / Skill: Digging */
456
457     s16b num_blow[2]{}; /* Number of blows */
458     s16b num_fire{}; /* Number of shots */
459
460     byte tval_xtra{}; /* (Unused)Correct xtra tval */
461     byte tval_ammo{}; /* Correct ammo tval */
462
463     s16b pspeed{}; /*!< 現在の速度 / Current speed */
464
465     ENERGY energy_use{}; /*!< 直近のターンに消費したエネルギー / Energy use this turn */
466
467     POSITION y{}; /*!< ダンジョンの現在Y座標 / Player location in dungeon */
468     POSITION x{}; /*!< ダンジョンの現在X座標 / Player location in dungeon */
469     GAME_TEXT name[32]{}; /*!< 現在のプレイヤー名 / Current player's character name */
470     char base_name[32]{}; /*!< Stripped version of "player_name" */
471 } player_type;
472
473 extern player_type *p_ptr;
474
475 extern concptr your_alignment(player_type *creature_ptr, bool with_value = false);
476 extern int weapon_exp_level(int weapon_exp);
477 extern int riding_exp_level(int riding_exp);
478 extern int spell_exp_level(int spell_exp);
479
480 extern int calc_weapon_weight_limit(player_type *creature_ptr);
481 extern WEIGHT calc_inventory_weight(player_type *creature_ptr);
482
483 extern s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
484 extern WEIGHT calc_weight_limit(player_type *creature_ptr);
485 extern bool has_melee_weapon(player_type *creature_ptr, int i);
486
487 extern bool heavy_armor(player_type *creature_ptr);
488 extern void update_creature(player_type *creature_ptr);
489 extern BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
490 extern bool player_has_no_spellbooks(player_type *creature_ptr);
491
492 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
493 extern void free_turn(player_type *creature_ptr);
494
495 extern bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
496
497 extern void check_experience(player_type *creature_ptr);
498 extern void wreck_the_pattern(player_type *creature_ptr);
499 extern void cnv_stat(int val, char *out_val);
500 extern s16b modify_stat_value(int value, int amount);
501 extern long calc_score(player_type *creature_ptr);
502
503 extern bool is_blessed(player_type *creature_ptr);
504 extern bool is_time_limit_esp(player_type *creature_ptr);
505 extern bool is_time_limit_stealth(player_type *creature_ptr);
506 extern bool can_two_hands_wielding(player_type *creature_ptr);
507 bool is_fast(player_type *creature_ptr);
508 bool is_invuln(player_type *creature_ptr);
509 bool is_hero(player_type *creature_ptr);
510 bool is_shero(player_type *creature_ptr);
511 bool is_echizen(player_type *creature_ptr);
512 bool is_in_dungeon(player_type *creature_ptr);
513
514 /*
515  * Player "food" crucial values
516  */
517 #define PY_FOOD_MAX 15000 /*!< 食べ過ぎ~満腹の閾値 / Food value (Bloated) */
518 #define PY_FOOD_FULL 10000 /*!< 満腹~平常の閾値 / Food value (Normal) */
519 #define PY_FOOD_ALERT 2000 /*!< 平常~空腹の閾値 / Food value (Hungry) */
520 #define PY_FOOD_WEAK 1000 /*!< 空腹~衰弱の閾値 / Food value (Weak) */
521 #define PY_FOOD_FAINT 500 /*!< 衰弱~衰弱(赤表示/麻痺)の閾値 / Food value (Fainting) */
522 #define PY_FOOD_STARVE 100 /*!< 衰弱(赤表示/麻痺)~飢餓ダメージの閾値 / Food value (Starving) */
523
524 /*
525  * Player regeneration constants
526  */
527 #define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
528 #define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
529 #define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
530 #define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
531 #define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
532
533 extern void stop_singing(player_type *creature_ptr);
534 extern void stop_mouth(player_type *caster_ptr);
535 extern PERCENTAGE calculate_upkeep(player_type *creature_ptr);
536 extern bool music_singing(player_type *caster_ptr, int music_songs);
537
538 #define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0])
539 #define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1])
540 #define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2])
541 #define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0])
542 #define music_singing_any(CREATURE_PTR) (((CREATURE_PTR)->pclass == CLASS_BARD) && (CREATURE_PTR)->magic_num1[0])