2 #include "knowledge-experiences.h"
3 #include "cmd/dump-util.h"
4 #include "core/show-file.h"
5 #include "object-flavor.h"
6 #include "objectkind.h"
7 #include "player-skill.h"
12 void do_cmd_knowledge_weapon_exp(player_type *creature_ptr)
15 GAME_TEXT file_name[FILE_NAME_SIZE];
16 if (!open_temporary_file(&fff, file_name)) return;
18 for (int i = 0; i < 5; i++)
20 for (int num = 0; num < 64; num++)
24 for (KIND_OBJECT_IDX j = 0; j < max_k_idx; j++)
26 object_kind *k_ptr = &k_info[j];
28 if ((k_ptr->tval != TV_SWORD - i) || (k_ptr->sval != num)) continue;
29 if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue;
31 weapon_exp = creature_ptr->weapon_exp[4 - i][num];
33 fprintf(fff, "%-25s ", tmp);
34 if (weapon_exp >= s_info[creature_ptr->pclass].w_max[4 - i][num]) fprintf(fff, "!");
35 else fprintf(fff, " ");
36 fprintf(fff, "%s", exp_level_str[weapon_exp_level(weapon_exp)]);
37 if (cheat_xtra) fprintf(fff, " %d", weapon_exp);
45 (void)show_file(creature_ptr, TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
51 * @brief 魔法の経験値を表示するコマンドのメインルーチン
55 void do_cmd_knowledge_spell_exp(player_type *creature_ptr)
58 GAME_TEXT file_name[FILE_NAME_SIZE];
59 if (!open_temporary_file(&fff, file_name)) return;
61 if (creature_ptr->realm1 != REALM_NONE)
63 fprintf(fff, _("%sの魔法書\n", "%s Spellbook\n"), realm_names[creature_ptr->realm1]);
64 for (SPELL_IDX i = 0; i < 32; i++)
66 const magic_type *s_ptr;
67 if (!is_magic(creature_ptr->realm1))
69 s_ptr = &technic_info[creature_ptr->realm1 - MIN_TECHNIC][i];
73 s_ptr = &mp_ptr->info[creature_ptr->realm1 - 1][i];
76 if (s_ptr->slevel >= 99) continue;
77 SUB_EXP spell_exp = creature_ptr->spell_exp[i];
78 int exp_level = spell_exp_level(spell_exp);
79 fprintf(fff, "%-25s ", exe_spell(creature_ptr, creature_ptr->realm1, i, SPELL_NAME));
80 if (creature_ptr->realm1 == REALM_HISSATSU)
84 if (exp_level >= EXP_LEVEL_MASTER) fprintf(fff, "!");
85 else fprintf(fff, " ");
86 fprintf(fff, "%s", exp_level_str[exp_level]);
89 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
94 if (creature_ptr->realm2 != REALM_NONE)
96 fprintf(fff, _("%sの魔法書\n", "\n%s Spellbook\n"), realm_names[creature_ptr->realm2]);
97 for (SPELL_IDX i = 0; i < 32; i++)
99 const magic_type *s_ptr;
100 if (!is_magic(creature_ptr->realm1))
102 s_ptr = &technic_info[creature_ptr->realm2 - MIN_TECHNIC][i];
106 s_ptr = &mp_ptr->info[creature_ptr->realm2 - 1][i];
109 if (s_ptr->slevel >= 99) continue;
111 SUB_EXP spell_exp = creature_ptr->spell_exp[i + 32];
112 int exp_level = spell_exp_level(spell_exp);
113 fprintf(fff, "%-25s ", exe_spell(creature_ptr, creature_ptr->realm2, i, SPELL_NAME));
114 if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
115 else fprintf(fff, " ");
116 fprintf(fff, "%s", exp_level_str[exp_level]);
117 if (cheat_xtra) fprintf(fff, " %d", spell_exp);
123 (void)show_file(creature_ptr, TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
129 * @brief スキル情報を表示するコマンドのメインルーチン /
133 void do_cmd_knowledge_skill_exp(player_type *creature_ptr)
135 char skill_name[GINOU_TEMPMAX][20] =
137 _("マーシャルアーツ", "Martial Arts "),
138 _("二刀流 ", "Dual Wielding "),
144 char file_name[FILE_NAME_SIZE];
145 if (!open_temporary_file(&fff, file_name)) return;
147 for (int i = 0; i < GINOU_TEMPMAX; i++)
149 int skill_exp = creature_ptr->skill_exp[i];
150 fprintf(fff, "%-20s ", skill_name[i]);
151 if (skill_exp >= s_info[creature_ptr->pclass].s_max[i]) fprintf(fff, "!");
152 else fprintf(fff, " ");
153 fprintf(fff, "%s", exp_level_str[(i == GINOU_RIDING) ? riding_exp_level(skill_exp) : weapon_exp_level(skill_exp)]);
154 if (cheat_xtra) fprintf(fff, " %d", skill_exp);
159 (void)show_file(creature_ptr, TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);