q = _("どのアイテムを調べますか?", "Meditate on which item? ");
s = _("調べるアイテムがありません。", "You have nothing appropriate.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return (FALSE);
/* It is fully known, no information needed */
if (object_is_known(o_ptr))
}
#ifdef JP
- msg_format("%sは%sという感じがする...",
- o_name, game_inscriptions[feel]);
+ msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
#else
msg_format("You feel that the %s %s %s...",
- o_name, ((o_ptr->number == 1) ? "is" : "are"),
- game_inscriptions[feel]);
+ o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
#endif
q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
s = _("強化できる武器がない。", "You have nothing to enchant.");
- if (!get_item(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
-
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return;
/* you can never modify artifacts / ego-items */
/* you can never modify cursed items */
q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ if (!o_ptr) return (FALSE);
/* See how many items */
if (o_ptr->number > 1)
q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
s = _("強化できるアイテムがない。", "You have nothing to enchant.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return (FALSE);
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
s = _("強化できるアイテムがない。", "You have nothing to enchant.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return (FALSE);
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return (FALSE);
old_known = identify_item(o_ptr);
q = _("どれを使いますか?", "Use which item? ");
s = _("使えるものがありません。", "You have nothing you can use.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return (FALSE);
msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
{