OSDN Git Service

Merge branch 'For2.2.2-Refactoring' into For3.0.0-Artifact-Monster-Addition
[hengband/hengband.git] / src / view / display-birth.c
1 #include "view/display-birth.h"
2 #include "birth/auto-roller.h"
3 #include "birth/birth-stat.h"
4 #include "game-option/birth-options.h"
5 #include "player/player-class.h"
6 #include "player/player-personality.h"
7 #include "player/player-race.h"
8 #include "term/screen-processor.h"
9 #include "term/term-color-types.h"
10
11 /*!
12  * @brief オートロール中のステータスを表示する / Display stat values, subset of "put_stats()"
13  * @details See 'display_player(p_ptr, )' for screen layout constraints.
14  * @return なし
15  */
16 void birth_put_stats(player_type *creature_ptr)
17 {
18     if (!autoroller)
19         return;
20
21     const int col = 42;
22     for (int i = 0; i < A_MAX; i++) {
23         int j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
24         int m = adjust_stat(creature_ptr->stat_max[i], j);
25         char buf[80];
26         cnv_stat(m, buf);
27         c_put_str(TERM_L_GREEN, buf, 3 + i, col + 24);
28         if (stat_match[i]) {
29             int p = stat_match[i] > 1000000L ? stat_match[i] / (auto_round / 1000L) : 1000L * stat_match[i] / auto_round;
30             TERM_COLOR attr = (p < 100) ? TERM_YELLOW : TERM_L_GREEN;
31             sprintf(buf, "%3d.%d%%", p / 10, p % 10);
32             c_put_str(attr, buf, 3 + i, col + 13);
33         } else {
34             c_put_str(TERM_RED, _("(なし)", "(NONE)"), 3 + i, col + 13);
35         }
36     }
37 }