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 lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
50 (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))
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) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
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 lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
125 (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))
128 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
129 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
130 (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
137 /* Get a new command */
138 command_new = inkey();
140 /* Restore the screen */
144 /* Process "Escape" */
145 if (command_new == ESCAPE)
150 Term_get_size(&wid, &hgt);
154 command_gap = wid - 30;
157 /* Process normal keys */
160 /* Enter "display" mode */
167 * The "wearable" tester
169 static bool item_tester_hook_wear(object_type *o_ptr)
171 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
172 if (p_ptr->psex == SEX_MALE) return FALSE;
174 /* Check for a usable slot */
175 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
177 /* Assume not wearable */
182 static bool item_tester_hook_mochikae(object_type *o_ptr)
184 /* Check for a usable slot */
185 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
186 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
187 (o_ptr->tval == TV_CARD)) return (TRUE);
189 /* Assume not wearable */
194 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
196 /* Check for a usable slot */
197 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
199 /* Assume not wearable */
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 if (p_ptr->special_defense & KATA_MUSOU)
224 set_action(ACTION_NONE);
227 /* Restrict the choices */
228 item_tester_hook = item_tester_hook_wear;
232 q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
233 s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
235 q = "Wear/Wield which item? ";
236 s = "You have nothing you can wear or wield.";
239 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
241 /* Get the item (in the pack) */
244 o_ptr = &inventory[item];
247 /* Get the item (on the floor) */
250 o_ptr = &o_list[0 - item];
255 slot = wield_slot(o_ptr);
259 /* Shields and some misc. items */
263 if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
265 /* Restrict the choices */
266 item_tester_hook = item_tester_hook_melee_weapon;
267 item_tester_no_ryoute = TRUE;
269 /* Choose a weapon from the equipment only */
271 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
274 q = "Replace which weapon? ";
278 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
279 if ((slot == INVEN_RARM) && !cursed_p(&inventory[INVEN_RARM]))
281 object_type *or_ptr = &inventory[INVEN_RARM];
282 object_type *ol_ptr = &inventory[INVEN_LARM];
283 object_type object_tmp;
284 object_type *otmp_ptr = &object_tmp;
285 char ol_name[MAX_NLEN];
287 object_desc(ol_name, ol_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
289 object_copy(otmp_ptr, ol_ptr);
290 object_copy(ol_ptr, or_ptr);
291 object_copy(or_ptr, otmp_ptr);
293 msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name, left_hander ? "º¸¼ê" : "±¦¼ê");
295 msg_format("You wield %s at %s hand.", ol_name, left_hander ? "left" : "right");
308 /* Asking for dual wielding */
309 if (slot == INVEN_LARM)
312 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM;
314 if (!get_check("Dual wielding? ")) slot = INVEN_RARM;
318 /* Both arms are already used */
319 else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
321 /* Restrict the choices */
322 item_tester_hook = item_tester_hook_mochikae;
326 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
329 q = "Equip which hand? ";
333 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
339 if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
341 /* Restrict the choices */
342 item_tester_tval = TV_RING;
343 item_tester_no_ryoute = TRUE;
345 /* Choose a ring from the equipment only */
347 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
350 q = "Replace which ring? ";
354 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
359 /* Prevent wielding into a cursed slot */
360 if (cursed_p(&inventory[slot]))
363 object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
367 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
368 describe_use(slot) , o_name );
370 msg_format("The %s you are %s appears to be cursed.",
371 o_name, describe_use(slot));
374 /* Cancel the command */
378 if (cursed_p(o_ptr) && confirm_wear &&
379 (object_known_p(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
381 char dummy[MAX_NLEN+80];
384 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
387 sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
389 sprintf(dummy, "Really use the %s {cursed}? ", o_name);
392 if (!get_check(dummy)) return;
395 if ((o_ptr->name1 == ART_STONEMASK) && object_known_p(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
397 char dummy[MAX_NLEN+80];
400 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
403 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
405 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
406 sprintf(dummy, "Do you become a vampire?");
409 if (!get_check(dummy)) return;
412 /* Check if completed a quest */
413 for (i = 0; i < max_quests; i++)
415 if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
416 (quest[i].status == QUEST_STATUS_TAKEN) &&
417 (quest[i].k_idx == o_ptr->name1))
419 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
420 quest[i].status = QUEST_STATUS_COMPLETED;
421 quest[i].complev = (byte)p_ptr->lev;
423 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
425 msg_print("You completed the quest!");
432 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
434 identify_item(o_ptr);
436 /* Auto-inscription */
437 autopick_alter_item(item, FALSE);
443 /* Get local object */
446 /* Obtain local object */
447 object_copy(q_ptr, o_ptr);
449 /* Modify quantity */
452 /* Decrease the item (from the pack) */
455 inven_item_increase(item, -1);
456 inven_item_optimize(item);
459 /* Decrease the item (from the floor) */
462 floor_item_increase(0 - item, -1);
463 floor_item_optimize(0 - item);
466 /* Access the wield slot */
467 o_ptr = &inventory[slot];
469 /* Take off existing item */
472 /* Take off existing item */
473 (void)inven_takeoff(slot, 255);
476 /* Wear the new stuff */
477 object_copy(o_ptr, q_ptr);
479 /* Increase the weight */
480 p_ptr->total_weight += q_ptr->weight;
482 /* Increment the equip counter by hand */
485 /* Where is the item now */
489 if ((o_ptr->tval != TV_SHIELD) && (o_ptr->tval != TV_CAPTURE) && (o_ptr->tval != TV_CARD) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
491 act = "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£";
493 act = "You are wielding %s (%c) with both hands.";
497 act = (left_hander ? "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£" : "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£");
499 act = (left_hander ? "You are wielding %s (%c) on left hand." : "You are wielding %s (%c) on right hand.");
505 act = (left_hander ? "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£" : "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£");
507 act = (left_hander ? "You are wielding %s (%c) on right hand." : "You are wielding %s (%c) on left hand.");
513 act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£";
515 act = "You are shooting with %s (%c).";
521 act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£";
523 act = "Your light source is %s (%c).";
529 act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£";
531 act = "You are wearing %s (%c).";
536 /* Describe the result */
537 object_desc(o_name, o_ptr, 0);
540 msg_format(act, o_name, index_to_label(slot));
546 /* Warn the player */
548 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
550 msg_print("Oops! It feels deathly cold!");
554 chg_virtue(V_HARMONY, -1);
557 o_ptr->ident |= (IDENT_SENSE);
560 /* The Stone Mask make the player turn into a vampire! */
561 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
563 /* Turn into a vampire */
564 change_race(RACE_VAMPIRE, "");
567 /* Recalculate bonuses */
568 p_ptr->update |= (PU_BONUS);
570 /* Recalculate torch */
571 p_ptr->update |= (PU_TORCH);
573 /* Recalculate mana */
574 p_ptr->update |= (PU_MANA);
576 p_ptr->redraw |= (PR_EQUIPPY);
579 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
585 void kamaenaoshi(int item)
587 object_type *o_ptr, *o2_ptr;
588 char o_name[MAX_NLEN];
590 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
592 o_ptr = &inventory[INVEN_RARM];
593 o2_ptr = &inventory[INVEN_LARM];
594 object_copy(o_ptr, o2_ptr);
595 p_ptr->total_weight += o2_ptr->weight;
596 inven_item_increase(INVEN_LARM,-1);
597 inven_item_optimize(INVEN_LARM);
598 object_desc(o_name, o_ptr, 0);
599 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
601 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
603 msg_format("You are wielding %s with both hands.", o_name );
607 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
609 msg_format("You are wielding %s on %s hand.", o_name, (left_hander ? "left":"right") );
612 else if (item == INVEN_LARM)
614 if (buki_motteruka(INVEN_RARM))
616 o_ptr = &inventory[INVEN_RARM];
617 object_desc(o_name, o_ptr, 0);
618 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
620 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
622 msg_format("You are wielding %s with both hands.", o_name );
625 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM))
627 o_ptr = &inventory[INVEN_LARM];
628 o2_ptr = &inventory[INVEN_RARM];
629 object_copy(o_ptr, o2_ptr);
630 p_ptr->total_weight += o2_ptr->weight;
631 inven_item_increase(INVEN_RARM,-1);
632 inven_item_optimize(INVEN_RARM);
633 object_desc(o_name, o_ptr, 0);
635 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
637 msg_format("You switched hand of %s.", o_name);
647 void do_cmd_takeoff(void)
655 if (p_ptr->special_defense & KATA_MUSOU)
657 set_action(ACTION_NONE);
660 item_tester_no_ryoute = TRUE;
663 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
664 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
666 q = "Take off which item? ";
667 s = "You are not wearing anything to take off.";
670 if (!get_item(&item, q, s, (USE_EQUIP))) return;
672 /* Get the item (in the pack) */
675 o_ptr = &inventory[item];
678 /* Get the item (on the floor) */
681 o_ptr = &o_list[0 - item];
688 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
692 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
694 msg_print("Hmmm, it seems to be cursed.");
701 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
704 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
706 msg_print("You teared a cursed equipment off by sheer strength!");
709 /* Hack -- Assume felt */
710 o_ptr->ident |= (IDENT_SENSE);
712 o_ptr->curse_flags = 0L;
715 o_ptr->feeling = FEEL_NONE;
717 /* Recalculate the bonuses */
718 p_ptr->update |= (PU_BONUS);
721 p_ptr->window |= (PW_EQUIP);
724 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
726 msg_print("You break the curse.");
732 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
734 msg_print("You couldn't remove the equipment.");
741 /* Take a partial turn */
744 /* Take off the item */
745 (void)inven_takeoff(item, 255);
751 p_ptr->redraw |= (PR_EQUIPPY);
758 void do_cmd_drop(void)
766 if (p_ptr->special_defense & KATA_MUSOU)
768 set_action(ACTION_NONE);
771 item_tester_no_ryoute = TRUE;
774 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
775 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
777 q = "Drop which item? ";
778 s = "You have nothing to drop.";
781 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
783 /* Get the item (in the pack) */
786 o_ptr = &inventory[item];
789 /* Get the item (on the floor) */
792 o_ptr = &o_list[0 - item];
796 /* Hack -- Cannot remove cursed items */
797 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
801 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
803 msg_print("Hmmm, it seems to be cursed.");
812 /* See how many items */
813 if (o_ptr->number > 1)
816 amt = get_quantity(NULL, o_ptr->number);
818 /* Allow user abort */
819 if (amt <= 0) return;
823 /* Take a partial turn */
826 /* Drop (some of) the item */
827 inven_drop(item, amt);
829 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
831 if (item >= INVEN_RARM) calc_android_exp();
833 p_ptr->redraw |= (PR_EQUIPPY);
837 static bool high_level_book(object_type *o_ptr)
839 if ((o_ptr->tval == TV_LIFE_BOOK) ||
840 (o_ptr->tval == TV_SORCERY_BOOK) ||
841 (o_ptr->tval == TV_NATURE_BOOK) ||
842 (o_ptr->tval == TV_CHAOS_BOOK) ||
843 (o_ptr->tval == TV_DEATH_BOOK) ||
844 (o_ptr->tval == TV_TRUMP_BOOK) ||
845 (o_ptr->tval == TV_ENCHANT_BOOK) ||
846 (o_ptr->tval == TV_DAEMON_BOOK) ||
847 (o_ptr->tval == TV_CRUSADE_BOOK) ||
848 (o_ptr->tval == TV_MUSIC_BOOK))
863 void do_cmd_destroy(void)
872 object_type *q_ptr = &forge;
874 char o_name[MAX_NLEN];
876 char out_val[MAX_NLEN+40];
880 if (p_ptr->special_defense & KATA_MUSOU)
882 set_action(ACTION_NONE);
885 /* Hack -- force destruction */
886 if (command_arg > 0) force = TRUE;
891 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
892 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
894 q = "Destroy which item? ";
895 s = "You have nothing to destroy.";
898 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
900 /* Get the item (in the pack) */
903 o_ptr = &inventory[item];
906 /* Get the item (on the floor) */
909 o_ptr = &o_list[0 - item];
912 /* Verify unless quantity given beforehand */
913 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
915 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
917 /* Make a verification */
920 "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
922 "Really destroy %s? [y/n/Auto]",
928 /* HACK : Add the line to message buffer */
929 message_add(out_val);
930 p_ptr->window |= (PW_MESSAGE);
933 /* Get an acceptable answer */
943 /* Erase the prompt */
947 if (i == 'y' || i == 'Y')
951 if (i == ESCAPE || i == 'n' || i == 'N')
958 /* Add an auto-destroy preference line */
959 if (autopick_autoregister(o_ptr))
961 /* Auto-destroy it */
962 autopick_alter_item(item, TRUE);
965 /* The object is already destroyed. */
971 /* See how many items */
972 if (o_ptr->number > 1)
975 amt = get_quantity(NULL, o_ptr->number);
977 /* Allow user abort */
978 if (amt <= 0) return;
982 /* Describe the object */
983 old_number = o_ptr->number;
985 object_desc(o_name, o_ptr, 0);
986 o_ptr->number = old_number;
991 /* Artifacts cannot be destroyed */
992 if (!can_player_destroy_object(o_ptr))
998 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1000 msg_format("You cannot destroy %s.", o_name);
1007 object_copy(q_ptr, o_ptr);
1011 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1013 msg_format("You destroy %s.", o_name);
1016 sound(SOUND_DESTITEM);
1018 /* Reduce the charges of rods/wands */
1019 reduce_charges(o_ptr, amt);
1021 /* Eliminate the item (from the pack) */
1024 inven_item_increase(item, -amt);
1025 inven_item_describe(item);
1026 inven_item_optimize(item);
1029 /* Eliminate the item (from the floor) */
1032 floor_item_increase(0 - item, -amt);
1033 floor_item_describe(0 - item);
1034 floor_item_optimize(0 - item);
1037 if (high_level_book(q_ptr))
1039 bool gain_expr = FALSE;
1041 if (p_ptr->prace == RACE_ANDROID)
1044 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1048 else if (p_ptr->pclass == CLASS_PALADIN)
1050 if (is_good_realm(p_ptr->realm1))
1052 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1056 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1060 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1062 s32b tester_exp = p_ptr->max_exp / 20;
1063 if (tester_exp > 10000) tester_exp = 10000;
1064 if (q_ptr->sval < 3) tester_exp /= 4;
1065 if (tester_exp<1) tester_exp = 1;
1068 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1070 msg_print("You feel more experienced.");
1073 gain_exp(tester_exp * amt);
1075 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1077 chg_virtue(V_UNLIFE, 1);
1078 chg_virtue(V_VITALITY, -1);
1080 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1082 chg_virtue(V_UNLIFE, -1);
1083 chg_virtue(V_VITALITY, 1);
1086 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1087 chg_virtue(V_ENCHANT, -1);
1089 if (object_value_real(q_ptr) > 30000)
1090 chg_virtue(V_SACRIFICE, 2);
1092 else if (object_value_real(q_ptr) > 10000)
1093 chg_virtue(V_SACRIFICE, 1);
1096 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1097 chg_virtue(V_HARMONY, 1);
1099 if (item >= INVEN_RARM) calc_android_exp();
1104 * Observe an item which has been *identify*-ed
1106 void do_cmd_observe(void)
1112 char o_name[MAX_NLEN];
1116 item_tester_no_ryoute = TRUE;
1119 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1120 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1122 q = "Examine which item? ";
1123 s = "You have nothing to examine.";
1126 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1128 /* Get the item (in the pack) */
1131 o_ptr = &inventory[item];
1134 /* Get the item (on the floor) */
1137 o_ptr = &o_list[0 - item];
1141 /* Require full knowledge */
1142 if (!(o_ptr->ident & IDENT_MENTAL))
1145 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1147 msg_print("You have no special knowledge about that item.");
1155 object_desc(o_name, o_ptr, 0);
1159 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1161 msg_format("Examining %s...", o_name);
1164 /* Describe it fully */
1166 if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1168 if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
1176 * Remove the inscription from an object
1177 * XXX Mention item (when done)?
1179 void do_cmd_uninscribe(void)
1187 item_tester_no_ryoute = TRUE;
1190 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1191 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1193 q = "Un-inscribe which item? ";
1194 s = "You have nothing to un-inscribe.";
1197 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1199 /* Get the item (in the pack) */
1202 o_ptr = &inventory[item];
1205 /* Get the item (on the floor) */
1208 o_ptr = &o_list[0 - item];
1211 /* Nothing to remove */
1212 if (!o_ptr->inscription)
1215 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1217 msg_print("That item had no inscription to remove.");
1225 msg_print("Ìäò¾Ã¤·¤¿¡£");
1227 msg_print("Inscription removed.");
1231 /* Remove the incription */
1232 o_ptr->inscription = 0;
1234 /* Combine the pack */
1235 p_ptr->notice |= (PN_COMBINE);
1238 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1240 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1241 p_ptr->update |= (PU_BONUS);
1247 * Inscribe an object with a comment
1249 void do_cmd_inscribe(void)
1255 char o_name[MAX_NLEN];
1261 item_tester_no_ryoute = TRUE;
1264 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1265 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1267 q = "Inscribe which item? ";
1268 s = "You have nothing to inscribe.";
1271 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1273 /* Get the item (in the pack) */
1276 o_ptr = &inventory[item];
1279 /* Get the item (on the floor) */
1282 o_ptr = &o_list[0 - item];
1285 /* Describe the activity */
1286 object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
1290 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1292 msg_format("Inscribing %s.", o_name);
1297 /* Start with nothing */
1298 strcpy(out_val, "");
1300 /* Use old inscription */
1301 if (o_ptr->inscription)
1303 /* Start with the old inscription */
1304 strcpy(out_val, quark_str(o_ptr->inscription));
1307 /* Get a new inscription (possibly empty) */
1309 if (get_string("ÌÃ: ", out_val, 80))
1311 if (get_string("Inscription: ", out_val, 80))
1314 /* Save the inscription */
1315 o_ptr->inscription = quark_add(out_val);
1317 /* Combine the pack */
1318 p_ptr->notice |= (PN_COMBINE);
1321 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1323 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1324 p_ptr->update |= (PU_BONUS);
1331 * An "item_tester_hook" for refilling lanterns
1333 static bool item_tester_refill_lantern(object_type *o_ptr)
1335 /* Flasks of oil are okay */
1336 if (o_ptr->tval == TV_FLASK) return (TRUE);
1338 /* Laterns are okay */
1339 if ((o_ptr->tval == TV_LITE) &&
1340 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1342 /* Assume not okay */
1348 * Refill the players lamp (from the pack or floor)
1350 static void do_cmd_refill_lamp(void)
1360 /* Restrict the choices */
1361 item_tester_hook = item_tester_refill_lantern;
1365 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1366 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1368 q = "Refill with which flask? ";
1369 s = "You have no flasks of oil.";
1372 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1374 /* Get the item (in the pack) */
1377 o_ptr = &inventory[item];
1380 /* Get the item (on the floor) */
1383 o_ptr = &o_list[0 - item];
1387 /* Take a partial turn */
1390 /* Access the lantern */
1391 j_ptr = &inventory[INVEN_LITE];
1394 j_ptr->xtra4 += o_ptr->xtra4;
1398 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1400 msg_print("You fuel your lamp.");
1404 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1408 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1410 msg_print("Your lamp has gone out!");
1413 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1417 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1419 msg_print("Curiously, your lamp doesn't light.");
1422 else if (j_ptr->xtra4 >= FUEL_LAMP)
1424 j_ptr->xtra4 = FUEL_LAMP;
1426 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1428 msg_print("Your lamp is full.");
1433 /* Decrease the item (from the pack) */
1436 inven_item_increase(item, -1);
1437 inven_item_describe(item);
1438 inven_item_optimize(item);
1441 /* Decrease the item (from the floor) */
1444 floor_item_increase(0 - item, -1);
1445 floor_item_describe(0 - item);
1446 floor_item_optimize(0 - item);
1449 /* Recalculate torch */
1450 p_ptr->update |= (PU_TORCH);
1455 * An "item_tester_hook" for refilling torches
1457 static bool item_tester_refill_torch(object_type *o_ptr)
1459 /* Torches are okay */
1460 if ((o_ptr->tval == TV_LITE) &&
1461 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1463 /* Assume not okay */
1469 * Refuel the players torch (from the pack or floor)
1471 static void do_cmd_refill_torch(void)
1481 /* Restrict the choices */
1482 item_tester_hook = item_tester_refill_torch;
1486 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1487 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1489 q = "Refuel with which torch? ";
1490 s = "You have no extra torches.";
1493 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1495 /* Get the item (in the pack) */
1498 o_ptr = &inventory[item];
1501 /* Get the item (on the floor) */
1504 o_ptr = &o_list[0 - item];
1508 /* Take a partial turn */
1511 /* Access the primary torch */
1512 j_ptr = &inventory[INVEN_LITE];
1515 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1519 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1521 msg_print("You combine the torches.");
1526 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1530 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1532 msg_print("Your torch has gone out!");
1535 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1539 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1541 msg_print("Curiously, your torche don't light.");
1544 /* Over-fuel message */
1545 else if (j_ptr->xtra4 >= FUEL_TORCH)
1547 j_ptr->xtra4 = FUEL_TORCH;
1549 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1551 msg_print("Your torch is fully fueled.");
1556 /* Refuel message */
1560 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1562 msg_print("Your torch glows more brightly.");
1567 /* Decrease the item (from the pack) */
1570 inven_item_increase(item, -1);
1571 inven_item_describe(item);
1572 inven_item_optimize(item);
1575 /* Decrease the item (from the floor) */
1578 floor_item_increase(0 - item, -1);
1579 floor_item_describe(0 - item);
1580 floor_item_optimize(0 - item);
1583 /* Recalculate torch */
1584 p_ptr->update |= (PU_TORCH);
1589 * Refill the players lamp, or restock his torches
1591 void do_cmd_refill(void)
1596 o_ptr = &inventory[INVEN_LITE];
1598 if (p_ptr->special_defense & KATA_MUSOU)
1600 set_action(ACTION_NONE);
1604 if (o_ptr->tval != TV_LITE)
1607 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1609 msg_print("You are not wielding a light.");
1615 else if (o_ptr->sval == SV_LITE_LANTERN)
1617 do_cmd_refill_lamp();
1621 else if (o_ptr->sval == SV_LITE_TORCH)
1623 do_cmd_refill_torch();
1626 /* No torch to refill */
1630 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1632 msg_print("Your light cannot be refilled.");
1642 void do_cmd_target(void)
1645 if (target_set(TARGET_KILL))
1648 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1650 msg_print("Target Selected.");
1655 /* Target aborted */
1659 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1661 msg_print("Target Aborted.");
1672 void do_cmd_look(void)
1675 if (target_set(TARGET_LOOK))
1678 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1680 msg_print("Target Selected.");
1689 * Allow the player to examine other sectors on the map
1691 void do_cmd_locate(void)
1693 int dir, y1, x1, y2, x2;
1702 get_screen_size(&wid, &hgt);
1705 /* Start at current panel */
1706 y2 = y1 = panel_row_min;
1707 x2 = x1 = panel_col_min;
1709 /* Show panels until done */
1712 /* Describe the location */
1713 if ((y2 == y1) && (x2 == x1))
1716 strcpy(tmp_val, "¿¿¾å");
1725 sprintf(tmp_val, "%s%s",
1726 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1727 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1729 sprintf(tmp_val, "%s%s of",
1730 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1731 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1736 /* Prepare to ask which way to look */
1739 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1741 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1744 y2 / (hgt / 2), y2 % (hgt / 2),
1745 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1747 /* Assume no direction */
1750 /* Get a direction */
1755 /* Get a command (or Cancel) */
1756 if (!get_com(out_val, &command, TRUE)) break;
1758 /* Extract the action (if any) */
1759 dir = get_keymap_dir(command);
1768 /* Apply the motion */
1769 if (change_panel(ddy[dir], ddx[dir]))
1777 /* Recenter the map around the player */
1781 p_ptr->update |= (PU_MONSTERS);
1784 p_ptr->redraw |= (PR_MAP);
1787 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1796 * Sorting hook -- Comp function -- see below
1798 * We use "u" to point to array of monster indexes,
1799 * and "v" to select the type of sorting to perform on "u".
1801 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1803 u16b *who = (u16b*)(u);
1805 u16b *why = (u16b*)(v);
1812 /* Sort by player kills */
1815 /* Extract player kills */
1816 z1 = r_info[w1].r_pkills;
1817 z2 = r_info[w2].r_pkills;
1819 /* Compare player kills */
1820 if (z1 < z2) return (TRUE);
1821 if (z1 > z2) return (FALSE);
1825 /* Sort by total kills */
1828 /* Extract total kills */
1829 z1 = r_info[w1].r_tkills;
1830 z2 = r_info[w2].r_tkills;
1832 /* Compare total kills */
1833 if (z1 < z2) return (TRUE);
1834 if (z1 > z2) return (FALSE);
1838 /* Sort by monster level */
1841 /* Extract levels */
1842 z1 = r_info[w1].level;
1843 z2 = r_info[w2].level;
1845 /* Compare levels */
1846 if (z1 < z2) return (TRUE);
1847 if (z1 > z2) return (FALSE);
1851 /* Sort by monster experience */
1854 /* Extract experience */
1855 z1 = r_info[w1].mexp;
1856 z2 = r_info[w2].mexp;
1858 /* Compare experience */
1859 if (z1 < z2) return (TRUE);
1860 if (z1 > z2) return (FALSE);
1864 /* Compare indexes */
1870 * Sorting hook -- Swap function -- see below
1872 * We use "u" to point to array of monster indexes,
1873 * and "v" to select the type of sorting to perform.
1875 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1877 u16b *who = (u16b*)(u);
1893 * Identify a character, allow recall of monsters
1895 * Several "special" responses recall "multiple" monsters:
1897 * ^U (all unique monsters)
1898 * ^N (all non-unique monsters)
1900 * The responses may be sorted in several ways, see below.
1902 * Note that the player ghosts are ignored. XXX XXX XXX
1904 void do_cmd_query_symbol(void)
1916 bool recall = FALSE;
1921 /* Get a character, or abort */
1923 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^R¾èÇÏ,^M̾Á°): ", &sym, FALSE)) return;
1925 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1928 /* Find that character info, and describe it */
1929 for (i = 0; ident_info[i]; ++i)
1931 if (sym == ident_info[i][0]) break;
1935 if (sym == KTRL('A'))
1939 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1941 strcpy(buf, "Full monster list.");
1944 else if (sym == KTRL('U'))
1948 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1950 strcpy(buf, "Unique monster list.");
1953 else if (sym == KTRL('N'))
1957 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1959 strcpy(buf, "Non-unique monster list.");
1962 else if (sym == KTRL('R'))
1966 strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1968 strcpy(buf, "Ridable monster list.");
1971 /* XTRA HACK WHATSEARCH */
1972 else if (sym == KTRL('M'))
1976 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
1978 if (!get_string("Enter name:",temp, 70))
1985 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
1987 sprintf(buf, "Monsters with a name \"%s\"",temp);
1990 else if (ident_info[i])
1992 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
1997 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
1999 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2003 /* Display the result */
2006 /* Allocate the "who" array */
2007 C_MAKE(who, max_r_idx, u16b);
2009 /* Collect matching monsters */
2010 for (n = 0, i = 1; i < max_r_idx; i++)
2012 monster_race *r_ptr = &r_info[i];
2014 /* Nothing to recall */
2015 if (!cheat_know && !r_ptr->r_sights) continue;
2017 /* Require non-unique monsters if needed */
2018 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2020 /* Require unique monsters if needed */
2021 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2023 /* Require ridable monsters if needed */
2024 if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
2026 /* XTRA HACK WHATSEARCH */
2032 for (xx=0; temp[xx] && xx<80; xx++)
2035 if (iskanji( temp[xx])) { xx++; continue; }
2037 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2041 strcpy(temp2, r_name+r_ptr->E_name);
2043 strcpy(temp2, r_name+r_ptr->name);
2045 for (xx=0; temp2[xx] && xx<80; xx++)
2046 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2049 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
2051 if (my_strstr(temp2, temp))
2056 /* Collect "appropriate" monsters */
2057 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
2060 /* Nothing to recall */
2063 /* Free the "who" array */
2064 C_KILL(who, max_r_idx, u16b);
2070 /* Prompt XXX XXX XXX */
2072 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2074 put_str("Recall details? (k/y/n): ", 0, 40);
2086 /* Select the sort method */
2087 ang_sort_comp = ang_sort_comp_hook;
2088 ang_sort_swap = ang_sort_swap_hook;
2090 /* Sort the array */
2091 ang_sort(who, &why, n);
2093 /* Sort by kills (and level) */
2100 /* Catch "escape" */
2103 /* Free the "who" array */
2104 C_KILL(who, max_r_idx, u16b);
2109 /* Sort if needed */
2112 /* Select the sort method */
2113 ang_sort_comp = ang_sort_comp_hook;
2114 ang_sort_swap = ang_sort_swap_hook;
2116 /* Sort the array */
2117 ang_sort(who, &why, n);
2121 /* Start at the end */
2124 /* Scan the monster memory */
2127 /* Extract a race */
2130 /* Hack -- Auto-recall */
2131 monster_race_track(r_idx);
2133 /* Hack -- Handle stuff */
2142 /* Save the screen */
2145 /* Recall on screen */
2146 screen_roff(who[i], 0);
2149 /* Hack -- Begin the prompt */
2152 /* Hack -- Complete the prompt */
2154 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2156 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2169 /* Normal commands */
2170 if (query != 'r') break;
2177 if (query == ESCAPE) break;
2179 /* Move to "prev" monster */
2185 if (!expand_list) break;
2189 /* Move to "next" monster */
2195 if (!expand_list) break;
2200 /* Free the "who" array */
2201 C_KILL(who, max_r_idx, u16b);
2203 /* Re-display the identity */