<ClCompile Include="..\..\src\cmd-io\cmd-lore.c" />\r
<ClCompile Include="..\..\src\cmd-io\cmd-menu-content-table.c" />\r
<ClCompile Include="..\..\src\cmd-io\macro-util.c" />\r
+ <ClCompile Include="..\..\src\cmd-item\cmd-equipment.c" />\r
<ClCompile Include="..\..\src\cmd-item\cmd-throw.c" />\r
<ClCompile Include="..\..\src\cmd-visual\cmd-map.c" />\r
<ClCompile Include="..\..\src\core\asking-player.c" />\r
<ClInclude Include="..\..\src\cmd-io\cmd-lore.h" />\r
<ClInclude Include="..\..\src\cmd-io\cmd-menu-content-table.h" />\r
<ClInclude Include="..\..\src\cmd-io\macro-util.h" />\r
+ <ClInclude Include="..\..\src\cmd-item\cmd-equipment.h" />\r
<ClInclude Include="..\..\src\cmd-item\cmd-throw.h" />\r
<ClInclude Include="..\..\src\cmd-visual\cmd-map.h" />\r
<ClInclude Include="..\..\src\core\asking-player.h" />\r
<ClCompile Include="..\..\src\cmd-io\cmd-floor.c">
<Filter>cmd-io</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\cmd-item\cmd-equipment.c">
+ <Filter>cmd-item</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\cmd-io\cmd-floor.h">
<Filter>cmd-io</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\cmd-item\cmd-equipment.h">
+ <Filter>cmd-item</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
cmd-io/macro-util.c cmd-io/macro-util.h \
\
cmd-item/cmd-eat.c cmd-item/cmd-eat.h \
+ cmd-item/cmd-equipment.c cmd-item/cmd-equipment.h \
cmd-item/cmd-item.c cmd-item/cmd-item.h \
cmd-item/cmd-magiceat.c cmd-item/cmd-magiceat.h \
cmd-item/cmd-quaff.c cmd-item/cmd-quaff.h \
--- /dev/null
+#include "cmd-item/cmd-equipment.h"
+#include "action/weapon-shield.h"
+#include "art-definition/art-protector-types.h"
+#include "autopick/autopick.h"
+#include "core/asking-player.h"
+#include "core/player-redraw-types.h"
+#include "core/player-update-types.h"
+#include "core/window-redrawer.h"
+#include "dungeon/quest.h" // todo \88á\98a\8a´\81A\89½\8cÌ\83A\83C\83e\83\80\82ð\91\95\94õ\82·\82é\82Æ\83N\83G\83X\83g\82Ì\90¬\8c÷\94»\92è\82ª\91\96\82é\82Ì\82©\81H.
+#include "flavor/flavor-describer.h"
+#include "flavor/object-flavor-types.h"
+#include "floor/floor-object.h"
+#include "game-option/birth-options.h"
+#include "game-option/input-options.h"
+#include "inventory/inventory-describer.h"
+#include "inventory/inventory-object.h"
+#include "inventory/inventory-slot-types.h"
+#include "io/input-key-acceptor.h"
+#include "io/input-key-requester.h"
+#include "object-enchant/item-feeling.h"
+#include "object-enchant/special-object-flags.h"
+#include "object-enchant/trc-types.h"
+#include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
+#include "object/item-tester-hooker.h"
+#include "object/item-use-flags.h"
+#include "object/object-generator.h"
+#include "object/object-info.h"
+#include "object/object-mark-types.h"
+#include "perception/object-perception.h"
+#include "player/attack-defense-types.h"
+#include "player/avatar.h"
+#include "player/special-defense-types.h"
+#include "racial/racial-android.h"
+#include "spell-kind/spells-perception.h"
+#include "status/action-setter.h"
+#include "status/shape-changer.h"
+#include "system/object-type-definition.h"
+#include "term/screen-processor.h"
+#include "util/int-char-converter.h"
+#include "view/display-inventory.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief \91\95\94õ\88ê\97\97\82ð\95\\8e¦\82·\82é\83R\83}\83\93\83h\82Ì\83\81\83C\83\93\83\8b\81[\83`\83\93 / Display equipment
+ * @return \82È\82µ
+ */
+void do_cmd_equip(player_type *creature_ptr)
+{
+ char out_val[160];
+ command_wrk = TRUE;
+ if (easy_floor)
+ command_wrk = USE_EQUIP;
+
+ screen_save();
+ (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
+#ifdef JP
+ sprintf(out_val, "\91\95\94õ\81F \8d\87\8cv %3d.%1d kg (\8cÀ\8aE\82Ì%ld%%) \83R\83}\83\93\83h: ", (int)lbtokg1(creature_ptr->total_weight), (int)lbtokg2(creature_ptr->total_weight),
+ (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
+#else
+ sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ", (int)(creature_ptr->total_weight / 10),
+ (int)(creature_ptr->total_weight % 10), (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
+#endif
+
+ prt(out_val, 0, 0);
+ command_new = inkey();
+ screen_load();
+
+ if (command_new != ESCAPE) {
+ command_see = TRUE;
+ return;
+ }
+
+ TERM_LEN wid, hgt;
+ term_get_size(&wid, &hgt);
+ command_new = 0;
+ command_gap = wid - 30;
+}
+
+bool select_ring_slot = FALSE;
+
+/*!
+ * @brief \91\95\94õ\82·\82é\83R\83}\83\93\83h\82Ì\83\81\83C\83\93\83\8b\81[\83`\83\93 / Wield or wear a single item from the pack or floor
+ * @param creature_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \82È\82µ
+ */
+void do_cmd_wield(player_type *creature_ptr)
+{
+ OBJECT_IDX item, slot;
+ object_type forge;
+ object_type *q_ptr;
+ object_type *o_ptr;
+ concptr act;
+ GAME_TEXT o_name[MAX_NLEN];
+ OBJECT_IDX need_switch_wielding = 0;
+ if (creature_ptr->special_defense & KATA_MUSOU)
+ set_action(creature_ptr, ACTION_NONE);
+
+ item_tester_hook = item_tester_hook_wear;
+ concptr q = _("\82Ç\82ê\82ð\91\95\94õ\82µ\82Ü\82·\82©? ", "Wear/Wield which item? ");
+ concptr s = _("\91\95\94õ\89Â\94\\82È\83A\83C\83e\83\80\82ª\82È\82¢\81B", "You have nothing you can wear or wield.");
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ if (!o_ptr)
+ return;
+
+ slot = wield_slot(creature_ptr, o_ptr);
+
+ switch (o_ptr->tval) {
+ case TV_CAPTURE:
+ case TV_SHIELD:
+ case TV_CARD:
+ if (has_melee_weapon(creature_ptr, INVEN_RARM) && has_melee_weapon(creature_ptr, INVEN_LARM)) {
+ item_tester_hook = item_tester_hook_melee_weapon;
+ q = _("\82Ç\82¿\82ç\82Ì\95\90\8aí\82Æ\8eæ\82è\91Ö\82¦\82Ü\82·\82©?", "Replace which weapon? ");
+ s = _("\82¨\82Á\82Æ\81B", "Oops.");
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
+ return;
+
+ if (slot == INVEN_RARM)
+ need_switch_wielding = INVEN_LARM;
+ } else if (has_melee_weapon(creature_ptr, INVEN_LARM))
+ slot = INVEN_RARM;
+ else if (creature_ptr->inventory_list[INVEN_RARM].k_idx && !object_is_melee_weapon(&creature_ptr->inventory_list[INVEN_RARM])
+ && creature_ptr->inventory_list[INVEN_LARM].k_idx && !object_is_melee_weapon(&creature_ptr->inventory_list[INVEN_LARM])) {
+ item_tester_hook = item_tester_hook_mochikae;
+ q = _("\82Ç\82¿\82ç\82Ì\8eè\82É\91\95\94õ\82µ\82Ü\82·\82©?", "Equip which hand? ");
+ s = _("\82¨\82Á\82Æ\81B", "Oops.");
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
+ return;
+ }
+
+ break;
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ if (slot == INVEN_LARM) {
+ if (!get_check(_("\93ñ\93\81\97¬\82Å\90í\82¢\82Ü\82·\82©\81H", "Dual wielding? ")))
+ slot = INVEN_RARM;
+ } else if (!creature_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(creature_ptr, INVEN_LARM)) {
+ if (!get_check(_("\93ñ\93\81\97¬\82Å\90í\82¢\82Ü\82·\82©\81H", "Dual wielding? ")))
+ slot = INVEN_LARM;
+ } else if (creature_ptr->inventory_list[INVEN_LARM].k_idx && creature_ptr->inventory_list[INVEN_RARM].k_idx) {
+ item_tester_hook = item_tester_hook_mochikae;
+ q = _("\82Ç\82¿\82ç\82Ì\8eè\82É\91\95\94õ\82µ\82Ü\82·\82©?", "Equip which hand? ");
+ s = _("\82¨\82Á\82Æ\81B", "Oops.");
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
+ return;
+
+ if ((slot == INVEN_LARM) && !has_melee_weapon(creature_ptr, INVEN_RARM))
+ need_switch_wielding = INVEN_RARM;
+ }
+
+ break;
+ case TV_RING:
+ if (creature_ptr->inventory_list[INVEN_LEFT].k_idx && creature_ptr->inventory_list[INVEN_RIGHT].k_idx)
+ q = _("\82Ç\82¿\82ç\82Ì\8ew\97Ö\82Æ\8eæ\82è\91Ö\82¦\82Ü\82·\82©?", "Replace which ring? ");
+ else
+ q = _("\82Ç\82¿\82ç\82Ì\8eè\82É\91\95\94õ\82µ\82Ü\82·\82©?", "Equip which hand? ");
+
+ s = _("\82¨\82Á\82Æ\81B", "Oops.");
+ select_ring_slot = TRUE;
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) {
+ select_ring_slot = FALSE;
+ return;
+ }
+
+ select_ring_slot = FALSE;
+ break;
+ }
+
+ if (object_is_cursed(&creature_ptr->inventory_list[slot])) {
+ describe_flavor(creature_ptr, o_name, &creature_ptr->inventory_list[slot], OD_OMIT_PREFIX | OD_NAME_ONLY);
+#ifdef JP
+ msg_format("%s%s\82Í\8eô\82í\82ê\82Ä\82¢\82é\82æ\82¤\82¾\81B", describe_use(creature_ptr, slot), o_name);
+#else
+ msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(creature_ptr, slot));
+#endif
+ return;
+ }
+
+ if (confirm_wear
+ && ((object_is_cursed(o_ptr) && object_is_known(o_ptr))
+ || ((o_ptr->ident & IDENT_SENSE) && (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED)))) {
+ char dummy[MAX_NLEN + 80];
+ describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ sprintf(dummy, _("\96{\93\96\82É%s{\8eô\82í\82ê\82Ä\82¢\82é}\82ð\8eg\82¢\82Ü\82·\82©\81H", "Really use the %s {cursed}? "), o_name);
+
+ if (!get_check(dummy))
+ return;
+ }
+
+ if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID)) {
+ char dummy[MAX_NLEN + 100];
+ describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ sprintf(dummy,
+ _("%s\82ð\91\95\94õ\82·\82é\82Æ\8bz\8c\8c\8bS\82É\82È\82è\82Ü\82·\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H", "%s will transforms you into a vampire permanently when equiped. Do you become a vampire?"),
+ o_name);
+
+ if (!get_check(dummy))
+ return;
+ }
+
+ if (need_switch_wielding && !object_is_cursed(&creature_ptr->inventory_list[need_switch_wielding])) {
+ object_type *slot_o_ptr = &creature_ptr->inventory_list[slot];
+ object_type *switch_o_ptr = &creature_ptr->inventory_list[need_switch_wielding];
+ object_type object_tmp;
+ object_type *otmp_ptr = &object_tmp;
+ GAME_TEXT switch_name[MAX_NLEN];
+ describe_flavor(creature_ptr, switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_copy(otmp_ptr, switch_o_ptr);
+ object_copy(switch_o_ptr, slot_o_ptr);
+ object_copy(slot_o_ptr, otmp_ptr);
+ msg_format(_("%s\82ð%s\82É\8d\\82¦\82È\82¨\82µ\82½\81B", "You wield %s at %s hand."), switch_name,
+ (slot == INVEN_RARM) ? (left_hander ? _("\8d¶\8eè", "left") : _("\89E\8eè", "right")) : (left_hander ? _("\89E\8eè", "right") : _("\8d¶\8eè", "left")));
+ slot = need_switch_wielding;
+ }
+
+ check_find_art_quest_completion(creature_ptr, o_ptr);
+ if (creature_ptr->pseikaku == PERSONALITY_MUNCHKIN) {
+ identify_item(creature_ptr, o_ptr);
+ autopick_alter_item(creature_ptr, item, FALSE);
+ }
+
+ take_turn(creature_ptr, 100);
+ q_ptr = &forge;
+ object_copy(q_ptr, o_ptr);
+ q_ptr->number = 1;
+ if (item >= 0) {
+ inven_item_increase(creature_ptr, item, -1);
+ inven_item_optimize(creature_ptr, item);
+ } else {
+ floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+ floor_item_optimize(creature_ptr, 0 - item);
+ }
+
+ o_ptr = &creature_ptr->inventory_list[slot];
+ if (o_ptr->k_idx)
+ (void)inven_takeoff(creature_ptr, slot, 255);
+
+ object_copy(o_ptr, q_ptr);
+ o_ptr->marked |= OM_TOUCHED;
+ creature_ptr->total_weight += q_ptr->weight;
+ creature_ptr->equip_cnt++;
+
+#define STR_WIELD_RARM _("%s(%c)\82ð\89E\8eè\82É\91\95\94õ\82µ\82½\81B", "You are wielding %s (%c) in your right hand.")
+#define STR_WIELD_LARM _("%s(%c)\82ð\8d¶\8eè\82É\91\95\94õ\82µ\82½\81B", "You are wielding %s (%c) in your left hand.")
+#define STR_WIELD_ARMS _("%s(%c)\82ð\97¼\8eè\82Å\8d\\82¦\82½\81B", "You are wielding %s (%c) with both hands.")
+
+ switch (slot) {
+ case INVEN_RARM:
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && can_two_hands_wielding(creature_ptr))
+ act = STR_WIELD_ARMS;
+ else
+ act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
+
+ break;
+ case INVEN_LARM:
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && can_two_hands_wielding(creature_ptr))
+ act = STR_WIELD_ARMS;
+ else
+ act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
+
+ break;
+ case INVEN_BOW:
+ act = _("%s(%c)\82ð\8eË\8c\82\97p\82É\91\95\94õ\82µ\82½\81B", "You are shooting with %s (%c).");
+ break;
+ case INVEN_LITE:
+ act = _("%s(%c)\82ð\8cõ\8c¹\82É\82µ\82½\81B", "Your light source is %s (%c).");
+ break;
+ default:
+ act = _("%s(%c)\82ð\91\95\94õ\82µ\82½\81B", "You are wearing %s (%c).");
+ break;
+ }
+
+ describe_flavor(creature_ptr, o_name, o_ptr, 0);
+ msg_format(act, o_name, index_to_label(slot));
+ if (object_is_cursed(o_ptr)) {
+ msg_print(_("\82¤\82í\81I \82·\82³\82Ü\82¶\82\97â\82½\82¢\81I", "Oops! It feels deathly cold!"));
+ chg_virtue(creature_ptr, V_HARMONY, -1);
+ o_ptr->ident |= (IDENT_SENSE);
+ }
+
+ if ((o_ptr->name1 == ART_STONEMASK) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID))
+ change_race(creature_ptr, RACE_VAMPIRE, "");
+
+ creature_ptr->update |= PU_BONUS | PU_TORCH | PU_MANA;
+ creature_ptr->redraw |= PR_EQUIPPY;
+ creature_ptr->window |= PW_INVEN | PW_EQUIP | PW_PLAYER;
+ calc_android_exp(creature_ptr);
+}
+
+/*!
+ * @brief \91\95\94õ\82ð\8aO\82·\83R\83}\83\93\83h\82Ì\83\81\83C\83\93\83\8b\81[\83`\83\93 / Take off an item
+ * @return \82È\82µ
+ */
+void do_cmd_takeoff(player_type *creature_ptr)
+{
+ OBJECT_IDX item;
+ object_type *o_ptr;
+ if (creature_ptr->special_defense & KATA_MUSOU)
+ set_action(creature_ptr, ACTION_NONE);
+
+ concptr q = _("\82Ç\82ê\82ð\91\95\94õ\82©\82ç\82Í\82¸\82µ\82Ü\82·\82©? ", "Take off which item? ");
+ concptr s = _("\82Í\82¸\82¹\82é\91\95\94õ\82ª\82È\82¢\81B", "You are not wearing anything to take off.");
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
+ if (!o_ptr)
+ return;
+
+ if (object_is_cursed(o_ptr)) {
+ if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (creature_ptr->pclass != CLASS_BERSERKER)) {
+ msg_print(_("\82Ó\81[\82Þ\81A\82Ç\82¤\82â\82ç\8eô\82í\82ê\82Ä\82¢\82é\82æ\82¤\82¾\81B", "Hmmm, it seems to be cursed."));
+ return;
+ }
+
+ if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4)) {
+ msg_print(_("\8eô\82í\82ê\82½\91\95\94õ\82ð\97Í\82Ã\82\82Å\94\8d\82ª\82µ\82½\81I", "You tore off a piece of cursed equipment by sheer strength!"));
+ o_ptr->ident |= (IDENT_SENSE);
+ o_ptr->curse_flags = 0L;
+ o_ptr->feeling = FEEL_NONE;
+ creature_ptr->update |= PU_BONUS;
+ creature_ptr->window |= PW_EQUIP;
+ msg_print(_("\8eô\82¢\82ð\91Å\82¿\94j\82Á\82½\81B", "You break the curse."));
+ } else {
+ msg_print(_("\91\95\94õ\82ð\8aO\82¹\82È\82©\82Á\82½\81B", "You couldn't remove the equipment."));
+ take_turn(creature_ptr, 50);
+ return;
+ }
+ }
+
+ take_turn(creature_ptr, 50);
+ (void)inven_takeoff(creature_ptr, item, 255);
+ verify_equip_slot(creature_ptr, item);
+ calc_android_exp(creature_ptr);
+ creature_ptr->redraw |= PR_EQUIPPY;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+void do_cmd_equip(player_type *creature_ptr);
+void do_cmd_wield(player_type *creature_ptr);
+void do_cmd_takeoff(player_type *creature_ptr);
#include "action/action-limited.h"
#include "action/activation-execution.h"
#include "action/weapon-shield.h"
-#include "art-definition/art-protector-types.h"
#include "autopick/autopick-registry.h"
#include "autopick/autopick.h"
#include "cmd-action/cmd-open-close.h"
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#include "dungeon/quest.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-object.h"
-#include "game-option/birth-options.h"
#include "game-option/input-options.h"
-#include "inventory/inventory-describer.h"
#include "inventory/inventory-object.h"
#include "inventory/inventory-slot-types.h"
#include "io/input-key-acceptor.h"
#include "main/sound-of-music.h"
#include "mind/snipe-types.h"
#include "object-activation/activation-switcher.h"
-#include "object-enchant/item-feeling.h"
#include "object-enchant/object-ego.h"
-#include "object-enchant/special-object-flags.h"
-#include "object-enchant/trc-types.h"
-#include "object-hook/hook-armor.h"
#include "object-hook/hook-checker.h"
#include "object-hook/hook-expendable.h"
#include "object-hook/hook-magic.h"
-#include "object-hook/hook-weapon.h"
#include "object-use/quaff-execution.h"
#include "object-use/read-execution.h"
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
#include "object/object-generator.h"
-#include "object/object-info.h"
-#include "object/object-mark-types.h"
#include "object/object-stack.h"
#include "object/object-value.h"
#include "perception/identification.h"
#include "realm/realm-hex-numbers.h"
#include "realm/realm-names-table.h"
#include "realm/realm-types.h"
-#include "spell-kind/spells-perception.h"
#include "status/action-setter.h"
#include "status/experience.h"
-#include "status/shape-changer.h"
#include "sv-definition/sv-lite-types.h"
#include "term/screen-processor.h"
#include "util/int-char-converter.h"
}
/*!
- * @brief 装備一覧を表示するコマンドのメインルーチン / Display equipment
- * @return なし
- */
-void do_cmd_equip(player_type *creature_ptr)
-{
- char out_val[160];
- command_wrk = TRUE;
- if (easy_floor)
- command_wrk = USE_EQUIP;
-
- screen_save();
- (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
-#ifdef JP
- sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ", (int)lbtokg1(creature_ptr->total_weight), (int)lbtokg2(creature_ptr->total_weight),
- (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
-#else
- sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ", (int)(creature_ptr->total_weight / 10),
- (int)(creature_ptr->total_weight % 10), (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
-#endif
-
- prt(out_val, 0, 0);
- command_new = inkey();
- screen_load();
-
- if (command_new != ESCAPE) {
- command_see = TRUE;
- return;
- }
-
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- command_new = 0;
- command_gap = wid - 30;
-}
-
-bool select_ring_slot = FALSE;
-
-/*!
- * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void do_cmd_wield(player_type *creature_ptr)
-{
- OBJECT_IDX item, slot;
- object_type forge;
- object_type *q_ptr;
- object_type *o_ptr;
- concptr act;
- GAME_TEXT o_name[MAX_NLEN];
- OBJECT_IDX need_switch_wielding = 0;
- if (creature_ptr->special_defense & KATA_MUSOU)
- set_action(creature_ptr, ACTION_NONE);
-
- item_tester_hook = item_tester_hook_wear;
- concptr q = _("どれを装備しますか? ", "Wear/Wield which item? ");
- concptr s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
- if (!o_ptr)
- return;
-
- slot = wield_slot(creature_ptr, o_ptr);
-
- switch (o_ptr->tval) {
- case TV_CAPTURE:
- case TV_SHIELD:
- case TV_CARD:
- if (has_melee_weapon(creature_ptr, INVEN_RARM) && has_melee_weapon(creature_ptr, INVEN_LARM)) {
- item_tester_hook = item_tester_hook_melee_weapon;
- q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
- s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
- return;
-
- if (slot == INVEN_RARM)
- need_switch_wielding = INVEN_LARM;
- } else if (has_melee_weapon(creature_ptr, INVEN_LARM))
- slot = INVEN_RARM;
- else if (creature_ptr->inventory_list[INVEN_RARM].k_idx && !object_is_melee_weapon(&creature_ptr->inventory_list[INVEN_RARM])
- && creature_ptr->inventory_list[INVEN_LARM].k_idx && !object_is_melee_weapon(&creature_ptr->inventory_list[INVEN_LARM])) {
- item_tester_hook = item_tester_hook_mochikae;
- q = _("どちらの手に装備しますか?", "Equip which hand? ");
- s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
- return;
- }
-
- break;
- case TV_DIGGING:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_SWORD:
- if (slot == INVEN_LARM) {
- if (!get_check(_("二刀流で戦いますか?", "Dual wielding? ")))
- slot = INVEN_RARM;
- } else if (!creature_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(creature_ptr, INVEN_LARM)) {
- if (!get_check(_("二刀流で戦いますか?", "Dual wielding? ")))
- slot = INVEN_LARM;
- } else if (creature_ptr->inventory_list[INVEN_LARM].k_idx && creature_ptr->inventory_list[INVEN_RARM].k_idx) {
- item_tester_hook = item_tester_hook_mochikae;
- q = _("どちらの手に装備しますか?", "Equip which hand? ");
- s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
- return;
-
- if ((slot == INVEN_LARM) && !has_melee_weapon(creature_ptr, INVEN_RARM))
- need_switch_wielding = INVEN_RARM;
- }
-
- break;
- case TV_RING:
- if (creature_ptr->inventory_list[INVEN_LEFT].k_idx && creature_ptr->inventory_list[INVEN_RIGHT].k_idx)
- q = _("どちらの指輪と取り替えますか?", "Replace which ring? ");
- else
- q = _("どちらの手に装備しますか?", "Equip which hand? ");
-
- s = _("おっと。", "Oops.");
- select_ring_slot = TRUE;
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) {
- select_ring_slot = FALSE;
- return;
- }
-
- select_ring_slot = FALSE;
- break;
- }
-
- if (object_is_cursed(&creature_ptr->inventory_list[slot])) {
- describe_flavor(creature_ptr, o_name, &creature_ptr->inventory_list[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
-#ifdef JP
- msg_format("%s%sは呪われているようだ。", describe_use(creature_ptr, slot), o_name);
-#else
- msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(creature_ptr, slot));
-#endif
- return;
- }
-
- if (confirm_wear
- && ((object_is_cursed(o_ptr) && object_is_known(o_ptr))
- || ((o_ptr->ident & IDENT_SENSE) && (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED)))) {
- char dummy[MAX_NLEN + 80];
- describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name);
-
- if (!get_check(dummy))
- return;
- }
-
- if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID)) {
- char dummy[MAX_NLEN + 100];
- describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- sprintf(dummy,
- _("%sを装備すると吸血鬼になります。よろしいですか?", "%s will transforms you into a vampire permanently when equiped. Do you become a vampire?"),
- o_name);
-
- if (!get_check(dummy))
- return;
- }
-
- if (need_switch_wielding && !object_is_cursed(&creature_ptr->inventory_list[need_switch_wielding])) {
- object_type *slot_o_ptr = &creature_ptr->inventory_list[slot];
- object_type *switch_o_ptr = &creature_ptr->inventory_list[need_switch_wielding];
- object_type object_tmp;
- object_type *otmp_ptr = &object_tmp;
- GAME_TEXT switch_name[MAX_NLEN];
- describe_flavor(creature_ptr, switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- object_copy(otmp_ptr, switch_o_ptr);
- object_copy(switch_o_ptr, slot_o_ptr);
- object_copy(slot_o_ptr, otmp_ptr);
- msg_format(_("%sを%sに構えなおした。", "You wield %s at %s hand."), switch_name,
- (slot == INVEN_RARM) ? (left_hander ? _("左手", "left") : _("右手", "right")) : (left_hander ? _("右手", "right") : _("左手", "left")));
- slot = need_switch_wielding;
- }
-
- check_find_art_quest_completion(creature_ptr, o_ptr);
- if (creature_ptr->pseikaku == PERSONALITY_MUNCHKIN) {
- identify_item(creature_ptr, o_ptr);
- autopick_alter_item(creature_ptr, item, FALSE);
- }
-
- take_turn(creature_ptr, 100);
- q_ptr = &forge;
- object_copy(q_ptr, o_ptr);
- q_ptr->number = 1;
- if (item >= 0) {
- inven_item_increase(creature_ptr, item, -1);
- inven_item_optimize(creature_ptr, item);
- } else {
- floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
- floor_item_optimize(creature_ptr, 0 - item);
- }
-
- o_ptr = &creature_ptr->inventory_list[slot];
- if (o_ptr->k_idx)
- (void)inven_takeoff(creature_ptr, slot, 255);
-
- object_copy(o_ptr, q_ptr);
- o_ptr->marked |= OM_TOUCHED;
- creature_ptr->total_weight += q_ptr->weight;
- creature_ptr->equip_cnt++;
-
-#define STR_WIELD_RARM _("%s(%c)を右手に装備した。", "You are wielding %s (%c) in your right hand.")
-#define STR_WIELD_LARM _("%s(%c)を左手に装備した。", "You are wielding %s (%c) in your left hand.")
-#define STR_WIELD_ARMS _("%s(%c)を両手で構えた。", "You are wielding %s (%c) with both hands.")
-
- switch (slot) {
- case INVEN_RARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && can_two_hands_wielding(creature_ptr))
- act = STR_WIELD_ARMS;
- else
- act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
-
- break;
- case INVEN_LARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && can_two_hands_wielding(creature_ptr))
- act = STR_WIELD_ARMS;
- else
- act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
-
- break;
- case INVEN_BOW:
- act = _("%s(%c)を射撃用に装備した。", "You are shooting with %s (%c).");
- break;
- case INVEN_LITE:
- act = _("%s(%c)を光源にした。", "Your light source is %s (%c).");
- break;
- default:
- act = _("%s(%c)を装備した。", "You are wearing %s (%c).");
- break;
- }
-
- describe_flavor(creature_ptr, o_name, o_ptr, 0);
- msg_format(act, o_name, index_to_label(slot));
- if (object_is_cursed(o_ptr)) {
- msg_print(_("うわ! すさまじく冷たい!", "Oops! It feels deathly cold!"));
- chg_virtue(creature_ptr, V_HARMONY, -1);
- o_ptr->ident |= (IDENT_SENSE);
- }
-
- if ((o_ptr->name1 == ART_STONEMASK) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID))
- change_race(creature_ptr, RACE_VAMPIRE, "");
-
- creature_ptr->update |= PU_BONUS | PU_TORCH | PU_MANA;
- creature_ptr->redraw |= PR_EQUIPPY;
- creature_ptr->window |= PW_INVEN | PW_EQUIP | PW_PLAYER;
- calc_android_exp(creature_ptr);
-}
-
-/*!
- * @brief 装備を外すコマンドのメインルーチン / Take off an item
- * @return なし
- */
-void do_cmd_takeoff(player_type *creature_ptr)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- if (creature_ptr->special_defense & KATA_MUSOU)
- set_action(creature_ptr, ACTION_NONE);
-
- concptr q = _("どれを装備からはずしますか? ", "Take off which item? ");
- concptr s = _("はずせる装備がない。", "You are not wearing anything to take off.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
- if (!o_ptr)
- return;
-
- if (object_is_cursed(o_ptr)) {
- if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (creature_ptr->pclass != CLASS_BERSERKER)) {
- msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
- return;
- }
-
- if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4)) {
- msg_print(_("呪われた装備を力づくで剥がした!", "You tore off a piece of cursed equipment by sheer strength!"));
- o_ptr->ident |= (IDENT_SENSE);
- o_ptr->curse_flags = 0L;
- o_ptr->feeling = FEEL_NONE;
- creature_ptr->update |= PU_BONUS;
- creature_ptr->window |= PW_EQUIP;
- msg_print(_("呪いを打ち破った。", "You break the curse."));
- } else {
- msg_print(_("装備を外せなかった。", "You couldn't remove the equipment."));
- take_turn(creature_ptr, 50);
- return;
- }
- }
-
- take_turn(creature_ptr, 50);
- (void)inven_takeoff(creature_ptr, item, 255);
- verify_equip_slot(creature_ptr, item);
- calc_android_exp(creature_ptr);
- creature_ptr->redraw |= (PR_EQUIPPY);
-}
-
-/*!
* @brief アイテムを落とすコマンドのメインルーチン / Drop an item
* @return なし
*/
#include "system/angband.h"
void do_cmd_inven(player_type *creature_ptr);
-void do_cmd_equip(player_type *creature_ptr);
-void do_cmd_wield(player_type *creature_ptr);
-void do_cmd_takeoff(player_type *creature_ptr);
void do_cmd_drop(player_type *creature_ptr);
void do_cmd_destroy(player_type *creature_ptr);
void do_cmd_observe(player_type *creature_ptr);
#include "cmd-io/cmd-process-screen.h"
#include "cmd-io/cmd-save.h"
#include "cmd-item/cmd-eat.h"
+#include "cmd-item/cmd-equipment.h"
#include "cmd-item/cmd-item.h"
#include "cmd-item/cmd-magiceat.h"
#include "cmd-item/cmd-quaff.h"
#include "cmd-item/cmd-magiceat.h"
#include "cmd-io/cmd-lore.h"
#include "cmd-io/cmd-macro.h"
+#include "cmd-item/cmd-equipment.h"
#include "cmd-item/cmd-smith.h"
#include "cmd-visual/cmd-draw.h"
#include "cmd-visual/cmd-visuals.h"