3 /* Purpose: 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.
20 void do_cmd_inven(void)
25 /* Note that we are in "inventory" mode */
28 #ifdef ALLOW_EASY_FLOOR
30 /* Note that we are in "inventory" mode */
31 if (easy_floor) command_wrk = (USE_INVEN);
33 #endif /* ALLOW_EASY_FLOOR */
38 /* Hack -- show empty slots */
39 item_tester_full = TRUE;
41 /* Display the inventory */
44 /* Hack -- hide empty slots */
45 item_tester_full = FALSE;
48 sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
49 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
50 (long int)((p_ptr->total_weight * 100) / weight_limit()));
52 sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
53 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
54 (p_ptr->total_weight * 100) / weight_limit());
61 /* Get a new command */
62 command_new = inkey();
68 /* Process "Escape" */
69 if (command_new == ESCAPE)
74 Term_get_size(&wid, &hgt);
78 command_gap = wid - 30;
81 /* Process normal keys */
84 /* Hack -- Use "display" mode */
93 void do_cmd_equip(void)
98 /* Note that we are in "equipment" mode */
101 #ifdef ALLOW_EASY_FLOOR
103 /* Note that we are in "equipment" mode */
104 if (easy_floor) command_wrk = (USE_EQUIP);
106 #endif /* ALLOW_EASY_FLOOR */
108 /* Save the screen */
111 /* Hack -- show empty slots */
112 item_tester_full = TRUE;
114 /* Display the equipment */
117 /* Hack -- undo the hack above */
118 item_tester_full = FALSE;
122 sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
123 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
124 (long int)((p_ptr->total_weight * 100) / weight_limit()));
126 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
127 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
128 (long int)((p_ptr->total_weight * 100) / weight_limit()));
135 /* Get a new command */
136 command_new = inkey();
138 /* Restore the screen */
142 /* Process "Escape" */
143 if (command_new == ESCAPE)
148 Term_get_size(&wid, &hgt);
152 command_gap = wid - 30;
155 /* Process normal keys */
158 /* Enter "display" mode */
165 * The "wearable" tester
167 static bool item_tester_hook_wear(object_type *o_ptr)
169 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
170 if (p_ptr->psex == SEX_MALE) return FALSE;
172 /* Check for a usable slot */
173 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
175 /* Assume not wearable */
180 static bool item_tester_hook_mochikae(object_type *o_ptr)
182 /* Check for a usable slot */
183 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
184 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
185 (o_ptr->tval == TV_CARD)) return (TRUE);
187 /* Assume not wearable */
192 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
194 /* Check for a usable slot */
195 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
197 /* Assume not wearable */
202 bool select_ring_slot = FALSE;
205 * Wield or wear a single item from the pack or floor
207 void do_cmd_wield(void)
218 char o_name[MAX_NLEN];
222 int need_switch_wielding = 0;
224 if (p_ptr->special_defense & KATA_MUSOU)
226 set_action(ACTION_NONE);
229 /* Restrict the choices */
230 item_tester_hook = item_tester_hook_wear;
234 q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
235 s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
237 q = "Wear/Wield which item? ";
238 s = "You have nothing you can wear or wield.";
241 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
243 /* Get the item (in the pack) */
246 o_ptr = &inventory[item];
249 /* Get the item (on the floor) */
252 o_ptr = &o_list[0 - item];
257 slot = wield_slot(o_ptr);
261 /* Shields and some misc. items */
266 if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
268 /* Restrict the choices */
269 item_tester_hook = item_tester_hook_melee_weapon;
270 item_tester_no_ryoute = TRUE;
272 /* Choose a weapon from the equipment only */
274 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
277 q = "Replace which weapon? ";
281 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
282 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
285 else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
287 /* Both arms are already used by non-weapon */
288 else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
289 inventory[INVEN_LARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_LARM]))
291 /* Restrict the choices */
292 item_tester_hook = item_tester_hook_mochikae;
296 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
299 q = "Equip which hand? ";
303 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
312 /* Asking for dual wielding */
313 if (slot == INVEN_LARM)
316 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM;
318 if (!get_check("Dual wielding? ")) slot = INVEN_RARM;
322 else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
325 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_LARM;
327 if (!get_check("Dual wielding? ")) slot = INVEN_LARM;
331 /* Both arms are already used */
332 else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
334 /* Restrict the choices */
335 item_tester_hook = item_tester_hook_mochikae;
339 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
342 q = "Equip which hand? ";
346 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
347 if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
348 need_switch_wielding = INVEN_RARM;
354 /* Choose a ring slot */
355 if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
358 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
360 q = "Replace which ring? ";
366 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
368 q = "Equip which hand? ";
378 /* Restrict the choices */
379 select_ring_slot = TRUE;
380 item_tester_no_ryoute = TRUE;
382 if (!get_item(&slot, q, s, (USE_EQUIP)))
384 select_ring_slot = FALSE;
387 select_ring_slot = FALSE;
391 /* Prevent wielding into a cursed slot */
392 if (object_is_cursed(&inventory[slot]))
395 object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
399 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
400 describe_use(slot) , o_name );
402 msg_format("The %s you are %s appears to be cursed.",
403 o_name, describe_use(slot));
406 /* Cancel the command */
411 ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
412 ((o_ptr->ident & IDENT_SENSE) &&
413 (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
415 char dummy[MAX_NLEN+80];
418 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
421 sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
423 sprintf(dummy, "Really use the %s {cursed}? ", o_name);
426 if (!get_check(dummy)) return;
429 if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
431 char dummy[MAX_NLEN+80];
434 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
437 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
439 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
440 sprintf(dummy, "Do you become a vampire?");
443 if (!get_check(dummy)) return;
446 if (need_switch_wielding && !object_is_cursed(&inventory[need_switch_wielding]))
448 object_type *slot_o_ptr = &inventory[slot];
449 object_type *switch_o_ptr = &inventory[need_switch_wielding];
450 object_type object_tmp;
451 object_type *otmp_ptr = &object_tmp;
452 char switch_name[MAX_NLEN];
454 object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
456 object_copy(otmp_ptr, switch_o_ptr);
457 object_copy(switch_o_ptr, slot_o_ptr);
458 object_copy(slot_o_ptr, otmp_ptr);
460 msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", switch_name, (slot == INVEN_RARM) ? (left_hander ? "º¸¼ê" : "±¦¼ê") : (left_hander ? "±¦¼ê" : "º¸¼ê"));
462 msg_format("You wield %s at %s hand.", switch_name, (slot == INVEN_RARM) ? (left_hander ? "left" : "right") : (left_hander ? "right" : "left"));
465 slot = need_switch_wielding;
468 check_find_art_quest_completion(o_ptr);
470 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
472 identify_item(o_ptr);
474 /* Auto-inscription */
475 autopick_alter_item(item, FALSE);
481 /* Get local object */
484 /* Obtain local object */
485 object_copy(q_ptr, o_ptr);
487 /* Modify quantity */
490 /* Decrease the item (from the pack) */
493 inven_item_increase(item, -1);
494 inven_item_optimize(item);
497 /* Decrease the item (from the floor) */
500 floor_item_increase(0 - item, -1);
501 floor_item_optimize(0 - item);
504 /* Access the wield slot */
505 o_ptr = &inventory[slot];
507 /* Take off existing item */
510 /* Take off existing item */
511 (void)inven_takeoff(slot, 255);
514 /* Wear the new stuff */
515 object_copy(o_ptr, q_ptr);
517 /* Player touches it */
518 o_ptr->marked |= OM_TOUCHED;
520 /* Increase the weight */
521 p_ptr->total_weight += q_ptr->weight;
523 /* Increment the equip counter by hand */
527 #define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£"
528 #define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£"
529 #define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£"
531 #define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
532 #define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
533 #define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
536 /* Where is the item now */
540 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
541 act = STR_WIELD_ARMS;
543 act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
547 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
548 act = STR_WIELD_ARMS;
550 act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
555 act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£";
557 act = "You are shooting with %s (%c).";
563 act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£";
565 act = "Your light source is %s (%c).";
571 act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£";
573 act = "You are wearing %s (%c).";
578 /* Describe the result */
579 object_desc(o_name, o_ptr, 0);
582 msg_format(act, o_name, index_to_label(slot));
586 if (object_is_cursed(o_ptr))
588 /* Warn the player */
590 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
592 msg_print("Oops! It feels deathly cold!");
596 chg_virtue(V_HARMONY, -1);
599 o_ptr->ident |= (IDENT_SENSE);
602 /* The Stone Mask make the player turn into a vampire! */
603 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
605 /* Turn into a vampire */
606 change_race(RACE_VAMPIRE, "");
609 /* Recalculate bonuses */
610 p_ptr->update |= (PU_BONUS);
612 /* Recalculate torch */
613 p_ptr->update |= (PU_TORCH);
615 /* Recalculate mana */
616 p_ptr->update |= (PU_MANA);
618 p_ptr->redraw |= (PR_EQUIPPY);
621 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
627 void kamaenaoshi(int item)
629 object_type *o_ptr, *new_o_ptr;
630 char o_name[MAX_NLEN];
632 if (item == INVEN_RARM)
634 if (buki_motteruka(INVEN_LARM))
636 o_ptr = &inventory[INVEN_LARM];
637 object_desc(o_name, o_ptr, 0);
639 if (!object_is_cursed(o_ptr))
641 new_o_ptr = &inventory[INVEN_RARM];
642 object_copy(new_o_ptr, o_ptr);
643 p_ptr->total_weight += o_ptr->weight;
644 inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
645 inven_item_optimize(INVEN_LARM);
646 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
648 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
650 msg_format("You are wielding %s with both hands.", o_name);
654 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
656 msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right"));
661 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
663 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
665 msg_format("You are wielding %s with both hands.", o_name);
670 else if (item == INVEN_LARM)
672 o_ptr = &inventory[INVEN_RARM];
673 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
675 if (buki_motteruka(INVEN_RARM))
677 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
679 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
681 msg_format("You are wielding %s with both hands.", o_name);
684 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
686 new_o_ptr = &inventory[INVEN_LARM];
687 object_copy(new_o_ptr, o_ptr);
688 p_ptr->total_weight += o_ptr->weight;
689 inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
690 inven_item_optimize(INVEN_RARM);
692 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
694 msg_format("You switched hand of %s.", o_name);
704 void do_cmd_takeoff(void)
712 if (p_ptr->special_defense & KATA_MUSOU)
714 set_action(ACTION_NONE);
717 item_tester_no_ryoute = TRUE;
720 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
721 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
723 q = "Take off which item? ";
724 s = "You are not wearing anything to take off.";
727 if (!get_item(&item, q, s, (USE_EQUIP))) return;
729 /* Get the item (in the pack) */
732 o_ptr = &inventory[item];
735 /* Get the item (on the floor) */
738 o_ptr = &o_list[0 - item];
743 if (object_is_cursed(o_ptr))
745 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
749 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
751 msg_print("Hmmm, it seems to be cursed.");
758 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
761 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
763 msg_print("You teared a cursed equipment off by sheer strength!");
766 /* Hack -- Assume felt */
767 o_ptr->ident |= (IDENT_SENSE);
769 o_ptr->curse_flags = 0L;
772 o_ptr->feeling = FEEL_NONE;
774 /* Recalculate the bonuses */
775 p_ptr->update |= (PU_BONUS);
778 p_ptr->window |= (PW_EQUIP);
781 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
783 msg_print("You break the curse.");
789 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
791 msg_print("You couldn't remove the equipment.");
798 /* Take a partial turn */
801 /* Take off the item */
802 (void)inven_takeoff(item, 255);
808 p_ptr->redraw |= (PR_EQUIPPY);
815 void do_cmd_drop(void)
823 if (p_ptr->special_defense & KATA_MUSOU)
825 set_action(ACTION_NONE);
828 item_tester_no_ryoute = TRUE;
831 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
832 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
834 q = "Drop which item? ";
835 s = "You have nothing to drop.";
838 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
840 /* Get the item (in the pack) */
843 o_ptr = &inventory[item];
846 /* Get the item (on the floor) */
849 o_ptr = &o_list[0 - item];
853 /* Hack -- Cannot remove cursed items */
854 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
858 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
860 msg_print("Hmmm, it seems to be cursed.");
869 /* See how many items */
870 if (o_ptr->number > 1)
873 amt = get_quantity(NULL, o_ptr->number);
875 /* Allow user abort */
876 if (amt <= 0) return;
880 /* Take a partial turn */
883 /* Drop (some of) the item */
884 inven_drop(item, amt);
886 if (item >= INVEN_RARM)
892 p_ptr->redraw |= (PR_EQUIPPY);
896 static bool high_level_book(object_type *o_ptr)
898 if ((o_ptr->tval == TV_LIFE_BOOK) ||
899 (o_ptr->tval == TV_SORCERY_BOOK) ||
900 (o_ptr->tval == TV_NATURE_BOOK) ||
901 (o_ptr->tval == TV_CHAOS_BOOK) ||
902 (o_ptr->tval == TV_DEATH_BOOK) ||
903 (o_ptr->tval == TV_TRUMP_BOOK) ||
904 (o_ptr->tval == TV_CRAFT_BOOK) ||
905 (o_ptr->tval == TV_DAEMON_BOOK) ||
906 (o_ptr->tval == TV_CRUSADE_BOOK) ||
907 (o_ptr->tval == TV_MUSIC_BOOK) ||
908 (o_ptr->tval == TV_HEX_BOOK))
923 void do_cmd_destroy(void)
932 object_type *q_ptr = &forge;
934 char o_name[MAX_NLEN];
936 char out_val[MAX_NLEN+40];
940 if (p_ptr->special_defense & KATA_MUSOU)
942 set_action(ACTION_NONE);
945 /* Hack -- force destruction */
946 if (command_arg > 0) force = TRUE;
951 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
952 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
954 q = "Destroy which item? ";
955 s = "You have nothing to destroy.";
958 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
960 /* Get the item (in the pack) */
963 o_ptr = &inventory[item];
966 /* Get the item (on the floor) */
969 o_ptr = &o_list[0 - item];
972 /* Verify unless quantity given beforehand */
973 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
975 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
977 /* Make a verification */
980 "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
982 "Really destroy %s? [y/n/Auto]",
988 /* HACK : Add the line to message buffer */
989 message_add(out_val);
990 p_ptr->window |= (PW_MESSAGE);
993 /* Get an acceptable answer */
1003 /* Erase the prompt */
1007 if (i == 'y' || i == 'Y')
1011 if (i == ESCAPE || i == 'n' || i == 'N')
1018 /* Add an auto-destroy preference line */
1019 if (autopick_autoregister(o_ptr))
1021 /* Auto-destroy it */
1022 autopick_alter_item(item, TRUE);
1025 /* The object is already destroyed. */
1028 } /* while (TRUE) */
1031 /* See how many items */
1032 if (o_ptr->number > 1)
1034 /* Get a quantity */
1035 amt = get_quantity(NULL, o_ptr->number);
1037 /* Allow user abort */
1038 if (amt <= 0) return;
1042 /* Describe the object */
1043 old_number = o_ptr->number;
1044 o_ptr->number = amt;
1045 object_desc(o_name, o_ptr, 0);
1046 o_ptr->number = old_number;
1051 /* Artifacts cannot be destroyed */
1052 if (!can_player_destroy_object(o_ptr))
1058 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1060 msg_format("You cannot destroy %s.", o_name);
1067 object_copy(q_ptr, o_ptr);
1071 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1073 msg_format("You destroy %s.", o_name);
1076 sound(SOUND_DESTITEM);
1078 /* Reduce the charges of rods/wands */
1079 reduce_charges(o_ptr, amt);
1081 /* Eliminate the item (from the pack) */
1084 inven_item_increase(item, -amt);
1085 inven_item_describe(item);
1086 inven_item_optimize(item);
1089 /* Eliminate the item (from the floor) */
1092 floor_item_increase(0 - item, -amt);
1093 floor_item_describe(0 - item);
1094 floor_item_optimize(0 - item);
1097 if (high_level_book(q_ptr))
1099 bool gain_expr = FALSE;
1101 if (p_ptr->prace == RACE_ANDROID)
1104 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1108 else if (p_ptr->pclass == CLASS_PALADIN)
1110 if (is_good_realm(p_ptr->realm1))
1112 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1116 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1120 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1122 s32b tester_exp = p_ptr->max_exp / 20;
1123 if (tester_exp > 10000) tester_exp = 10000;
1124 if (q_ptr->sval < 3) tester_exp /= 4;
1125 if (tester_exp<1) tester_exp = 1;
1128 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1130 msg_print("You feel more experienced.");
1133 gain_exp(tester_exp * amt);
1135 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1137 chg_virtue(V_UNLIFE, 1);
1138 chg_virtue(V_VITALITY, -1);
1140 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1142 chg_virtue(V_UNLIFE, -1);
1143 chg_virtue(V_VITALITY, 1);
1146 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1147 chg_virtue(V_ENCHANT, -1);
1149 if (object_value_real(q_ptr) > 30000)
1150 chg_virtue(V_SACRIFICE, 2);
1152 else if (object_value_real(q_ptr) > 10000)
1153 chg_virtue(V_SACRIFICE, 1);
1156 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1157 chg_virtue(V_HARMONY, 1);
1159 if (item >= INVEN_RARM) calc_android_exp();
1164 * Observe an item which has been *identify*-ed
1166 void do_cmd_observe(void)
1172 char o_name[MAX_NLEN];
1176 item_tester_no_ryoute = TRUE;
1179 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1180 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1182 q = "Examine which item? ";
1183 s = "You have nothing to examine.";
1186 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1188 /* Get the item (in the pack) */
1191 o_ptr = &inventory[item];
1194 /* Get the item (on the floor) */
1197 o_ptr = &o_list[0 - item];
1201 /* Require full knowledge */
1202 if (!(o_ptr->ident & IDENT_MENTAL))
1205 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1207 msg_print("You have no special knowledge about that item.");
1215 object_desc(o_name, o_ptr, 0);
1219 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1221 msg_format("Examining %s...", o_name);
1224 /* Describe it fully */
1226 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1228 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
1236 * Remove the inscription from an object
1237 * XXX Mention item (when done)?
1239 void do_cmd_uninscribe(void)
1247 item_tester_no_ryoute = TRUE;
1250 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1251 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1253 q = "Un-inscribe which item? ";
1254 s = "You have nothing to un-inscribe.";
1257 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1259 /* Get the item (in the pack) */
1262 o_ptr = &inventory[item];
1265 /* Get the item (on the floor) */
1268 o_ptr = &o_list[0 - item];
1271 /* Nothing to remove */
1272 if (!o_ptr->inscription)
1275 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1277 msg_print("That item had no inscription to remove.");
1285 msg_print("Ìäò¾Ã¤·¤¿¡£");
1287 msg_print("Inscription removed.");
1291 /* Remove the incription */
1292 o_ptr->inscription = 0;
1294 /* Combine the pack */
1295 p_ptr->notice |= (PN_COMBINE);
1298 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1300 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1301 p_ptr->update |= (PU_BONUS);
1307 * Inscribe an object with a comment
1309 void do_cmd_inscribe(void)
1315 char o_name[MAX_NLEN];
1321 item_tester_no_ryoute = TRUE;
1324 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1325 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1327 q = "Inscribe which item? ";
1328 s = "You have nothing to inscribe.";
1331 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1333 /* Get the item (in the pack) */
1336 o_ptr = &inventory[item];
1339 /* Get the item (on the floor) */
1342 o_ptr = &o_list[0 - item];
1345 /* Describe the activity */
1346 object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
1350 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1352 msg_format("Inscribing %s.", o_name);
1357 /* Start with nothing */
1358 strcpy(out_val, "");
1360 /* Use old inscription */
1361 if (o_ptr->inscription)
1363 /* Start with the old inscription */
1364 strcpy(out_val, quark_str(o_ptr->inscription));
1367 /* Get a new inscription (possibly empty) */
1369 if (get_string("ÌÃ: ", out_val, 80))
1371 if (get_string("Inscription: ", out_val, 80))
1374 /* Save the inscription */
1375 o_ptr->inscription = quark_add(out_val);
1377 /* Combine the pack */
1378 p_ptr->notice |= (PN_COMBINE);
1381 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1383 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1384 p_ptr->update |= (PU_BONUS);
1391 * An "item_tester_hook" for refilling lanterns
1393 static bool item_tester_refill_lantern(object_type *o_ptr)
1395 /* Flasks of oil are okay */
1396 if (o_ptr->tval == TV_FLASK) return (TRUE);
1398 /* Laterns are okay */
1399 if ((o_ptr->tval == TV_LITE) &&
1400 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1402 /* Assume not okay */
1408 * Refill the players lamp (from the pack or floor)
1410 static void do_cmd_refill_lamp(void)
1420 /* Restrict the choices */
1421 item_tester_hook = item_tester_refill_lantern;
1425 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1426 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1428 q = "Refill with which flask? ";
1429 s = "You have no flasks of oil.";
1432 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1434 /* Get the item (in the pack) */
1437 o_ptr = &inventory[item];
1440 /* Get the item (on the floor) */
1443 o_ptr = &o_list[0 - item];
1447 /* Take a partial turn */
1450 /* Access the lantern */
1451 j_ptr = &inventory[INVEN_LITE];
1454 j_ptr->xtra4 += o_ptr->xtra4;
1458 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1460 msg_print("You fuel your lamp.");
1464 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1468 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1470 msg_print("Your lamp has gone out!");
1473 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1477 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1479 msg_print("Curiously, your lamp doesn't light.");
1482 else if (j_ptr->xtra4 >= FUEL_LAMP)
1484 j_ptr->xtra4 = FUEL_LAMP;
1486 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1488 msg_print("Your lamp is full.");
1493 /* Decrease the item (from the pack) */
1496 inven_item_increase(item, -1);
1497 inven_item_describe(item);
1498 inven_item_optimize(item);
1501 /* Decrease the item (from the floor) */
1504 floor_item_increase(0 - item, -1);
1505 floor_item_describe(0 - item);
1506 floor_item_optimize(0 - item);
1509 /* Recalculate torch */
1510 p_ptr->update |= (PU_TORCH);
1515 * An "item_tester_hook" for refilling torches
1517 static bool item_tester_refill_torch(object_type *o_ptr)
1519 /* Torches are okay */
1520 if ((o_ptr->tval == TV_LITE) &&
1521 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1523 /* Assume not okay */
1529 * Refuel the players torch (from the pack or floor)
1531 static void do_cmd_refill_torch(void)
1541 /* Restrict the choices */
1542 item_tester_hook = item_tester_refill_torch;
1546 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1547 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1549 q = "Refuel with which torch? ";
1550 s = "You have no extra torches.";
1553 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1555 /* Get the item (in the pack) */
1558 o_ptr = &inventory[item];
1561 /* Get the item (on the floor) */
1564 o_ptr = &o_list[0 - item];
1568 /* Take a partial turn */
1571 /* Access the primary torch */
1572 j_ptr = &inventory[INVEN_LITE];
1575 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1579 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1581 msg_print("You combine the torches.");
1586 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1590 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1592 msg_print("Your torch has gone out!");
1595 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1599 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1601 msg_print("Curiously, your torche don't light.");
1604 /* Over-fuel message */
1605 else if (j_ptr->xtra4 >= FUEL_TORCH)
1607 j_ptr->xtra4 = FUEL_TORCH;
1609 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1611 msg_print("Your torch is fully fueled.");
1616 /* Refuel message */
1620 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1622 msg_print("Your torch glows more brightly.");
1627 /* Decrease the item (from the pack) */
1630 inven_item_increase(item, -1);
1631 inven_item_describe(item);
1632 inven_item_optimize(item);
1635 /* Decrease the item (from the floor) */
1638 floor_item_increase(0 - item, -1);
1639 floor_item_describe(0 - item);
1640 floor_item_optimize(0 - item);
1643 /* Recalculate torch */
1644 p_ptr->update |= (PU_TORCH);
1649 * Refill the players lamp, or restock his torches
1651 void do_cmd_refill(void)
1656 o_ptr = &inventory[INVEN_LITE];
1658 if (p_ptr->special_defense & KATA_MUSOU)
1660 set_action(ACTION_NONE);
1664 if (o_ptr->tval != TV_LITE)
1667 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1669 msg_print("You are not wielding a light.");
1675 else if (o_ptr->sval == SV_LITE_LANTERN)
1677 do_cmd_refill_lamp();
1681 else if (o_ptr->sval == SV_LITE_TORCH)
1683 do_cmd_refill_torch();
1686 /* No torch to refill */
1690 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1692 msg_print("Your light cannot be refilled.");
1702 void do_cmd_target(void)
1705 if (target_set(TARGET_KILL))
1708 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1710 msg_print("Target Selected.");
1715 /* Target aborted */
1719 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1721 msg_print("Target Aborted.");
1732 void do_cmd_look(void)
1735 p_ptr->window |= PW_MONSTER_LIST;
1740 if (target_set(TARGET_LOOK))
1743 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1745 msg_print("Target Selected.");
1754 * Allow the player to examine other sectors on the map
1756 void do_cmd_locate(void)
1758 int dir, y1, x1, y2, x2;
1767 get_screen_size(&wid, &hgt);
1770 /* Start at current panel */
1771 y2 = y1 = panel_row_min;
1772 x2 = x1 = panel_col_min;
1774 /* Show panels until done */
1777 /* Describe the location */
1778 if ((y2 == y1) && (x2 == x1))
1781 strcpy(tmp_val, "¿¿¾å");
1790 sprintf(tmp_val, "%s%s",
1791 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1792 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1794 sprintf(tmp_val, "%s%s of",
1795 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1796 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1801 /* Prepare to ask which way to look */
1804 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1806 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1809 y2 / (hgt / 2), y2 % (hgt / 2),
1810 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1812 /* Assume no direction */
1815 /* Get a direction */
1820 /* Get a command (or Cancel) */
1821 if (!get_com(out_val, &command, TRUE)) break;
1823 /* Extract the action (if any) */
1824 dir = get_keymap_dir(command);
1833 /* Apply the motion */
1834 if (change_panel(ddy[dir], ddx[dir]))
1842 /* Recenter the map around the player */
1846 p_ptr->update |= (PU_MONSTERS);
1849 p_ptr->redraw |= (PR_MAP);
1852 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1861 * Sorting hook -- Comp function -- see below
1863 * We use "u" to point to array of monster indexes,
1864 * and "v" to select the type of sorting to perform on "u".
1866 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1868 u16b *who = (u16b*)(u);
1870 u16b *why = (u16b*)(v);
1877 /* Sort by player kills */
1880 /* Extract player kills */
1881 z1 = r_info[w1].r_pkills;
1882 z2 = r_info[w2].r_pkills;
1884 /* Compare player kills */
1885 if (z1 < z2) return (TRUE);
1886 if (z1 > z2) return (FALSE);
1890 /* Sort by total kills */
1893 /* Extract total kills */
1894 z1 = r_info[w1].r_tkills;
1895 z2 = r_info[w2].r_tkills;
1897 /* Compare total kills */
1898 if (z1 < z2) return (TRUE);
1899 if (z1 > z2) return (FALSE);
1903 /* Sort by monster level */
1906 /* Extract levels */
1907 z1 = r_info[w1].level;
1908 z2 = r_info[w2].level;
1910 /* Compare levels */
1911 if (z1 < z2) return (TRUE);
1912 if (z1 > z2) return (FALSE);
1916 /* Sort by monster experience */
1919 /* Extract experience */
1920 z1 = r_info[w1].mexp;
1921 z2 = r_info[w2].mexp;
1923 /* Compare experience */
1924 if (z1 < z2) return (TRUE);
1925 if (z1 > z2) return (FALSE);
1929 /* Compare indexes */
1935 * Sorting hook -- Swap function -- see below
1937 * We use "u" to point to array of monster indexes,
1938 * and "v" to select the type of sorting to perform.
1940 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1942 u16b *who = (u16b*)(u);
1958 * Identify a character, allow recall of monsters
1960 * Several "special" responses recall "multiple" monsters:
1962 * ^U (all unique monsters)
1963 * ^N (all non-unique monsters)
1965 * The responses may be sorted in several ways, see below.
1967 * Note that the player ghosts are ignored. XXX XXX XXX
1969 void do_cmd_query_symbol(void)
1981 bool recall = FALSE;
1986 /* Get a character, or abort */
1988 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^R¾èÇÏ,^M̾Á°): ", &sym, FALSE)) return;
1990 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1993 /* Find that character info, and describe it */
1994 for (i = 0; ident_info[i]; ++i)
1996 if (sym == ident_info[i][0]) break;
2000 if (sym == KTRL('A'))
2004 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2006 strcpy(buf, "Full monster list.");
2009 else if (sym == KTRL('U'))
2013 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2015 strcpy(buf, "Unique monster list.");
2018 else if (sym == KTRL('N'))
2022 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2024 strcpy(buf, "Non-unique monster list.");
2027 else if (sym == KTRL('R'))
2031 strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2033 strcpy(buf, "Ridable monster list.");
2036 /* XTRA HACK WHATSEARCH */
2037 else if (sym == KTRL('M'))
2041 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2043 if (!get_string("Enter name:",temp, 70))
2050 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2052 sprintf(buf, "Monsters with a name \"%s\"",temp);
2055 else if (ident_info[i])
2057 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2062 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2064 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2068 /* Display the result */
2071 /* Allocate the "who" array */
2072 C_MAKE(who, max_r_idx, u16b);
2074 /* Collect matching monsters */
2075 for (n = 0, i = 1; i < max_r_idx; i++)
2077 monster_race *r_ptr = &r_info[i];
2079 /* Nothing to recall */
2080 if (!cheat_know && !r_ptr->r_sights) continue;
2082 /* Require non-unique monsters if needed */
2083 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2085 /* Require unique monsters if needed */
2086 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2088 /* Require ridable monsters if needed */
2089 if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
2091 /* XTRA HACK WHATSEARCH */
2097 for (xx=0; temp[xx] && xx<80; xx++)
2100 if (iskanji( temp[xx])) { xx++; continue; }
2102 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2106 strcpy(temp2, r_name+r_ptr->E_name);
2108 strcpy(temp2, r_name+r_ptr->name);
2110 for (xx=0; temp2[xx] && xx<80; xx++)
2111 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2114 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
2116 if (my_strstr(temp2, temp))
2121 /* Collect "appropriate" monsters */
2122 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
2125 /* Nothing to recall */
2128 /* Free the "who" array */
2129 C_KILL(who, max_r_idx, u16b);
2135 /* Prompt XXX XXX XXX */
2137 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2139 put_str("Recall details? (k/y/n): ", 0, 40);
2151 /* Select the sort method */
2152 ang_sort_comp = ang_sort_comp_hook;
2153 ang_sort_swap = ang_sort_swap_hook;
2155 /* Sort the array */
2156 ang_sort(who, &why, n);
2158 /* Sort by kills (and level) */
2165 /* Catch "escape" */
2168 /* Free the "who" array */
2169 C_KILL(who, max_r_idx, u16b);
2174 /* Sort if needed */
2177 /* Select the sort method */
2178 ang_sort_comp = ang_sort_comp_hook;
2179 ang_sort_swap = ang_sort_swap_hook;
2181 /* Sort the array */
2182 ang_sort(who, &why, n);
2186 /* Start at the end */
2189 /* Scan the monster memory */
2192 /* Extract a race */
2195 /* Hack -- Auto-recall */
2196 monster_race_track(r_idx);
2198 /* Hack -- Handle stuff */
2207 /* Save the screen */
2210 /* Recall on screen */
2211 screen_roff(who[i], 0);
2214 /* Hack -- Begin the prompt */
2217 /* Hack -- Complete the prompt */
2219 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2221 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2234 /* Normal commands */
2235 if (query != 'r') break;
2242 if (query == ESCAPE) break;
2244 /* Move to "prev" monster */
2250 if (!expand_list) break;
2254 /* Move to "next" monster */
2260 if (!expand_list) break;
2265 /* Free the "who" array */
2266 C_KILL(who, max_r_idx, u16b);
2268 /* Re-display the identity */