2 * @brief プレーヤーのステータス表示メインルーチン群
6 * ここにこれ以上関数を引っ越してくるのは禁止
9 #include "display-player.h"
10 #include "player-personality.h"
12 #include "status-first-page.h"
13 #include "player-sex.h"
17 #include "core.h" // 暫定。後で消す
19 #include "dungeon-file.h"
20 #include "objectkind.h"
21 #include "view/display-util.h"
22 #include "view/display-characteristic.h"
23 #include "view/display-player-stat-info.h"
24 #include "view/display-player-misc-info.h"
25 #include "view/display-player-middle.h"
29 * @param creature_ptr プレーヤーへの参照ポインタ
30 * @param mode ステータス表示モード
31 * @return どれかの処理をこなしたらTRUE、何もしなかったらFALSE
33 static bool display_player_info(player_type *creature_ptr, int mode)
37 display_player_misc_info(creature_ptr);
38 display_player_stat_info(creature_ptr);
39 display_player_flag_info_1(creature_ptr, display_player_equippy);
45 display_player_flag_info_2(creature_ptr, display_player_equippy);
51 do_cmd_knowledge_mutations(creature_ptr);
60 * @brief 名前、性別、種族、職業を表示する
61 * @param creature_ptr プレーヤーへの参照ポインタ
63 static void display_player_basic_info(player_type *creature_ptr)
67 sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の" : "", creature_ptr->name);
69 sprintf(tmp, "%s %s", ap_ptr->title, creature_ptr->name);
72 display_player_one_line(ENTRY_NAME, tmp, TERM_L_BLUE);
73 display_player_one_line(ENTRY_SEX, sp_ptr->title, TERM_L_BLUE);
74 display_player_one_line(ENTRY_RACE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), TERM_L_BLUE);
75 display_player_one_line(ENTRY_CLASS, cp_ptr->title, TERM_L_BLUE);
80 * @brief プレイヤーのステータス表示メイン処理
81 * Display the character on the screen (various modes)
82 * @param creature_ptr プレーヤーへの参照ポインタ
87 * The top one and bottom two lines are left blank.
88 * Mode 0 = standard display with skills
89 * Mode 1 = standard display with history
90 * Mode 2 = summary of various things
91 * Mode 3 = summary of various things (part 2)
95 void display_player(player_type *creature_ptr, int mode, map_name_pf map_name)
97 if ((creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) && display_mutations)
103 if (display_player_info(creature_ptr, mode)) return;
105 display_player_basic_info(creature_ptr);
108 if (creature_ptr->realm1)
110 if (creature_ptr->realm2)
111 sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]);
113 strcpy(tmp, realm_names[creature_ptr->realm1]);
114 display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE);
117 if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT))
118 display_player_one_line(ENTRY_PATRON, chaos_patrons[creature_ptr->chaos_patron], TERM_L_BLUE);
120 /* Age, Height, Weight, Social */
121 /* 身長はセンチメートルに、体重はキログラムに変更してあります */
123 display_player_one_line(ENTRY_AGE, format("%d才", (int)creature_ptr->age), TERM_L_BLUE);
124 display_player_one_line(ENTRY_HEIGHT, format("%dcm", (int)((creature_ptr->ht * 254) / 100)), TERM_L_BLUE);
125 display_player_one_line(ENTRY_WEIGHT, format("%dkg", (int)((creature_ptr->wt * 4536) / 10000)), TERM_L_BLUE);
126 display_player_one_line(ENTRY_SOCIAL, format("%d ", (int)creature_ptr->sc), TERM_L_BLUE);
128 display_player_one_line(ENTRY_AGE, format("%d", (int)creature_ptr->age), TERM_L_BLUE);
129 display_player_one_line(ENTRY_HEIGHT, format("%d", (int)creature_ptr->ht), TERM_L_BLUE);
130 display_player_one_line(ENTRY_WEIGHT, format("%d", (int)creature_ptr->wt), TERM_L_BLUE);
131 display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE);
133 display_player_one_line(ENTRY_ALIGN, format("%s", your_alignment(creature_ptr)), TERM_L_BLUE);
136 for (int i = 0; i < A_MAX; i++)
138 if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i])
140 put_str(stat_names_reduced[i], 3 + i, 53);
141 int value = creature_ptr->stat_use[i];
142 cnv_stat(value, buf);
143 c_put_str(TERM_YELLOW, buf, 3 + i, 60);
144 value = creature_ptr->stat_top[i];
145 cnv_stat(value, buf);
146 c_put_str(TERM_L_GREEN, buf, 3 + i, 67);
150 put_str(stat_names[i], 3 + i, 53);
151 cnv_stat(creature_ptr->stat_use[i], buf);
152 c_put_str(TERM_L_GREEN, buf, 3 + i, 60);
155 if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i])
157 c_put_str(TERM_WHITE, "!", 3 + i, _(58, 58 - 2));
161 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
164 display_player_middle(creature_ptr);
165 display_player_various(creature_ptr);
170 put_str(_("(キャラクターの生い立ち)", "(Character Background)"), 11, 25);
172 for (int i = 0; i < 4; i++)
174 put_str(creature_ptr->history[i], i + 12, 10);
179 if (creature_ptr->is_dead)
181 if (current_world_ptr->total_winner)
184 sprintf(statmsg, "…あなたは勝利の後%sした。", streq(creature_ptr->died_from, "Seppuku") ? "切腹" : "引退");
186 sprintf(statmsg, "...You %s after winning.", streq(creature_ptr->died_from, "Seppuku") ? "committed seppuku" : "retired from the adventure");
189 else if (!floor_ptr->dun_level)
192 sprintf(statmsg, "…あなたは%sで%sに殺された。", (*map_name)(creature_ptr), creature_ptr->died_from);
194 sprintf(statmsg, "...You were killed by %s in %s.", creature_ptr->died_from, map_name(creature_ptr));
197 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
199 /* Get the quest text */
200 /* Bewere that INIT_ASSIGN resets the cur_num. */
201 init_flags = INIT_NAME_ONLY;
203 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
206 sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[floor_ptr->inside_quest].name, creature_ptr->died_from);
208 sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[floor_ptr->inside_quest].name);
214 sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", (*map_name)(creature_ptr), (int)floor_ptr->dun_level, creature_ptr->died_from);
216 sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, floor_ptr->dun_level, map_name(creature_ptr));
220 else if (current_world_ptr->character_dungeon)
222 if (!floor_ptr->dun_level)
224 sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name(creature_ptr));
226 else if (floor_ptr->inside_quest && is_fixed_quest_idx(floor_ptr->inside_quest))
229 /* Must be done before doing INIT_SHOW_TEXT */
230 for (int i = 0; i < 10; i++)
232 quest_text[i][0] = '\0';
236 init_flags = INIT_NAME_ONLY;
237 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
238 sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[floor_ptr->inside_quest].name);
243 sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(creature_ptr), (int)floor_ptr->dun_level);
245 sprintf(statmsg, "...Now, you are exploring level %d of %s.", floor_ptr->dun_level, map_name(creature_ptr));
250 if (!*statmsg) return;
253 roff_to_buf(statmsg, 60, temp, sizeof(temp));
256 for (int i = 0; i < 2; i++)
258 if (t[0] == 0) return;
260 put_str(t, i + 5 + 12, 10);
267 * todo y = 6、x = 0、mode = 0で固定。何とかする
268 * @brief プレイヤーの装備一覧をシンボルで並べる
270 * @param creature_ptr プレーヤーへの参照ポインタ
271 * @param y 表示するコンソールの行
272 * @param x 表示するコンソールの列
276 void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
278 int max_i = (mode & DP_WP) ? INVEN_LARM + 1 : INVEN_TOTAL;
279 for (int i = INVEN_RARM; i < max_i; i++)
282 o_ptr = &creature_ptr->inventory_list[i];
284 TERM_COLOR a = object_attr(o_ptr);
285 char c = object_char(o_ptr);
287 if (!equippy_chars || !o_ptr->k_idx)
293 Term_putch(x + i - INVEN_RARM, y, a, c);