OSDN Git Service

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