7 #include "system/angband.h"
8 #include "knowledge-self.h"
9 #include "io-dump/dump-util.h"
10 #include "player/avatar.h"
11 #include "core/show-file.h"
12 #include "dungeon/dungeon-file.h"
13 #include "world/world.h"
14 #include "store/store-util.h"
15 #include "floor/floor-town.h"
16 #include "object/object-flavor.h"
17 #include "birth/birth-explanations-table.h"
20 * List virtues & status
22 void do_cmd_knowledge_virtues(player_type *creature_ptr)
25 GAME_TEXT file_name[FILE_NAME_SIZE];
26 if (!open_temporary_file(&fff, file_name)) return;
28 fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr));
29 dump_virtues(creature_ptr, fff);
31 (void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
37 * @brief 自分に関する情報を画面に表示する
38 * @param creature_ptr プレーヤーへの参照ポインタ
42 static void dump_yourself(player_type *creature_ptr, FILE *fff)
48 roff_to_buf(race_explanations[creature_ptr->prace], 78, temp, sizeof(temp));
50 fprintf(fff, _("種族: %s\n", "Race: %s\n"), race_info[creature_ptr->prace].title);
53 for (int i = 0; i < 10; i++) {
56 fprintf(fff, "%s\n", t);
60 roff_to_buf(class_explanations[creature_ptr->pclass], 78, temp, sizeof(temp));
62 fprintf(fff, _("職業: %s\n", "Class: %s\n"), class_info[creature_ptr->pclass].title);
65 for (int i = 0; i < 10; i++) {
68 fprintf(fff, "%s\n", t);
72 roff_to_buf(personality_explanations[creature_ptr->pseikaku], 78, temp, sizeof(temp));
74 fprintf(fff, _("性格: %s\n", "Pesonality: %s\n"), seikaku_info[creature_ptr->pseikaku].title);
77 for (int i = 0; i < A_MAX; i++) {
80 fprintf(fff, "%s\n", t);
85 if (creature_ptr->realm1) {
86 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm1) - 1], 78, temp, sizeof(temp));
87 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm1]);
90 for (int i = 0; i < A_MAX; i++) {
94 fprintf(fff, "%s\n", t);
100 if (creature_ptr->realm2) {
101 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm2) - 1], 78, temp, sizeof(temp));
102 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm2]);
105 for (int i = 0; i < A_MAX; i++) {
109 fprintf(fff, "%s\n", t);
116 * List virtues & status
119 void do_cmd_knowledge_stat(player_type *creature_ptr)
122 GAME_TEXT file_name[FILE_NAME_SIZE];
123 if (!open_temporary_file(&fff, file_name)) return;
125 int percent = (int)(((long)creature_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
126 (2 * creature_ptr->hitdie +
127 ((PY_MAX_LEVEL - 1 + 3) * (creature_ptr->hitdie + 1))));
129 if (creature_ptr->knowledge & KNOW_HPRATE)
130 fprintf(fff, _("現在の体力ランク : %d/100\n\n", "Your current Life Rating is %d/100.\n\n"), percent);
131 else fprintf(fff, _("現在の体力ランク : ???\n\n", "Your current Life Rating is ???.\n\n"));
133 fprintf(fff, _("能力の最大値\n\n", "Limits of maximum stats\n\n"));
134 for (int v_nr = 0; v_nr < A_MAX; v_nr++)
136 if ((creature_ptr->knowledge & KNOW_STAT) || creature_ptr->stat_max[v_nr] == creature_ptr->stat_max_max[v_nr])
137 fprintf(fff, "%s 18/%d\n", stat_names[v_nr], creature_ptr->stat_max_max[v_nr] - 18);
139 fprintf(fff, "%s ???\n", stat_names[v_nr]);
142 dump_yourself(creature_ptr, fff);
144 (void)show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
151 * @param player_ptr プレーヤーへの参照ポインタ
154 void do_cmd_knowledge_home(player_type *player_ptr)
156 process_dungeon_file(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
159 GAME_TEXT file_name[FILE_NAME_SIZE];
160 if (!open_temporary_file(&fff, file_name)) return;
162 store_type *store_ptr;
163 store_ptr = &town_info[1].store[STORE_HOME];
165 if (store_ptr->stock_num)
170 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
172 GAME_TEXT o_name[MAX_NLEN];
173 for (int i = 0; i < store_ptr->stock_num; i++)
176 if ((i % 12) == 0) fprintf(fff, "\n ( %d ページ )\n", x++);
177 object_desc(player_ptr, o_name, &store_ptr->stock[i], 0);
178 if (strlen(o_name) <= 80 - 3)
180 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
186 for (n = 0, t = o_name; n < 80 - 3; n++, t++)
187 if (iskanji(*t)) { t++; n++; }
188 if (n == 81 - 3) n = 79 - 3; /* 最後が漢字半分 */
190 fprintf(fff, "%c%s %.*s\n", I2A(i % 12), paren, n, o_name);
191 fprintf(fff, " %.77s\n", o_name + n);
194 object_desc(player_ptr, o_name, &store_ptr->stock[i], 0);
195 fprintf(fff, "%c%s %s\n", I2A(i % 12), paren, o_name);
199 fprintf(fff, "\n\n");
203 (void)show_file(player_ptr, TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);