OSDN Git Service

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