OSDN Git Service

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