3 * @brief プレイヤーのアイテムに関するコマンドの実装1 / Inventory commands
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
16 #include "cmd-activate.h"
18 #include "cmd-quaff.h"
20 #include "cmd-usestaff.h"
21 #include "cmd-zaprod.h"
22 #include "cmd-zapwand.h"
27 * @brief 持ち物一覧を表示するコマンドのメインルーチン / Display inventory
30 void do_cmd_inven(void)
35 /* Note that we are in "inventory" mode */
38 #ifdef ALLOW_EASY_FLOOR
40 /* Note that we are in "inventory" mode */
41 if (easy_floor) command_wrk = (USE_INVEN);
43 #endif /* ALLOW_EASY_FLOOR */
48 /* Hack -- show empty slots */
49 item_tester_full = TRUE;
51 /* Display the inventory */
54 /* Hack -- hide empty slots */
55 item_tester_full = FALSE;
58 sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
59 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
60 (long int)((p_ptr->total_weight * 100) / weight_limit()));
62 sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
63 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
64 (p_ptr->total_weight * 100) / weight_limit());
71 /* Get a new command */
72 command_new = inkey();
78 /* Process "Escape" */
79 if (command_new == ESCAPE)
84 Term_get_size(&wid, &hgt);
88 command_gap = wid - 30;
91 /* Process normal keys */
94 /* Hack -- Use "display" mode */
101 * @brief 装備一覧を表示するコマンドのメインルーチン / Display equipment
104 void do_cmd_equip(void)
109 /* Note that we are in "equipment" mode */
112 #ifdef ALLOW_EASY_FLOOR
114 /* Note that we are in "equipment" mode */
115 if (easy_floor) command_wrk = (USE_EQUIP);
117 #endif /* ALLOW_EASY_FLOOR */
119 /* Save the screen */
122 /* Hack -- show empty slots */
123 item_tester_full = TRUE;
125 /* Display the equipment */
128 /* Hack -- undo the hack above */
129 item_tester_full = FALSE;
133 sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
134 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
135 (long int)((p_ptr->total_weight * 100) / weight_limit()));
137 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
138 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
139 (long int)((p_ptr->total_weight * 100) / weight_limit()));
146 /* Get a new command */
147 command_new = inkey();
149 /* Restore the screen */
153 /* Process "Escape" */
154 if (command_new == ESCAPE)
159 Term_get_size(&wid, &hgt);
163 command_gap = wid - 30;
166 /* Process normal keys */
169 /* Enter "display" mode */
176 * @brief オブジェクトを防具として装備できるかの判定 / The "wearable" tester
177 * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
178 * @return オブジェクトが防具として装備できるならTRUEを返す。
180 static bool item_tester_hook_wear(object_type *o_ptr)
182 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
183 if (p_ptr->psex == SEX_MALE) return FALSE;
185 /* Check for a usable slot */
186 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
188 /* Assume not wearable */
194 * @brief オブジェクトがどちらの手にも装備できる武器かどうかの判定
195 * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
196 * @return 左右両方の手で装備できるならばTRUEを返す。
198 static bool item_tester_hook_mochikae(object_type *o_ptr)
200 /* Check for a usable slot */
201 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
202 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
203 (o_ptr->tval == TV_CARD)) return (TRUE);
205 /* Assume not wearable */
210 * @brief オブジェクトが右手か左手に装備できる武器かどうかの判定
211 * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
212 * @return 右手か左手の武器として装備できるならばTRUEを返す。
214 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
216 /* Check for a usable slot */
217 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
219 /* Assume not wearable */
224 bool select_ring_slot = FALSE;
227 * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
230 void do_cmd_wield(void)
232 OBJECT_IDX item, slot;
241 char o_name[MAX_NLEN];
245 OBJECT_IDX need_switch_wielding = 0;
247 if (p_ptr->special_defense & KATA_MUSOU)
249 set_action(ACTION_NONE);
252 /* Restrict the choices */
253 item_tester_hook = item_tester_hook_wear;
256 q = _("どれを装備しますか? ", "Wear/Wield which item? ");
257 s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
259 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
261 /* Get the item (in the pack) */
264 o_ptr = &inventory[item];
267 /* Get the item (on the floor) */
270 o_ptr = &o_list[0 - item];
275 slot = wield_slot(o_ptr);
279 /* Shields and some misc. items */
284 if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
286 /* Restrict the choices */
287 item_tester_hook = item_tester_hook_melee_weapon;
288 item_tester_no_ryoute = TRUE;
290 /* Choose a weapon from the equipment only */
291 q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
292 s = _("おっと。", "Oops.");
293 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
294 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
297 else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
299 /* Both arms are already used by non-weapon */
300 else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
301 inventory[INVEN_LARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_LARM]))
303 /* Restrict the choices */
304 item_tester_hook = item_tester_hook_mochikae;
307 q = _("どちらの手に装備しますか?", "Equip which hand? ");
308 s = _("おっと。", "Oops.");
309 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
318 /* Asking for dual wielding */
319 if (slot == INVEN_LARM)
321 if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM;
324 else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
326 if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM;
329 /* Both arms are already used */
330 else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
332 /* Restrict the choices */
333 item_tester_hook = item_tester_hook_mochikae;
336 q = _("どちらの手に装備しますか?", "Equip which hand? ");
337 s = _("おっと。", "Oops.");
339 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
340 if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
341 need_switch_wielding = INVEN_RARM;
347 /* Choose a ring slot */
348 if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
350 q = _("どちらの指輪と取り替えますか?", "Replace which ring? ");
354 q = _("どちらの手に装備しますか?", "Equip which hand? ");
356 s = _("おっと。", "Oops.");
358 /* Restrict the choices */
359 select_ring_slot = TRUE;
360 item_tester_no_ryoute = TRUE;
362 if (!get_item(&slot, q, s, (USE_EQUIP)))
364 select_ring_slot = FALSE;
367 select_ring_slot = FALSE;
371 /* Prevent wielding into a cursed slot */
372 if (object_is_cursed(&inventory[slot]))
375 object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
379 msg_format("%s%sは呪われているようだ。",
380 describe_use(slot) , o_name );
382 msg_format("The %s you are %s appears to be cursed.",
383 o_name, describe_use(slot));
386 /* Cancel the command */
391 ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
392 ((o_ptr->ident & IDENT_SENSE) &&
393 (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
395 char dummy[MAX_NLEN+80];
398 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
399 sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name);
401 if (!get_check(dummy)) return;
404 if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
406 char dummy[MAX_NLEN+80];
409 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
412 sprintf(dummy, "%sを装備すると吸血鬼になります。よろしいですか?", o_name);
414 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
415 sprintf(dummy, "Do you become a vampire?");
418 if (!get_check(dummy)) return;
421 if (need_switch_wielding && !object_is_cursed(&inventory[need_switch_wielding]))
423 object_type *slot_o_ptr = &inventory[slot];
424 object_type *switch_o_ptr = &inventory[need_switch_wielding];
425 object_type object_tmp;
426 object_type *otmp_ptr = &object_tmp;
427 char switch_name[MAX_NLEN];
429 object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
431 object_copy(otmp_ptr, switch_o_ptr);
432 object_copy(switch_o_ptr, slot_o_ptr);
433 object_copy(slot_o_ptr, otmp_ptr);
435 msg_format(_("%sを%sに構えなおした。", "You wield %s at %s hand."), switch_name,
436 (slot == INVEN_RARM) ? (left_hander ? _("左手", "left") : _("右手", "right")) :
437 (left_hander ? _("右手", "right") : _("左手", "left")));
438 slot = need_switch_wielding;
441 check_find_art_quest_completion(o_ptr);
443 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
445 identify_item(o_ptr);
447 /* Auto-inscription */
448 autopick_alter_item(item, FALSE);
452 p_ptr->energy_use = 100;
454 /* Get local object */
457 /* Obtain local object */
458 object_copy(q_ptr, o_ptr);
460 /* Modify quantity */
463 /* Decrease the item (from the pack) */
466 inven_item_increase(item, -1);
467 inven_item_optimize(item);
470 /* Decrease the item (from the floor) */
473 floor_item_increase(0 - item, -1);
474 floor_item_optimize(0 - item);
477 /* Access the wield slot */
478 o_ptr = &inventory[slot];
480 /* Take off existing item */
483 /* Take off existing item */
484 (void)inven_takeoff(slot, 255);
487 /* Wear the new stuff */
488 object_copy(o_ptr, q_ptr);
490 /* Player touches it */
491 o_ptr->marked |= OM_TOUCHED;
493 /* Increase the weight */
494 p_ptr->total_weight += q_ptr->weight;
496 /* Increment the equip counter by hand */
500 #define STR_WIELD_RARM "%s(%c)を右手に装備した。"
501 #define STR_WIELD_LARM "%s(%c)を左手に装備した。"
502 #define STR_WIELD_ARMS "%s(%c)を両手で構えた。"
504 #define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
505 #define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
506 #define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
509 /* Where is the item now */
513 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
514 act = STR_WIELD_ARMS;
516 act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
520 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
521 act = STR_WIELD_ARMS;
523 act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
527 act = _("%s(%c)を射撃用に装備した。", "You are shooting with %s (%c).");
531 act = _("%s(%c)を光源にした。", "Your light source is %s (%c).");
535 act = _("%s(%c)を装備した。", "You are wearing %s (%c).");
539 /* Describe the result */
540 object_desc(o_name, o_ptr, 0);
543 msg_format(act, o_name, index_to_label(slot));
547 if (object_is_cursed(o_ptr))
549 /* Warn the player */
550 msg_print(_("うわ! すさまじく冷たい!", "Oops! It feels deathly cold!"));
551 chg_virtue(V_HARMONY, -1);
554 o_ptr->ident |= (IDENT_SENSE);
557 /* The Stone Mask make the player turn into a vampire! */
558 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
560 /* Turn into a vampire */
561 change_race(RACE_VAMPIRE, "");
564 /* Recalculate bonuses */
565 p_ptr->update |= (PU_BONUS);
567 /* Recalculate torch */
568 p_ptr->update |= (PU_TORCH);
570 /* Recalculate mana */
571 p_ptr->update |= (PU_MANA);
573 p_ptr->redraw |= (PR_EQUIPPY);
576 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
583 * @param item 持ち替えを行いたい装備部位ID
586 void kamaenaoshi(int item)
588 object_type *o_ptr, *new_o_ptr;
589 char o_name[MAX_NLEN];
591 if (item == INVEN_RARM)
593 if (buki_motteruka(INVEN_LARM))
595 o_ptr = &inventory[INVEN_LARM];
596 object_desc(o_name, o_ptr, 0);
598 if (!object_is_cursed(o_ptr))
600 new_o_ptr = &inventory[INVEN_RARM];
601 object_copy(new_o_ptr, o_ptr);
602 p_ptr->total_weight += o_ptr->weight;
603 inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
604 inven_item_optimize(INVEN_LARM);
605 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
606 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
608 msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
609 (left_hander ? _("左手", "left") : _("右手", "right")));
613 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
614 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
618 else if (item == INVEN_LARM)
620 o_ptr = &inventory[INVEN_RARM];
621 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
623 if (buki_motteruka(INVEN_RARM))
625 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
626 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
628 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
630 new_o_ptr = &inventory[INVEN_LARM];
631 object_copy(new_o_ptr, o_ptr);
632 p_ptr->total_weight += o_ptr->weight;
633 inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
634 inven_item_optimize(INVEN_RARM);
635 msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
642 * @brief 装備を外すコマンドのメインルーチン / Take off an item
645 void do_cmd_takeoff(void)
653 if (p_ptr->special_defense & KATA_MUSOU)
655 set_action(ACTION_NONE);
658 item_tester_no_ryoute = TRUE;
661 q = "どれを装備からはずしますか? ";
664 q = "Take off which item? ";
665 s = "You are not wearing anything to take off.";
668 if (!get_item(&item, q, s, (USE_EQUIP))) return;
670 /* Get the item (in the pack) */
673 o_ptr = &inventory[item];
676 /* Get the item (on the floor) */
679 o_ptr = &o_list[0 - item];
684 if (object_is_cursed(o_ptr))
686 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
689 msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
695 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
697 msg_print(_("呪われた装備を力づくで剥がした!", "You teared a cursed equipment off by sheer strength!"));
699 /* Hack -- Assume felt */
700 o_ptr->ident |= (IDENT_SENSE);
702 o_ptr->curse_flags = 0L;
705 o_ptr->feeling = FEEL_NONE;
707 /* Recalculate the bonuses */
708 p_ptr->update |= (PU_BONUS);
711 p_ptr->window |= (PW_EQUIP);
713 msg_print(_("呪いを打ち破った。", "You break the curse."));
717 msg_print(_("装備を外せなかった。", "You couldn't remove the equipment."));
718 p_ptr->energy_use = 50;
723 /* Take a partial turn */
724 p_ptr->energy_use = 50;
726 /* Take off the item */
727 (void)inven_takeoff(item, 255);
733 p_ptr->redraw |= (PR_EQUIPPY);
738 * @brief アイテムを落とすコマンドのメインルーチン / Drop an item
741 void do_cmd_drop(void)
750 if (p_ptr->special_defense & KATA_MUSOU)
752 set_action(ACTION_NONE);
755 item_tester_no_ryoute = TRUE;
758 q = "どのアイテムを落としますか? ";
759 s = "落とせるアイテムを持っていない。";
761 q = "Drop which item? ";
762 s = "You have nothing to drop.";
765 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
767 /* Get the item (in the pack) */
770 o_ptr = &inventory[item];
773 /* Get the item (on the floor) */
776 o_ptr = &o_list[0 - item];
780 /* Hack -- Cannot remove cursed items */
781 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
784 msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
790 /* See how many items */
791 if (o_ptr->number > 1)
794 amt = get_quantity(NULL, o_ptr->number);
796 /* Allow user abort */
797 if (amt <= 0) return;
801 /* Take a partial turn */
802 p_ptr->energy_use = 50;
804 /* Drop (some of) the item */
805 inven_drop(item, amt);
807 if (item >= INVEN_RARM)
813 p_ptr->redraw |= (PR_EQUIPPY);
817 * @brief オブジェクトが高位の魔法書かどうかを判定する
818 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
819 * @return オブジェクトが高位の魔法書ならばTRUEを返す
821 static bool high_level_book(object_type *o_ptr)
823 if ((o_ptr->tval == TV_LIFE_BOOK) ||
824 (o_ptr->tval == TV_SORCERY_BOOK) ||
825 (o_ptr->tval == TV_NATURE_BOOK) ||
826 (o_ptr->tval == TV_CHAOS_BOOK) ||
827 (o_ptr->tval == TV_DEATH_BOOK) ||
828 (o_ptr->tval == TV_TRUMP_BOOK) ||
829 (o_ptr->tval == TV_CRAFT_BOOK) ||
830 (o_ptr->tval == TV_DAEMON_BOOK) ||
831 (o_ptr->tval == TV_CRUSADE_BOOK) ||
832 (o_ptr->tval == TV_MUSIC_BOOK) ||
833 (o_ptr->tval == TV_HEX_BOOK))
846 * @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
849 void do_cmd_destroy(void)
859 object_type *q_ptr = &forge;
861 char o_name[MAX_NLEN];
862 char out_val[MAX_NLEN+40];
866 if (p_ptr->special_defense & KATA_MUSOU)
868 set_action(ACTION_NONE);
871 /* Hack -- force destruction */
872 if (command_arg > 0) force = TRUE;
877 q = "どのアイテムを壊しますか? ";
878 s = "壊せるアイテムを持っていない。";
880 q = "Destroy which item? ";
881 s = "You have nothing to destroy.";
884 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
886 /* Get the item (in the pack) */
889 o_ptr = &inventory[item];
892 /* Get the item (on the floor) */
895 o_ptr = &o_list[0 - item];
898 /* Verify unless quantity given beforehand */
899 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
901 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
903 /* Make a verification */
904 sprintf(out_val, _("本当に%sを壊しますか? [y/n/Auto]", "Really destroy %s? [y/n/Auto]"), o_name);
907 /* HACK : Add the line to message buffer */
908 message_add(out_val);
909 p_ptr->window |= (PW_MESSAGE);
912 /* Get an acceptable answer */
922 /* Erase the prompt */
926 if (i == 'y' || i == 'Y')
930 if (i == ESCAPE || i == 'n' || i == 'N')
937 /* Add an auto-destroy preference line */
938 if (autopick_autoregister(o_ptr))
940 /* Auto-destroy it */
941 autopick_alter_item(item, TRUE);
944 /* The object is already destroyed. */
950 /* See how many items */
951 if (o_ptr->number > 1)
954 amt = get_quantity(NULL, o_ptr->number);
956 /* Allow user abort */
957 if (amt <= 0) return;
961 /* Describe the object */
962 old_number = o_ptr->number;
964 object_desc(o_name, o_ptr, 0);
965 o_ptr->number = old_number;
968 p_ptr->energy_use = 100;
970 /* Artifacts cannot be destroyed */
971 if (!can_player_destroy_object(o_ptr))
973 p_ptr->energy_use = 0;
976 msg_format(_("%sは破壊不可能だ。", "You cannot destroy %s."), o_name);
981 object_copy(q_ptr, o_ptr);
984 msg_format(_("%sを壊した。", "You destroy %s."), o_name);
985 sound(SOUND_DESTITEM);
987 /* Reduce the charges of rods/wands */
988 reduce_charges(o_ptr, amt);
990 /* Eliminate the item (from the pack) */
993 inven_item_increase(item, -amt);
994 inven_item_describe(item);
995 inven_item_optimize(item);
998 /* Eliminate the item (from the floor) */
1001 floor_item_increase(0 - item, -amt);
1002 floor_item_describe(0 - item);
1003 floor_item_optimize(0 - item);
1006 if (high_level_book(q_ptr))
1008 bool gain_expr = FALSE;
1010 if (p_ptr->prace == RACE_ANDROID)
1013 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1017 else if (p_ptr->pclass == CLASS_PALADIN)
1019 if (is_good_realm(p_ptr->realm1))
1021 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1025 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1029 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1031 s32b tester_exp = p_ptr->max_exp / 20;
1032 if (tester_exp > 10000) tester_exp = 10000;
1033 if (q_ptr->sval < 3) tester_exp /= 4;
1034 if (tester_exp<1) tester_exp = 1;
1036 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
1037 gain_exp(tester_exp * amt);
1039 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1041 chg_virtue(V_UNLIFE, 1);
1042 chg_virtue(V_VITALITY, -1);
1044 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1046 chg_virtue(V_UNLIFE, -1);
1047 chg_virtue(V_VITALITY, 1);
1050 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1051 chg_virtue(V_ENCHANT, -1);
1053 if (object_value_real(q_ptr) > 30000)
1054 chg_virtue(V_SACRIFICE, 2);
1056 else if (object_value_real(q_ptr) > 10000)
1057 chg_virtue(V_SACRIFICE, 1);
1060 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1061 chg_virtue(V_HARMONY, 1);
1063 if (item >= INVEN_RARM) calc_android_exp();
1068 * @brief アイテムを調査するコマンドのメインルーチン / Observe an item which has been *identify*-ed
1071 void do_cmd_observe(void)
1075 char o_name[MAX_NLEN];
1079 item_tester_no_ryoute = TRUE;
1082 q = "どのアイテムを調べますか? ";
1083 s = "調べられるアイテムがない。";
1085 q = "Examine which item? ";
1086 s = "You have nothing to examine.";
1089 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1091 /* Get the item (in the pack) */
1094 o_ptr = &inventory[item];
1097 /* Get the item (on the floor) */
1100 o_ptr = &o_list[0 - item];
1104 /* Require full knowledge */
1105 if (!(o_ptr->ident & IDENT_MENTAL))
1107 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
1113 object_desc(o_name, o_ptr, 0);
1116 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
1117 /* Describe it fully */
1118 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
1124 * @brief アイテムの銘を消すコマンドのメインルーチン
1125 * Remove the inscription from an object XXX Mention item (when done)?
1128 void do_cmd_uninscribe(void)
1134 item_tester_no_ryoute = TRUE;
1137 q = "どのアイテムの銘を消しますか? ";
1138 s = "銘を消せるアイテムがない。";
1140 q = "Un-inscribe which item? ";
1141 s = "You have nothing to un-inscribe.";
1144 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1146 /* Get the item (in the pack) */
1149 o_ptr = &inventory[item];
1152 /* Get the item (on the floor) */
1155 o_ptr = &o_list[0 - item];
1158 /* Nothing to remove */
1159 if (!o_ptr->inscription)
1161 msg_print(_("このアイテムには消すべき銘がない。", "That item had no inscription to remove."));
1166 msg_print(_("銘を消した。", "Inscription removed."));
1168 /* Remove the incription */
1169 o_ptr->inscription = 0;
1171 /* Combine the pack */
1172 p_ptr->notice |= (PN_COMBINE);
1175 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1177 /* .や$の関係で, 再計算が必要なはず -- henkma */
1178 p_ptr->update |= (PU_BONUS);
1184 * @brief アイテムの銘を刻むコマンドのメインルーチン
1185 * Inscribe an object with a comment
1188 void do_cmd_inscribe(void)
1192 char o_name[MAX_NLEN];
1196 item_tester_no_ryoute = TRUE;
1199 q = "どのアイテムに銘を刻みますか? ";
1200 s = "銘を刻めるアイテムがない。";
1202 q = "Inscribe which item? ";
1203 s = "You have nothing to inscribe.";
1206 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1208 /* Get the item (in the pack) */
1211 o_ptr = &inventory[item];
1214 /* Get the item (on the floor) */
1217 o_ptr = &o_list[0 - item];
1220 /* Describe the activity */
1221 object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
1224 msg_format(_("%sに銘を刻む。", "Inscribing %s."), o_name);
1227 /* Start with nothing */
1228 strcpy(out_val, "");
1230 /* Use old inscription */
1231 if (o_ptr->inscription)
1233 /* Start with the old inscription */
1234 strcpy(out_val, quark_str(o_ptr->inscription));
1237 /* Get a new inscription (possibly empty) */
1238 if (get_string(_("銘: ", "Inscription: "), out_val, 80))
1240 /* Save the inscription */
1241 o_ptr->inscription = quark_add(out_val);
1243 /* Combine the pack */
1244 p_ptr->notice |= (PN_COMBINE);
1247 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1249 /* .や$の関係で, 再計算が必要なはず -- henkma */
1250 p_ptr->update |= (PU_BONUS);
1257 * @brief オブジェクトがランタンの燃料になるかどうかを判定する
1258 * An "item_tester_hook" for refilling lanterns
1259 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
1260 * @return オブジェクトがランタンの燃料になるならばTRUEを返す
1262 static bool item_tester_refill_lantern(object_type *o_ptr)
1264 /* Flasks of oil are okay */
1265 if (o_ptr->tval == TV_FLASK) return (TRUE);
1267 /* Laterns are okay */
1268 if ((o_ptr->tval == TV_LITE) &&
1269 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1271 /* Assume not okay */
1277 * @brief ランタンに燃料を加えるコマンドのメインルーチン
1278 * Refill the players lamp (from the pack or floor)
1281 static void do_cmd_refill_lamp(void)
1291 /* Restrict the choices */
1292 item_tester_hook = item_tester_refill_lantern;
1296 q = "どの油つぼから注ぎますか? ";
1299 q = "Refill with which flask? ";
1300 s = "You have no flasks of oil.";
1303 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1305 /* Get the item (in the pack) */
1308 o_ptr = &inventory[item];
1311 /* Get the item (on the floor) */
1314 o_ptr = &o_list[0 - item];
1318 /* Take a partial turn */
1319 p_ptr->energy_use = 50;
1321 /* Access the lantern */
1322 j_ptr = &inventory[INVEN_LITE];
1325 j_ptr->xtra4 += o_ptr->xtra4;
1328 msg_print(_("ランプに油を注いだ。", "You fuel your lamp."));
1331 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1334 msg_print(_("ランプが消えてしまった!", "Your lamp has gone out!"));
1336 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1339 msg_print(_("しかしランプは全く光らない。", "Curiously, your lamp doesn't light."));
1341 else if (j_ptr->xtra4 >= FUEL_LAMP)
1343 j_ptr->xtra4 = FUEL_LAMP;
1344 msg_print(_("ランプの油は一杯だ。", "Your lamp is full."));
1347 /* Decrease the item (from the pack) */
1350 inven_item_increase(item, -1);
1351 inven_item_describe(item);
1352 inven_item_optimize(item);
1355 /* Decrease the item (from the floor) */
1358 floor_item_increase(0 - item, -1);
1359 floor_item_describe(0 - item);
1360 floor_item_optimize(0 - item);
1363 /* Recalculate torch */
1364 p_ptr->update |= (PU_TORCH);
1369 * @brief オブジェクトが松明に束ねられるかどうかを判定する
1370 * An "item_tester_hook" for refilling torches
1371 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
1372 * @return オブジェクトが松明に束ねられるならばTRUEを返す
1374 static bool item_tester_refill_torch(object_type *o_ptr)
1376 /* Torches are okay */
1377 if ((o_ptr->tval == TV_LITE) &&
1378 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1380 /* Assume not okay */
1386 * @brief 松明を束ねるコマンドのメインルーチン
1387 * Refuel the players torch (from the pack or floor)
1390 static void do_cmd_refill_torch(void)
1400 /* Restrict the choices */
1401 item_tester_hook = item_tester_refill_torch;
1405 q = "どの松明で明かりを強めますか? ";
1408 q = "Refuel with which torch? ";
1409 s = "You have no extra torches.";
1412 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1414 /* Get the item (in the pack) */
1417 o_ptr = &inventory[item];
1420 /* Get the item (on the floor) */
1423 o_ptr = &o_list[0 - item];
1427 /* Take a partial turn */
1428 p_ptr->energy_use = 50;
1430 /* Access the primary torch */
1431 j_ptr = &inventory[INVEN_LITE];
1434 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1437 msg_print(_("松明を結合した。", "You combine the torches."));
1440 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1443 msg_print(_("松明が消えてしまった!", "Your torch has gone out!"));
1445 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1448 msg_print(_("しかし松明は全く光らない。", "Curiously, your torche don't light."));
1450 /* Over-fuel message */
1451 else if (j_ptr->xtra4 >= FUEL_TORCH)
1453 j_ptr->xtra4 = FUEL_TORCH;
1454 msg_print(_("松明の寿命は十分だ。", "Your torch is fully fueled."));
1457 /* Refuel message */
1460 msg_print(_("松明はいっそう明るく輝いた。", "Your torch glows more brightly."));
1463 /* Decrease the item (from the pack) */
1466 inven_item_increase(item, -1);
1467 inven_item_describe(item);
1468 inven_item_optimize(item);
1471 /* Decrease the item (from the floor) */
1474 floor_item_increase(0 - item, -1);
1475 floor_item_describe(0 - item);
1476 floor_item_optimize(0 - item);
1479 /* Recalculate torch */
1480 p_ptr->update |= (PU_TORCH);
1485 * @brief 燃料を補充するコマンドのメインルーチン
1486 * Refill the players lamp, or restock his torches
1489 void do_cmd_refill(void)
1494 o_ptr = &inventory[INVEN_LITE];
1496 if (p_ptr->special_defense & KATA_MUSOU)
1498 set_action(ACTION_NONE);
1502 if (o_ptr->tval != TV_LITE)
1504 msg_print(_("光源を装備していない。", "You are not wielding a light."));
1508 else if (o_ptr->sval == SV_LITE_LANTERN)
1510 do_cmd_refill_lamp();
1514 else if (o_ptr->sval == SV_LITE_TORCH)
1516 do_cmd_refill_torch();
1519 /* No torch to refill */
1522 msg_print(_("この光源は寿命を延ばせない。", "Your light cannot be refilled."));
1528 * @brief ターゲットを設定するコマンドのメインルーチン
1532 void do_cmd_target(void)
1535 if (target_set(TARGET_KILL))
1537 msg_print(_("ターゲット決定。", "Target Selected."));
1540 /* Target aborted */
1543 msg_print(_("ターゲット解除。", "Target Aborted."));
1550 * @brief 周囲を見渡すコマンドのメインルーチン
1554 void do_cmd_look(void)
1557 p_ptr->window |= PW_MONSTER_LIST;
1562 if (target_set(TARGET_LOOK))
1564 msg_print(_("ターゲット決定。", "Target Selected."));
1570 * @brief 位置を確認するコマンドのメインルーチン
1571 * Allow the player to examine other sectors on the map
1574 void do_cmd_locate(void)
1576 int dir, y1, x1, y2, x2;
1585 get_screen_size(&wid, &hgt);
1588 /* Start at current panel */
1589 y2 = y1 = panel_row_min;
1590 x2 = x1 = panel_col_min;
1592 /* Show panels until done */
1595 /* Describe the location */
1596 if ((y2 == y1) && (x2 == x1))
1599 strcpy(tmp_val, "真上");
1608 sprintf(tmp_val, "%s%s",
1609 ((y2 < y1) ? "北" : (y2 > y1) ? "南" : ""),
1610 ((x2 < x1) ? "西" : (x2 > x1) ? "東" : ""));
1612 sprintf(tmp_val, "%s%s of",
1613 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1614 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1619 /* Prepare to ask which way to look */
1620 sprintf(out_val, _("マップ位置 [%d(%02d),%d(%02d)] (プレイヤーの%s) 方向?",
1621 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?"),
1622 y2 / (hgt / 2), y2 % (hgt / 2),
1623 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1625 /* Assume no direction */
1628 /* Get a direction */
1633 /* Get a command (or Cancel) */
1634 if (!get_com(out_val, &command, TRUE)) break;
1636 /* Extract the action (if any) */
1637 dir = get_keymap_dir(command);
1646 /* Apply the motion */
1647 if (change_panel(ddy[dir], ddx[dir]))
1655 /* Recenter the map around the player */
1659 p_ptr->update |= (PU_MONSTERS);
1662 p_ptr->redraw |= (PR_MAP);
1665 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1674 * @brief モンスター種族情報を特定の基準によりソートするための比較処理
1675 * Sorting hook -- Comp function -- see below
1676 * @param u モンスター種族情報の入れるポインタ
1678 * @param a 比較するモンスター種族のID1
1679 * @param b 比較するモンスター種族のID2
1680 * @return 2の方が大きければTRUEを返す
1681 * We use "u" to point to array of monster indexes,
1682 * and "v" to select the type of sorting to perform on "u".
1684 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1686 u16b *who = (u16b*)(u);
1688 u16b *why = (u16b*)(v);
1695 /* Sort by player kills */
1698 /* Extract player kills */
1699 z1 = r_info[w1].r_pkills;
1700 z2 = r_info[w2].r_pkills;
1702 /* Compare player kills */
1703 if (z1 < z2) return (TRUE);
1704 if (z1 > z2) return (FALSE);
1708 /* Sort by total kills */
1711 /* Extract total kills */
1712 z1 = r_info[w1].r_tkills;
1713 z2 = r_info[w2].r_tkills;
1715 /* Compare total kills */
1716 if (z1 < z2) return (TRUE);
1717 if (z1 > z2) return (FALSE);
1721 /* Sort by monster level */
1724 /* Extract levels */
1725 z1 = r_info[w1].level;
1726 z2 = r_info[w2].level;
1728 /* Compare levels */
1729 if (z1 < z2) return (TRUE);
1730 if (z1 > z2) return (FALSE);
1734 /* Sort by monster experience */
1737 /* Extract experience */
1738 z1 = r_info[w1].mexp;
1739 z2 = r_info[w2].mexp;
1741 /* Compare experience */
1742 if (z1 < z2) return (TRUE);
1743 if (z1 > z2) return (FALSE);
1747 /* Compare indexes */
1753 * @brief モンスター種族情報を特定の基準によりソートするためのスワップ処理
1754 * Sorting hook -- Swap function -- see below
1755 * @param u モンスター種族情報の入れるポインタ
1757 * @param a スワップするモンスター種族のID1
1758 * @param b スワップするモンスター種族のID2
1761 * We use "u" to point to array of monster indexes,
1762 * and "v" to select the type of sorting to perform.
1764 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1766 u16b *who = (u16b*)(u);
1782 * @brief モンスターの思い出を見るコマンドのメインルーチン
1783 * Identify a character, allow recall of monsters
1787 * Several "special" responses recall "multiple" monsters:
1789 * ^U (all unique monsters)
1790 * ^N (all non-unique monsters)
1792 * The responses may be sorted in several ways, see below.
1794 * Note that the player ghosts are ignored. XXX XXX XXX
1797 void do_cmd_query_symbol(void)
1811 bool recall = FALSE;
1816 /* Get a character, or abort */
1817 if (!get_com(_("知りたい文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^R乗馬,^M名前): ",
1818 "Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "), &sym, FALSE)) return;
1820 /* Find that character info, and describe it */
1821 for (i = 0; ident_info[i]; ++i)
1823 if (sym == ident_info[i][0]) break;
1827 if (sym == KTRL('A'))
1830 strcpy(buf, _("全モンスターのリスト", "Full monster list."));
1832 else if (sym == KTRL('U'))
1835 strcpy(buf, _("ユニーク・モンスターのリスト", "Unique monster list."));
1837 else if (sym == KTRL('N'))
1840 strcpy(buf, _("ユニーク外モンスターのリスト", "Non-unique monster list."));
1842 else if (sym == KTRL('R'))
1845 strcpy(buf, _("乗馬可能モンスターのリスト", "Ridable monster list."));
1847 /* XTRA HACK WHATSEARCH */
1848 else if (sym == KTRL('M'))
1851 if (!get_string(_("名前(英語の場合小文字で可)", "Enter name:"),temp, 70))
1856 sprintf(buf, _("名前:%sにマッチ", "Monsters with a name \"%s\""),temp);
1858 else if (ident_info[i])
1860 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
1864 sprintf(buf, "%c - %s", sym, _("無効な文字", "Unknown Symbol"));
1867 /* Display the result */
1870 /* Allocate the "who" array */
1871 C_MAKE(who, max_r_idx, IDX);
1873 /* Collect matching monsters */
1874 for (n = 0, i = 1; i < max_r_idx; i++)
1876 monster_race *r_ptr = &r_info[i];
1878 /* Nothing to recall */
1879 if (!cheat_know && !r_ptr->r_sights) continue;
1881 /* Require non-unique monsters if needed */
1882 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
1884 /* Require unique monsters if needed */
1885 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
1887 /* Require ridable monsters if needed */
1888 if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
1890 /* XTRA HACK WHATSEARCH */
1896 for (xx=0; temp[xx] && xx<80; xx++)
1899 if (iskanji( temp[xx])) { xx++; continue; }
1901 if (isupper(temp[xx])) temp[xx] = (char)tolower(temp[xx]);
1905 strcpy(temp2, r_name+r_ptr->E_name);
1907 strcpy(temp2, r_name+r_ptr->name);
1909 for (xx=0; temp2[xx] && xx<80; xx++)
1910 if (isupper(temp2[xx])) temp2[xx] = (char)tolower(temp2[xx]);
1913 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
1915 if (my_strstr(temp2, temp))
1920 /* Collect "appropriate" monsters */
1921 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
1924 /* Nothing to recall */
1927 /* Free the "who" array */
1928 C_KILL(who, max_r_idx, IDX);
1934 /* Prompt XXX XXX XXX */
1935 put_str(_("思い出を見ますか? (k:殺害順/y/n): ", "Recall details? (k/y/n): "), 0, _(36, 40));
1946 /* Select the sort method */
1947 ang_sort_comp = ang_sort_comp_hook;
1948 ang_sort_swap = ang_sort_swap_hook;
1950 /* Sort the array */
1951 ang_sort(who, &why, n);
1953 /* Sort by kills (and level) */
1960 /* Catch "escape" */
1963 /* Free the "who" array */
1964 C_KILL(who, max_r_idx, IDX);
1969 /* Sort if needed */
1972 /* Select the sort method */
1973 ang_sort_comp = ang_sort_comp_hook;
1974 ang_sort_swap = ang_sort_swap_hook;
1976 /* Sort the array */
1977 ang_sort(who, &why, n);
1981 /* Start at the end */
1984 /* Scan the monster memory */
1987 /* Extract a race */
1990 /* Hack -- Auto-recall */
1991 monster_race_track(r_idx);
1993 /* Hack -- Handle stuff */
2002 /* Save the screen */
2005 /* Recall on screen */
2006 screen_roff(who[i], 0);
2009 /* Hack -- Begin the prompt */
2012 /* Hack -- Complete the prompt */
2013 Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ESC]", " [(r)ecall, ESC]"));
2025 /* Normal commands */
2026 if (query != 'r') break;
2033 if (query == ESCAPE) break;
2035 /* Move to "prev" monster */
2041 if (!expand_list) break;
2045 /* Move to "next" monster */
2051 if (!expand_list) break;
2056 /* Free the "who" array */
2057 C_KILL(who, max_r_idx, IDX);
2059 /* Re-display the identity */
2065 * @brief オブジェクトをプレイヤーが簡易使用コマンドで利用できるかを判定する /
2066 * Hook to determine if an object is useable
2067 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
2068 * @return 利用可能ならばTRUEを返す
2070 static bool item_tester_hook_use(object_type *o_ptr)
2072 u32b flgs[TR_FLAG_SIZE];
2075 if (o_ptr->tval == p_ptr->tval_ammo)
2078 /* Useable object */
2079 switch (o_ptr->tval)
2097 if (!object_is_known(o_ptr)) return (FALSE);
2099 /* HACK - only items from the equipment can be activated */
2100 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2102 if (&inventory[i] == o_ptr)
2104 /* Extract the flags */
2105 object_flags(o_ptr, flgs);
2107 /* Check activation flag */
2108 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
2120 * @brief アイテムを汎用的に「使う」コマンドのメインルーチン /
2124 * XXX - Add actions for other item types
2126 void do_cmd_use(void)
2132 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2134 set_action(ACTION_NONE);
2137 item_tester_no_ryoute = TRUE;
2138 /* Prepare the hook */
2139 item_tester_hook = item_tester_hook_use;
2142 q = _("どれを使いますか?", "Use which item? ");
2143 s = _("使えるものがありません。", "You have nothing to use.");
2145 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
2147 /* Get the item (in the pack) */
2150 o_ptr = &inventory[item];
2152 /* Get the item (on the floor) */
2155 o_ptr = &o_list[0 - item];
2158 switch (o_ptr->tval)
2170 do_cmd_eat_food_aux(item);
2177 do_cmd_aim_wand_aux(item);
2184 do_cmd_use_staff_aux(item);
2191 do_cmd_zap_rod_aux(item);
2195 /* Quaff a potion */
2198 do_cmd_quaff_potion_aux(item);
2205 /* Check some conditions */
2208 msg_print(_("目が見えない。", "You can't see anything."));
2213 msg_print(_("明かりがないので、暗くて読めない。", "You have no light to read by."));
2216 if (p_ptr->confused)
2218 msg_print(_("混乱していて読めない!", "You are too confused!"));
2222 do_cmd_read_scroll_aux(item, TRUE);
2231 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
2235 /* Activate an artifact */
2238 do_cmd_activate_aux(item);