OSDN Git Service

[Refactor] #39962 *_immunity() とplayer_vulnerability_flags() をrace-resistances.c...
[hengband/hengband.git] / src / view / display-player.c
1 /*!
2  * @brief プレーヤー表示に関するあれこれ (整理中)
3  * @date 2020/02/25
4  * @author Hourier
5  * @details
6  * ここにこれ以上関数を引っ越してくるのは禁止。何ならここから更に分割していく
7  */
8
9 #include "display-player.h"
10 #include "player-personality.h"
11 #include "term.h"
12 #include "status-first-page.h"
13 #include "player-sex.h"
14 #include "patron.h"
15 #include "world.h"
16 #include "quest.h"
17 #include "core.h" // 暫定。後で消す
18 #include "player/permanent-resistances.h"
19 #include "player/temporary-resistances.h"
20 #include "files.h"
21 #include "mutation.h"
22 #include "view-mainwindow.h" // 暫定。後で消す
23 #include "player-skill.h"
24 #include "player-effects.h"
25 #include "realm-song.h"
26 #include "object-hook.h"
27 #include "shoot.h"
28 #include "dungeon-file.h"
29 #include "objectkind.h"
30 #include "view/display-util.h"
31 #include "player/race-resistances.h"
32
33 /*!
34  * @brief プレイヤーの特性フラグ一種を表示するサブルーチン /
35  * Helper function, see below
36  * @param creature_ptr プレーヤーへの参照ポインタ
37  * @param row コンソール表示位置の左上行
38  * @param col コンソール表示位置の左上列
39  * @param header コンソール上で表示する特性名
40  * @param flag1 参照する特性ID
41  * @param f プレイヤーの特性情報構造体
42  * @param mode 表示オプション
43  * @return なし
44  */
45 static void display_flag_aux(player_type *creature_ptr, TERM_LEN row, TERM_LEN col, concptr header, int flag1, all_player_flags *f, u16b mode)
46 {
47         byte header_color = TERM_L_DARK;
48         int header_col = col;
49
50         bool vuln = FALSE;
51         if (have_flag(f->player_vuln, flag1) &&
52                 !(have_flag(f->known_obj_imm, flag1) ||
53                         have_flag(f->player_imm, flag1) ||
54                         have_flag(f->tim_player_imm, flag1)))
55                 vuln = TRUE;
56
57         col += strlen(header) + 1;
58
59         /* Weapon flags need only two column */
60         int max_i = (mode & DP_WP) ? INVEN_LARM + 1 : INVEN_TOTAL;
61
62         for (int i = INVEN_RARM; i < max_i; i++)
63         {
64                 BIT_FLAGS flgs[TR_FLAG_SIZE];
65                 object_type *o_ptr;
66                 o_ptr = &creature_ptr->inventory_list[i];
67                 object_flags_known(o_ptr, flgs);
68                 if (!(mode & DP_IMM))
69                         c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
70
71                 if (mode & DP_CURSE)
72                 {
73                         if (have_flag(flgs, TR_ADD_L_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
74                         {
75                                 c_put_str(TERM_L_DARK, "+", row, col);
76                                 header_color = TERM_WHITE;
77                         }
78
79                         if (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE))
80                         {
81                                 c_put_str(TERM_WHITE, "+", row, col);
82                                 header_color = TERM_WHITE;
83                         }
84
85                         if (o_ptr->curse_flags & TRC_PERMA_CURSE)
86                         {
87                                 c_put_str(TERM_WHITE, "*", row, col);
88                                 header_color = TERM_WHITE;
89                         }
90
91                         col++;
92                         continue;
93                 }
94
95                 if (flag1 == TR_LITE_1)
96                 {
97                         if (HAVE_DARK_FLAG(flgs))
98                         {
99                                 c_put_str(TERM_L_DARK, "+", row, col);
100                                 header_color = TERM_WHITE;
101                         }
102                         else if (HAVE_LITE_FLAG(flgs))
103                         {
104                                 c_put_str(TERM_WHITE, "+", row, col);
105                                 header_color = TERM_WHITE;
106                         }
107
108                         col++;
109                         continue;
110                 }
111
112                 if (have_flag(flgs, flag1))
113                 {
114                         c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE),
115                                 (mode & DP_IMM) ? "*" : "+", row, col);
116                         header_color = TERM_WHITE;
117                 }
118
119                 col++;
120         }
121
122         if (mode & DP_IMM)
123         {
124                 if (header_color != TERM_L_DARK)
125                 {
126                         c_put_str(header_color, header, row, header_col);
127                 }
128
129                 return;
130         }
131
132         c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
133         if (have_flag(f->player_flags, flag1))
134         {
135                 c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE), "+", row, col);
136                 header_color = TERM_WHITE;
137         }
138
139         if (have_flag(f->tim_player_flags, flag1))
140         {
141                 c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
142                 header_color = TERM_WHITE;
143         }
144
145         if (have_flag(f->tim_player_imm, flag1))
146         {
147                 c_put_str(TERM_YELLOW, "*", row, col);
148                 header_color = TERM_WHITE;
149         }
150
151         if (have_flag(f->player_imm, flag1))
152         {
153                 c_put_str(TERM_WHITE, "*", row, col);
154                 header_color = TERM_WHITE;
155         }
156
157         if (vuln) c_put_str(TERM_RED, "v", row, col + 1);
158         c_put_str(header_color, header, row, header_col);
159 }
160
161
162 /*!
163  * @brief プレイヤーの特性フラグ一覧表示2a /
164  * @param creature_ptr プレーヤーへの参照ポインタ
165  * Special display, part 2a
166  * @return なし
167  */
168 static void display_player_misc_info(player_type *creature_ptr)
169 {
170 #ifdef JP
171         put_str("名前  :", 1, 26);
172         put_str("性別  :", 3, 1);
173         put_str("種族  :", 4, 1);
174         put_str("職業  :", 5, 1);
175 #else
176         put_str("Name  :", 1, 26);
177         put_str("Sex   :", 3, 1);
178         put_str("Race  :", 4, 1);
179         put_str("Class :", 5, 1);
180 #endif
181
182         char    buf[80];
183         char    tmp[80];
184         strcpy(tmp, ap_ptr->title);
185 #ifdef JP
186         if (ap_ptr->no == 1)
187                 strcat(tmp, "の");
188 #else
189         strcat(tmp, " ");
190 #endif
191         strcat(tmp, creature_ptr->name);
192
193         c_put_str(TERM_L_BLUE, tmp, 1, 34);
194         c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9);
195         c_put_str(TERM_L_BLUE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), 4, 9);
196         c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 9);
197
198 #ifdef JP
199         put_str("レベル:", 6, 1);
200         put_str("HP  :", 7, 1);
201         put_str("MP  :", 8, 1);
202 #else
203         put_str("Level :", 6, 1);
204         put_str("Hits  :", 7, 1);
205         put_str("Mana  :", 8, 1);
206 #endif
207
208         (void)sprintf(buf, "%d", (int)creature_ptr->lev);
209         c_put_str(TERM_L_BLUE, buf, 6, 9);
210         (void)sprintf(buf, "%d/%d", (int)creature_ptr->chp, (int)creature_ptr->mhp);
211         c_put_str(TERM_L_BLUE, buf, 7, 9);
212         (void)sprintf(buf, "%d/%d", (int)creature_ptr->csp, (int)creature_ptr->msp);
213         c_put_str(TERM_L_BLUE, buf, 8, 9);
214 }
215
216
217 /*!
218  * @brief プレイヤーの特性フラグ一覧表示2b /
219  * Special display, part 2b
220  * @param creature_ptr プレーヤーへの参照ポインタ
221  * @return なし
222  * @details
223  * <pre>
224  * How to print out the modifications and sustains.
225  * Positive mods with no sustain will be light green.
226  * Positive mods with a sustain will be dark green.
227  * Sustains (with no modification) will be a dark green 's'.
228  * Negative mods (from a curse) will be red.
229  * Huge mods (>9), like from MICoMorgoth, will be a '*'
230  * No mod, no sustain, will be a slate '.'
231  * </pre>
232  */
233 static void display_player_stat_info(player_type *creature_ptr)
234 {
235         int stat_col = 22;
236         int row = 3;
237         c_put_str(TERM_WHITE, _("能力", "Stat"), row, stat_col + 1);
238         c_put_str(TERM_BLUE, _("  基本", "  Base"), row, stat_col + 7);
239         c_put_str(TERM_L_BLUE, _(" 種 職 性 装 ", "RacClaPerMod"), row, stat_col + 13);
240         c_put_str(TERM_L_GREEN, _("合計", "Actual"), row, stat_col + 28);
241         c_put_str(TERM_YELLOW, _("現在", "Current"), row, stat_col + 35);
242
243         char buf[80];
244         for (int i = 0; i < A_MAX; i++)
245         {
246                 int r_adj;
247                 if (creature_ptr->mimic_form) r_adj = mimic_info[creature_ptr->mimic_form].r_adj[i];
248                 else r_adj = rp_ptr->r_adj[i];
249
250                 int e_adj = 0;
251
252                 if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] > 18))
253                         e_adj = (creature_ptr->stat_top[i] - creature_ptr->stat_max[i]) / 10;
254                 if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] <= 18))
255                         e_adj = creature_ptr->stat_top[i] - creature_ptr->stat_max[i];
256                 if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] > 18))
257                         e_adj = (creature_ptr->stat_top[i] - 18) / 10 - creature_ptr->stat_max[i] + 18;
258
259                 if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] <= 18))
260                         e_adj = creature_ptr->stat_top[i] - (creature_ptr->stat_max[i] - 19) / 10 - 19;
261
262                 if (PRACE_IS_(creature_ptr, RACE_ENT))
263                 {
264                         switch (i)
265                         {
266                         case A_STR:
267                         case A_CON:
268                                 if (creature_ptr->lev > 25) r_adj++;
269                                 if (creature_ptr->lev > 40) r_adj++;
270                                 if (creature_ptr->lev > 45) r_adj++;
271                                 break;
272                         case A_DEX:
273                                 if (creature_ptr->lev > 25) r_adj--;
274                                 if (creature_ptr->lev > 40) r_adj--;
275                                 if (creature_ptr->lev > 45) r_adj--;
276                                 break;
277                         }
278                 }
279
280                 e_adj -= r_adj;
281                 e_adj -= cp_ptr->c_adj[i];
282                 e_adj -= ap_ptr->a_adj[i];
283
284                 if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i])
285                         c_put_str(TERM_WHITE, stat_names_reduced[i], row + i + 1, stat_col + 1);
286                 else
287                         c_put_str(TERM_WHITE, stat_names[i], row + i + 1, stat_col + 1);
288
289                 /* Internal "natural" max value.  Maxes at 18/100 */
290                 /* This is useful to see if you are maxed out */
291                 cnv_stat(creature_ptr->stat_max[i], buf);
292                 if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i])
293                         c_put_str(TERM_WHITE, "!", row + i + 1, _(stat_col + 6, stat_col + 4));
294
295                 c_put_str(TERM_BLUE, buf, row + i + 1, stat_col + 13 - strlen(buf));
296
297                 (void)sprintf(buf, "%3d", r_adj);
298                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 13);
299                 (void)sprintf(buf, "%3d", (int)cp_ptr->c_adj[i]);
300                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 16);
301                 (void)sprintf(buf, "%3d", (int)ap_ptr->a_adj[i]);
302                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 19);
303                 (void)sprintf(buf, "%3d", (int)e_adj);
304                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 22);
305
306                 cnv_stat(creature_ptr->stat_top[i], buf);
307                 c_put_str(TERM_L_GREEN, buf, row + i + 1, stat_col + 26);
308
309                 if (creature_ptr->stat_use[i] < creature_ptr->stat_top[i])
310                 {
311                         cnv_stat(creature_ptr->stat_use[i], buf);
312                         c_put_str(TERM_YELLOW, buf, row + i + 1, stat_col + 33);
313                 }
314         }
315
316         int col = stat_col + 41;
317         c_put_str(TERM_WHITE, "abcdefghijkl@", row, col);
318         c_put_str(TERM_L_GREEN, _("能力修正", "Modification"), row - 1, col);
319
320         BIT_FLAGS flgs[TR_FLAG_SIZE];
321         for (int i = INVEN_RARM; i < INVEN_TOTAL; i++)
322         {
323                 object_type *o_ptr;
324                 o_ptr = &creature_ptr->inventory_list[i];
325                 object_flags_known(o_ptr, flgs);
326                 for (int stat = 0; stat < A_MAX; stat++)
327                 {
328                         byte a = TERM_SLATE;
329                         char c = '.';
330                         if (have_flag(flgs, stat))
331                         {
332                                 c = '*';
333
334                                 if (o_ptr->pval > 0)
335                                 {
336                                         a = TERM_L_GREEN;
337                                         if (o_ptr->pval < 10) c = '0' + o_ptr->pval;
338                                 }
339
340                                 if (have_flag(flgs, stat + TR_SUST_STR))
341                                 {
342                                         a = TERM_GREEN;
343                                 }
344
345                                 if (o_ptr->pval < 0)
346                                 {
347                                         a = TERM_RED;
348                                         if (o_ptr->pval > -10) c = '0' - o_ptr->pval;
349                                 }
350                         }
351                         else if (have_flag(flgs, stat + TR_SUST_STR))
352                         {
353                                 a = TERM_GREEN;
354                                 c = 's';
355                         }
356
357                         Term_putch(col, row + stat + 1, a, c);
358                 }
359
360                 col++;
361         }
362
363         player_flags(creature_ptr, flgs);
364         for (int stat = 0; stat < A_MAX; stat++)
365         {
366                 byte a = TERM_SLATE;
367                 char c = '.';
368
369                 if (creature_ptr->muta3 || creature_ptr->tsuyoshi)
370                 {
371                         int dummy = 0;
372
373                         if (stat == A_STR)
374                         {
375                                 if (creature_ptr->muta3 & MUT3_HYPER_STR) dummy += 4;
376                                 if (creature_ptr->muta3 & MUT3_PUNY) dummy -= 4;
377                                 if (creature_ptr->tsuyoshi) dummy += 4;
378                         }
379                         else if (stat == A_WIS || stat == A_INT)
380                         {
381                                 if (creature_ptr->muta3 & MUT3_HYPER_INT) dummy += 4;
382                                 if (creature_ptr->muta3 & MUT3_MORONIC) dummy -= 4;
383                         }
384                         else if (stat == A_DEX)
385                         {
386                                 if (creature_ptr->muta3 & MUT3_IRON_SKIN) dummy -= 1;
387                                 if (creature_ptr->muta3 & MUT3_LIMBER) dummy += 3;
388                                 if (creature_ptr->muta3 & MUT3_ARTHRITIS) dummy -= 3;
389                         }
390                         else if (stat == A_CON)
391                         {
392                                 if (creature_ptr->muta3 & MUT3_RESILIENT) dummy += 4;
393                                 if (creature_ptr->muta3 & MUT3_XTRA_FAT) dummy += 2;
394                                 if (creature_ptr->muta3 & MUT3_ALBINO) dummy -= 4;
395                                 if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 2;
396                                 if (creature_ptr->tsuyoshi) dummy += 4;
397                         }
398                         else if (stat == A_CHR)
399                         {
400                                 if (creature_ptr->muta3 & MUT3_SILLY_VOI) dummy -= 4;
401                                 if (creature_ptr->muta3 & MUT3_BLANK_FAC) dummy -= 1;
402                                 if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 1;
403                                 if (creature_ptr->muta3 & MUT3_SCALES) dummy -= 1;
404                                 if (creature_ptr->muta3 & MUT3_WART_SKIN) dummy -= 2;
405                                 if (creature_ptr->muta3 & MUT3_ILL_NORM) dummy = 0;
406                         }
407
408                         if (dummy != 0)
409                         {
410                                 c = '*';
411                                 if (dummy > 0)
412                                 {
413                                         /* Good */
414                                         a = TERM_L_GREEN;
415
416                                         /* Label boost */
417                                         if (dummy < 10) c = '0' + dummy;
418                                 }
419
420                                 if (dummy < 0)
421                                 {
422                                         a = TERM_RED;
423                                         if (dummy > -10) c = '0' - dummy;
424                                 }
425                         }
426                 }
427
428                 if (have_flag(flgs, stat + TR_SUST_STR))
429                 {
430                         a = TERM_GREEN;
431                         c = 's';
432                 }
433
434                 Term_putch(col, row + stat + 1, a, c);
435         }
436 }
437
438
439 /*!
440  * @brief プレイヤーの特性フラグ一覧表示1
441  * @param creature_ptr プレーヤーへの参照ポインタ
442  * Special display, part 1
443  * @return なし
444  */
445 static void display_player_flag_info(player_type *creature_ptr)
446 {
447         all_player_flags f;
448         player_flags(creature_ptr, f.player_flags);
449         tim_player_flags(creature_ptr, f.tim_player_flags);
450         player_immunity(creature_ptr, f.player_imm);
451         tim_player_immunity(creature_ptr, f.tim_player_imm);
452         known_obj_immunity(creature_ptr, f.known_obj_imm);
453         player_vulnerability_flags(creature_ptr, f.player_vuln);
454
455         /*** Set 1 ***/
456         TERM_LEN row = 12;
457         TERM_LEN col = 1;
458         display_player_equippy(creature_ptr, row - 2, col + 8, 0);
459         c_put_str(TERM_WHITE, "abcdefghijkl@", row - 1, col + 8);
460
461 #ifdef JP
462         display_flag_aux(creature_ptr, row + 0, col, "耐酸  :", TR_RES_ACID, &f, 0);
463         display_flag_aux(creature_ptr, row + 0, col, "耐酸  :", TR_IM_ACID, &f, DP_IMM);
464         display_flag_aux(creature_ptr, row + 1, col, "耐電撃:", TR_RES_ELEC, &f, 0);
465         display_flag_aux(creature_ptr, row + 1, col, "耐電撃:", TR_IM_ELEC, &f, DP_IMM);
466         display_flag_aux(creature_ptr, row + 2, col, "耐火炎:", TR_RES_FIRE, &f, 0);
467         display_flag_aux(creature_ptr, row + 2, col, "耐火炎:", TR_IM_FIRE, &f, DP_IMM);
468         display_flag_aux(creature_ptr, row + 3, col, "耐冷気:", TR_RES_COLD, &f, 0);
469         display_flag_aux(creature_ptr, row + 3, col, "耐冷気:", TR_IM_COLD, &f, DP_IMM);
470         display_flag_aux(creature_ptr, row + 4, col, "耐毒  :", TR_RES_POIS, &f, 0);
471         display_flag_aux(creature_ptr, row + 5, col, "耐閃光:", TR_RES_LITE, &f, 0);
472         display_flag_aux(creature_ptr, row + 6, col, "耐暗黒:", TR_RES_DARK, &f, 0);
473         display_flag_aux(creature_ptr, row + 7, col, "耐破片:", TR_RES_SHARDS, &f, 0);
474         display_flag_aux(creature_ptr, row + 8, col, "耐盲目:", TR_RES_BLIND, &f, 0);
475         display_flag_aux(creature_ptr, row + 9, col, "耐混乱:", TR_RES_CONF, &f, 0);
476 #else
477         display_flag_aux(creature_ptr, row + 0, col, "Acid  :", TR_RES_ACID, &f, 0);
478         display_flag_aux(creature_ptr, row + 0, col, "Acid  :", TR_IM_ACID, &f, DP_IMM);
479         display_flag_aux(creature_ptr, row + 1, col, "Elec  :", TR_RES_ELEC, &f, 0);
480         display_flag_aux(creature_ptr, row + 1, col, "Elec  :", TR_IM_ELEC, &f, DP_IMM);
481         display_flag_aux(creature_ptr, row + 2, col, "Fire  :", TR_RES_FIRE, &f, 0);
482         display_flag_aux(creature_ptr, row + 2, col, "Fire  :", TR_IM_FIRE, &f, DP_IMM);
483         display_flag_aux(creature_ptr, row + 3, col, "Cold  :", TR_RES_COLD, &f, 0);
484         display_flag_aux(creature_ptr, row + 3, col, "Cold  :", TR_IM_COLD, &f, DP_IMM);
485         display_flag_aux(creature_ptr, row + 4, col, "Poison:", TR_RES_POIS, &f, 0);
486         display_flag_aux(creature_ptr, row + 5, col, "Light :", TR_RES_LITE, &f, 0);
487         display_flag_aux(creature_ptr, row + 6, col, "Dark  :", TR_RES_DARK, &f, 0);
488         display_flag_aux(creature_ptr, row + 7, col, "Shard :", TR_RES_SHARDS, &f, 0);
489         display_flag_aux(creature_ptr, row + 8, col, "Blind :", TR_RES_BLIND, &f, 0);
490         display_flag_aux(creature_ptr, row + 9, col, "Conf  :", TR_RES_CONF, &f, 0);
491 #endif
492
493         /*** Set 2 ***/
494         row = 12;
495         col = 26;
496         display_player_equippy(creature_ptr, row - 2, col + 8, 0);
497         c_put_str(TERM_WHITE, "abcdefghijkl@", row - 1, col + 8);
498
499 #ifdef JP
500         display_flag_aux(creature_ptr, row + 0, col, "耐轟音:", TR_RES_SOUND, &f, 0);
501         display_flag_aux(creature_ptr, row + 1, col, "耐地獄:", TR_RES_NETHER, &f, 0);
502         display_flag_aux(creature_ptr, row + 2, col, "耐因混:", TR_RES_NEXUS, &f, 0);
503         display_flag_aux(creature_ptr, row + 3, col, "耐カオ:", TR_RES_CHAOS, &f, 0);
504         display_flag_aux(creature_ptr, row + 4, col, "耐劣化:", TR_RES_DISEN, &f, 0);
505         display_flag_aux(creature_ptr, row + 5, col, "耐恐怖:", TR_RES_FEAR, &f, 0);
506         display_flag_aux(creature_ptr, row + 6, col, "反射  :", TR_REFLECT, &f, 0);
507         display_flag_aux(creature_ptr, row + 7, col, "火炎オ:", TR_SH_FIRE, &f, 0);
508         display_flag_aux(creature_ptr, row + 8, col, "電気オ:", TR_SH_ELEC, &f, 0);
509         display_flag_aux(creature_ptr, row + 9, col, "冷気オ:", TR_SH_COLD, &f, 0);
510 #else
511         display_flag_aux(creature_ptr, row + 0, col, "Sound :", TR_RES_SOUND, &f, 0);
512         display_flag_aux(creature_ptr, row + 1, col, "Nether:", TR_RES_NETHER, &f, 0);
513         display_flag_aux(creature_ptr, row + 2, col, "Nexus :", TR_RES_NEXUS, &f, 0);
514         display_flag_aux(creature_ptr, row + 3, col, "Chaos :", TR_RES_CHAOS, &f, 0);
515         display_flag_aux(creature_ptr, row + 4, col, "Disnch:", TR_RES_DISEN, &f, 0);
516         display_flag_aux(creature_ptr, row + 5, col, "Fear  :", TR_RES_FEAR, &f, 0);
517         display_flag_aux(creature_ptr, row + 6, col, "Reflct:", TR_REFLECT, &f, 0);
518         display_flag_aux(creature_ptr, row + 7, col, "AuFire:", TR_SH_FIRE, &f, 0);
519         display_flag_aux(creature_ptr, row + 8, col, "AuElec:", TR_SH_ELEC, &f, 0);
520         display_flag_aux(creature_ptr, row + 9, col, "AuCold:", TR_SH_COLD, &f, 0);
521 #endif
522
523         /*** Set 3 ***/
524         row = 12;
525         col = 51;
526         display_player_equippy(creature_ptr, row - 2, col + 12, 0);
527         c_put_str(TERM_WHITE, "abcdefghijkl@", row - 1, col + 12);
528
529 #ifdef JP
530         display_flag_aux(creature_ptr, row + 0, col, "加速      :", TR_SPEED, &f, 0);
531         display_flag_aux(creature_ptr, row + 1, col, "耐麻痺    :", TR_FREE_ACT, &f, 0);
532         display_flag_aux(creature_ptr, row + 2, col, "透明体視認:", TR_SEE_INVIS, &f, 0);
533         display_flag_aux(creature_ptr, row + 3, col, "経験値保持:", TR_HOLD_EXP, &f, 0);
534         display_flag_aux(creature_ptr, row + 4, col, "警告      :", TR_WARNING, &f, 0);
535         display_flag_aux(creature_ptr, row + 5, col, "遅消化    :", TR_SLOW_DIGEST, &f, 0);
536         display_flag_aux(creature_ptr, row + 6, col, "急回復    :", TR_REGEN, &f, 0);
537         display_flag_aux(creature_ptr, row + 7, col, "浮遊      :", TR_LEVITATION, &f, 0);
538         display_flag_aux(creature_ptr, row + 8, col, "永遠光源  :", TR_LITE_1, &f, 0);
539         display_flag_aux(creature_ptr, row + 9, col, "呪い      :", 0, &f, DP_CURSE);
540 #else
541         display_flag_aux(creature_ptr, row + 0, col, "Speed     :", TR_SPEED, &f, 0);
542         display_flag_aux(creature_ptr, row + 1, col, "FreeAction:", TR_FREE_ACT, &f, 0);
543         display_flag_aux(creature_ptr, row + 2, col, "SeeInvisi.:", TR_SEE_INVIS, &f, 0);
544         display_flag_aux(creature_ptr, row + 3, col, "Hold Exp  :", TR_HOLD_EXP, &f, 0);
545         display_flag_aux(creature_ptr, row + 4, col, "Warning   :", TR_WARNING, &f, 0);
546         display_flag_aux(creature_ptr, row + 5, col, "SlowDigest:", TR_SLOW_DIGEST, &f, 0);
547         display_flag_aux(creature_ptr, row + 6, col, "Regene.   :", TR_REGEN, &f, 0);
548         display_flag_aux(creature_ptr, row + 7, col, "Levitation:", TR_LEVITATION, &f, 0);
549         display_flag_aux(creature_ptr, row + 8, col, "Perm Lite :", TR_LITE_1, &f, 0);
550         display_flag_aux(creature_ptr, row + 9, col, "Cursed    :", 0, &f, DP_CURSE);
551 #endif
552 }
553
554
555 /*!
556  * @brief プレイヤーの特性フラグ一覧表示2 /
557  * @param creature_ptr プレーヤーへの参照ポインタ
558  * Special display, part 2
559  * @return なし
560  */
561 static void display_player_other_flag_info(player_type *creature_ptr)
562 {
563         /* Extract flags and store */
564         all_player_flags f;
565         player_flags(creature_ptr, f.player_flags);
566         tim_player_flags(creature_ptr, f.tim_player_flags);
567         player_immunity(creature_ptr, f.player_imm);
568         tim_player_immunity(creature_ptr, f.tim_player_imm);
569         known_obj_immunity(creature_ptr, f.known_obj_imm);
570         player_vulnerability_flags(creature_ptr, f.player_vuln);
571
572         /*** Set 1 ***/
573         TERM_LEN row = 3;
574         TERM_LEN col = 1;
575         display_player_equippy(creature_ptr, row - 2, col + 12, DP_WP);
576         c_put_str(TERM_WHITE, "ab@", row - 1, col + 12);
577
578 #ifdef JP
579         display_flag_aux(creature_ptr, row + 0, col, "邪悪 倍打 :", TR_SLAY_EVIL, &f, DP_WP);
580         display_flag_aux(creature_ptr, row + 0, col, "邪悪 倍打 :", TR_KILL_EVIL, &f, (DP_WP | DP_IMM));
581         display_flag_aux(creature_ptr, row + 1, col, "不死 倍打 :", TR_SLAY_UNDEAD, &f, DP_WP);
582         display_flag_aux(creature_ptr, row + 1, col, "不死 倍打 :", TR_KILL_UNDEAD, &f, (DP_WP | DP_IMM));
583         display_flag_aux(creature_ptr, row + 2, col, "悪魔 倍打 :", TR_SLAY_DEMON, &f, DP_WP);
584         display_flag_aux(creature_ptr, row + 2, col, "悪魔 倍打 :", TR_KILL_DEMON, &f, (DP_WP | DP_IMM));
585         display_flag_aux(creature_ptr, row + 3, col, "龍 倍打   :", TR_SLAY_DRAGON, &f, DP_WP);
586         display_flag_aux(creature_ptr, row + 3, col, "龍 倍打   :", TR_KILL_DRAGON, &f, (DP_WP | DP_IMM));
587         display_flag_aux(creature_ptr, row + 4, col, "人間 倍打 :", TR_SLAY_HUMAN, &f, DP_WP);
588         display_flag_aux(creature_ptr, row + 4, col, "人間 倍打 :", TR_KILL_HUMAN, &f, (DP_WP | DP_IMM));
589         display_flag_aux(creature_ptr, row + 5, col, "動物 倍打 :", TR_SLAY_ANIMAL, &f, DP_WP);
590         display_flag_aux(creature_ptr, row + 5, col, "動物 倍打 :", TR_KILL_ANIMAL, &f, (DP_WP | DP_IMM));
591         display_flag_aux(creature_ptr, row + 6, col, "オーク倍打:", TR_SLAY_ORC, &f, DP_WP);
592         display_flag_aux(creature_ptr, row + 6, col, "オーク倍打:", TR_KILL_ORC, &f, (DP_WP | DP_IMM));
593         display_flag_aux(creature_ptr, row + 7, col, "トロル倍打:", TR_SLAY_TROLL, &f, DP_WP);
594         display_flag_aux(creature_ptr, row + 7, col, "トロル倍打:", TR_KILL_TROLL, &f, (DP_WP | DP_IMM));
595         display_flag_aux(creature_ptr, row + 8, col, "巨人 倍打 :", TR_SLAY_GIANT, &f, DP_WP);
596         display_flag_aux(creature_ptr, row + 8, col, "巨人 倍打 :", TR_KILL_GIANT, &f, (DP_WP | DP_IMM));
597         display_flag_aux(creature_ptr, row + 9, col, "溶解      :", TR_BRAND_ACID, &f, DP_WP);
598         display_flag_aux(creature_ptr, row + 10, col, "電撃      :", TR_BRAND_ELEC, &f, DP_WP);
599         display_flag_aux(creature_ptr, row + 11, col, "焼棄      :", TR_BRAND_FIRE, &f, DP_WP);
600         display_flag_aux(creature_ptr, row + 12, col, "凍結      :", TR_BRAND_COLD, &f, DP_WP);
601         display_flag_aux(creature_ptr, row + 13, col, "毒殺      :", TR_BRAND_POIS, &f, DP_WP);
602         display_flag_aux(creature_ptr, row + 14, col, "切れ味    :", TR_VORPAL, &f, DP_WP);
603         display_flag_aux(creature_ptr, row + 15, col, "地震      :", TR_IMPACT, &f, DP_WP);
604         display_flag_aux(creature_ptr, row + 16, col, "吸血      :", TR_VAMPIRIC, &f, DP_WP);
605         display_flag_aux(creature_ptr, row + 17, col, "カオス効果:", TR_CHAOTIC, &f, DP_WP);
606         display_flag_aux(creature_ptr, row + 18, col, "理力      :", TR_FORCE_WEAPON, &f, DP_WP);
607 #else
608         display_flag_aux(creature_ptr, row + 0, col, "Slay Evil :", TR_SLAY_EVIL, &f, DP_WP);
609         display_flag_aux(creature_ptr, row + 0, col, "Slay Evil :", TR_KILL_EVIL, &f, (DP_WP | DP_IMM));
610         display_flag_aux(creature_ptr, row + 1, col, "Slay Und. :", TR_SLAY_UNDEAD, &f, DP_WP);
611         display_flag_aux(creature_ptr, row + 1, col, "Slay Und. :", TR_KILL_UNDEAD, &f, (DP_WP | DP_IMM));
612         display_flag_aux(creature_ptr, row + 2, col, "Slay Demon:", TR_SLAY_DEMON, &f, DP_WP);
613         display_flag_aux(creature_ptr, row + 2, col, "Slay Demon:", TR_KILL_DEMON, &f, (DP_WP | DP_IMM));
614         display_flag_aux(creature_ptr, row + 3, col, "Slay Drag.:", TR_SLAY_DRAGON, &f, DP_WP);
615         display_flag_aux(creature_ptr, row + 3, col, "Slay Drag.:", TR_KILL_DRAGON, &f, (DP_WP | DP_IMM));
616         display_flag_aux(creature_ptr, row + 4, col, "Slay Human:", TR_SLAY_HUMAN, &f, DP_WP);
617         display_flag_aux(creature_ptr, row + 4, col, "Slay Human:", TR_KILL_HUMAN, &f, (DP_WP | DP_IMM));
618         display_flag_aux(creature_ptr, row + 5, col, "Slay Anim.:", TR_SLAY_ANIMAL, &f, DP_WP);
619         display_flag_aux(creature_ptr, row + 5, col, "Slay Anim.:", TR_KILL_ANIMAL, &f, (DP_WP | DP_IMM));
620         display_flag_aux(creature_ptr, row + 6, col, "Slay Orc  :", TR_SLAY_ORC, &f, DP_WP);
621         display_flag_aux(creature_ptr, row + 6, col, "Slay Orc  :", TR_KILL_ORC, &f, (DP_WP | DP_IMM));
622         display_flag_aux(creature_ptr, row + 7, col, "Slay Troll:", TR_SLAY_TROLL, &f, DP_WP);
623         display_flag_aux(creature_ptr, row + 7, col, "Slay Troll:", TR_KILL_TROLL, &f, (DP_WP | DP_IMM));
624         display_flag_aux(creature_ptr, row + 8, col, "Slay Giant:", TR_SLAY_GIANT, &f, DP_WP);
625         display_flag_aux(creature_ptr, row + 8, col, "Slay Giant:", TR_KILL_GIANT, &f, (DP_WP | DP_IMM));
626         display_flag_aux(creature_ptr, row + 9, col, "Acid Brand:", TR_BRAND_ACID, &f, DP_WP);
627         display_flag_aux(creature_ptr, row + 10, col, "Elec Brand:", TR_BRAND_ELEC, &f, DP_WP);
628         display_flag_aux(creature_ptr, row + 11, col, "Fire Brand:", TR_BRAND_FIRE, &f, DP_WP);
629         display_flag_aux(creature_ptr, row + 12, col, "Cold Brand:", TR_BRAND_COLD, &f, DP_WP);
630         display_flag_aux(creature_ptr, row + 13, col, "Poison Brd:", TR_BRAND_POIS, &f, DP_WP);
631         display_flag_aux(creature_ptr, row + 14, col, "Sharpness :", TR_VORPAL, &f, DP_WP);
632         display_flag_aux(creature_ptr, row + 15, col, "Quake     :", TR_IMPACT, &f, DP_WP);
633         display_flag_aux(creature_ptr, row + 16, col, "Vampiric  :", TR_VAMPIRIC, &f, DP_WP);
634         display_flag_aux(creature_ptr, row + 17, col, "Chaotic   :", TR_CHAOTIC, &f, DP_WP);
635         display_flag_aux(creature_ptr, row + 18, col, "Force Wep.:", TR_FORCE_WEAPON, &f, DP_WP);
636 #endif
637
638         /*** Set 2 ***/
639         row = 3;
640         col = col + 12 + 7;
641         display_player_equippy(creature_ptr, row - 2, col + 13, 0);
642         c_put_str(TERM_WHITE, "abcdefghijkl@", row - 1, col + 13);
643
644 #ifdef JP
645         display_flag_aux(creature_ptr, row + 0, col, "テレパシー :", TR_TELEPATHY, &f, 0);
646         display_flag_aux(creature_ptr, row + 1, col, "邪悪ESP    :", TR_ESP_EVIL, &f, 0);
647         display_flag_aux(creature_ptr, row + 2, col, "無生物ESP  :", TR_ESP_NONLIVING, &f, 0);
648         display_flag_aux(creature_ptr, row + 3, col, "善良ESP    :", TR_ESP_GOOD, &f, 0);
649         display_flag_aux(creature_ptr, row + 4, col, "不死ESP    :", TR_ESP_UNDEAD, &f, 0);
650         display_flag_aux(creature_ptr, row + 5, col, "悪魔ESP    :", TR_ESP_DEMON, &f, 0);
651         display_flag_aux(creature_ptr, row + 6, col, "龍ESP      :", TR_ESP_DRAGON, &f, 0);
652         display_flag_aux(creature_ptr, row + 7, col, "人間ESP    :", TR_ESP_HUMAN, &f, 0);
653         display_flag_aux(creature_ptr, row + 8, col, "動物ESP    :", TR_ESP_ANIMAL, &f, 0);
654         display_flag_aux(creature_ptr, row + 9, col, "オークESP  :", TR_ESP_ORC, &f, 0);
655         display_flag_aux(creature_ptr, row + 10, col, "トロルESP  :", TR_ESP_TROLL, &f, 0);
656         display_flag_aux(creature_ptr, row + 11, col, "巨人ESP    :", TR_ESP_GIANT, &f, 0);
657         display_flag_aux(creature_ptr, row + 12, col, "ユニークESP:", TR_ESP_UNIQUE, &f, 0);
658         display_flag_aux(creature_ptr, row + 13, col, "腕力維持   :", TR_SUST_STR, &f, 0);
659         display_flag_aux(creature_ptr, row + 14, col, "知力維持   :", TR_SUST_INT, &f, 0);
660         display_flag_aux(creature_ptr, row + 15, col, "賢さ維持   :", TR_SUST_WIS, &f, 0);
661         display_flag_aux(creature_ptr, row + 16, col, "器用維持   :", TR_SUST_DEX, &f, 0);
662         display_flag_aux(creature_ptr, row + 17, col, "耐久維持   :", TR_SUST_CON, &f, 0);
663         display_flag_aux(creature_ptr, row + 18, col, "魅力維持   :", TR_SUST_CHR, &f, 0);
664 #else
665         display_flag_aux(creature_ptr, row + 0, col, "Telepathy  :", TR_TELEPATHY, &f, 0);
666         display_flag_aux(creature_ptr, row + 1, col, "ESP Evil   :", TR_ESP_EVIL, &f, 0);
667         display_flag_aux(creature_ptr, row + 2, col, "ESP Noliv. :", TR_ESP_NONLIVING, &f, 0);
668         display_flag_aux(creature_ptr, row + 3, col, "ESP Good   :", TR_ESP_GOOD, &f, 0);
669         display_flag_aux(creature_ptr, row + 4, col, "ESP Undead :", TR_ESP_UNDEAD, &f, 0);
670         display_flag_aux(creature_ptr, row + 5, col, "ESP Demon  :", TR_ESP_DEMON, &f, 0);
671         display_flag_aux(creature_ptr, row + 6, col, "ESP Dragon :", TR_ESP_DRAGON, &f, 0);
672         display_flag_aux(creature_ptr, row + 7, col, "ESP Human  :", TR_ESP_HUMAN, &f, 0);
673         display_flag_aux(creature_ptr, row + 8, col, "ESP Animal :", TR_ESP_ANIMAL, &f, 0);
674         display_flag_aux(creature_ptr, row + 9, col, "ESP Orc    :", TR_ESP_ORC, &f, 0);
675         display_flag_aux(creature_ptr, row + 10, col, "ESP Troll  :", TR_ESP_TROLL, &f, 0);
676         display_flag_aux(creature_ptr, row + 11, col, "ESP Giant  :", TR_ESP_GIANT, &f, 0);
677         display_flag_aux(creature_ptr, row + 12, col, "ESP Unique :", TR_ESP_UNIQUE, &f, 0);
678         display_flag_aux(creature_ptr, row + 13, col, "Sust Str   :", TR_SUST_STR, &f, 0);
679         display_flag_aux(creature_ptr, row + 14, col, "Sust Int   :", TR_SUST_INT, &f, 0);
680         display_flag_aux(creature_ptr, row + 15, col, "Sust Wis   :", TR_SUST_WIS, &f, 0);
681         display_flag_aux(creature_ptr, row + 16, col, "Sust Dex   :", TR_SUST_DEX, &f, 0);
682         display_flag_aux(creature_ptr, row + 17, col, "Sust Con   :", TR_SUST_CON, &f, 0);
683         display_flag_aux(creature_ptr, row + 18, col, "Sust Chr   :", TR_SUST_CHR, &f, 0);
684 #endif
685
686         /*** Set 3 ***/
687         row = 3;
688         col = col + 12 + 17;
689         display_player_equippy(creature_ptr, row - 2, col + 14, 0);
690         c_put_str(TERM_WHITE, "abcdefghijkl@", row - 1, col + 14);
691
692 #ifdef JP
693         display_flag_aux(creature_ptr, row + 0, col, "追加攻撃    :", TR_BLOWS, &f, 0);
694         display_flag_aux(creature_ptr, row + 1, col, "採掘        :", TR_TUNNEL, &f, 0);
695         display_flag_aux(creature_ptr, row + 2, col, "赤外線視力  :", TR_INFRA, &f, 0);
696         display_flag_aux(creature_ptr, row + 3, col, "魔法道具支配:", TR_MAGIC_MASTERY, &f, 0);
697         display_flag_aux(creature_ptr, row + 4, col, "隠密        :", TR_STEALTH, &f, 0);
698         display_flag_aux(creature_ptr, row + 5, col, "探索        :", TR_SEARCH, &f, 0);
699
700         display_flag_aux(creature_ptr, row + 7, col, "乗馬        :", TR_RIDING, &f, 0);
701         display_flag_aux(creature_ptr, row + 8, col, "投擲        :", TR_THROW, &f, 0);
702         display_flag_aux(creature_ptr, row + 9, col, "祝福        :", TR_BLESSED, &f, 0);
703         display_flag_aux(creature_ptr, row + 10, col, "反テレポート:", TR_NO_TELE, &f, 0);
704         display_flag_aux(creature_ptr, row + 11, col, "反魔法      :", TR_NO_MAGIC, &f, 0);
705         display_flag_aux(creature_ptr, row + 12, col, "消費魔力減少:", TR_DEC_MANA, &f, 0);
706
707         display_flag_aux(creature_ptr, row + 14, col, "経験値減少  :", TR_DRAIN_EXP, &f, 0);
708         display_flag_aux(creature_ptr, row + 15, col, "乱テレポート:", TR_TELEPORT, &f, 0);
709         display_flag_aux(creature_ptr, row + 16, col, "反感        :", TR_AGGRAVATE, &f, 0);
710         display_flag_aux(creature_ptr, row + 17, col, "太古の怨念  :", TR_TY_CURSE, &f, 0);
711 #else
712         display_flag_aux(creature_ptr, row + 0, col, "Add Blows   :", TR_BLOWS, &f, 0);
713         display_flag_aux(creature_ptr, row + 1, col, "Add Tunnel  :", TR_TUNNEL, &f, 0);
714         display_flag_aux(creature_ptr, row + 2, col, "Add Infra   :", TR_INFRA, &f, 0);
715         display_flag_aux(creature_ptr, row + 3, col, "Add Device  :", TR_MAGIC_MASTERY, &f, 0);
716         display_flag_aux(creature_ptr, row + 4, col, "Add Stealth :", TR_STEALTH, &f, 0);
717         display_flag_aux(creature_ptr, row + 5, col, "Add Search  :", TR_SEARCH, &f, 0);
718
719         display_flag_aux(creature_ptr, row + 7, col, "Riding      :", TR_RIDING, &f, 0);
720         display_flag_aux(creature_ptr, row + 8, col, "Throw       :", TR_THROW, &f, 0);
721         display_flag_aux(creature_ptr, row + 9, col, "Blessed     :", TR_BLESSED, &f, 0);
722         display_flag_aux(creature_ptr, row + 10, col, "No Teleport :", TR_NO_TELE, &f, 0);
723         display_flag_aux(creature_ptr, row + 11, col, "Anti Magic  :", TR_NO_MAGIC, &f, 0);
724         display_flag_aux(creature_ptr, row + 12, col, "Econom. Mana:", TR_DEC_MANA, &f, 0);
725
726         display_flag_aux(creature_ptr, row + 14, col, "Drain Exp   :", TR_DRAIN_EXP, &f, 0);
727         display_flag_aux(creature_ptr, row + 15, col, "Rnd.Teleport:", TR_TELEPORT, &f, 0);
728         display_flag_aux(creature_ptr, row + 16, col, "Aggravate   :", TR_AGGRAVATE, &f, 0);
729         display_flag_aux(creature_ptr, row + 17, col, "TY Curse    :", TR_TY_CURSE, &f, 0);
730 #endif
731
732 }
733
734
735 /*!
736  * @brief プレイヤーの打撃能力修正を表示する
737  * @param creature_ptr プレーヤーへの参照ポインタ
738  * @param hand 武器の装備部位ID
739  * @param hand_entry 項目ID
740  * @return なし
741  */
742 static void display_player_melee_bonus(player_type *creature_ptr, int hand, int hand_entry)
743 {
744         HIT_PROB show_tohit = creature_ptr->dis_to_h[hand];
745         HIT_POINT show_todam = creature_ptr->dis_to_d[hand];
746         object_type *o_ptr = &creature_ptr->inventory_list[INVEN_RARM + hand];
747
748         if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
749         if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
750
751         show_tohit += creature_ptr->skill_thn / BTH_PLUS_ADJ;
752
753         char buf[160];
754         sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
755
756         if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
757                 display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
758         else if (creature_ptr->ryoute)
759                 display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
760         else
761                 display_player_one_line(hand_entry, buf, TERM_L_BLUE);
762 }
763
764
765 /*!
766  * @brief プレイヤーステータス表示の中央部分を表示するサブルーチン
767  * @param creature_ptr プレーヤーへの参照ポインタ
768  * Prints the following information on the screen.
769  * @return なし
770  */
771 static void display_player_middle(player_type *creature_ptr)
772 {
773         HIT_PROB show_tohit = creature_ptr->dis_to_h_b;
774         HIT_POINT show_todam = 0;
775         if (creature_ptr->migite)
776         {
777                 display_player_melee_bonus(creature_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
778         }
779
780         if (creature_ptr->hidarite)
781         {
782                 display_player_melee_bonus(creature_ptr, 1, left_hander ? ENTRY_RIGHT_HAND2 : ENTRY_LEFT_HAND2);
783         }
784         else if ((creature_ptr->pclass == CLASS_MONK) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM))
785         {
786                 int i;
787                 if (creature_ptr->special_defense & KAMAE_MASK)
788                 {
789                         for (i = 0; i < MAX_KAMAE; i++)
790                         {
791                                 if ((creature_ptr->special_defense >> i) & KAMAE_GENBU) break;
792                         }
793                         if (i < MAX_KAMAE)
794                         {
795                                 display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), kamae_shurui[i].desc), TERM_YELLOW);
796                         }
797                 }
798                 else
799                 {
800                         display_player_one_line(ENTRY_POSTURE, _("構えなし", "none"), TERM_YELLOW);
801                 }
802         }
803
804         object_type *o_ptr = &creature_ptr->inventory_list[INVEN_BOW];
805         if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
806         if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
807
808         if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
809                 show_tohit += creature_ptr->weapon_exp[0][o_ptr->sval] / 400;
810         else
811                 show_tohit += (creature_ptr->weapon_exp[0][o_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200;
812
813         show_tohit += creature_ptr->skill_thb / BTH_PLUS_ADJ;
814
815         display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
816         int tmul = 0;
817         if (creature_ptr->inventory_list[INVEN_BOW].k_idx)
818         {
819                 tmul = bow_tmul(creature_ptr->inventory_list[INVEN_BOW].sval);
820                 if (creature_ptr->xtra_might) tmul++;
821
822                 tmul = tmul * (100 + (int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
823         }
824
825         display_player_one_line(ENTRY_SHOOT_POWER, format("x%d.%02d", tmul / 100, tmul % 100), TERM_L_BLUE);
826         display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE);
827
828         int i = creature_ptr->pspeed - 110;
829         if (creature_ptr->action == ACTION_SEARCH) i += 10;
830
831         TERM_COLOR attr;
832         if (i > 0)
833         {
834                 if (!creature_ptr->riding)
835                         attr = TERM_L_GREEN;
836                 else
837                         attr = TERM_GREEN;
838         }
839         else if (i == 0)
840         {
841                 if (!creature_ptr->riding)
842                         attr = TERM_L_BLUE;
843                 else
844                         attr = TERM_GREEN;
845         }
846         else
847         {
848                 if (!creature_ptr->riding)
849                         attr = TERM_L_UMBER;
850                 else
851                         attr = TERM_RED;
852         }
853
854         int tmp_speed = 0;
855         if (!creature_ptr->riding)
856         {
857                 if (IS_FAST(creature_ptr)) tmp_speed += 10;
858                 if (creature_ptr->slow) tmp_speed -= 10;
859                 if (creature_ptr->lightspeed) tmp_speed = 99;
860         }
861         else
862         {
863                 if (MON_FAST(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
864                 if (MON_SLOW(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
865         }
866
867         char buf[160];
868         if (tmp_speed)
869         {
870                 if (!creature_ptr->riding)
871                         sprintf(buf, "(%+d%+d)", i - tmp_speed, tmp_speed);
872                 else
873                         sprintf(buf, _("乗馬中 (%+d%+d)", "Riding (%+d%+d)"), i - tmp_speed, tmp_speed);
874
875                 if (tmp_speed > 0)
876                         attr = TERM_YELLOW;
877                 else
878                         attr = TERM_VIOLET;
879         }
880         else
881         {
882                 if (!creature_ptr->riding)
883                         sprintf(buf, "(%+d)", i);
884                 else
885                         sprintf(buf, _("乗馬中 (%+d)", "Riding (%+d)"), i);
886         }
887
888         display_player_one_line(ENTRY_SPEED, buf, attr);
889         display_player_one_line(ENTRY_LEVEL, format("%d", creature_ptr->lev), TERM_L_GREEN);
890
891         int e = (creature_ptr->prace == RACE_ANDROID) ? ENTRY_EXP_ANDR : ENTRY_CUR_EXP;
892         if (creature_ptr->exp >= creature_ptr->max_exp)
893                 display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_L_GREEN);
894         else
895                 display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_YELLOW);
896
897         if (creature_ptr->prace != RACE_ANDROID)
898                 display_player_one_line(ENTRY_MAX_EXP, format("%ld", creature_ptr->max_exp), TERM_L_GREEN);
899
900         e = (creature_ptr->prace == RACE_ANDROID) ? ENTRY_EXP_TO_ADV_ANDR : ENTRY_EXP_TO_ADV;
901
902         if (creature_ptr->lev >= PY_MAX_LEVEL)
903                 display_player_one_line(e, "*****", TERM_L_GREEN);
904         else if (creature_ptr->prace == RACE_ANDROID)
905                 display_player_one_line(e, format("%ld", (s32b)(player_exp_a[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN);
906         else
907                 display_player_one_line(e, format("%ld", (s32b)(player_exp[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN);
908
909         display_player_one_line(ENTRY_GOLD, format("%ld", creature_ptr->au), TERM_L_GREEN);
910
911         int day, hour, min;
912         extract_day_hour_min(creature_ptr, &day, &hour, &min);
913
914         if (day < MAX_DAYS)
915                 sprintf(buf, _("%d日目 %2d:%02d", "Day %d %2d:%02d"), day, hour, min);
916         else
917                 sprintf(buf, _("*****日目 %2d:%02d", "Day ***** %2d:%02d"), hour, min);
918
919         display_player_one_line(ENTRY_DAY, buf, TERM_L_GREEN);
920
921         if (creature_ptr->chp >= creature_ptr->mhp)
922                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_L_GREEN);
923         else if (creature_ptr->chp > (creature_ptr->mhp * hitpoint_warn) / 10)
924                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_YELLOW);
925         else
926                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_RED);
927
928         if (creature_ptr->csp >= creature_ptr->msp)
929                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_L_GREEN);
930         else if (creature_ptr->csp > (creature_ptr->msp * mana_warn) / 10)
931                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_YELLOW);
932         else
933                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_RED);
934
935         u32b play_hour = current_world_ptr->play_time / (60 * 60);
936         u32b play_min = (current_world_ptr->play_time / 60) % 60;
937         u32b play_sec = current_world_ptr->play_time % 60;
938         display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", play_hour, play_min, play_sec), TERM_L_GREEN);
939 }
940
941
942 /*!
943  * @brief プレイヤーのステータス表示メイン処理
944  * Display the character on the screen (various modes)
945  * @param creature_ptr プレーヤーへの参照ポインタ
946  * @param mode 表示モードID
947  * @return なし
948  * @details
949  * <pre>
950  * The top one and bottom two lines are left blank.
951  * Mode 0 = standard display with skills
952  * Mode 1 = standard display with history
953  * Mode 2 = summary of various things
954  * Mode 3 = summary of various things (part 2)
955  * Mode 4 = mutations
956  * </pre>
957  */
958 void display_player(player_type *creature_ptr, int mode)
959 {
960         if ((creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) && display_mutations)
961                 mode = (mode % 5);
962         else
963                 mode = (mode % 4);
964
965         clear_from(0);
966
967         if (mode == 2)
968         {
969                 display_player_misc_info(creature_ptr);
970                 display_player_stat_info(creature_ptr);
971                 display_player_flag_info(creature_ptr);
972                 return;
973         }
974
975         if (mode == 3)
976         {
977                 display_player_other_flag_info(creature_ptr);
978                 return;
979         }
980
981         if (mode == 4)
982         {
983                 do_cmd_knowledge_mutations(creature_ptr);
984                 return;
985         }
986
987         char tmp[64];
988         if ((mode != 0) && (mode != 1)) return;
989
990         /* Name, Sex, Race, Class */
991 #ifdef JP
992         sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の" : "", creature_ptr->name);
993 #else
994         sprintf(tmp, "%s %s", ap_ptr->title, creature_ptr->name);
995 #endif
996
997         display_player_one_line(ENTRY_NAME, tmp, TERM_L_BLUE);
998         display_player_one_line(ENTRY_SEX, sp_ptr->title, TERM_L_BLUE);
999         display_player_one_line(ENTRY_RACE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), TERM_L_BLUE);
1000         display_player_one_line(ENTRY_CLASS, cp_ptr->title, TERM_L_BLUE);
1001
1002         if (creature_ptr->realm1)
1003         {
1004                 if (creature_ptr->realm2)
1005                         sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]);
1006                 else
1007                         strcpy(tmp, realm_names[creature_ptr->realm1]);
1008                 display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE);
1009         }
1010
1011         if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT))
1012                 display_player_one_line(ENTRY_PATRON, chaos_patrons[creature_ptr->chaos_patron], TERM_L_BLUE);
1013
1014         /* Age, Height, Weight, Social */
1015         /* 身長はセンチメートルに、体重はキログラムに変更してあります */
1016 #ifdef JP
1017         display_player_one_line(ENTRY_AGE, format("%d才", (int)creature_ptr->age), TERM_L_BLUE);
1018         display_player_one_line(ENTRY_HEIGHT, format("%dcm", (int)((creature_ptr->ht * 254) / 100)), TERM_L_BLUE);
1019         display_player_one_line(ENTRY_WEIGHT, format("%dkg", (int)((creature_ptr->wt * 4536) / 10000)), TERM_L_BLUE);
1020         display_player_one_line(ENTRY_SOCIAL, format("%d  ", (int)creature_ptr->sc), TERM_L_BLUE);
1021 #else
1022         display_player_one_line(ENTRY_AGE, format("%d", (int)creature_ptr->age), TERM_L_BLUE);
1023         display_player_one_line(ENTRY_HEIGHT, format("%d", (int)creature_ptr->ht), TERM_L_BLUE);
1024         display_player_one_line(ENTRY_WEIGHT, format("%d", (int)creature_ptr->wt), TERM_L_BLUE);
1025         display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE);
1026 #endif
1027         display_player_one_line(ENTRY_ALIGN, format("%s", your_alignment(creature_ptr)), TERM_L_BLUE);
1028
1029         char buf[80];
1030         for (int i = 0; i < A_MAX; i++)
1031         {
1032                 if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i])
1033                 {
1034                         put_str(stat_names_reduced[i], 3 + i, 53);
1035                         int value = creature_ptr->stat_use[i];
1036                         cnv_stat(value, buf);
1037                         c_put_str(TERM_YELLOW, buf, 3 + i, 60);
1038                         value = creature_ptr->stat_top[i];
1039                         cnv_stat(value, buf);
1040                         c_put_str(TERM_L_GREEN, buf, 3 + i, 67);
1041                 }
1042                 else
1043                 {
1044                         put_str(stat_names[i], 3 + i, 53);
1045                         cnv_stat(creature_ptr->stat_use[i], buf);
1046                         c_put_str(TERM_L_GREEN, buf, 3 + i, 60);
1047                 }
1048
1049                 if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i])
1050                 {
1051                         c_put_str(TERM_WHITE, "!", 3 + i, _(58, 58 - 2));
1052                 }
1053         }
1054
1055         floor_type *floor_ptr = creature_ptr->current_floor_ptr;
1056         if (mode == 0)
1057         {
1058                 display_player_middle(creature_ptr);
1059                 display_player_various(creature_ptr);
1060                 return;
1061         }
1062
1063         char statmsg[1000];
1064         put_str(_("(キャラクターの生い立ち)", "(Character Background)"), 11, 25);
1065
1066         for (int i = 0; i < 4; i++)
1067         {
1068                 put_str(creature_ptr->history[i], i + 12, 10);
1069         }
1070
1071         *statmsg = '\0';
1072
1073         if (creature_ptr->is_dead)
1074         {
1075                 if (current_world_ptr->total_winner)
1076                 {
1077 #ifdef JP
1078                         sprintf(statmsg, "…あなたは勝利の後%sした。", streq(creature_ptr->died_from, "Seppuku") ? "切腹" : "引退");
1079 #else
1080                         sprintf(statmsg, "...You %s after winning.", streq(creature_ptr->died_from, "Seppuku") ? "committed seppuku" : "retired from the adventure");
1081 #endif
1082                 }
1083                 else if (!floor_ptr->dun_level)
1084                 {
1085 #ifdef JP
1086                         sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(creature_ptr), creature_ptr->died_from);
1087 #else
1088                         sprintf(statmsg, "...You were killed by %s in %s.", creature_ptr->died_from, map_name(creature_ptr));
1089 #endif
1090                 }
1091                 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
1092                 {
1093                         /* Get the quest text */
1094                         /* Bewere that INIT_ASSIGN resets the cur_num. */
1095                         init_flags = INIT_NAME_ONLY;
1096
1097                         process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
1098
1099 #ifdef JP
1100                         sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[floor_ptr->inside_quest].name, creature_ptr->died_from);
1101 #else
1102                         sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[floor_ptr->inside_quest].name);
1103 #endif
1104                 }
1105                 else
1106                 {
1107 #ifdef JP
1108                         sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(creature_ptr), (int)floor_ptr->dun_level, creature_ptr->died_from);
1109 #else
1110                         sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, floor_ptr->dun_level, map_name(creature_ptr));
1111 #endif
1112                 }
1113         }
1114         else if (current_world_ptr->character_dungeon)
1115         {
1116                 if (!floor_ptr->dun_level)
1117                 {
1118                         sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name(creature_ptr));
1119                 }
1120                 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
1121                 {
1122                         /* Clear the text */
1123                         /* Must be done before doing INIT_SHOW_TEXT */
1124                         for (int i = 0; i < 10; i++)
1125                         {
1126                                 quest_text[i][0] = '\0';
1127                         }
1128
1129                         quest_text_line = 0;
1130                         init_flags = INIT_NAME_ONLY;
1131                         process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
1132                         sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[floor_ptr->inside_quest].name);
1133                 }
1134                 else
1135                 {
1136 #ifdef JP
1137                         sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(creature_ptr), (int)floor_ptr->dun_level);
1138 #else
1139                         sprintf(statmsg, "...Now, you are exploring level %d of %s.", floor_ptr->dun_level, map_name(creature_ptr));
1140 #endif
1141                 }
1142         }
1143
1144         if (!*statmsg) return;
1145
1146         char temp[64 * 2];
1147         roff_to_buf(statmsg, 60, temp, sizeof(temp));
1148         char  *t;
1149         t = temp;
1150         for (int i = 0; i < 2; i++)
1151         {
1152                 if (t[0] == 0) return;
1153
1154                 put_str(t, i + 5 + 12, 10);
1155                 t += strlen(t) + 1;
1156         }
1157 }
1158
1159
1160 /*!
1161  * todo y = 6、x = 0、mode = 0で固定。何とかする
1162  * @brief プレイヤーの装備一覧をシンボルで並べる
1163  * Equippy chars
1164  * @param creature_ptr プレーヤーへの参照ポインタ
1165  * @param y 表示するコンソールの行
1166  * @param x 表示するコンソールの列
1167  * @param mode オプション
1168  * @return なし
1169  */
1170 void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
1171 {
1172         int max_i = (mode & DP_WP) ? INVEN_LARM + 1 : INVEN_TOTAL;
1173         for (int i = INVEN_RARM; i < max_i; i++)
1174         {
1175                 object_type *o_ptr;
1176                 o_ptr = &creature_ptr->inventory_list[i];
1177
1178                 TERM_COLOR a = object_attr(o_ptr);
1179                 char c = object_char(o_ptr);
1180
1181                 if (!equippy_chars || !o_ptr->k_idx)
1182                 {
1183                         c = ' ';
1184                         a = TERM_DARK;
1185                 }
1186
1187                 Term_putch(x + i - INVEN_RARM, y, a, c);
1188         }
1189 }