7 #include "knowledge-self.h"
8 #include "birth/birth-explanations-table.h"
9 #include "core/show-file.h"
10 #include "flavor/flavor-describer.h"
11 #include "floor/floor-town.h"
12 #include "info-reader/fixed-map-parser.h"
13 #include "io-dump/dump-util.h"
14 #include "player/avatar.h"
15 #include "player/player-class.h"
16 #include "player/race-info-table.h"
17 #include "store/store-util.h"
18 #include "system/object-type-definition.h"
19 #include "util/angband-files.h"
20 #include "util/buffer-shaper.h"
21 #include "util/int-char-converter.h"
22 #include "world/world.h"
25 * List virtues & status
27 void do_cmd_knowledge_virtues(player_type *creature_ptr)
30 GAME_TEXT file_name[FILE_NAME_SIZE];
31 if (!open_temporary_file(&fff, file_name))
34 fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr));
35 dump_virtues(creature_ptr, fff);
37 (void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
42 * @brief 自分に関する情報を画面に表示する
43 * @param creature_ptr プレーヤーへの参照ポインタ
47 static void dump_yourself(player_type *creature_ptr, FILE *fff)
53 shape_buffer(race_explanations[creature_ptr->prace], 78, temp, sizeof(temp));
55 fprintf(fff, _("種族: %s\n", "Race: %s\n"), race_info[creature_ptr->prace].title);
58 for (int i = 0; i < 10; i++) {
61 fprintf(fff, "%s\n", t);
65 shape_buffer(class_explanations[creature_ptr->pclass], 78, temp, sizeof(temp));
67 fprintf(fff, _("職業: %s\n", "Class: %s\n"), class_info[creature_ptr->pclass].title);
70 for (int i = 0; i < 10; i++) {
73 fprintf(fff, "%s\n", t);
77 shape_buffer(personality_explanations[creature_ptr->pseikaku], 78, temp, sizeof(temp));
79 fprintf(fff, _("性格: %s\n", "Pesonality: %s\n"), personality_info[creature_ptr->pseikaku].title);
82 for (int i = 0; i < A_MAX; i++) {
85 fprintf(fff, "%s\n", t);
90 if (creature_ptr->realm1) {
91 shape_buffer(realm_explanations[technic2magic(creature_ptr->realm1) - 1], 78, temp, sizeof(temp));
92 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm1]);
95 for (int i = 0; i < A_MAX; i++) {
99 fprintf(fff, "%s\n", t);
105 if (creature_ptr->realm2) {
106 shape_buffer(realm_explanations[technic2magic(creature_ptr->realm2) - 1], 78, temp, sizeof(temp));
107 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm2]);
110 for (int i = 0; i < A_MAX; i++) {
114 fprintf(fff, "%s\n", t);
121 * List virtues & status
124 void do_cmd_knowledge_stat(player_type *creature_ptr)
127 GAME_TEXT file_name[FILE_NAME_SIZE];
128 if (!open_temporary_file(&fff, file_name))
132 = (int)(((long)creature_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) / (2 * creature_ptr->hitdie + ((PY_MAX_LEVEL - 1 + 3) * (creature_ptr->hitdie + 1))));
134 if (creature_ptr->knowledge & KNOW_HPRATE)
135 fprintf(fff, _("現在の体力ランク : %d/100\n\n", "Your current Life Rating is %d/100.\n\n"), percent);
137 fprintf(fff, _("現在の体力ランク : ???\n\n", "Your current Life Rating is ???.\n\n"));
139 fprintf(fff, _("能力の最大値\n\n", "Limits of maximum stats\n\n"));
140 for (int v_nr = 0; v_nr < A_MAX; v_nr++) {
141 if ((creature_ptr->knowledge & KNOW_STAT) || creature_ptr->stat_max[v_nr] == creature_ptr->stat_max_max[v_nr])
142 fprintf(fff, "%s 18/%d\n", stat_names[v_nr], creature_ptr->stat_max_max[v_nr] - 18);
144 fprintf(fff, "%s ???\n", stat_names[v_nr]);
147 dump_yourself(creature_ptr, fff);
149 (void)show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
155 * @param player_ptr プレーヤーへの参照ポインタ
158 void do_cmd_knowledge_home(player_type *player_ptr)
160 parse_fixed_map(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
163 GAME_TEXT file_name[FILE_NAME_SIZE];
164 if (!open_temporary_file(&fff, file_name))
167 store_type *store_ptr;
168 store_ptr = &town_info[1].store[STORE_HOME];
170 if (store_ptr->stock_num) {
174 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
176 GAME_TEXT o_name[MAX_NLEN];
177 for (int i = 0; i < store_ptr->stock_num; i++) {
180 fprintf(fff, "\n ( %d ページ )\n", x++);
181 describe_flavor(player_ptr, o_name, &store_ptr->stock[i], 0);
182 if (strlen(o_name) <= 80 - 3) {
183 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
187 for (n = 0, t = o_name; n < 80 - 3; n++, t++)
193 n = 79 - 3; /* 最後が漢字半分 */
195 fprintf(fff, "%c%s %.*s\n", I2A(i % 12), paren, n, o_name);
196 fprintf(fff, " %.77s\n", o_name + n);
199 describe_flavor(player_ptr, o_name, &store_ptr->stock[i], 0);
200 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
204 fprintf(fff, "\n\n");
208 (void)show_file(player_ptr, TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);