OSDN Git Service

[Refactor] #39962 display_player_other_flag_info() からdisplay_slay_info() を分離 / Separa...
[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 "files.h"
20 #include "mutation.h"
21 #include "view-mainwindow.h" // 暫定。後で消す
22 #include "player-skill.h"
23 #include "player-effects.h"
24 #include "realm-song.h"
25 #include "object-hook.h"
26 #include "shoot.h"
27 #include "dungeon-file.h"
28 #include "objectkind.h"
29 #include "view/display-util.h"
30 #include "view/display-characteristic.h"
31
32 /*!
33  * @brief プレイヤーの特性フラグ一覧表示2a /
34  * @param creature_ptr プレーヤーへの参照ポインタ
35  * Special display, part 2a
36  * @return なし
37  */
38 static void display_player_misc_info(player_type *creature_ptr)
39 {
40 #ifdef JP
41         put_str("名前  :", 1, 26);
42         put_str("性別  :", 3, 1);
43         put_str("種族  :", 4, 1);
44         put_str("職業  :", 5, 1);
45 #else
46         put_str("Name  :", 1, 26);
47         put_str("Sex   :", 3, 1);
48         put_str("Race  :", 4, 1);
49         put_str("Class :", 5, 1);
50 #endif
51
52         char    buf[80];
53         char    tmp[80];
54         strcpy(tmp, ap_ptr->title);
55 #ifdef JP
56         if (ap_ptr->no == 1)
57                 strcat(tmp, "の");
58 #else
59         strcat(tmp, " ");
60 #endif
61         strcat(tmp, creature_ptr->name);
62
63         c_put_str(TERM_L_BLUE, tmp, 1, 34);
64         c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9);
65         c_put_str(TERM_L_BLUE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), 4, 9);
66         c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 9);
67
68 #ifdef JP
69         put_str("レベル:", 6, 1);
70         put_str("HP  :", 7, 1);
71         put_str("MP  :", 8, 1);
72 #else
73         put_str("Level :", 6, 1);
74         put_str("Hits  :", 7, 1);
75         put_str("Mana  :", 8, 1);
76 #endif
77
78         (void)sprintf(buf, "%d", (int)creature_ptr->lev);
79         c_put_str(TERM_L_BLUE, buf, 6, 9);
80         (void)sprintf(buf, "%d/%d", (int)creature_ptr->chp, (int)creature_ptr->mhp);
81         c_put_str(TERM_L_BLUE, buf, 7, 9);
82         (void)sprintf(buf, "%d/%d", (int)creature_ptr->csp, (int)creature_ptr->msp);
83         c_put_str(TERM_L_BLUE, buf, 8, 9);
84 }
85
86
87 /*!
88  * @brief プレイヤーの特性フラグ一覧表示2b /
89  * Special display, part 2b
90  * @param creature_ptr プレーヤーへの参照ポインタ
91  * @return なし
92  * @details
93  * <pre>
94  * How to print out the modifications and sustains.
95  * Positive mods with no sustain will be light green.
96  * Positive mods with a sustain will be dark green.
97  * Sustains (with no modification) will be a dark green 's'.
98  * Negative mods (from a curse) will be red.
99  * Huge mods (>9), like from MICoMorgoth, will be a '*'
100  * No mod, no sustain, will be a slate '.'
101  * </pre>
102  */
103 static void display_player_stat_info(player_type *creature_ptr)
104 {
105         int stat_col = 22;
106         int row = 3;
107         c_put_str(TERM_WHITE, _("能力", "Stat"), row, stat_col + 1);
108         c_put_str(TERM_BLUE, _("  基本", "  Base"), row, stat_col + 7);
109         c_put_str(TERM_L_BLUE, _(" 種 職 性 装 ", "RacClaPerMod"), row, stat_col + 13);
110         c_put_str(TERM_L_GREEN, _("合計", "Actual"), row, stat_col + 28);
111         c_put_str(TERM_YELLOW, _("現在", "Current"), row, stat_col + 35);
112
113         char buf[80];
114         for (int i = 0; i < A_MAX; i++)
115         {
116                 int r_adj;
117                 if (creature_ptr->mimic_form) r_adj = mimic_info[creature_ptr->mimic_form].r_adj[i];
118                 else r_adj = rp_ptr->r_adj[i];
119
120                 int e_adj = 0;
121
122                 if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] > 18))
123                         e_adj = (creature_ptr->stat_top[i] - creature_ptr->stat_max[i]) / 10;
124                 if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] <= 18))
125                         e_adj = creature_ptr->stat_top[i] - creature_ptr->stat_max[i];
126                 if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] > 18))
127                         e_adj = (creature_ptr->stat_top[i] - 18) / 10 - creature_ptr->stat_max[i] + 18;
128
129                 if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] <= 18))
130                         e_adj = creature_ptr->stat_top[i] - (creature_ptr->stat_max[i] - 19) / 10 - 19;
131
132                 if (PRACE_IS_(creature_ptr, RACE_ENT))
133                 {
134                         switch (i)
135                         {
136                         case A_STR:
137                         case A_CON:
138                                 if (creature_ptr->lev > 25) r_adj++;
139                                 if (creature_ptr->lev > 40) r_adj++;
140                                 if (creature_ptr->lev > 45) r_adj++;
141                                 break;
142                         case A_DEX:
143                                 if (creature_ptr->lev > 25) r_adj--;
144                                 if (creature_ptr->lev > 40) r_adj--;
145                                 if (creature_ptr->lev > 45) r_adj--;
146                                 break;
147                         }
148                 }
149
150                 e_adj -= r_adj;
151                 e_adj -= cp_ptr->c_adj[i];
152                 e_adj -= ap_ptr->a_adj[i];
153
154                 if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i])
155                         c_put_str(TERM_WHITE, stat_names_reduced[i], row + i + 1, stat_col + 1);
156                 else
157                         c_put_str(TERM_WHITE, stat_names[i], row + i + 1, stat_col + 1);
158
159                 /* Internal "natural" max value.  Maxes at 18/100 */
160                 /* This is useful to see if you are maxed out */
161                 cnv_stat(creature_ptr->stat_max[i], buf);
162                 if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i])
163                         c_put_str(TERM_WHITE, "!", row + i + 1, _(stat_col + 6, stat_col + 4));
164
165                 c_put_str(TERM_BLUE, buf, row + i + 1, stat_col + 13 - strlen(buf));
166
167                 (void)sprintf(buf, "%3d", r_adj);
168                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 13);
169                 (void)sprintf(buf, "%3d", (int)cp_ptr->c_adj[i]);
170                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 16);
171                 (void)sprintf(buf, "%3d", (int)ap_ptr->a_adj[i]);
172                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 19);
173                 (void)sprintf(buf, "%3d", (int)e_adj);
174                 c_put_str(TERM_L_BLUE, buf, row + i + 1, stat_col + 22);
175
176                 cnv_stat(creature_ptr->stat_top[i], buf);
177                 c_put_str(TERM_L_GREEN, buf, row + i + 1, stat_col + 26);
178
179                 if (creature_ptr->stat_use[i] < creature_ptr->stat_top[i])
180                 {
181                         cnv_stat(creature_ptr->stat_use[i], buf);
182                         c_put_str(TERM_YELLOW, buf, row + i + 1, stat_col + 33);
183                 }
184         }
185
186         int col = stat_col + 41;
187         c_put_str(TERM_WHITE, "abcdefghijkl@", row, col);
188         c_put_str(TERM_L_GREEN, _("能力修正", "Modification"), row - 1, col);
189
190         BIT_FLAGS flgs[TR_FLAG_SIZE];
191         for (int i = INVEN_RARM; i < INVEN_TOTAL; i++)
192         {
193                 object_type *o_ptr;
194                 o_ptr = &creature_ptr->inventory_list[i];
195                 object_flags_known(o_ptr, flgs);
196                 for (int stat = 0; stat < A_MAX; stat++)
197                 {
198                         byte a = TERM_SLATE;
199                         char c = '.';
200                         if (have_flag(flgs, stat))
201                         {
202                                 c = '*';
203
204                                 if (o_ptr->pval > 0)
205                                 {
206                                         a = TERM_L_GREEN;
207                                         if (o_ptr->pval < 10) c = '0' + o_ptr->pval;
208                                 }
209
210                                 if (have_flag(flgs, stat + TR_SUST_STR))
211                                 {
212                                         a = TERM_GREEN;
213                                 }
214
215                                 if (o_ptr->pval < 0)
216                                 {
217                                         a = TERM_RED;
218                                         if (o_ptr->pval > -10) c = '0' - o_ptr->pval;
219                                 }
220                         }
221                         else if (have_flag(flgs, stat + TR_SUST_STR))
222                         {
223                                 a = TERM_GREEN;
224                                 c = 's';
225                         }
226
227                         Term_putch(col, row + stat + 1, a, c);
228                 }
229
230                 col++;
231         }
232
233         player_flags(creature_ptr, flgs);
234         for (int stat = 0; stat < A_MAX; stat++)
235         {
236                 byte a = TERM_SLATE;
237                 char c = '.';
238
239                 if (creature_ptr->muta3 || creature_ptr->tsuyoshi)
240                 {
241                         int dummy = 0;
242
243                         if (stat == A_STR)
244                         {
245                                 if (creature_ptr->muta3 & MUT3_HYPER_STR) dummy += 4;
246                                 if (creature_ptr->muta3 & MUT3_PUNY) dummy -= 4;
247                                 if (creature_ptr->tsuyoshi) dummy += 4;
248                         }
249                         else if (stat == A_WIS || stat == A_INT)
250                         {
251                                 if (creature_ptr->muta3 & MUT3_HYPER_INT) dummy += 4;
252                                 if (creature_ptr->muta3 & MUT3_MORONIC) dummy -= 4;
253                         }
254                         else if (stat == A_DEX)
255                         {
256                                 if (creature_ptr->muta3 & MUT3_IRON_SKIN) dummy -= 1;
257                                 if (creature_ptr->muta3 & MUT3_LIMBER) dummy += 3;
258                                 if (creature_ptr->muta3 & MUT3_ARTHRITIS) dummy -= 3;
259                         }
260                         else if (stat == A_CON)
261                         {
262                                 if (creature_ptr->muta3 & MUT3_RESILIENT) dummy += 4;
263                                 if (creature_ptr->muta3 & MUT3_XTRA_FAT) dummy += 2;
264                                 if (creature_ptr->muta3 & MUT3_ALBINO) dummy -= 4;
265                                 if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 2;
266                                 if (creature_ptr->tsuyoshi) dummy += 4;
267                         }
268                         else if (stat == A_CHR)
269                         {
270                                 if (creature_ptr->muta3 & MUT3_SILLY_VOI) dummy -= 4;
271                                 if (creature_ptr->muta3 & MUT3_BLANK_FAC) dummy -= 1;
272                                 if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 1;
273                                 if (creature_ptr->muta3 & MUT3_SCALES) dummy -= 1;
274                                 if (creature_ptr->muta3 & MUT3_WART_SKIN) dummy -= 2;
275                                 if (creature_ptr->muta3 & MUT3_ILL_NORM) dummy = 0;
276                         }
277
278                         if (dummy != 0)
279                         {
280                                 c = '*';
281                                 if (dummy > 0)
282                                 {
283                                         /* Good */
284                                         a = TERM_L_GREEN;
285
286                                         /* Label boost */
287                                         if (dummy < 10) c = '0' + dummy;
288                                 }
289
290                                 if (dummy < 0)
291                                 {
292                                         a = TERM_RED;
293                                         if (dummy > -10) c = '0' - dummy;
294                                 }
295                         }
296                 }
297
298                 if (have_flag(flgs, stat + TR_SUST_STR))
299                 {
300                         a = TERM_GREEN;
301                         c = 's';
302                 }
303
304                 Term_putch(col, row + stat + 1, a, c);
305         }
306 }
307
308
309 /*!
310  * @brief プレイヤーの打撃能力修正を表示する
311  * @param creature_ptr プレーヤーへの参照ポインタ
312  * @param hand 武器の装備部位ID
313  * @param hand_entry 項目ID
314  * @return なし
315  */
316 static void display_player_melee_bonus(player_type *creature_ptr, int hand, int hand_entry)
317 {
318         HIT_PROB show_tohit = creature_ptr->dis_to_h[hand];
319         HIT_POINT show_todam = creature_ptr->dis_to_d[hand];
320         object_type *o_ptr = &creature_ptr->inventory_list[INVEN_RARM + hand];
321
322         if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
323         if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
324
325         show_tohit += creature_ptr->skill_thn / BTH_PLUS_ADJ;
326
327         char buf[160];
328         sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
329
330         if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
331                 display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
332         else if (creature_ptr->ryoute)
333                 display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
334         else
335                 display_player_one_line(hand_entry, buf, TERM_L_BLUE);
336 }
337
338
339 /*!
340  * @brief プレイヤーステータス表示の中央部分を表示するサブルーチン
341  * @param creature_ptr プレーヤーへの参照ポインタ
342  * Prints the following information on the screen.
343  * @return なし
344  */
345 static void display_player_middle(player_type *creature_ptr)
346 {
347         HIT_PROB show_tohit = creature_ptr->dis_to_h_b;
348         HIT_POINT show_todam = 0;
349         if (creature_ptr->migite)
350         {
351                 display_player_melee_bonus(creature_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
352         }
353
354         if (creature_ptr->hidarite)
355         {
356                 display_player_melee_bonus(creature_ptr, 1, left_hander ? ENTRY_RIGHT_HAND2 : ENTRY_LEFT_HAND2);
357         }
358         else if ((creature_ptr->pclass == CLASS_MONK) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM))
359         {
360                 int i;
361                 if (creature_ptr->special_defense & KAMAE_MASK)
362                 {
363                         for (i = 0; i < MAX_KAMAE; i++)
364                         {
365                                 if ((creature_ptr->special_defense >> i) & KAMAE_GENBU) break;
366                         }
367                         if (i < MAX_KAMAE)
368                         {
369                                 display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), kamae_shurui[i].desc), TERM_YELLOW);
370                         }
371                 }
372                 else
373                 {
374                         display_player_one_line(ENTRY_POSTURE, _("構えなし", "none"), TERM_YELLOW);
375                 }
376         }
377
378         object_type *o_ptr = &creature_ptr->inventory_list[INVEN_BOW];
379         if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
380         if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
381
382         if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
383                 show_tohit += creature_ptr->weapon_exp[0][o_ptr->sval] / 400;
384         else
385                 show_tohit += (creature_ptr->weapon_exp[0][o_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200;
386
387         show_tohit += creature_ptr->skill_thb / BTH_PLUS_ADJ;
388
389         display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
390         int tmul = 0;
391         if (creature_ptr->inventory_list[INVEN_BOW].k_idx)
392         {
393                 tmul = bow_tmul(creature_ptr->inventory_list[INVEN_BOW].sval);
394                 if (creature_ptr->xtra_might) tmul++;
395
396                 tmul = tmul * (100 + (int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
397         }
398
399         display_player_one_line(ENTRY_SHOOT_POWER, format("x%d.%02d", tmul / 100, tmul % 100), TERM_L_BLUE);
400         display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE);
401
402         int i = creature_ptr->pspeed - 110;
403         if (creature_ptr->action == ACTION_SEARCH) i += 10;
404
405         TERM_COLOR attr;
406         if (i > 0)
407         {
408                 if (!creature_ptr->riding)
409                         attr = TERM_L_GREEN;
410                 else
411                         attr = TERM_GREEN;
412         }
413         else if (i == 0)
414         {
415                 if (!creature_ptr->riding)
416                         attr = TERM_L_BLUE;
417                 else
418                         attr = TERM_GREEN;
419         }
420         else
421         {
422                 if (!creature_ptr->riding)
423                         attr = TERM_L_UMBER;
424                 else
425                         attr = TERM_RED;
426         }
427
428         int tmp_speed = 0;
429         if (!creature_ptr->riding)
430         {
431                 if (IS_FAST(creature_ptr)) tmp_speed += 10;
432                 if (creature_ptr->slow) tmp_speed -= 10;
433                 if (creature_ptr->lightspeed) tmp_speed = 99;
434         }
435         else
436         {
437                 if (MON_FAST(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
438                 if (MON_SLOW(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
439         }
440
441         char buf[160];
442         if (tmp_speed)
443         {
444                 if (!creature_ptr->riding)
445                         sprintf(buf, "(%+d%+d)", i - tmp_speed, tmp_speed);
446                 else
447                         sprintf(buf, _("乗馬中 (%+d%+d)", "Riding (%+d%+d)"), i - tmp_speed, tmp_speed);
448
449                 if (tmp_speed > 0)
450                         attr = TERM_YELLOW;
451                 else
452                         attr = TERM_VIOLET;
453         }
454         else
455         {
456                 if (!creature_ptr->riding)
457                         sprintf(buf, "(%+d)", i);
458                 else
459                         sprintf(buf, _("乗馬中 (%+d)", "Riding (%+d)"), i);
460         }
461
462         display_player_one_line(ENTRY_SPEED, buf, attr);
463         display_player_one_line(ENTRY_LEVEL, format("%d", creature_ptr->lev), TERM_L_GREEN);
464
465         int e = (creature_ptr->prace == RACE_ANDROID) ? ENTRY_EXP_ANDR : ENTRY_CUR_EXP;
466         if (creature_ptr->exp >= creature_ptr->max_exp)
467                 display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_L_GREEN);
468         else
469                 display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_YELLOW);
470
471         if (creature_ptr->prace != RACE_ANDROID)
472                 display_player_one_line(ENTRY_MAX_EXP, format("%ld", creature_ptr->max_exp), TERM_L_GREEN);
473
474         e = (creature_ptr->prace == RACE_ANDROID) ? ENTRY_EXP_TO_ADV_ANDR : ENTRY_EXP_TO_ADV;
475
476         if (creature_ptr->lev >= PY_MAX_LEVEL)
477                 display_player_one_line(e, "*****", TERM_L_GREEN);
478         else if (creature_ptr->prace == RACE_ANDROID)
479                 display_player_one_line(e, format("%ld", (s32b)(player_exp_a[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN);
480         else
481                 display_player_one_line(e, format("%ld", (s32b)(player_exp[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN);
482
483         display_player_one_line(ENTRY_GOLD, format("%ld", creature_ptr->au), TERM_L_GREEN);
484
485         int day, hour, min;
486         extract_day_hour_min(creature_ptr, &day, &hour, &min);
487
488         if (day < MAX_DAYS)
489                 sprintf(buf, _("%d日目 %2d:%02d", "Day %d %2d:%02d"), day, hour, min);
490         else
491                 sprintf(buf, _("*****日目 %2d:%02d", "Day ***** %2d:%02d"), hour, min);
492
493         display_player_one_line(ENTRY_DAY, buf, TERM_L_GREEN);
494
495         if (creature_ptr->chp >= creature_ptr->mhp)
496                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_L_GREEN);
497         else if (creature_ptr->chp > (creature_ptr->mhp * hitpoint_warn) / 10)
498                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_YELLOW);
499         else
500                 display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp, creature_ptr->mhp), TERM_RED);
501
502         if (creature_ptr->csp >= creature_ptr->msp)
503                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_L_GREEN);
504         else if (creature_ptr->csp > (creature_ptr->msp * mana_warn) / 10)
505                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_YELLOW);
506         else
507                 display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_RED);
508
509         u32b play_hour = current_world_ptr->play_time / (60 * 60);
510         u32b play_min = (current_world_ptr->play_time / 60) % 60;
511         u32b play_sec = current_world_ptr->play_time % 60;
512         display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", play_hour, play_min, play_sec), TERM_L_GREEN);
513 }
514
515
516 /*!
517  * @brief プレイヤーのステータス表示メイン処理
518  * Display the character on the screen (various modes)
519  * @param creature_ptr プレーヤーへの参照ポインタ
520  * @param mode 表示モードID
521  * @return なし
522  * @details
523  * <pre>
524  * The top one and bottom two lines are left blank.
525  * Mode 0 = standard display with skills
526  * Mode 1 = standard display with history
527  * Mode 2 = summary of various things
528  * Mode 3 = summary of various things (part 2)
529  * Mode 4 = mutations
530  * </pre>
531  */
532 void display_player(player_type *creature_ptr, int mode)
533 {
534         if ((creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) && display_mutations)
535                 mode = (mode % 5);
536         else
537                 mode = (mode % 4);
538
539         clear_from(0);
540
541         if (mode == 2)
542         {
543                 display_player_misc_info(creature_ptr);
544                 display_player_stat_info(creature_ptr);
545                 display_player_flag_info(creature_ptr, display_player_equippy);
546                 return;
547         }
548
549         if (mode == 3)
550         {
551                 display_player_flag_info_2(creature_ptr, display_player_equippy);
552                 return;
553         }
554
555         if (mode == 4)
556         {
557                 do_cmd_knowledge_mutations(creature_ptr);
558                 return;
559         }
560
561         char tmp[64];
562         if ((mode != 0) && (mode != 1)) return;
563
564         /* Name, Sex, Race, Class */
565 #ifdef JP
566         sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の" : "", creature_ptr->name);
567 #else
568         sprintf(tmp, "%s %s", ap_ptr->title, creature_ptr->name);
569 #endif
570
571         display_player_one_line(ENTRY_NAME, tmp, TERM_L_BLUE);
572         display_player_one_line(ENTRY_SEX, sp_ptr->title, TERM_L_BLUE);
573         display_player_one_line(ENTRY_RACE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), TERM_L_BLUE);
574         display_player_one_line(ENTRY_CLASS, cp_ptr->title, TERM_L_BLUE);
575
576         if (creature_ptr->realm1)
577         {
578                 if (creature_ptr->realm2)
579                         sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]);
580                 else
581                         strcpy(tmp, realm_names[creature_ptr->realm1]);
582                 display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE);
583         }
584
585         if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT))
586                 display_player_one_line(ENTRY_PATRON, chaos_patrons[creature_ptr->chaos_patron], TERM_L_BLUE);
587
588         /* Age, Height, Weight, Social */
589         /* 身長はセンチメートルに、体重はキログラムに変更してあります */
590 #ifdef JP
591         display_player_one_line(ENTRY_AGE, format("%d才", (int)creature_ptr->age), TERM_L_BLUE);
592         display_player_one_line(ENTRY_HEIGHT, format("%dcm", (int)((creature_ptr->ht * 254) / 100)), TERM_L_BLUE);
593         display_player_one_line(ENTRY_WEIGHT, format("%dkg", (int)((creature_ptr->wt * 4536) / 10000)), TERM_L_BLUE);
594         display_player_one_line(ENTRY_SOCIAL, format("%d  ", (int)creature_ptr->sc), TERM_L_BLUE);
595 #else
596         display_player_one_line(ENTRY_AGE, format("%d", (int)creature_ptr->age), TERM_L_BLUE);
597         display_player_one_line(ENTRY_HEIGHT, format("%d", (int)creature_ptr->ht), TERM_L_BLUE);
598         display_player_one_line(ENTRY_WEIGHT, format("%d", (int)creature_ptr->wt), TERM_L_BLUE);
599         display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE);
600 #endif
601         display_player_one_line(ENTRY_ALIGN, format("%s", your_alignment(creature_ptr)), TERM_L_BLUE);
602
603         char buf[80];
604         for (int i = 0; i < A_MAX; i++)
605         {
606                 if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i])
607                 {
608                         put_str(stat_names_reduced[i], 3 + i, 53);
609                         int value = creature_ptr->stat_use[i];
610                         cnv_stat(value, buf);
611                         c_put_str(TERM_YELLOW, buf, 3 + i, 60);
612                         value = creature_ptr->stat_top[i];
613                         cnv_stat(value, buf);
614                         c_put_str(TERM_L_GREEN, buf, 3 + i, 67);
615                 }
616                 else
617                 {
618                         put_str(stat_names[i], 3 + i, 53);
619                         cnv_stat(creature_ptr->stat_use[i], buf);
620                         c_put_str(TERM_L_GREEN, buf, 3 + i, 60);
621                 }
622
623                 if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i])
624                 {
625                         c_put_str(TERM_WHITE, "!", 3 + i, _(58, 58 - 2));
626                 }
627         }
628
629         floor_type *floor_ptr = creature_ptr->current_floor_ptr;
630         if (mode == 0)
631         {
632                 display_player_middle(creature_ptr);
633                 display_player_various(creature_ptr);
634                 return;
635         }
636
637         char statmsg[1000];
638         put_str(_("(キャラクターの生い立ち)", "(Character Background)"), 11, 25);
639
640         for (int i = 0; i < 4; i++)
641         {
642                 put_str(creature_ptr->history[i], i + 12, 10);
643         }
644
645         *statmsg = '\0';
646
647         if (creature_ptr->is_dead)
648         {
649                 if (current_world_ptr->total_winner)
650                 {
651 #ifdef JP
652                         sprintf(statmsg, "…あなたは勝利の後%sした。", streq(creature_ptr->died_from, "Seppuku") ? "切腹" : "引退");
653 #else
654                         sprintf(statmsg, "...You %s after winning.", streq(creature_ptr->died_from, "Seppuku") ? "committed seppuku" : "retired from the adventure");
655 #endif
656                 }
657                 else if (!floor_ptr->dun_level)
658                 {
659 #ifdef JP
660                         sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(creature_ptr), creature_ptr->died_from);
661 #else
662                         sprintf(statmsg, "...You were killed by %s in %s.", creature_ptr->died_from, map_name(creature_ptr));
663 #endif
664                 }
665                 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
666                 {
667                         /* Get the quest text */
668                         /* Bewere that INIT_ASSIGN resets the cur_num. */
669                         init_flags = INIT_NAME_ONLY;
670
671                         process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
672
673 #ifdef JP
674                         sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[floor_ptr->inside_quest].name, creature_ptr->died_from);
675 #else
676                         sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[floor_ptr->inside_quest].name);
677 #endif
678                 }
679                 else
680                 {
681 #ifdef JP
682                         sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(creature_ptr), (int)floor_ptr->dun_level, creature_ptr->died_from);
683 #else
684                         sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, floor_ptr->dun_level, map_name(creature_ptr));
685 #endif
686                 }
687         }
688         else if (current_world_ptr->character_dungeon)
689         {
690                 if (!floor_ptr->dun_level)
691                 {
692                         sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name(creature_ptr));
693                 }
694                 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
695                 {
696                         /* Clear the text */
697                         /* Must be done before doing INIT_SHOW_TEXT */
698                         for (int i = 0; i < 10; i++)
699                         {
700                                 quest_text[i][0] = '\0';
701                         }
702
703                         quest_text_line = 0;
704                         init_flags = INIT_NAME_ONLY;
705                         process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
706                         sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[floor_ptr->inside_quest].name);
707                 }
708                 else
709                 {
710 #ifdef JP
711                         sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(creature_ptr), (int)floor_ptr->dun_level);
712 #else
713                         sprintf(statmsg, "...Now, you are exploring level %d of %s.", floor_ptr->dun_level, map_name(creature_ptr));
714 #endif
715                 }
716         }
717
718         if (!*statmsg) return;
719
720         char temp[64 * 2];
721         roff_to_buf(statmsg, 60, temp, sizeof(temp));
722         char  *t;
723         t = temp;
724         for (int i = 0; i < 2; i++)
725         {
726                 if (t[0] == 0) return;
727
728                 put_str(t, i + 5 + 12, 10);
729                 t += strlen(t) + 1;
730         }
731 }
732
733
734 /*!
735  * todo y = 6、x = 0、mode = 0で固定。何とかする
736  * @brief プレイヤーの装備一覧をシンボルで並べる
737  * Equippy chars
738  * @param creature_ptr プレーヤーへの参照ポインタ
739  * @param y 表示するコンソールの行
740  * @param x 表示するコンソールの列
741  * @param mode オプション
742  * @return なし
743  */
744 void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
745 {
746         int max_i = (mode & DP_WP) ? INVEN_LARM + 1 : INVEN_TOTAL;
747         for (int i = INVEN_RARM; i < max_i; i++)
748         {
749                 object_type *o_ptr;
750                 o_ptr = &creature_ptr->inventory_list[i];
751
752                 TERM_COLOR a = object_attr(o_ptr);
753                 char c = object_char(o_ptr);
754
755                 if (!equippy_chars || !o_ptr->k_idx)
756                 {
757                         c = ' ';
758                         a = TERM_DARK;
759                 }
760
761                 Term_putch(x + i - INVEN_RARM, y, a, c);
762         }
763 }