OSDN Git Service

[Refactor] #38997 empty_hands() に player_type * 引数を追加.
[hengband/hengband.git] / src / player-status.h
1 #pragma once 
2
3 /*
4  * Most of the "player" information goes here.
5  *
6  * This stucture gives us a large collection of player variables.
7  *
8  * This structure contains several "blocks" of information.
9  *   (1) the "permanent" info
10  *   (2) the "variable" info
11  *   (3) the "transient" info
12  *
13  * All of the "permanent" info, and most of the "variable" info,
14  * is saved in the savefile.  The "transient" info is recomputed
15  * whenever anything important changes.
16  */
17
18 /*
19  * Player constants
20  */
21 #define PY_MAX_EXP      99999999L       /*!< プレイヤー経験値の最大値 / Maximum exp */
22 #define PY_MAX_GOLD     999999999L      /*!< プレイヤー所持金の最大値 / Maximum gold */
23 #define PY_MAX_LEVEL    50              /*!< プレイヤーレベルの最大値 / Maximum level */
24
25 #define GINOU_MAX      10
26 #define MAX_MANE 16
27
28 #define MAGIC_GLOVE_REDUCE_MANA 0x0001
29 #define MAGIC_FAIL_5PERCENT     0x0002
30 #define MAGIC_GAIN_EXP          0x0004
31
32 /*
33  * Magic-books for the realms
34  */
35 #define REALM1_BOOK     (p_ptr->realm1 + TV_LIFE_BOOK - 1)
36 #define REALM2_BOOK     (p_ptr->realm2 + TV_LIFE_BOOK - 1)
37
38 /* no_flowed 判定対象となるスペル */
39 #define SPELL_DD_S 27
40 #define SPELL_DD_T 13
41 #define SPELL_SW   22
42 #define SPELL_KABE 20
43
44 /* Empty hand status */
45 #define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
46 #define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
47 #define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
48
49 /*
50  * Player sex constants (hard-coded by save-files, arrays, etc)
51  */
52 #define SEX_FEMALE              0
53 #define SEX_MALE                1
54 #define MAX_SEXES        2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
55
56 extern const byte adj_mag_study[];
57 extern const byte adj_mag_mana[];
58 extern const byte adj_mag_fail[];
59 extern const byte adj_mag_stat[];
60 extern const byte adj_chr_gold[];
61 extern const byte adj_int_dev[];
62 extern const byte adj_wis_sav[];
63 extern const byte adj_dex_dis[];
64 extern const byte adj_int_dis[];
65 extern const byte adj_dex_ta[];
66 extern const byte adj_str_td[];
67 extern const byte adj_dex_th[];
68 extern const byte adj_str_th[];
69 extern const byte adj_str_wgt[];
70 extern const byte adj_str_hold[];
71 extern const byte adj_str_dig[];
72 extern const byte adj_dex_safe[];
73 extern const byte adj_con_fix[];
74 extern const byte adj_con_mhp[];
75 extern const byte adj_chr_chm[];
76
77
78 extern const concptr stat_names[6];
79 extern const concptr stat_names_reduced[6];
80
81 typedef struct player_type player_type;
82
83 struct player_type
84 {
85         int player_uid;
86         int player_euid;
87         int player_egid;
88
89         POSITION oldpy;         /* Previous player location -KMW- */
90         POSITION oldpx;         /* Previous player location -KMW- */
91
92         SEX_IDX psex;           /* Sex index */
93         RACE_IDX prace;         /* Race index */
94         CLASS_IDX pclass;       /* Class index */
95         CHARACTER_IDX pseikaku; /* Seikaku index */
96         REALM_IDX realm1;               /* First magic realm */
97         REALM_IDX realm2;               /* Second magic realm */
98         CHARACTER_IDX oops;             /* Unused */
99
100         DICE_SID hitdie;        /* Hit dice (sides) */
101         u16b expfact;   /* Experience factor
102                                         * Note: was byte, causing overflow for Amberite
103                                         * characters (such as Amberite Paladins)
104                                         */
105
106         s16b age;                       /* Characters age */
107         s16b ht;                        /* Height */
108         s16b wt;                        /* Weight */
109         s16b sc;                        /* Social Class */
110
111         PRICE au;                       /* Current Gold */
112
113         EXP max_max_exp;        /* Max max experience (only to calculate score) */
114         EXP max_exp;            /* Max experience */
115         EXP exp;                        /* Cur experience */
116         u32b exp_frac;          /* Cur exp frac (times 2^16) */
117
118         PLAYER_LEVEL lev;                       /* Level */
119
120         TOWN_IDX town_num;                      /* Current town number */
121         s16b arena_number;              /* monster number in arena -KMW- */
122         bool inside_arena;              /* Is character inside arena? */
123         QUEST_IDX inside_quest;         /* Inside quest level */
124         bool phase_out;         /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
125
126         DUNGEON_IDX dungeon_idx; /* current dungeon index */
127         POSITION wilderness_x;  /* Coordinates in the wilderness */
128         POSITION wilderness_y;
129         bool wild_mode;
130
131         HIT_POINT mhp;                  /* Max hit pts */
132         HIT_POINT chp;                  /* Cur hit pts */
133         u32b chp_frac;          /* Cur hit frac (times 2^16) */
134         PERCENTAGE mutant_regenerate_mod;
135
136         MANA_POINT msp;                 /* Max mana pts */
137         MANA_POINT csp;                 /* Cur mana pts */
138         u32b csp_frac;          /* Cur mana frac (times 2^16) */
139
140         s16b max_plv;           /* Max Player Level */
141
142         #define A_STR 0
143         #define A_INT 1
144         #define A_WIS 2
145         #define A_DEX 3
146         #define A_CON 4
147         #define A_CHR 5
148         #define A_MAX 6
149         BASE_STATUS stat_max[6];        /* Current "maximal" stat values */
150         BASE_STATUS stat_max_max[6];    /* Maximal "maximal" stat values */
151         BASE_STATUS stat_cur[6];        /* Current "natural" stat values */
152
153         s16b learned_spells;
154         s16b add_spells;
155
156         u32b count;
157
158         TIME_EFFECT fast;               /* Timed -- Fast */
159         TIME_EFFECT slow;               /* Timed -- Slow */
160         TIME_EFFECT blind;              /* Timed -- Blindness */
161         TIME_EFFECT paralyzed;          /* Timed -- Paralysis */
162         TIME_EFFECT confused;           /* Timed -- Confusion */
163         TIME_EFFECT afraid;             /* Timed -- Fear */
164         TIME_EFFECT image;              /* Timed -- Hallucination */
165         TIME_EFFECT poisoned;           /* Timed -- Poisoned */
166         TIME_EFFECT cut;                /* Timed -- Cut */
167         TIME_EFFECT stun;               /* Timed -- Stun */
168
169         TIME_EFFECT protevil;           /* Timed -- Protection */
170         TIME_EFFECT invuln;             /* Timed -- Invulnerable */
171         TIME_EFFECT ult_res;            /* Timed -- Ultimate Resistance */
172         TIME_EFFECT hero;               /* Timed -- Heroism */
173         TIME_EFFECT shero;              /* Timed -- Super Heroism */
174         TIME_EFFECT shield;             /* Timed -- Shield Spell */
175         TIME_EFFECT blessed;            /* Timed -- Blessed */
176         TIME_EFFECT tim_invis;          /* Timed -- See Invisible */
177         TIME_EFFECT tim_infra;          /* Timed -- Infra Vision */
178         TIME_EFFECT tsuyoshi;           /* Timed -- Tsuyoshi Special */
179         TIME_EFFECT ele_attack; /* Timed -- Elemental Attack */
180         TIME_EFFECT ele_immune; /* Timed -- Elemental Immune */
181
182         TIME_EFFECT oppose_acid;        /* Timed -- oppose acid */
183         TIME_EFFECT oppose_elec;        /* Timed -- oppose lightning */
184         TIME_EFFECT oppose_fire;        /* Timed -- oppose heat */
185         TIME_EFFECT oppose_cold;        /* Timed -- oppose cold */
186         TIME_EFFECT oppose_pois;        /* Timed -- oppose poison */
187
188         TIME_EFFECT tim_esp;       /* Timed ESP */
189         TIME_EFFECT wraith_form;   /* Timed wraithform */
190
191         TIME_EFFECT resist_magic;  /* Timed Resist Magic (later) */
192         TIME_EFFECT tim_regen;
193         TIME_EFFECT kabenuke;
194         TIME_EFFECT tim_stealth;
195         TIME_EFFECT tim_levitation;
196         TIME_EFFECT tim_sh_touki;
197         TIME_EFFECT lightspeed;
198         TIME_EFFECT tsubureru;
199         TIME_EFFECT magicdef;
200         TIME_EFFECT tim_res_nether;     /* Timed -- Nether resistance */
201         TIME_EFFECT tim_res_time;       /* Timed -- Time resistance */
202         MIMIC_RACE_IDX mimic_form;
203         TIME_EFFECT tim_mimic;
204         TIME_EFFECT tim_sh_fire;
205         TIME_EFFECT tim_sh_holy;
206         TIME_EFFECT tim_eyeeye;
207
208         /* for mirror master */
209         TIME_EFFECT tim_reflect;       /* Timed -- Reflect */
210         TIME_EFFECT multishadow;       /* Timed -- Multi-shadow */
211         TIME_EFFECT dustrobe;          /* Timed -- Robe of dust */
212
213         bool timewalk;
214
215 #define COMMAND_ARG_REST_UNTIL_DONE -2   /*!<休憩コマンド引数 … 必要な分だけ回復 */
216 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
217         GAME_TURN resting;      /* Current counter for resting, if any */
218
219         PATRON_IDX chaos_patron;
220
221         BIT_FLAGS muta1; /*!< レイシャル型の変異 / "Activatable" mutations must be in MUT1_* */
222 #define MUT1_SPIT_ACID                  0x00000001L /*!< 突然変異: 酸の唾 */
223 #define MUT1_BR_FIRE                    0x00000002L /*!< 突然変異: 炎のブレス */
224 #define MUT1_HYPN_GAZE                  0x00000004L /*!< 突然変異: 催眠睨み */
225 #define MUT1_TELEKINES                  0x00000008L /*!< 突然変異: 念動力 */
226 #define MUT1_VTELEPORT                  0x00000010L /*!< 突然変異: テレポート / Voluntary teleport */
227 #define MUT1_MIND_BLST                  0x00000020L /*!< 突然変異: 精神攻撃 */
228 #define MUT1_RADIATION                  0x00000040L /*!< 突然変異: 放射能 */
229 #define MUT1_VAMPIRISM                  0x00000080L /*!< 突然変異: 吸血 */
230 #define MUT1_SMELL_MET                  0x00000100L /*!< 突然変異: 金属嗅覚 */
231 #define MUT1_SMELL_MON                  0x00000200L /*!< 突然変異: 敵臭嗅覚 */
232 #define MUT1_BLINK                      0x00000400L /*!< 突然変異: ショート・テレポート */
233 #define MUT1_EAT_ROCK                   0x00000800L /*!< 突然変異: 岩喰い */
234 #define MUT1_SWAP_POS                   0x00001000L /*!< 突然変異: 位置交換 */
235 #define MUT1_SHRIEK                     0x00002000L /*!< 突然変異: 叫び */
236 #define MUT1_ILLUMINE                   0x00004000L /*!< 突然変異: 照明 */
237 #define MUT1_DET_CURSE                  0x00008000L /*!< 突然変異: 呪い感知 */
238 #define MUT1_BERSERK                    0x00010000L /*!< 突然変異: 狂戦士化 */
239 #define MUT1_POLYMORPH                  0x00020000L /*!< 突然変異: 変身 */
240 #define MUT1_MIDAS_TCH                  0x00040000L /*!< 突然変異: ミダスの手 */
241 #define MUT1_GROW_MOLD                  0x00080000L /*!< 突然変異: カビ発生 */
242 #define MUT1_RESIST                     0x00100000L /*!< 突然変異: エレメント耐性 */
243 #define MUT1_EARTHQUAKE                 0x00200000L /*!< 突然変異: 地震 */
244 #define MUT1_EAT_MAGIC                  0x00400000L /*!< 突然変異: 魔力喰い */
245 #define MUT1_WEIGH_MAG                  0x00800000L /*!< 突然変異: 魔力感知 */
246 #define MUT1_STERILITY                  0x01000000L /*!< 突然変異: 増殖阻止 */
247 #define MUT1_PANIC_HIT                  0x02000000L /*!< 突然変異: ヒットアンドアウェイ */
248 #define MUT1_DAZZLE                     0x04000000L /*!< 突然変異: 眩惑 */
249 #define MUT1_LASER_EYE                  0x08000000L /*!< 突然変異: レーザー・アイ */
250 #define MUT1_RECALL                     0x10000000L /*!< 突然変異: 帰還 */
251 #define MUT1_BANISH                     0x20000000L /*!< 突然変異: 邪悪消滅 */
252 #define MUT1_COLD_TOUCH                 0x40000000L /*!< 突然変異: 凍結の手 */
253 #define MUT1_LAUNCHER                   0x80000000L /*!< 突然変異: アイテム投げ */
254
255         BIT_FLAGS muta2; /*!< 常時効果つきの変異1 / Randomly activating mutations must be MUT2_* */
256 #define MUT2_BERS_RAGE                  0x00000001L /*!< 突然変異: 狂戦士化の発作 */
257 #define MUT2_COWARDICE                  0x00000002L /*!< 突然変異: 臆病 */
258 #define MUT2_RTELEPORT                  0x00000004L /*!< 突然変異: ランダムテレポート / Random teleport, instability */
259 #define MUT2_ALCOHOL                    0x00000008L /*!< 突然変異: アルコール分泌 */
260 #define MUT2_HALLU                      0x00000010L /*!< 突然変異: 幻覚を引き起こす精神錯乱 */
261 #define MUT2_FLATULENT                  0x00000020L /*!< 突然変異: 猛烈な屁 */
262 #define MUT2_SCOR_TAIL                  0x00000040L /*!< 突然変異: サソリの尻尾 */
263 #define MUT2_HORNS                      0x00000080L /*!< 突然変異: ツノ */
264 #define MUT2_BEAK                       0x00000100L /*!< 突然変異: クチバシ */
265 #define MUT2_ATT_DEMON                  0x00000200L /*!< 突然変異: デーモンを引き付ける */
266 #define MUT2_PROD_MANA                  0x00000400L /*!< 突然変異: 制御できない魔力のエネルギー */
267 #define MUT2_SPEED_FLUX                 0x00000800L /*!< 突然変異: ランダムな加減速 */
268 #define MUT2_BANISH_ALL                 0x00001000L /*!< 突然変異: ランダムなモンスター消滅 */
269 #define MUT2_EAT_LIGHT                  0x00002000L /*!< 突然変異: 光源喰い */
270 #define MUT2_TRUNK                      0x00004000L /*!< 突然変異: 象の鼻 */
271 #define MUT2_ATT_ANIMAL                 0x00008000L /*!< 突然変異: 動物を引き寄せる */
272 #define MUT2_TENTACLES                  0x00010000L /*!< 突然変異: 邪悪な触手 */
273 #define MUT2_RAW_CHAOS                  0x00020000L /*!< 突然変異: 純カオス */
274 #define MUT2_NORMALITY                  0x00040000L /*!< 突然変異: ランダムな変異の消滅 */
275 #define MUT2_WRAITH                     0x00080000L /*!< 突然変異: ランダムな幽体化 */
276 #define MUT2_POLY_WOUND                 0x00100000L /*!< 突然変異: ランダムな傷の変化 */
277 #define MUT2_WASTING                    0x00200000L /*!< 突然変異: 衰弱 */
278 #define MUT2_ATT_DRAGON                 0x00400000L /*!< 突然変異: ドラゴンを引き寄せる */
279 #define MUT2_WEIRD_MIND                 0x00800000L /*!< 突然変異: ランダムなテレパシー */
280 #define MUT2_NAUSEA                     0x01000000L /*!< 突然変異: 落ち着きの無い胃 */
281 #define MUT2_CHAOS_GIFT                 0x02000000L /*!< 突然変異: カオスパトロン */
282 #define MUT2_WALK_SHAD                  0x04000000L /*!< 突然変異: ランダムな現実変容 */
283 #define MUT2_WARNING                    0x08000000L /*!< 突然変異: 警告 */
284 #define MUT2_INVULN                     0x10000000L /*!< 突然変異: ランダムな無敵化 */
285 #define MUT2_SP_TO_HP                   0x20000000L /*!< 突然変異: ランダムなMPからHPへの変換 */
286 #define MUT2_HP_TO_SP                   0x40000000L /*!< 突然変異: ランダムなHPからMPへの変換 */
287 #define MUT2_DISARM                     0x80000000L /*!< 突然変異: ランダムな武器落とし */
288
289         BIT_FLAGS muta3; /*!< 常時効果つきの変異2 / Other mutations will be mainly in MUT3_* */
290 #define MUT3_HYPER_STR                  0x00000001L /*!< 突然変異: 超人的な力 */
291 #define MUT3_PUNY                       0x00000002L /*!< 突然変異: 虚弱 */
292 #define MUT3_HYPER_INT                  0x00000004L /*!< 突然変異: 生体コンピュータ */
293 #define MUT3_MORONIC                    0x00000008L /*!< 突然変異: 精神薄弱 */
294 #define MUT3_RESILIENT                  0x00000010L /*!< 突然変異: 弾力のある体 */
295 #define MUT3_XTRA_FAT                   0x00000020L /*!< 突然変異: 異常な肥満 */
296 #define MUT3_ALBINO                     0x00000040L /*!< 突然変異: アルビノ */
297 #define MUT3_FLESH_ROT                  0x00000080L /*!< 突然変異: 腐敗した肉体 */
298 #define MUT3_SILLY_VOI                  0x00000100L /*!< 突然変異: 間抜けなキーキー声 */
299 #define MUT3_BLANK_FAC                  0x00000200L /*!< 突然変異: のっぺらぼう */
300 #define MUT3_ILL_NORM                   0x00000400L /*!< 突然変異: 幻影に覆われた体 */
301 #define MUT3_XTRA_EYES                  0x00000800L /*!< 突然変異: 第三の目 */
302 #define MUT3_MAGIC_RES                  0x00001000L /*!< 突然変異: 魔法防御 */
303 #define MUT3_XTRA_NOIS                  0x00002000L /*!< 突然変異: 騒音 */
304 #define MUT3_INFRAVIS                   0x00004000L /*!< 突然変異: 赤外線視力 */
305 #define MUT3_XTRA_LEGS                  0x00008000L /*!< 突然変異: 追加の脚 */
306 #define MUT3_SHORT_LEG                  0x00010000L /*!< 突然変異: 短い脚 */
307 #define MUT3_ELEC_TOUC                  0x00020000L /*!< 突然変異: 電撃オーラ */
308 #define MUT3_FIRE_BODY                  0x00040000L /*!< 突然変異: 火炎オーラ */
309 #define MUT3_WART_SKIN                  0x00080000L /*!< 突然変異: イボ肌 */
310 #define MUT3_SCALES                     0x00100000L /*!< 突然変異: 鱗肌 */
311 #define MUT3_IRON_SKIN                  0x00200000L /*!< 突然変異: 鉄の肌 */
312 #define MUT3_WINGS                      0x00400000L /*!< 突然変異: 翼 */
313 #define MUT3_FEARLESS                   0x00800000L /*!< 突然変異: 恐れ知らず */
314 #define MUT3_REGEN                      0x01000000L /*!< 突然変異: 急回復 */
315 #define MUT3_ESP                        0x02000000L /*!< 突然変異: テレパシー */
316 #define MUT3_LIMBER                     0x04000000L /*!< 突然変異: しなやかな肉体 */
317 #define MUT3_ARTHRITIS                  0x08000000L /*!< 突然変異: 関節の痛み */
318 #define MUT3_BAD_LUCK                   0x10000000L /*!< 突然変異: 黒いオーラ(不運) */
319 #define MUT3_VULN_ELEM                  0x20000000L /*!< 突然変異: 元素攻撃弱点 */
320 #define MUT3_MOTION                     0x40000000L /*!< 突然変異: 正確で力強い動作 */
321 #define MUT3_GOOD_LUCK                  0x80000000L /*!< 突然変異: 白いオーラ(幸運) */
322
323         s16b virtues[8];
324         s16b vir_types[8];
325
326         TIME_EFFECT word_recall;          /* Word of recall counter */
327         TIME_EFFECT alter_reality;        /* Alter reality counter */
328         DUNGEON_IDX recall_dungeon;      /* Dungeon set to be recalled */
329
330         ENERGY energy_need;       /* Energy needed for next move */
331         ENERGY enchant_energy_need;       /* Energy needed for next upkeep effect        */
332
333         FEED food;                /* Current nutrition */
334
335         /*
336          * p_ptr->special_attackによるプレイヤーの攻撃状態の定義 / Bit flags for the "p_ptr->special_attack" variable. -LM-
337          *
338          * Note:  The elemental and poison attacks should be managed using the
339          * function "set_ele_attack", in spell2.c.  This provides for timeouts and
340          * prevents the player from getting more than one at a time.
341          */
342         BIT_FLAGS special_attack;
343 #define ATTACK_CONFUSE  0x00000001 /*!< プレイヤーのステータス:混乱打撃 */
344 #define ATTACK_XXX1             0x00000002 /*!< プレイヤーのステータス:未使用1 */
345 #define ATTACK_XXX2             0x00000004 /*!< プレイヤーのステータス:未使用2 */
346 #define ATTACK_XXX3         0x00000008 /*!< プレイヤーのステータス:未使用3 */
347 #define ATTACK_ACID             0x00000010 /*!< プレイヤーのステータス:魔法剣/溶解 */
348 #define ATTACK_ELEC             0x00000020 /*!< プレイヤーのステータス:魔法剣/電撃 */
349 #define ATTACK_FIRE             0x00000040 /*!< プレイヤーのステータス:魔法剣/火炎 */
350 #define ATTACK_COLD             0x00000080 /*!< プレイヤーのステータス:魔法剣/冷凍 */
351 #define ATTACK_POIS             0x00000100 /*!< プレイヤーのステータス:魔法剣/毒殺 */
352 #define ATTACK_HOLY             0x00000200 /*!< プレイヤーのステータス:対邪?(未使用) */
353 #define ATTACK_SUIKEN   0x00000400 /*!< プレイヤーのステータス:酔拳 */
354
355         /*
356          * p_ptr->special_defenseによるプレイヤーの防御状態の定義 / Bit flags for the "p_ptr->special_defense" variable. -LM-
357          */
358         BIT_FLAGS special_defense;
359 #define DEFENSE_ACID    0x00000001 /*!< プレイヤーのステータス:酸免疫 */
360 #define DEFENSE_ELEC    0x00000002 /*!< プレイヤーのステータス:電撃免疫 */
361 #define DEFENSE_FIRE    0x00000004 /*!< プレイヤーのステータス:火炎免疫 */
362 #define DEFENSE_COLD    0x00000008 /*!< プレイヤーのステータス:冷気免疫 */
363 #define DEFENSE_POIS    0x00000010 /*!< プレイヤーのステータス:毒免疫 */
364 #define KAMAE_GENBU     0x00000020 /*!< プレイヤーのステータス:玄武の構え */
365 #define KAMAE_BYAKKO    0x00000040 /*!< プレイヤーのステータス:白虎の構え */
366 #define KAMAE_SEIRYU    0x00000080 /*!< プレイヤーのステータス:青竜の構え */
367 #define KAMAE_SUZAKU    0x00000100 /*!< プレイヤーのステータス:朱雀の構え */
368 #define KATA_IAI        0x00000200 /*!< プレイヤーのステータス:居合 */
369 #define KATA_FUUJIN     0x00000400 /*!< プレイヤーのステータス:風塵 */
370 #define KATA_KOUKIJIN   0x00000800 /*!< プレイヤーのステータス:降鬼陣 */
371 #define KATA_MUSOU      0x00001000 /*!< プレイヤーのステータス:無想 */
372 #define NINJA_KAWARIMI  0x00002000 /*!< プレイヤーのステータス:変わり身 */
373 #define NINJA_S_STEALTH 0x00004000 /*!< プレイヤーのステータス:超隠密 */
374 #define MAX_KAMAE 4 /*!< 修行僧の構え最大数 */
375 #define KAMAE_MASK (KAMAE_GENBU | KAMAE_BYAKKO | KAMAE_SEIRYU | KAMAE_SUZAKU) /*!< 修行僧の構えビット配列 */
376 #define MAX_KATA 4 /*!< 修行僧の型最大数 */
377 #define KATA_MASK (KATA_IAI | KATA_FUUJIN | KATA_KOUKIJIN | KATA_MUSOU) /*!< 修行僧の型ビット配列 */
378
379         ACTION_IDX action;                /* Currently action */
380 #define ACTION_NONE     0 /*!< 持続行動: なし */
381 #define ACTION_SEARCH   1 /*!< 持続行動: 探索 */
382 #define ACTION_REST     2 /*!< 持続行動: 休憩 */
383 #define ACTION_LEARN    3 /*!< 持続行動: 青魔法ラーニング */
384 #define ACTION_FISH     4 /*!< 持続行動: 釣り */
385 #define ACTION_KAMAE    5 /*!< 持続行動: 修行僧の構え */
386 #define ACTION_KATA     6 /*!< 持続行動: 剣術家の型 */
387 #define ACTION_SING     7 /*!< 持続行動: 歌 */
388 #define ACTION_HAYAGAKE 8 /*!< 持続行動: 早駆け */
389 #define ACTION_SPELL    9 /*!< 持続行動: 呪術 */
390
391         BIT_FLAGS spell_learned1;         /* bit mask of spells learned */
392         BIT_FLAGS spell_learned2;         /* bit mask of spells learned */
393         BIT_FLAGS spell_worked1;          /* bit mask of spells tried and worked */
394         BIT_FLAGS spell_worked2;          /* bit mask of spells tried and worked */
395         BIT_FLAGS spell_forgotten1;       /* bit mask of spells learned but forgotten */
396         BIT_FLAGS spell_forgotten2;       /* bit mask of spells learned but forgotten */
397         SPELL_IDX spell_order[64];  /* order spells learned/remembered/forgotten */
398
399         SUB_EXP spell_exp[64];        /* Proficiency of spells */
400         SUB_EXP weapon_exp[5][64];    /* Proficiency of weapons */
401         SUB_EXP skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */
402
403         MAGIC_NUM1 magic_num1[108];     /*!< Array for non-spellbook type magic */
404         MAGIC_NUM2 magic_num2[108];     /*!< 魔道具術師の取り込み済魔道具使用回数 / Flags for non-spellbook type magics */
405
406         SPELL_IDX mane_spell[MAX_MANE];
407         HIT_POINT mane_dam[MAX_MANE];
408         s16b mane_num;
409         bool new_mane;
410
411         #define CONCENT_RADAR_THRESHOLD 2
412         #define CONCENT_TELE_THRESHOLD  5
413         s16b concent;      /* Sniper's concentration level */
414
415         HIT_POINT player_hp[PY_MAX_LEVEL];
416         char died_from[80];       /* What killed the player */
417         concptr last_message;        /* Last message on death or retirement */
418         char history[4][60];      /* Textual "history" for the Player */
419
420         u16b total_winner;        /* Total winner */
421         u16b panic_save;          /* Panic save */
422
423         u16b noscore;             /* Cheating flags */
424
425         bool wait_report_score;   /* Waiting to report score */
426         bool is_dead;             /* Player is dead */
427         bool now_damaged;
428         bool ambush_flag;
429         BIT_FLAGS change_floor_mode;  /*!<フロア移行処理に関するフラグ / Mode flags for changing floor */
430
431         bool reset_concent;   /* Concentration reset flag */
432
433         bool wizard;              /* Player is in wizard mode */
434
435         MONSTER_IDX riding;              /* Riding on a monster of this index */
436
437         #define KNOW_STAT   0x01
438         #define KNOW_HPRATE 0x02
439         BIT_FLAGS8 knowledge;           /* Knowledge about yourself */
440         BIT_FLAGS visit;               /* Visited towns */
441
442         RACE_IDX start_race;          /* Race at birth */
443         BIT_FLAGS old_race1;           /* Record of race changes */
444         BIT_FLAGS old_race2;           /* Record of race changes */
445         s16b old_realm;           /* Record of realm changes */
446
447         s16b pet_follow_distance; /* Length of the imaginary "leash" for pets */
448         s16b pet_extra_flags;     /* Various flags for controling pets */
449
450         s16b today_mon;           /* Wanted monster */
451
452         bool dtrap;               /* Whether you are on trap-safe grids */
453         FLOOR_IDX floor_id;            /* Current floor location */
454
455         bool autopick_autoregister; /* auto register is in-use or not */
456
457         byte feeling;           /* Most recent dungeon feeling */
458         s32b feeling_turn;      /* The turn of the last dungeon feeling */
459
460         /*
461          * Maximum number of "normal" pack slots, and the index of the "overflow"
462          * slot, which can hold an item, but only temporarily, since it causes the
463          * pack to "overflow", dropping the "last" item onto the ground.  Since this
464          * value is used as an actual slot, it must be less than "INVEN_RARM" (below).
465          * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
466          * by the fact that the screen can only show 23 items plus a one-line prompt.
467          * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
468          */
469         #define INVEN_PACK      23 /*!< アイテムスロット…所持品(0~) */
470         #define INVEN_RARM      24 /*!< アイテムスロット…右手 */
471         #define INVEN_LARM      25 /*!< アイテムスロット…左手 */
472         #define INVEN_BOW       26 /*!< アイテムスロット…射撃 */
473         #define INVEN_RIGHT     27 /*!< アイテムスロット…右手指 */
474         #define INVEN_LEFT      28 /*!< アイテムスロット…左手指 */
475         #define INVEN_NECK      29 /*!< アイテムスロット…首 */
476         #define INVEN_LITE      30 /*!< アイテムスロット…光源 */
477         #define INVEN_BODY      31 /*!< アイテムスロット…体 */
478         #define INVEN_OUTER     32 /*!< アイテムスロット…体の上 */
479         #define INVEN_HEAD      33 /*!< アイテムスロット…頭部 */
480         #define INVEN_HANDS     34 /*!< アイテムスロット…腕部 */
481         #define INVEN_FEET      35 /*!< アイテムスロット…脚部 */
482         #define INVEN_AMMO      23 /*!< used for get_random_ego()  */
483         #define INVEN_TOTAL     36 /*!< Total number of inventory_list slots (hard-coded). */
484         #define INVEN_FORCE     1111 /*!< inventory_list slot for selecting force (hard-coded). */
485         object_type *inventory_list; /* The player's inventory */
486         s16b inven_cnt; /* Number of items in inventory */
487         s16b equip_cnt; /* Number of items in equipment */
488
489         /*** Temporary fields ***/
490
491         bool playing;                   /* True if player is playing */
492         bool leaving;                   /* True if player is leaving */
493
494         bool monk_armour_aux;
495         bool monk_notify_aux;
496
497         byte leave_bldg;
498         byte exit_bldg;                 /* Goal obtained in arena? -KMW- */
499
500         bool leaving_dungeon;   /* True if player is leaving the dungeon */
501         bool teleport_town;
502         bool enter_dungeon;     /* Just enter the dungeon */
503
504         IDX health_who; /* Health bar trackee */
505
506         MONRACE_IDX monster_race_idx;   /* Monster race trackee */
507
508         KIND_OBJECT_IDX object_kind_idx;        /* Object kind trackee */
509
510         s16b new_spells;        /* Number of spells available */
511         s16b old_spells;
512
513         s16b old_food_aux;      /* Old value of food */
514
515         bool old_cumber_armor;
516         bool old_cumber_glove;
517         bool old_heavy_wield[2];
518         bool old_heavy_shoot;
519         bool old_icky_wield[2];
520         bool old_riding_wield[2];
521         bool old_riding_ryoute;
522         bool old_monlite;
523
524         POSITION old_lite;              /* Old radius of lite (if any) */
525
526         bool cumber_armor;      /* Mana draining armor */
527         bool cumber_glove;      /* Mana draining gloves */
528         bool heavy_wield[2];    /* Heavy weapon */
529         bool heavy_shoot;       /* Heavy shooter */
530         bool icky_wield[2];     /* Icky weapon */
531         bool riding_wield[2];   /* Riding weapon */
532         bool riding_ryoute;     /* Riding weapon */
533         bool monlite;
534
535         POSITION cur_lite;              /* Radius of lite (if any) */
536
537         BIT_FLAGS update;       /* Pending Updates */
538 #define PU_BONUS        0x00000001L     /*!< ステータス更新フラグ: 能力値修正 / Calculate bonuses */
539 #define PU_TORCH        0x00000002L     /*!< ステータス更新フラグ: 光源半径 / Calculate torch radius */
540 #define PU_HP           0x00000010L     /*!< ステータス更新フラグ: HP / Calculate chp and mhp */
541 #define PU_MANA         0x00000020L     /*!< ステータス更新フラグ: MP / Calculate csp and msp */
542 #define PU_SPELLS       0x00000040L     /*!< ステータス更新フラグ: 魔法学習数 / Calculate spells */
543 #define PU_COMBINE      0x00000100L     /*!< アイテム処理フラグ: アイテムの結合を要する / Combine the pack */
544 #define PU_REORDER      0x00000200L     /*!< アイテム処理フラグ: アイテムの並び替えを要する / Reorder the pack */
545 #define PU_AUTODESTROY  0x00000400L     /*!< アイテム処理フラグ: アイテムの自動破壊を要する / Auto-destroy marked item */
546 #define PU_UN_VIEW      0x00010000L     /*!< ステータス更新フラグ: 地形の視界外化 / Forget view */
547 #define PU_UN_LITE      0x00020000L     /*!< ステータス更新フラグ: 明暗範囲の視界外化 / Forget lite */
548 #define PU_VIEW         0x00100000L     /*!< ステータス更新フラグ: 視界 / Update view */
549 #define PU_LITE         0x00200000L     /*!< ステータス更新フラグ: 明暗範囲 / Update lite */
550 #define PU_MON_LITE     0x00400000L     /*!< ステータス更新フラグ: モンスターの光源範囲 / Monster illumination */
551 #define PU_DELAY_VIS    0x00800000L     /*!< ステータス更新フラグ: 視界の追加更新 / Mega-Hack -- Delayed visual update */
552 #define PU_MONSTERS     0x01000000L     /*!< ステータス更新フラグ: モンスターのステータス / Update monsters */
553 #define PU_DISTANCE     0x02000000L     /*!< ステータス更新フラグ: プレイヤーとモンスターの距離 / Update distances */
554 #define PU_FLOW         0x10000000L     /*!< ステータス更新フラグ: プレイヤーから各マスへの到達距離 / Update flow */
555
556         BIT_FLAGS redraw;       /* Normal Redraws */
557         BIT_FLAGS window;       /* Window Redraws */
558
559         s16b stat_use[A_MAX];   /* Current modified stats */
560         s16b stat_top[A_MAX];   /* Maximal modified stats */
561
562         bool sutemi;
563         bool counter;
564
565         ALIGNMENT align; /* Good/evil/neutral */
566         POSITION run_py;
567         POSITION run_px;
568         DIRECTION fishing_dir;
569
570         MONSTER_IDX pet_t_m_idx;
571         MONSTER_IDX riding_t_m_idx;
572
573         /*** Extracted fields ***/
574
575         s16b running;                   /* Current counter for running, if any */
576         bool suppress_multi_reward; /*!< 複数レベルアップ時のパトロンからの報酬多重受け取りを防止 */
577
578         WEIGHT total_weight;    /*!< 所持品と装備品の計算総重量 / Total weight being carried */
579
580         s16b stat_add[A_MAX];   /* Modifiers to stat values */
581         s16b stat_ind[A_MAX];   /* Indexes into stat tables */
582
583         bool hack_mutation;
584         bool is_fired;
585         bool level_up_message;
586
587         bool immune_acid;       /* Immunity to acid */
588         bool immune_elec;       /* Immunity to lightning */
589         bool immune_fire;       /* Immunity to fire */
590         bool immune_cold;       /* Immunity to cold */
591
592         bool resist_acid;       /* Resist acid */
593         bool resist_elec;       /* Resist lightning */
594         bool resist_fire;       /* Resist fire */
595         bool resist_cold;       /* Resist cold */
596         bool resist_pois;       /* Resist poison */
597
598         bool resist_conf;       /* Resist confusion */
599         bool resist_sound;      /* Resist sound */
600         bool resist_lite;       /* Resist light */
601         bool resist_dark;       /* Resist darkness */
602         bool resist_chaos;      /* Resist chaos */
603         bool resist_disen;      /* Resist disenchant */
604         bool resist_shard;      /* Resist shards */
605         bool resist_nexus;      /* Resist nexus */
606         bool resist_blind;      /* Resist blindness */
607         bool resist_neth;       /* Resist nether */
608         bool resist_fear;       /* Resist fear */
609         bool resist_time;       /* Resist time */
610         bool resist_water;      /* Resist water */
611
612         bool reflect;       /* Reflect 'bolt' attacks */
613         bool sh_fire;       /* Fiery 'immolation' effect */
614         bool sh_elec;       /* Electric 'immolation' effect */
615         bool sh_cold;       /* Cold 'immolation' effect */
616
617         bool anti_magic;    /* Anti-magic */
618         bool anti_tele;     /* Prevent teleportation */
619
620         bool sustain_str;       /* Keep strength */
621         bool sustain_int;       /* Keep intelligence */
622         bool sustain_wis;       /* Keep wisdom */
623         bool sustain_dex;       /* Keep dexterity */
624         bool sustain_con;       /* Keep constitution */
625         bool sustain_chr;       /* Keep charisma */
626
627         BIT_FLAGS cursed;       /* Player is cursed */
628
629         bool can_swim;          /* No damage falling */
630         bool levitation;                /* No damage falling */
631         bool lite;              /* Permanent light */
632         bool free_act;          /* Never paralyzed */
633         bool see_inv;           /* Can see invisible */
634         bool regenerate;        /* Regenerate hit pts */
635         bool hold_exp;          /* Resist exp draining */
636
637         bool telepathy;         /* Telepathy */
638         bool esp_animal;
639         bool esp_undead;
640         bool esp_demon;
641         bool esp_orc;
642         bool esp_troll;
643         bool esp_giant;
644         bool esp_dragon;
645         bool esp_human;
646         bool esp_evil;
647         bool esp_good;
648         bool esp_nonliving;
649         bool esp_unique;
650
651         bool slow_digest;       /* Slower digestion */
652         bool bless_blade;       /* Blessed blade */
653         bool xtra_might;        /* Extra might bow */
654         bool impact[2];         /* Earthquake blows */
655         bool pass_wall;     /* Permanent wraithform */
656         bool kill_wall;
657         bool dec_mana;
658         bool easy_spell;
659         bool heavy_spell;
660         bool warning;
661         bool mighty_throw;
662         bool see_nocto;         /* Noctovision */
663         bool invoking_midnight_curse;
664
665         DICE_NUMBER to_dd[2]; /* Extra dice/sides */
666         DICE_SID to_ds[2];
667
668         HIT_PROB dis_to_h[2];   /*!< 判明している現在の表記上の近接武器命中修正値 /  Known bonus to hit (wield) */
669         HIT_PROB dis_to_h_b;    /*!< 判明している現在の表記上の射撃武器命中修正値 / Known bonus to hit (bow) */
670         HIT_POINT dis_to_d[2];  /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
671         ARMOUR_CLASS dis_to_a;  /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
672         ARMOUR_CLASS dis_ac;    /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
673
674         s16b to_h[2];           /* Bonus to hit (wield) */
675         s16b to_h_b;            /* Bonus to hit (bow) */
676         s16b to_h_m;            /* Bonus to hit (misc) */
677         s16b to_d[2];           /* Bonus to dam (wield) */
678         s16b to_d_m;            /* Bonus to dam (misc) */
679         s16b to_a;                      /* Bonus to ac */
680
681         s16b to_m_chance;               /* Minusses to cast chance */
682
683         bool ryoute;
684         bool migite;
685         bool hidarite;
686         bool no_flowed;
687
688         ARMOUR_CLASS ac;        /*!< 装備無しの基本AC / Base ac */
689
690         ACTION_SKILL_POWER see_infra;   /*!< 赤外線視能力の強さ /Infravision range */
691         ACTION_SKILL_POWER skill_dis;   /*!< 行動技能値:解除能力 / Skill: Disarming */
692         ACTION_SKILL_POWER skill_dev;   /*!< 行動技能値:魔道具使用 / Skill: Magic Devices */
693         ACTION_SKILL_POWER skill_sav;   /*!< 行動技能値:魔法防御 / Skill: Saving throw */
694         ACTION_SKILL_POWER skill_stl;   /*!< 行動技能値:隠密 / Skill: Stealth factor */
695
696         /*!
697          * 行動技能値:知覚 / Skill: Searching ability
698          * この値はsearch()による地形の隠し要素発見処理などで混乱、盲目、幻覚、無光源などの
699          * 状態異常がない限り、難易度修正などがないままそのままパーセンテージ値として使われる。
700          * 100以上ならば必ず全てのトラップなどを見つけることが出来る。
701          */
702         ACTION_SKILL_POWER skill_srh;
703
704         ACTION_SKILL_POWER skill_fos;   /*!< 行動技能値:探索 / Skill: Searching frequency */
705         ACTION_SKILL_POWER skill_thn;   /*!< 行動技能値:打撃命中能力 / Skill: To hit (normal) */
706         ACTION_SKILL_POWER skill_thb;   /*!< 行動技能値:射撃命中能力 / Skill: To hit (shooting) */
707         ACTION_SKILL_POWER skill_tht;   /*!< 行動技能値:投射命中能力 / Skill: To hit (throwing) */
708         ACTION_SKILL_POWER skill_dig;   /*!< 行動技能値:掘削 / Skill: Digging */
709
710         s16b num_blow[2];       /* Number of blows */
711         s16b num_fire;          /* Number of shots */
712
713         byte tval_xtra;         /* Correct xtra tval */
714         byte tval_ammo;         /* Correct ammo tval */
715
716         byte pspeed;            /* Current speed */
717
718         ENERGY energy_use;      /* Energy use this current_world_ptr->game_turn */
719
720         POSITION y;     /* Player location in dungeon */
721         POSITION x;     /* Player location in dungeon */
722         GAME_TEXT name[32]; /*!< 現在のプレイヤー名 / Current player's character name */
723         char base_name[32]; /*!< Stripped version of "player_name" */
724
725 };
726 extern player_type *p_ptr;
727
728 extern concptr your_alignment(void);
729 extern int weapon_exp_level(int weapon_exp);
730 extern int riding_exp_level(int riding_exp);
731 extern int spell_exp_level(int spell_exp);
732
733 extern s16b calc_num_fire(object_type *o_ptr);
734 extern void calc_bonuses(void);
735 extern WEIGHT weight_limit(void);
736 extern bool has_melee_weapon(int i);
737 extern bool is_heavy_shoot(object_type *o_ptr);
738
739 extern bool heavy_armor(player_type *creature_ptr);
740 extern void update_creature(player_type *creature_ptr);
741 extern BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
742 extern bool player_has_no_spellbooks(player_type *creature_ptr);
743
744 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
745 extern void free_turn(player_type *creature_ptr);
746
747 extern bool player_place(POSITION y, POSITION x);
748 extern void sanity_blast(monster_type *m_ptr, bool necro);
749
750 extern void check_experience(void);
751 extern void wreck_the_pattern(void);
752 extern void cnv_stat(int val, char *out_val);
753 extern s16b modify_stat_value(int value, int amount);
754 extern long calc_score(void);
755
756 extern const s32b player_exp[PY_MAX_LEVEL];
757 extern const s32b player_exp_a[PY_MAX_LEVEL];
758
759
760 /* Temporary flags macro */
761 #define IS_FAST() (p_ptr->fast || music_singing(MUSIC_SPEED) || music_singing(MUSIC_SHERO))
762 #define IS_INVULN() (p_ptr->invuln || music_singing(MUSIC_INVULN))
763 #define IS_HERO() (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
764 #define IS_BLESSED() (p_ptr->blessed || music_singing(MUSIC_BLESS) || hex_spelling(HEX_BLESS))
765 #define IS_OPPOSE_ACID() (p_ptr->oppose_acid || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
766 #define IS_OPPOSE_ELEC() (p_ptr->oppose_elec || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
767 #define IS_OPPOSE_FIRE() (p_ptr->oppose_fire || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
768 #define IS_OPPOSE_COLD() (p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
769 #define IS_OPPOSE_POIS() (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
770 #define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(MUSIC_MIND) || (p_ptr->concent >= CONCENT_TELE_THRESHOLD))
771 #define IS_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
772
773 #define P_PTR_KI (p_ptr->magic_num1[0])
774
775 /*
776  * Player "food" crucial values
777  */
778 #define PY_FOOD_MAX     15000   /*!< 食べ過ぎ~満腹の閾値 / Food value (Bloated) */
779 #define PY_FOOD_FULL    10000   /*!< 満腹~平常の閾値 / Food value (Normal) */
780 #define PY_FOOD_ALERT   2000    /*!< 平常~空腹の閾値 / Food value (Hungry) */
781 #define PY_FOOD_WEAK    1000    /*!< 空腹~衰弱の閾値 / Food value (Weak) */
782 #define PY_FOOD_FAINT   500     /*!< 衰弱~衰弱(赤表示/麻痺)の閾値 / Food value (Fainting) */
783 #define PY_FOOD_STARVE  100     /*!< 衰弱(赤表示/麻痺)~飢餓ダメージの閾値 / Food value (Starving) */
784
785 /*
786  * Player regeneration constants
787  */
788 #define PY_REGEN_NORMAL         197     /* Regen factor*2^16 when full */
789 #define PY_REGEN_WEAK           98      /* Regen factor*2^16 when weak */
790 #define PY_REGEN_FAINT          33      /* Regen factor*2^16 when fainting */
791 #define PY_REGEN_HPBASE         1442    /* Min amount hp regen*2^16 */
792 #define PY_REGEN_MNBASE         524     /* Min amount mana regen*2^16 */
793
794 #define CAN_TWO_HANDS_WIELDING() (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))
795
796
797 extern void cheat_death(player_type *creature_ptr);