1 #include "window/main-window-left-frame.h"
2 #include "game-option/special-options.h"
3 #include "game-option/text-display-options.h"
4 #include "market/arena-info-table.h"
5 #include "monster-race/monster-race.h"
6 #include "monster/monster-status.h"
7 #include "player/mimic-info-table.h"
8 #include "player/player-class.h"
9 #include "player/player-status-table.h"
10 #include "system/floor-type-definition.h"
11 #include "term/screen-processor.h"
12 #include "term/term-color-types.h"
13 #include "util/string-processor.h"
14 #include "window/main-window-row-column.h"
15 #include "window/main-window-stat-poster.h"
16 #include "window/main-window-util.h"
17 #include "world/world.h"
20 * @brief プレイヤーの称号を表示する / Prints "title", including "wizard" or "winner" as needed.
23 void print_title(player_type *creature_ptr)
27 if (current_world_ptr->wizard) {
28 p = _("[ウィザード]", "[=-WIZARD-=]");
29 } else if (current_world_ptr->total_winner || (creature_ptr->lev > PY_MAX_LEVEL)) {
30 if (creature_ptr->arena_number > MAX_ARENA_MONS + 2) {
31 p = _("*真・勝利者*", "*TRUEWINNER*");
33 p = _("***勝利者***", "***WINNER***");
36 angband_strcpy(str, player_title[creature_ptr->pclass][(creature_ptr->lev - 1) / 5], sizeof(str));
40 print_field(p, ROW_TITLE, COL_TITLE);
44 * @brief プレイヤーのレベルを表示する / Prints level
47 void print_level(player_type *creature_ptr)
50 sprintf(tmp, "%5d", creature_ptr->lev);
51 if (creature_ptr->lev >= creature_ptr->max_plv) {
52 put_str(_("レベル ", "LEVEL "), ROW_LEVEL, 0);
53 c_put_str(TERM_L_GREEN, tmp, ROW_LEVEL, COL_LEVEL + 7);
55 put_str(_("xレベル", "Level "), ROW_LEVEL, 0);
56 c_put_str(TERM_YELLOW, tmp, ROW_LEVEL, COL_LEVEL + 7);
61 * @brief プレイヤーの経験値を表示する / Display the experience
64 void print_exp(player_type *creature_ptr)
68 if ((!exp_need) || (creature_ptr->prace == RACE_ANDROID)) {
69 (void)sprintf(out_val, "%8ld", (long)creature_ptr->exp);
71 if (creature_ptr->lev >= PY_MAX_LEVEL) {
72 (void)sprintf(out_val, "********");
74 (void)sprintf(out_val, "%8ld", (long)(player_exp[creature_ptr->lev - 1] * creature_ptr->expfact / 100L) - creature_ptr->exp);
78 if (creature_ptr->exp >= creature_ptr->max_exp) {
79 if (creature_ptr->prace == RACE_ANDROID)
80 put_str(_("強化 ", "Cst "), ROW_EXP, 0);
82 put_str(_("経験 ", "EXP "), ROW_EXP, 0);
83 c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 4);
85 put_str(_("x経験", "Exp "), ROW_EXP, 0);
86 c_put_str(TERM_YELLOW, out_val, ROW_EXP, COL_EXP + 4);
91 * @brief プレイヤーのACを表示する / Prints current AC
94 void print_ac(player_type *creature_ptr)
100 put_str(" AC( )", ROW_AC, COL_AC);
101 sprintf(tmp, "%5d", creature_ptr->dis_ac + creature_ptr->dis_to_a);
102 c_put_str(TERM_L_GREEN, tmp, ROW_AC, COL_AC + 6);
104 put_str("Cur AC ", ROW_AC, COL_AC);
105 sprintf(tmp, "%5d", creature_ptr->dis_ac + creature_ptr->dis_to_a);
106 c_put_str(TERM_L_GREEN, tmp, ROW_AC, COL_AC + 7);
111 * @brief プレイヤーのHPを表示する / Prints Cur/Max hit points
114 void print_hp(player_type *creature_ptr)
117 put_str("HP", ROW_CURHP, COL_CURHP);
118 sprintf(tmp, "%4ld", (long int)creature_ptr->chp);
120 if (creature_ptr->chp >= creature_ptr->mhp) {
121 color = TERM_L_GREEN;
122 } else if (creature_ptr->chp > (creature_ptr->mhp * hitpoint_warn) / 10) {
128 c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 3);
129 put_str("/", ROW_CURHP, COL_CURHP + 7);
130 sprintf(tmp, "%4ld", (long int)creature_ptr->mhp);
131 color = TERM_L_GREEN;
132 c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 8);
136 * @brief プレイヤーのMPを表示する / Prints players max/cur spell points
139 void print_sp(player_type *creature_ptr)
143 if (!mp_ptr->spell_book && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL)
146 put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP);
147 sprintf(tmp, "%4ld", (long int)creature_ptr->csp);
148 if (creature_ptr->csp >= creature_ptr->msp) {
149 color = TERM_L_GREEN;
150 } else if (creature_ptr->csp > (creature_ptr->msp * mana_warn) / 10) {
156 c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 3);
157 put_str("/", ROW_CURSP, COL_CURSP + 7);
158 sprintf(tmp, "%4ld", (long int)creature_ptr->msp);
159 color = TERM_L_GREEN;
160 c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 8);
164 * @brief プレイヤーの所持金を表示する / Prints current gold
165 * @param creature_ptr プレーヤーへの参照ポインタ
168 void print_gold(player_type *creature_ptr)
171 put_str(_("$ ", "AU "), ROW_GOLD, COL_GOLD);
172 sprintf(tmp, "%9ld", (long)creature_ptr->au);
173 c_put_str(TERM_L_GREEN, tmp, ROW_GOLD, COL_GOLD + 3);
177 * @brief 現在のフロアの深さを表示する / Prints depth in stat area
178 * @param creature_ptr プレーヤーへの参照ポインタ
181 void print_depth(player_type *creature_ptr)
184 TERM_COLOR attr = TERM_WHITE;
187 term_get_size(&wid, &hgt);
188 TERM_LEN col_depth = wid + COL_DEPTH;
189 TERM_LEN row_depth = hgt + ROW_DEPTH;
191 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
192 if (!floor_ptr->dun_level) {
193 strcpy(depths, _("地上", "Surf."));
194 c_prt(attr, format("%7s", depths), row_depth, col_depth);
198 if (floor_ptr->inside_quest && !creature_ptr->dungeon_idx) {
199 strcpy(depths, _("地上", "Quest"));
200 c_prt(attr, format("%7s", depths), row_depth, col_depth);
205 (void)sprintf(depths, _("%d ft", "%d ft"), (int)floor_ptr->dun_level * 50);
207 (void)sprintf(depths, _("%d 階", "Lev %d"), (int)floor_ptr->dun_level);
209 switch (creature_ptr->feeling) {
218 break; /* Horrible visions */
221 break; /* Very dangerous */
224 break; /* Very bad feeling */
227 break; /* Bad feeling */
233 break; /* Luck is turning */
236 break; /* Don't like */
239 break; /* Reasonably safe */
242 break; /* Boring place */
245 c_prt(attr, format("%7s", depths), row_depth, col_depth);
249 * @brief プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map)
250 * @param creature_ptr プレーヤーへの参照ポインタ
253 void print_frame_basic(player_type *creature_ptr)
255 if (creature_ptr->mimic_form) {
256 print_field(mimic_info[creature_ptr->mimic_form].title, ROW_RACE, COL_RACE);
259 angband_strcpy(str, rp_ptr->title, sizeof(str));
260 print_field(str, ROW_RACE, COL_RACE);
263 print_title(creature_ptr);
264 print_level(creature_ptr);
265 print_exp(creature_ptr);
266 for (int i = 0; i < A_MAX; i++)
267 print_stat(creature_ptr, i);
269 print_ac(creature_ptr);
270 print_hp(creature_ptr);
271 print_sp(creature_ptr);
272 print_gold(creature_ptr);
273 print_depth(creature_ptr);
274 health_redraw(creature_ptr, FALSE);
275 health_redraw(creature_ptr, TRUE);
279 * @brief モンスターの体力ゲージを表示する
280 * @param riding TRUEならば騎乗中のモンスターの体力、FALSEならターゲットモンスターの体力を表示する。表示位置は固定。
284 * Redraw the "monster health bar" -DRS-
285 * Rather extensive modifications by -BEN-
287 * The "monster health bar" provides visual feedback on the "health"
288 * of the monster currently being "tracked". There are several ways
289 * to "track" a monster, including targetting it, attacking it, and
290 * affecting it (and nobody else) with a ranged attack.
292 * Display the monster health bar (affectionately known as the
293 * "health-o-meter"). Clear health bar if nothing is being tracked.
294 * Auto-track current target monster when bored. Note that the
295 * health-bar stops tracking any monster that "disappears".
298 void health_redraw(player_type *creature_ptr, bool riding)
304 health_who = creature_ptr->riding;
305 row = ROW_RIDING_INFO;
306 col = COL_RIDING_INFO;
308 health_who = creature_ptr->health_who;
314 m_ptr = &creature_ptr->current_floor_ptr->m_list[health_who];
316 if (current_world_ptr->wizard && creature_ptr->phase_out) {
320 term_putstr(col - 2, row, 12, TERM_WHITE, " / ");
321 term_putstr(col - 2, row + 1, 12, TERM_WHITE, " / ");
322 term_putstr(col - 2, row + 2, 12, TERM_WHITE, " / ");
323 term_putstr(col - 2, row + 3, 12, TERM_WHITE, " / ");
325 if (creature_ptr->current_floor_ptr->m_list[1].r_idx) {
326 term_putstr(col - 2, row, 2, r_info[creature_ptr->current_floor_ptr->m_list[1].r_idx].x_attr,
327 format("%c", r_info[creature_ptr->current_floor_ptr->m_list[1].r_idx].x_char));
328 term_putstr(col - 1, row, 5, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[1].hp));
329 term_putstr(col + 5, row, 6, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[1].max_maxhp));
332 if (creature_ptr->current_floor_ptr->m_list[2].r_idx) {
333 term_putstr(col - 2, row + 1, 2, r_info[creature_ptr->current_floor_ptr->m_list[2].r_idx].x_attr,
334 format("%c", r_info[creature_ptr->current_floor_ptr->m_list[2].r_idx].x_char));
335 term_putstr(col - 1, row + 1, 5, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[2].hp));
336 term_putstr(col + 5, row + 1, 6, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[2].max_maxhp));
339 if (creature_ptr->current_floor_ptr->m_list[3].r_idx) {
340 term_putstr(col - 2, row + 2, 2, r_info[creature_ptr->current_floor_ptr->m_list[3].r_idx].x_attr,
341 format("%c", r_info[creature_ptr->current_floor_ptr->m_list[3].r_idx].x_char));
342 term_putstr(col - 1, row + 2, 5, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[3].hp));
343 term_putstr(col + 5, row + 2, 6, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[3].max_maxhp));
346 if (creature_ptr->current_floor_ptr->m_list[4].r_idx) {
347 term_putstr(col - 2, row + 3, 2, r_info[creature_ptr->current_floor_ptr->m_list[4].r_idx].x_attr,
348 format("%c", r_info[creature_ptr->current_floor_ptr->m_list[4].r_idx].x_char));
349 term_putstr(col - 1, row + 3, 5, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[4].hp));
350 term_putstr(col + 5, row + 3, 6, TERM_WHITE, format("%5d", creature_ptr->current_floor_ptr->m_list[4].max_maxhp));
357 term_erase(col, row, 12);
362 term_putstr(col, row, 12, TERM_WHITE, "[----------]");
366 if (creature_ptr->image) {
367 term_putstr(col, row, 12, TERM_WHITE, "[----------]");
372 term_putstr(col, row, 12, TERM_WHITE, "[----------]");
376 int pct = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
377 int pct2 = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->max_maxhp : 0;
378 int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
379 TERM_COLOR attr = TERM_RED;
380 if (monster_invulner_remaining(m_ptr))
382 else if (monster_csleep_remaining(m_ptr))
384 else if (monster_fear_remaining(m_ptr))
395 term_putstr(col, row, 12, TERM_WHITE, "[----------]");
396 term_putstr(col + 1, row, len, attr, "**********");