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