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.
21 void do_cmd_inven(void)
26 /* Note that we are in "inventory" mode */
29 #ifdef ALLOW_EASY_FLOOR
31 /* Note that we are in "inventory" mode */
32 if (easy_floor) command_wrk = (USE_INVEN);
34 #endif /* ALLOW_EASY_FLOOR */
39 /* Hack -- show empty slots */
40 item_tester_full = TRUE;
42 /* Display the inventory */
45 /* Hack -- hide empty slots */
46 item_tester_full = FALSE;
49 sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
50 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
51 (long int)((p_ptr->total_weight * 100) / weight_limit()));
53 sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
54 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
55 (p_ptr->total_weight * 100) / weight_limit());
62 /* Get a new command */
63 command_new = inkey();
69 /* Process "Escape" */
70 if (command_new == ESCAPE)
75 Term_get_size(&wid, &hgt);
79 command_gap = wid - 30;
82 /* Process normal keys */
85 /* Hack -- Use "display" mode */
94 void do_cmd_equip(void)
99 /* Note that we are in "equipment" mode */
102 #ifdef ALLOW_EASY_FLOOR
104 /* Note that we are in "equipment" mode */
105 if (easy_floor) command_wrk = (USE_EQUIP);
107 #endif /* ALLOW_EASY_FLOOR */
109 /* Save the screen */
112 /* Hack -- show empty slots */
113 item_tester_full = TRUE;
115 /* Display the equipment */
118 /* Hack -- undo the hack above */
119 item_tester_full = FALSE;
123 sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
124 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
125 (long int)((p_ptr->total_weight * 100) / weight_limit()));
127 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
128 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
129 (long int)((p_ptr->total_weight * 100) / weight_limit()));
136 /* Get a new command */
137 command_new = inkey();
139 /* Restore the screen */
143 /* Process "Escape" */
144 if (command_new == ESCAPE)
149 Term_get_size(&wid, &hgt);
153 command_gap = wid - 30;
156 /* Process normal keys */
159 /* Enter "display" mode */
166 * The "wearable" tester
168 static bool item_tester_hook_wear(object_type *o_ptr)
170 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
171 if (p_ptr->psex == SEX_MALE) return FALSE;
173 /* Check for a usable slot */
174 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
176 /* Assume not wearable */
181 static bool item_tester_hook_mochikae(object_type *o_ptr)
183 /* Check for a usable slot */
184 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
185 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
186 (o_ptr->tval == TV_CARD)) return (TRUE);
188 /* Assume not wearable */
193 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
195 /* Check for a usable slot */
196 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
198 /* Assume not wearable */
203 bool select_ring_slot = FALSE;
206 * Wield or wear a single item from the pack or floor
208 void do_cmd_wield(void)
219 char o_name[MAX_NLEN];
223 int need_switch_wielding = 0;
225 if (p_ptr->special_defense & KATA_MUSOU)
227 set_action(ACTION_NONE);
230 /* Restrict the choices */
231 item_tester_hook = item_tester_hook_wear;
235 q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
236 s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
238 q = "Wear/Wield which item? ";
239 s = "You have nothing you can wear or wield.";
242 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
244 /* Get the item (in the pack) */
247 o_ptr = &inventory[item];
250 /* Get the item (on the floor) */
253 o_ptr = &o_list[0 - item];
258 slot = wield_slot(o_ptr);
262 /* Shields and some misc. items */
267 if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
269 /* Restrict the choices */
270 item_tester_hook = item_tester_hook_melee_weapon;
271 item_tester_no_ryoute = TRUE;
273 /* Choose a weapon from the equipment only */
275 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
278 q = "Replace which weapon? ";
282 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
283 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
286 else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
288 /* Both arms are already used by non-weapon */
289 else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
290 inventory[INVEN_LARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_LARM]))
292 /* Restrict the choices */
293 item_tester_hook = item_tester_hook_mochikae;
297 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
300 q = "Equip which hand? ";
304 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
313 /* Asking for dual wielding */
314 if (slot == INVEN_LARM)
317 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM;
319 if (!get_check("Dual wielding? ")) slot = INVEN_RARM;
323 else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
326 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_LARM;
328 if (!get_check("Dual wielding? ")) slot = INVEN_LARM;
332 /* Both arms are already used */
333 else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
335 /* Restrict the choices */
336 item_tester_hook = item_tester_hook_mochikae;
340 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
343 q = "Equip which hand? ";
347 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
348 if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
349 need_switch_wielding = INVEN_RARM;
355 /* Choose a ring slot */
356 if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
359 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
361 q = "Replace which ring? ";
367 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
369 q = "Equip which hand? ";
379 /* Restrict the choices */
380 select_ring_slot = TRUE;
381 item_tester_no_ryoute = TRUE;
383 if (!get_item(&slot, q, s, (USE_EQUIP)))
385 select_ring_slot = FALSE;
388 select_ring_slot = FALSE;
392 /* Prevent wielding into a cursed slot */
393 if (object_is_cursed(&inventory[slot]))
396 object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
400 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
401 describe_use(slot) , o_name );
403 msg_format("The %s you are %s appears to be cursed.",
404 o_name, describe_use(slot));
407 /* Cancel the command */
412 ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
413 ((o_ptr->ident & IDENT_SENSE) &&
414 (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
416 char dummy[MAX_NLEN+80];
419 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
422 sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
424 sprintf(dummy, "Really use the %s {cursed}? ", o_name);
427 if (!get_check(dummy)) return;
430 if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
432 char dummy[MAX_NLEN+80];
435 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
438 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
440 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
441 sprintf(dummy, "Do you become a vampire?");
444 if (!get_check(dummy)) return;
447 if (need_switch_wielding && !object_is_cursed(&inventory[need_switch_wielding]))
449 object_type *slot_o_ptr = &inventory[slot];
450 object_type *switch_o_ptr = &inventory[need_switch_wielding];
451 object_type object_tmp;
452 object_type *otmp_ptr = &object_tmp;
453 char switch_name[MAX_NLEN];
455 object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
457 object_copy(otmp_ptr, switch_o_ptr);
458 object_copy(switch_o_ptr, slot_o_ptr);
459 object_copy(slot_o_ptr, otmp_ptr);
461 msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", switch_name, (slot == INVEN_RARM) ? (left_hander ? "º¸¼ê" : "±¦¼ê") : (left_hander ? "±¦¼ê" : "º¸¼ê"));
463 msg_format("You wield %s at %s hand.", switch_name, (slot == INVEN_RARM) ? (left_hander ? "left" : "right") : (left_hander ? "right" : "left"));
466 slot = need_switch_wielding;
469 check_find_art_quest_completion(o_ptr);
471 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
473 identify_item(o_ptr);
475 /* Auto-inscription */
476 autopick_alter_item(item, FALSE);
482 /* Get local object */
485 /* Obtain local object */
486 object_copy(q_ptr, o_ptr);
488 /* Modify quantity */
491 /* Decrease the item (from the pack) */
494 inven_item_increase(item, -1);
495 inven_item_optimize(item);
498 /* Decrease the item (from the floor) */
501 floor_item_increase(0 - item, -1);
502 floor_item_optimize(0 - item);
505 /* Access the wield slot */
506 o_ptr = &inventory[slot];
508 /* Take off existing item */
511 /* Take off existing item */
512 (void)inven_takeoff(slot, 255);
515 /* Wear the new stuff */
516 object_copy(o_ptr, q_ptr);
518 /* Player touches it */
519 o_ptr->marked |= OM_TOUCHED;
521 /* Increase the weight */
522 p_ptr->total_weight += q_ptr->weight;
524 /* Increment the equip counter by hand */
528 #define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£"
529 #define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£"
530 #define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£"
532 #define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
533 #define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
534 #define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
537 /* Where is the item now */
541 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
542 act = STR_WIELD_ARMS;
544 act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
548 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
549 act = STR_WIELD_ARMS;
551 act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
556 act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£";
558 act = "You are shooting with %s (%c).";
564 act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£";
566 act = "Your light source is %s (%c).";
572 act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£";
574 act = "You are wearing %s (%c).";
579 /* Describe the result */
580 object_desc(o_name, o_ptr, 0);
583 msg_format(act, o_name, index_to_label(slot));
587 if (object_is_cursed(o_ptr))
589 /* Warn the player */
591 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
593 msg_print("Oops! It feels deathly cold!");
597 chg_virtue(V_HARMONY, -1);
600 o_ptr->ident |= (IDENT_SENSE);
603 /* The Stone Mask make the player turn into a vampire! */
604 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
606 /* Turn into a vampire */
607 change_race(RACE_VAMPIRE, "");
610 /* Recalculate bonuses */
611 p_ptr->update |= (PU_BONUS);
613 /* Recalculate torch */
614 p_ptr->update |= (PU_TORCH);
616 /* Recalculate mana */
617 p_ptr->update |= (PU_MANA);
619 p_ptr->redraw |= (PR_EQUIPPY);
622 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
628 void kamaenaoshi(int item)
630 object_type *o_ptr, *new_o_ptr;
631 char o_name[MAX_NLEN];
633 if (item == INVEN_RARM)
635 if (buki_motteruka(INVEN_LARM))
637 o_ptr = &inventory[INVEN_LARM];
638 object_desc(o_name, o_ptr, 0);
640 if (!object_is_cursed(o_ptr))
642 new_o_ptr = &inventory[INVEN_RARM];
643 object_copy(new_o_ptr, o_ptr);
644 p_ptr->total_weight += o_ptr->weight;
645 inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
646 inven_item_optimize(INVEN_LARM);
647 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
649 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
651 msg_format("You are wielding %s with both hands.", o_name);
655 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
657 msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right"));
662 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
664 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
666 msg_format("You are wielding %s with both hands.", o_name);
671 else if (item == INVEN_LARM)
673 o_ptr = &inventory[INVEN_RARM];
674 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
676 if (buki_motteruka(INVEN_RARM))
678 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
680 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
682 msg_format("You are wielding %s with both hands.", o_name);
685 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
687 new_o_ptr = &inventory[INVEN_LARM];
688 object_copy(new_o_ptr, o_ptr);
689 p_ptr->total_weight += o_ptr->weight;
690 inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
691 inven_item_optimize(INVEN_RARM);
693 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
695 msg_format("You switched hand of %s.", o_name);
705 void do_cmd_takeoff(void)
713 if (p_ptr->special_defense & KATA_MUSOU)
715 set_action(ACTION_NONE);
718 item_tester_no_ryoute = TRUE;
721 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
722 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
724 q = "Take off which item? ";
725 s = "You are not wearing anything to take off.";
728 if (!get_item(&item, q, s, (USE_EQUIP))) return;
730 /* Get the item (in the pack) */
733 o_ptr = &inventory[item];
736 /* Get the item (on the floor) */
739 o_ptr = &o_list[0 - item];
744 if (object_is_cursed(o_ptr))
746 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
750 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
752 msg_print("Hmmm, it seems to be cursed.");
759 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
762 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
764 msg_print("You teared a cursed equipment off by sheer strength!");
767 /* Hack -- Assume felt */
768 o_ptr->ident |= (IDENT_SENSE);
770 o_ptr->curse_flags = 0L;
773 o_ptr->feeling = FEEL_NONE;
775 /* Recalculate the bonuses */
776 p_ptr->update |= (PU_BONUS);
779 p_ptr->window |= (PW_EQUIP);
782 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
784 msg_print("You break the curse.");
790 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
792 msg_print("You couldn't remove the equipment.");
799 /* Take a partial turn */
802 /* Take off the item */
803 (void)inven_takeoff(item, 255);
809 p_ptr->redraw |= (PR_EQUIPPY);
816 void do_cmd_drop(void)
824 if (p_ptr->special_defense & KATA_MUSOU)
826 set_action(ACTION_NONE);
829 item_tester_no_ryoute = TRUE;
832 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
833 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
835 q = "Drop which item? ";
836 s = "You have nothing to drop.";
839 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
841 /* Get the item (in the pack) */
844 o_ptr = &inventory[item];
847 /* Get the item (on the floor) */
850 o_ptr = &o_list[0 - item];
854 /* Hack -- Cannot remove cursed items */
855 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
859 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
861 msg_print("Hmmm, it seems to be cursed.");
870 /* See how many items */
871 if (o_ptr->number > 1)
874 amt = get_quantity(NULL, o_ptr->number);
876 /* Allow user abort */
877 if (amt <= 0) return;
881 /* Take a partial turn */
884 /* Drop (some of) the item */
885 inven_drop(item, amt);
887 if (item >= INVEN_RARM)
893 p_ptr->redraw |= (PR_EQUIPPY);
897 static bool high_level_book(object_type *o_ptr)
899 if ((o_ptr->tval == TV_LIFE_BOOK) ||
900 (o_ptr->tval == TV_SORCERY_BOOK) ||
901 (o_ptr->tval == TV_NATURE_BOOK) ||
902 (o_ptr->tval == TV_CHAOS_BOOK) ||
903 (o_ptr->tval == TV_DEATH_BOOK) ||
904 (o_ptr->tval == TV_TRUMP_BOOK) ||
905 (o_ptr->tval == TV_CRAFT_BOOK) ||
906 (o_ptr->tval == TV_DAEMON_BOOK) ||
907 (o_ptr->tval == TV_CRUSADE_BOOK) ||
908 (o_ptr->tval == TV_MUSIC_BOOK) ||
909 (o_ptr->tval == TV_HEX_BOOK))
924 void do_cmd_destroy(void)
933 object_type *q_ptr = &forge;
935 char o_name[MAX_NLEN];
937 char out_val[MAX_NLEN+40];
941 if (p_ptr->special_defense & KATA_MUSOU)
943 set_action(ACTION_NONE);
946 /* Hack -- force destruction */
947 if (command_arg > 0) force = TRUE;
952 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
953 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
955 q = "Destroy which item? ";
956 s = "You have nothing to destroy.";
959 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
961 /* Get the item (in the pack) */
964 o_ptr = &inventory[item];
967 /* Get the item (on the floor) */
970 o_ptr = &o_list[0 - item];
973 /* Verify unless quantity given beforehand */
974 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
976 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
978 /* Make a verification */
981 "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
983 "Really destroy %s? [y/n/Auto]",
989 /* HACK : Add the line to message buffer */
990 message_add(out_val);
991 p_ptr->window |= (PW_MESSAGE);
994 /* Get an acceptable answer */
1004 /* Erase the prompt */
1008 if (i == 'y' || i == 'Y')
1012 if (i == ESCAPE || i == 'n' || i == 'N')
1019 /* Add an auto-destroy preference line */
1020 if (autopick_autoregister(o_ptr))
1022 /* Auto-destroy it */
1023 autopick_alter_item(item, TRUE);
1026 /* The object is already destroyed. */
1029 } /* while (TRUE) */
1032 /* See how many items */
1033 if (o_ptr->number > 1)
1035 /* Get a quantity */
1036 amt = get_quantity(NULL, o_ptr->number);
1038 /* Allow user abort */
1039 if (amt <= 0) return;
1043 /* Describe the object */
1044 old_number = o_ptr->number;
1045 o_ptr->number = amt;
1046 object_desc(o_name, o_ptr, 0);
1047 o_ptr->number = old_number;
1052 /* Artifacts cannot be destroyed */
1053 if (!can_player_destroy_object(o_ptr))
1059 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1061 msg_format("You cannot destroy %s.", o_name);
1068 object_copy(q_ptr, o_ptr);
1072 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1074 msg_format("You destroy %s.", o_name);
1077 sound(SOUND_DESTITEM);
1079 /* Reduce the charges of rods/wands */
1080 reduce_charges(o_ptr, amt);
1082 /* Eliminate the item (from the pack) */
1085 inven_item_increase(item, -amt);
1086 inven_item_describe(item);
1087 inven_item_optimize(item);
1090 /* Eliminate the item (from the floor) */
1093 floor_item_increase(0 - item, -amt);
1094 floor_item_describe(0 - item);
1095 floor_item_optimize(0 - item);
1098 if (high_level_book(q_ptr))
1100 bool gain_expr = FALSE;
1102 if (p_ptr->prace == RACE_ANDROID)
1105 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1109 else if (p_ptr->pclass == CLASS_PALADIN)
1111 if (is_good_realm(p_ptr->realm1))
1113 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1117 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1121 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1123 s32b tester_exp = p_ptr->max_exp / 20;
1124 if (tester_exp > 10000) tester_exp = 10000;
1125 if (q_ptr->sval < 3) tester_exp /= 4;
1126 if (tester_exp<1) tester_exp = 1;
1129 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1131 msg_print("You feel more experienced.");
1134 gain_exp(tester_exp * amt);
1136 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1138 chg_virtue(V_UNLIFE, 1);
1139 chg_virtue(V_VITALITY, -1);
1141 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1143 chg_virtue(V_UNLIFE, -1);
1144 chg_virtue(V_VITALITY, 1);
1147 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1148 chg_virtue(V_ENCHANT, -1);
1150 if (object_value_real(q_ptr) > 30000)
1151 chg_virtue(V_SACRIFICE, 2);
1153 else if (object_value_real(q_ptr) > 10000)
1154 chg_virtue(V_SACRIFICE, 1);
1157 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1158 chg_virtue(V_HARMONY, 1);
1160 if (item >= INVEN_RARM) calc_android_exp();
1165 * Observe an item which has been *identify*-ed
1167 void do_cmd_observe(void)
1173 char o_name[MAX_NLEN];
1177 item_tester_no_ryoute = TRUE;
1180 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1181 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1183 q = "Examine which item? ";
1184 s = "You have nothing to examine.";
1187 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1189 /* Get the item (in the pack) */
1192 o_ptr = &inventory[item];
1195 /* Get the item (on the floor) */
1198 o_ptr = &o_list[0 - item];
1202 /* Require full knowledge */
1203 if (!(o_ptr->ident & IDENT_MENTAL))
1206 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1208 msg_print("You have no special knowledge about that item.");
1216 object_desc(o_name, o_ptr, 0);
1220 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1222 msg_format("Examining %s...", o_name);
1225 /* Describe it fully */
1227 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1229 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
1237 * Remove the inscription from an object
1238 * XXX Mention item (when done)?
1240 void do_cmd_uninscribe(void)
1248 item_tester_no_ryoute = TRUE;
1251 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1252 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1254 q = "Un-inscribe which item? ";
1255 s = "You have nothing to un-inscribe.";
1258 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1260 /* Get the item (in the pack) */
1263 o_ptr = &inventory[item];
1266 /* Get the item (on the floor) */
1269 o_ptr = &o_list[0 - item];
1272 /* Nothing to remove */
1273 if (!o_ptr->inscription)
1276 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1278 msg_print("That item had no inscription to remove.");
1286 msg_print("Ìäò¾Ã¤·¤¿¡£");
1288 msg_print("Inscription removed.");
1292 /* Remove the incription */
1293 o_ptr->inscription = 0;
1295 /* Combine the pack */
1296 p_ptr->notice |= (PN_COMBINE);
1299 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1301 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1302 p_ptr->update |= (PU_BONUS);
1308 * Inscribe an object with a comment
1310 void do_cmd_inscribe(void)
1316 char o_name[MAX_NLEN];
1322 item_tester_no_ryoute = TRUE;
1325 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1326 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1328 q = "Inscribe which item? ";
1329 s = "You have nothing to inscribe.";
1332 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1334 /* Get the item (in the pack) */
1337 o_ptr = &inventory[item];
1340 /* Get the item (on the floor) */
1343 o_ptr = &o_list[0 - item];
1346 /* Describe the activity */
1347 object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
1351 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1353 msg_format("Inscribing %s.", o_name);
1358 /* Start with nothing */
1359 strcpy(out_val, "");
1361 /* Use old inscription */
1362 if (o_ptr->inscription)
1364 /* Start with the old inscription */
1365 strcpy(out_val, quark_str(o_ptr->inscription));
1368 /* Get a new inscription (possibly empty) */
1370 if (get_string("ÌÃ: ", out_val, 80))
1372 if (get_string("Inscription: ", out_val, 80))
1375 /* Save the inscription */
1376 o_ptr->inscription = quark_add(out_val);
1378 /* Combine the pack */
1379 p_ptr->notice |= (PN_COMBINE);
1382 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1384 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1385 p_ptr->update |= (PU_BONUS);
1392 * An "item_tester_hook" for refilling lanterns
1394 static bool item_tester_refill_lantern(object_type *o_ptr)
1396 /* Flasks of oil are okay */
1397 if (o_ptr->tval == TV_FLASK) return (TRUE);
1399 /* Laterns are okay */
1400 if ((o_ptr->tval == TV_LITE) &&
1401 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1403 /* Assume not okay */
1409 * Refill the players lamp (from the pack or floor)
1411 static void do_cmd_refill_lamp(void)
1421 /* Restrict the choices */
1422 item_tester_hook = item_tester_refill_lantern;
1426 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1427 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1429 q = "Refill with which flask? ";
1430 s = "You have no flasks of oil.";
1433 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1435 /* Get the item (in the pack) */
1438 o_ptr = &inventory[item];
1441 /* Get the item (on the floor) */
1444 o_ptr = &o_list[0 - item];
1448 /* Take a partial turn */
1451 /* Access the lantern */
1452 j_ptr = &inventory[INVEN_LITE];
1455 j_ptr->xtra4 += o_ptr->xtra4;
1459 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1461 msg_print("You fuel your lamp.");
1465 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1469 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1471 msg_print("Your lamp has gone out!");
1474 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1478 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1480 msg_print("Curiously, your lamp doesn't light.");
1483 else if (j_ptr->xtra4 >= FUEL_LAMP)
1485 j_ptr->xtra4 = FUEL_LAMP;
1487 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1489 msg_print("Your lamp is full.");
1494 /* Decrease the item (from the pack) */
1497 inven_item_increase(item, -1);
1498 inven_item_describe(item);
1499 inven_item_optimize(item);
1502 /* Decrease the item (from the floor) */
1505 floor_item_increase(0 - item, -1);
1506 floor_item_describe(0 - item);
1507 floor_item_optimize(0 - item);
1510 /* Recalculate torch */
1511 p_ptr->update |= (PU_TORCH);
1516 * An "item_tester_hook" for refilling torches
1518 static bool item_tester_refill_torch(object_type *o_ptr)
1520 /* Torches are okay */
1521 if ((o_ptr->tval == TV_LITE) &&
1522 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1524 /* Assume not okay */
1530 * Refuel the players torch (from the pack or floor)
1532 static void do_cmd_refill_torch(void)
1542 /* Restrict the choices */
1543 item_tester_hook = item_tester_refill_torch;
1547 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1548 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1550 q = "Refuel with which torch? ";
1551 s = "You have no extra torches.";
1554 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1556 /* Get the item (in the pack) */
1559 o_ptr = &inventory[item];
1562 /* Get the item (on the floor) */
1565 o_ptr = &o_list[0 - item];
1569 /* Take a partial turn */
1572 /* Access the primary torch */
1573 j_ptr = &inventory[INVEN_LITE];
1576 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1580 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1582 msg_print("You combine the torches.");
1587 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1591 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1593 msg_print("Your torch has gone out!");
1596 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1600 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1602 msg_print("Curiously, your torche don't light.");
1605 /* Over-fuel message */
1606 else if (j_ptr->xtra4 >= FUEL_TORCH)
1608 j_ptr->xtra4 = FUEL_TORCH;
1610 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1612 msg_print("Your torch is fully fueled.");
1617 /* Refuel message */
1621 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1623 msg_print("Your torch glows more brightly.");
1628 /* Decrease the item (from the pack) */
1631 inven_item_increase(item, -1);
1632 inven_item_describe(item);
1633 inven_item_optimize(item);
1636 /* Decrease the item (from the floor) */
1639 floor_item_increase(0 - item, -1);
1640 floor_item_describe(0 - item);
1641 floor_item_optimize(0 - item);
1644 /* Recalculate torch */
1645 p_ptr->update |= (PU_TORCH);
1650 * Refill the players lamp, or restock his torches
1652 void do_cmd_refill(void)
1657 o_ptr = &inventory[INVEN_LITE];
1659 if (p_ptr->special_defense & KATA_MUSOU)
1661 set_action(ACTION_NONE);
1665 if (o_ptr->tval != TV_LITE)
1668 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1670 msg_print("You are not wielding a light.");
1676 else if (o_ptr->sval == SV_LITE_LANTERN)
1678 do_cmd_refill_lamp();
1682 else if (o_ptr->sval == SV_LITE_TORCH)
1684 do_cmd_refill_torch();
1687 /* No torch to refill */
1691 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1693 msg_print("Your light cannot be refilled.");
1703 void do_cmd_target(void)
1706 if (target_set(TARGET_KILL))
1709 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1711 msg_print("Target Selected.");
1716 /* Target aborted */
1720 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1722 msg_print("Target Aborted.");
1733 void do_cmd_look(void)
1736 p_ptr->window |= PW_MONSTER_LIST;
1741 if (target_set(TARGET_LOOK))
1744 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1746 msg_print("Target Selected.");
1755 * Allow the player to examine other sectors on the map
1757 void do_cmd_locate(void)
1759 int dir, y1, x1, y2, x2;
1768 get_screen_size(&wid, &hgt);
1771 /* Start at current panel */
1772 y2 = y1 = panel_row_min;
1773 x2 = x1 = panel_col_min;
1775 /* Show panels until done */
1778 /* Describe the location */
1779 if ((y2 == y1) && (x2 == x1))
1782 strcpy(tmp_val, "¿¿¾å");
1791 sprintf(tmp_val, "%s%s",
1792 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1793 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1795 sprintf(tmp_val, "%s%s of",
1796 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1797 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1802 /* Prepare to ask which way to look */
1805 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1807 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1810 y2 / (hgt / 2), y2 % (hgt / 2),
1811 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1813 /* Assume no direction */
1816 /* Get a direction */
1821 /* Get a command (or Cancel) */
1822 if (!get_com(out_val, &command, TRUE)) break;
1824 /* Extract the action (if any) */
1825 dir = get_keymap_dir(command);
1834 /* Apply the motion */
1835 if (change_panel(ddy[dir], ddx[dir]))
1843 /* Recenter the map around the player */
1847 p_ptr->update |= (PU_MONSTERS);
1850 p_ptr->redraw |= (PR_MAP);
1853 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1862 * Sorting hook -- Comp function -- see below
1864 * We use "u" to point to array of monster indexes,
1865 * and "v" to select the type of sorting to perform on "u".
1867 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1869 u16b *who = (u16b*)(u);
1871 u16b *why = (u16b*)(v);
1878 /* Sort by player kills */
1881 /* Extract player kills */
1882 z1 = r_info[w1].r_pkills;
1883 z2 = r_info[w2].r_pkills;
1885 /* Compare player kills */
1886 if (z1 < z2) return (TRUE);
1887 if (z1 > z2) return (FALSE);
1891 /* Sort by total kills */
1894 /* Extract total kills */
1895 z1 = r_info[w1].r_tkills;
1896 z2 = r_info[w2].r_tkills;
1898 /* Compare total kills */
1899 if (z1 < z2) return (TRUE);
1900 if (z1 > z2) return (FALSE);
1904 /* Sort by monster level */
1907 /* Extract levels */
1908 z1 = r_info[w1].level;
1909 z2 = r_info[w2].level;
1911 /* Compare levels */
1912 if (z1 < z2) return (TRUE);
1913 if (z1 > z2) return (FALSE);
1917 /* Sort by monster experience */
1920 /* Extract experience */
1921 z1 = r_info[w1].mexp;
1922 z2 = r_info[w2].mexp;
1924 /* Compare experience */
1925 if (z1 < z2) return (TRUE);
1926 if (z1 > z2) return (FALSE);
1930 /* Compare indexes */
1936 * Sorting hook -- Swap function -- see below
1938 * We use "u" to point to array of monster indexes,
1939 * and "v" to select the type of sorting to perform.
1941 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1943 u16b *who = (u16b*)(u);
1959 * Identify a character, allow recall of monsters
1961 * Several "special" responses recall "multiple" monsters:
1963 * ^U (all unique monsters)
1964 * ^N (all non-unique monsters)
1966 * The responses may be sorted in several ways, see below.
1968 * Note that the player ghosts are ignored. XXX XXX XXX
1970 void do_cmd_query_symbol(void)
1982 bool recall = FALSE;
1987 /* Get a character, or abort */
1989 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^R¾èÇÏ,^M̾Á°): ", &sym, FALSE)) return;
1991 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1994 /* Find that character info, and describe it */
1995 for (i = 0; ident_info[i]; ++i)
1997 if (sym == ident_info[i][0]) break;
2001 if (sym == KTRL('A'))
2005 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2007 strcpy(buf, "Full monster list.");
2010 else if (sym == KTRL('U'))
2014 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2016 strcpy(buf, "Unique monster list.");
2019 else if (sym == KTRL('N'))
2023 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2025 strcpy(buf, "Non-unique monster list.");
2028 else if (sym == KTRL('R'))
2032 strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2034 strcpy(buf, "Ridable monster list.");
2037 /* XTRA HACK WHATSEARCH */
2038 else if (sym == KTRL('M'))
2042 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2044 if (!get_string("Enter name:",temp, 70))
2051 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2053 sprintf(buf, "Monsters with a name \"%s\"",temp);
2056 else if (ident_info[i])
2058 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2063 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2065 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2069 /* Display the result */
2072 /* Allocate the "who" array */
2073 C_MAKE(who, max_r_idx, u16b);
2075 /* Collect matching monsters */
2076 for (n = 0, i = 1; i < max_r_idx; i++)
2078 monster_race *r_ptr = &r_info[i];
2080 /* Nothing to recall */
2081 if (!cheat_know && !r_ptr->r_sights) continue;
2083 /* Require non-unique monsters if needed */
2084 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2086 /* Require unique monsters if needed */
2087 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2089 /* Require ridable monsters if needed */
2090 if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
2092 /* XTRA HACK WHATSEARCH */
2098 for (xx=0; temp[xx] && xx<80; xx++)
2101 if (iskanji( temp[xx])) { xx++; continue; }
2103 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2107 strcpy(temp2, r_name+r_ptr->E_name);
2109 strcpy(temp2, r_name+r_ptr->name);
2111 for (xx=0; temp2[xx] && xx<80; xx++)
2112 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2115 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
2117 if (my_strstr(temp2, temp))
2122 /* Collect "appropriate" monsters */
2123 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
2126 /* Nothing to recall */
2129 /* Free the "who" array */
2130 C_KILL(who, max_r_idx, u16b);
2136 /* Prompt XXX XXX XXX */
2138 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2140 put_str("Recall details? (k/y/n): ", 0, 40);
2152 /* Select the sort method */
2153 ang_sort_comp = ang_sort_comp_hook;
2154 ang_sort_swap = ang_sort_swap_hook;
2156 /* Sort the array */
2157 ang_sort(who, &why, n);
2159 /* Sort by kills (and level) */
2166 /* Catch "escape" */
2169 /* Free the "who" array */
2170 C_KILL(who, max_r_idx, u16b);
2175 /* Sort if needed */
2178 /* Select the sort method */
2179 ang_sort_comp = ang_sort_comp_hook;
2180 ang_sort_swap = ang_sort_swap_hook;
2182 /* Sort the array */
2183 ang_sort(who, &why, n);
2187 /* Start at the end */
2190 /* Scan the monster memory */
2193 /* Extract a race */
2196 /* Hack -- Auto-recall */
2197 monster_race_track(r_idx);
2199 /* Hack -- Handle stuff */
2208 /* Save the screen */
2211 /* Recall on screen */
2212 screen_roff(who[i], 0);
2215 /* Hack -- Begin the prompt */
2218 /* Hack -- Complete the prompt */
2220 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2222 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2235 /* Normal commands */
2236 if (query != 'r') break;
2243 if (query == ESCAPE) break;
2245 /* Move to "prev" monster */
2251 if (!expand_list) break;
2255 /* Move to "next" monster */
2261 if (!expand_list) break;
2266 /* Free the "who" array */
2267 C_KILL(who, max_r_idx, u16b);
2269 /* Re-display the identity */