1 #include "view/object-describer.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "flavor/flavor-describer.h"
4 #include "flavor/object-flavor-types.h"
5 #include "object-enchant/special-object-flags.h"
6 #include "object/tval-types.h"
7 #include "perception/object-perception.h"
8 #include "player-base/player-class.h"
9 #include "realm/realm-names-table.h"
10 #include "spell/spell-info.h"
11 #include "system/item-entity.h"
12 #include "system/player-type-definition.h"
13 #include "term/term-color-types.h"
14 #include "view/display-messages.h"
17 * @brief 魔道具の使用回数の残量を示すメッセージを表示する
18 * @param item 残量を表示したいインベントリ内のアイテム
20 void inven_item_charges(const ItemEntity &item)
22 if (!item.is_wand_staff() || !item.is_known()) {
28 msg_print("もう魔力が残っていない。");
30 msg_format("あと %d 回分の魔力が残っている。", item.pval);
34 msg_format("You have %d charges remaining.", item.pval);
36 msg_format("You have %d charge remaining.", item.pval);
42 * @brief アイテムの残り所持数メッセージを表示する /
43 * Describe an item in the inventory.
44 * @param player_ptr プレイヤーへの参照ポインタ
45 * @param item 残量を表示したいプレイヤーのアイテム所持スロット
47 void inven_item_describe(PlayerType *player_ptr, short item)
49 auto *o_ptr = &player_ptr->inventory_list[item];
50 const auto item_name = describe_flavor(player_ptr, o_ptr, 0);
52 if (o_ptr->number <= 0) {
53 msg_format("もう%sを持っていない。", item_name.data());
55 msg_format("まだ %sを持っている。", item_name.data());
58 msg_format("You have %s.", item_name.data());
63 * @brief 現在アクティブになっているウィンドウにオブジェクトの詳細を表示する
64 * @param player_ptr プレイヤーへの参照ポインタ
65 * @details Include list of usable spells for readible books
67 void display_koff(PlayerType *player_ptr)
69 if (player_ptr->tracking_bi_id == 0) {
73 for (auto y = 0; y < game_term->hgt; y++) {
78 item.prep(player_ptr->tracking_bi_id);
79 const auto item_name = describe_flavor(player_ptr, &item, (OD_OMIT_PREFIX | OD_NAME_ONLY | OD_STORE));
80 term_putstr(0, 0, -1, TERM_WHITE, item_name);
81 const auto sval = item.bi_key.sval().value();
82 const short use_realm = tval2realm(item.bi_key.tval());
84 if (player_ptr->realm1 || player_ptr->realm2) {
85 if ((use_realm != player_ptr->realm1) && (use_realm != player_ptr->realm2)) {
89 PlayerClass pc(player_ptr);
90 if (!pc.is_every_magic()) {
93 if (!is_magic(use_realm)) {
96 if (pc.equals(PlayerClassType::RED_MAGE) && (use_realm != REALM_ARCANE) && (sval > 1)) {
103 for (int spell = 0; spell < 32; spell++) {
104 if (fake_spell_flags[sval] & (1UL << spell)) {
105 spells[num++] = spell;
109 print_spells(player_ptr, 0, spells, num, 2, 0, use_realm);