OSDN Git Service

Merge remote-tracking branch 'remotes/origin/feature/Fix-Sanity-Blast-by-AutoSave...
[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_SUB = 0x0001, /*!<Sub hand is empty */
51     EMPTY_HAND_MAIN = 0x0002 /*!<Main hand is empty */
52 };
53
54 /*!< Weapon hand status */
55 typedef enum player_hand {
56     PLAYER_HAND_MAIN = 0x0000,
57     PLAYER_HAND_SUB = 0x0001,
58     PLAYER_HAND_OTHER = 0x0002
59 } player_hand;
60
61 /*
62  * Player sex constants (hard-coded by save-files, arrays, etc)
63  */
64 #define SEX_FEMALE 0
65 #define SEX_MALE 1
66 #define MAX_SEXES 2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
67
68 typedef struct floor_type floor_type;
69 typedef struct object_type object_type;
70 typedef struct player_type {
71     int player_uid;
72     int player_euid;
73     int player_egid;
74
75     floor_type *current_floor_ptr;
76     POSITION oldpy; /* Previous player location -KMW- */
77     POSITION oldpx; /* Previous player location -KMW- */
78
79     SEX_IDX psex; /* Sex index */
80     player_race_type prace; /* Race index */
81     player_class_type pclass; /* Class index */
82     player_personality_type pseikaku; /* Seikaku index */
83     REALM_IDX realm1; /* First magic realm */
84     REALM_IDX realm2; /* Second magic realm */
85     player_personality_type oops; /* Unused */
86
87     DICE_SID hitdie; /* Hit dice (sides) */
88     u16b expfact; /* Experience factor
89                    * Note: was byte, causing overflow for Amberite
90                    * characters (such as Amberite Paladins)
91                    */
92
93     s16b age; /* Characters age */
94     s16b ht; /* Height */
95     s16b wt; /* Weight */
96     s16b sc; /* Social Class */
97
98     PRICE au; /* Current Gold */
99
100     EXP max_max_exp; /* Max max experience (only to calculate score) */
101     EXP max_exp; /* Max experience */
102     EXP exp; /* Cur experience */
103     u32b exp_frac; /* Cur exp frac (times 2^16) */
104
105     PLAYER_LEVEL lev; /* Level */
106
107     TOWN_IDX town_num; /* Current town number */
108     s16b arena_number; /* monster number in on_defeat_arena_monster -KMW- */
109     bool phase_out; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
110
111     DUNGEON_IDX dungeon_idx; /* current dungeon index */
112     POSITION wilderness_x; /* Coordinates in the wilderness */
113     POSITION wilderness_y;
114     bool wild_mode;
115
116     HIT_POINT mhp; /* Max hit pts */
117     HIT_POINT chp; /* Cur hit pts */
118     u32b chp_frac; /* Cur hit frac (times 2^16) */
119     PERCENTAGE mutant_regenerate_mod;
120
121     MANA_POINT msp; /* Max mana pts */
122     MANA_POINT csp; /* Cur mana pts */
123     u32b csp_frac; /* Cur mana frac (times 2^16) */
124
125     s16b max_plv; /* Max Player Level */
126
127     BASE_STATUS stat_max[A_MAX]; /* Current "maximal" stat values */
128     BASE_STATUS stat_max_max[A_MAX]; /* Maximal "maximal" stat values */
129     BASE_STATUS stat_cur[A_MAX]; /* Current "natural" stat values */
130
131     s16b learned_spells;
132     s16b add_spells;
133
134     u32b count;
135
136     TIME_EFFECT fast; /* Timed -- Fast */
137     TIME_EFFECT slow; /* Timed -- Slow */
138     TIME_EFFECT blind; /* Timed -- Blindness */
139     TIME_EFFECT paralyzed; /* Timed -- Paralysis */
140     TIME_EFFECT confused; /* Timed -- Confusion */
141     TIME_EFFECT afraid; /* Timed -- Fear */
142     TIME_EFFECT image; /* Timed -- Hallucination */
143     TIME_EFFECT poisoned; /* Timed -- Poisoned */
144     TIME_EFFECT cut; /* Timed -- Cut */
145     TIME_EFFECT stun; /* Timed -- Stun */
146
147     TIME_EFFECT protevil; /* Timed -- Protection */
148     TIME_EFFECT invuln; /* Timed -- Invulnerable */
149     TIME_EFFECT ult_res; /* Timed -- Ultimate Resistance */
150     TIME_EFFECT hero; /* Timed -- Heroism */
151     TIME_EFFECT shero; /* Timed -- Super Heroism */
152     TIME_EFFECT shield; /* Timed -- Shield Spell */
153     TIME_EFFECT blessed; /* Timed -- Blessed */
154     TIME_EFFECT tim_invis; /* Timed -- See Invisible */
155     TIME_EFFECT tim_infra; /* Timed -- Infra Vision */
156     TIME_EFFECT tsuyoshi; /* Timed -- Tsuyoshi Special */
157     TIME_EFFECT ele_attack; /* Timed -- Elemental Attack */
158     TIME_EFFECT ele_immune; /* Timed -- Elemental Immune */
159
160     TIME_EFFECT oppose_acid; /* Timed -- oppose acid */
161     TIME_EFFECT oppose_elec; /* Timed -- oppose lightning */
162     TIME_EFFECT oppose_fire; /* Timed -- oppose heat */
163     TIME_EFFECT oppose_cold; /* Timed -- oppose cold */
164     TIME_EFFECT oppose_pois; /* Timed -- oppose poison */
165
166     TIME_EFFECT tim_esp; /* Timed ESP */
167     TIME_EFFECT wraith_form; /* Timed wraithform */
168
169     TIME_EFFECT resist_magic; /* Timed Resist Magic (later) */
170     TIME_EFFECT tim_regen;
171     TIME_EFFECT tim_pass_wall;
172     TIME_EFFECT tim_stealth;
173     TIME_EFFECT tim_levitation;
174     TIME_EFFECT tim_sh_touki;
175     TIME_EFFECT lightspeed;
176     TIME_EFFECT tsubureru;
177     TIME_EFFECT magicdef;
178     TIME_EFFECT tim_res_nether; /* Timed -- Nether resistance */
179     TIME_EFFECT tim_res_time; /* Timed -- Time resistance */
180     MIMIC_RACE_IDX mimic_form;
181     TIME_EFFECT tim_mimic;
182     TIME_EFFECT tim_sh_fire;
183     TIME_EFFECT tim_sh_holy;
184     TIME_EFFECT tim_eyeeye;
185
186     /* for mirror master */
187     TIME_EFFECT tim_reflect; /* Timed -- Reflect */
188     TIME_EFFECT multishadow; /* Timed -- Multi-shadow */
189     TIME_EFFECT dustrobe; /* Timed -- Robe of dust */
190
191     bool timewalk;
192
193 #define COMMAND_ARG_REST_UNTIL_DONE -2 /*!<休憩コマンド引数 … 必要な分だけ回復 */
194 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
195     GAME_TURN resting; /* Current counter for resting, if any */
196
197     PATRON_IDX chaos_patron;
198
199     BIT_FLAGS muta1; /*!< レイシャル型の変異 / "Activatable" mutations must be in MUT1_* */
200     BIT_FLAGS muta2; /*!< 常時効果つきの変異1 / Randomly activating mutations must be MUT2_* */
201     BIT_FLAGS muta3; /*!< 常時効果つきの変異2 / Other mutations will be mainly in MUT3_* */
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     SPELL_IDX 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     s16b today_mon; /* Wanted monster */
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; /* 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_ind[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);
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 void calc_bonuses(player_type *creature_ptr);
485 extern WEIGHT calc_weight_limit(player_type *creature_ptr);
486 extern bool has_melee_weapon(player_type *creature_ptr, int i);
487
488 extern bool heavy_armor(player_type *creature_ptr);
489 extern void update_creature(player_type *creature_ptr);
490 extern BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
491 extern bool player_has_no_spellbooks(player_type *creature_ptr);
492
493 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
494 extern void free_turn(player_type *creature_ptr);
495
496 extern bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
497
498 extern void check_experience(player_type *creature_ptr);
499 extern void wreck_the_pattern(player_type *creature_ptr);
500 extern void cnv_stat(int val, char *out_val);
501 extern s16b modify_stat_value(int value, int amount);
502 extern long calc_score(player_type *creature_ptr);
503
504 extern bool is_blessed(player_type *creature_ptr);
505 extern bool is_time_limit_esp(player_type *creature_ptr);
506 extern bool is_time_limit_stealth(player_type *creature_ptr);
507 extern bool can_two_hands_wielding(player_type *creature_ptr);
508 bool is_fast(player_type *creature_ptr);
509 bool is_invuln(player_type *creature_ptr);
510 bool is_hero(player_type *creature_ptr);
511 bool is_shero(player_type *creature_ptr);
512 bool is_echizen(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])