OSDN Git Service

Merge pull request #938 from dis-/feature/RefactorPlayreInfraVision
[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 "spell/spells-util.h"
9 #include "util/flag-group.h"
10
11 // @todo 地雷、FlagGroupと強い関係がある
12 #include "player/player-classes-types.h"
13 #include "player/player-personalities-types.h"
14 #include "player/player-race-types.h"
15
16 /*
17  * Most of the "player" information goes here.
18  *
19  * This stucture gives us a large collection of player variables.
20  *
21  * This structure contains several "blocks" of information.
22  *   (1) the "permanent" info
23  *   (2) the "variable" info
24  *   (3) the "transient" info
25  *
26  * All of the "permanent" info, and most of the "variable" info,
27  * is saved in the savefile.  The "transient" info is recomputed
28  * whenever anything important changes.
29  */
30
31 /*
32  * Player constants
33  */
34 #define PY_MAX_EXP 99999999L /*!< プレイヤー経験値の最大値 / Maximum exp */
35 #define PY_MAX_GOLD 999999999L /*!< プレイヤー所持金の最大値 / Maximum gold */
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 /*
48  * Player "food" crucial values
49  */
50 #define PY_FOOD_MAX 15000 /*!< 食べ過ぎ~満腹の閾値 / Food value (Bloated) */
51 #define PY_FOOD_FULL 10000 /*!< 満腹~平常の閾値 / Food value (Normal) */
52 #define PY_FOOD_ALERT 2000 /*!< 平常~空腹の閾値 / Food value (Hungry) */
53 #define PY_FOOD_WEAK 1000 /*!< 空腹~衰弱の閾値 / Food value (Weak) */
54 #define PY_FOOD_FAINT 500 /*!< 衰弱~衰弱(赤表示/麻痺)の閾値 / Food value (Fainting) */
55 #define PY_FOOD_STARVE 100 /*!< 衰弱(赤表示/麻痺)~飢餓ダメージの閾値 / Food value (Starving) */
56
57 /*
58  * Player regeneration constants
59  */
60 #define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
61 #define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
62 #define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
63 #define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
64 #define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
65
66 /*!< Empty hand status */
67 enum empty_hand_status {
68     EMPTY_HAND_NONE = 0x0000, /*!<Both hands are used */
69     EMPTY_HAND_SUB = 0x0001, /*!<Sub hand is empty */
70     EMPTY_HAND_MAIN = 0x0002 /*!<Main hand is empty */
71 };
72
73 /*!< Weapon hand status */
74 enum player_hand { PLAYER_HAND_MAIN = 0x0000, PLAYER_HAND_SUB = 0x0001, PLAYER_HAND_OTHER = 0x0002 };
75
76 typedef struct object_type object_type;
77 typedef struct player_type player_type;
78 concptr your_alignment(player_type *creature_ptr, bool with_value = false);
79 int weapon_exp_level(int weapon_exp);
80 int riding_exp_level(int riding_exp);
81 int spell_exp_level(int spell_exp);
82
83 int calc_weapon_weight_limit(player_type *creature_ptr);
84 WEIGHT calc_inventory_weight(player_type *creature_ptr);
85
86 s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
87 WEIGHT calc_weight_limit(player_type *creature_ptr);
88 bool has_melee_weapon(player_type *creature_ptr, int i);
89
90 bool heavy_armor(player_type *creature_ptr);
91 void update_creature(player_type *creature_ptr);
92 BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
93 bool player_has_no_spellbooks(player_type *creature_ptr);
94
95 void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
96 void free_turn(player_type *creature_ptr);
97
98 bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
99
100 void check_experience(player_type *creature_ptr);
101 void wreck_the_pattern(player_type *creature_ptr);
102 void cnv_stat(int val, char *out_val);
103 s16b modify_stat_value(int value, int amount);
104 long calc_score(player_type *creature_ptr);
105
106 bool is_blessed(player_type *creature_ptr);
107 bool is_time_limit_esp(player_type *creature_ptr);
108 bool is_time_limit_stealth(player_type *creature_ptr);
109 bool can_two_hands_wielding(player_type *creature_ptr);
110 bool is_fast(player_type *creature_ptr);
111 bool is_invuln(player_type *creature_ptr);
112 bool is_hero(player_type *creature_ptr);
113 bool is_shero(player_type *creature_ptr);
114 bool is_echizen(player_type *creature_ptr);
115 bool is_in_dungeon(player_type *creature_ptr);
116
117 void stop_singing(player_type *creature_ptr);
118 void stop_mouth(player_type *caster_ptr);
119 PERCENTAGE calculate_upkeep(player_type *creature_ptr);
120 bool music_singing(player_type *caster_ptr, int music_songs);
121
122 // @todo 後で普通の関数に直す
123 #define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0])
124 #define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1])
125 #define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2])
126 #define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0])
127 #define music_singing_any(CREATURE_PTR) (((CREATURE_PTR)->pclass == CLASS_BARD) && (CREATURE_PTR)->magic_num1[0])