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, FALSE, 0);
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], FALSE, 0);
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, FALSE, 0);
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, FALSE, 0);
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 auto_inscribe_item(item, is_autopick(o_ptr));
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 */
490 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 = "¤òξ¼ê¤Ç¹½¤¨¤¿";
493 act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
497 act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
501 act = "You are wielding";
507 act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
509 act = "You are shooting with";
515 act = "¤ò¸÷¸»¤Ë¤·¤¿";
517 act = "Your light source is";
525 act = "You are wearing";
530 /* Describe the result */
531 object_desc(o_name, o_ptr, TRUE, 3);
535 msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
537 msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
544 /* Warn the player */
546 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
548 msg_print("Oops! It feels deathly cold!");
552 chg_virtue(V_HARMONY, -1);
555 o_ptr->ident |= (IDENT_SENSE);
558 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
561 if (p_ptr->prace < 32)
563 p_ptr->old_race1 |= 1L << p_ptr->prace;
567 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
569 p_ptr->prace = RACE_VAMPIRE;
571 msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
573 msg_format("You polymorphed into a vampire!");
576 rp_ptr = &race_info[p_ptr->prace];
578 /* Experience factor */
579 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
581 /* Calculate the height/weight for males */
582 if (p_ptr->psex == SEX_MALE)
584 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
585 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
586 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
587 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
590 /* Calculate the height/weight for females */
591 else if (p_ptr->psex == SEX_FEMALE)
593 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
594 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
595 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
596 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
602 if (p_ptr->pclass == CLASS_SORCERER)
603 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
605 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
607 do_cmd_rerate(FALSE);
609 p_ptr->redraw |= (PR_BASIC);
611 p_ptr->update |= (PU_BONUS);
617 /* Recalculate bonuses */
618 p_ptr->update |= (PU_BONUS);
620 /* Recalculate torch */
621 p_ptr->update |= (PU_TORCH);
623 /* Recalculate mana */
624 p_ptr->update |= (PU_MANA);
626 p_ptr->redraw |= (PR_EQUIPPY);
629 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
635 void kamaenaoshi(int item)
637 object_type *o_ptr, *o2_ptr;
638 char o_name[MAX_NLEN];
640 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
642 o_ptr = &inventory[INVEN_RARM];
643 o2_ptr = &inventory[INVEN_LARM];
644 object_copy(o_ptr, o2_ptr);
645 p_ptr->total_weight += o2_ptr->weight;
646 inven_item_increase(INVEN_LARM,-1);
647 inven_item_optimize(INVEN_LARM);
648 object_desc(o_name, o_ptr, TRUE, 3);
649 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
651 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
653 msg_format("You are wielding %s with two-handed.", o_name );
657 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
659 msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
662 else if (item == INVEN_LARM)
664 if (buki_motteruka(INVEN_RARM))
666 o_ptr = &inventory[INVEN_RARM];
667 object_desc(o_name, o_ptr, TRUE, 3);
668 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
670 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
672 msg_format("You are wielding %s with two-handed.", o_name );
675 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM))
677 o_ptr = &inventory[INVEN_LARM];
678 o2_ptr = &inventory[INVEN_RARM];
679 object_copy(o_ptr, o2_ptr);
680 p_ptr->total_weight += o2_ptr->weight;
681 inven_item_increase(INVEN_RARM,-1);
682 inven_item_optimize(INVEN_RARM);
683 object_desc(o_name, o_ptr, TRUE, 3);
685 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
687 msg_format("You switched hand of %s.", o_name);
697 void do_cmd_takeoff(void)
705 if (p_ptr->special_defense & KATA_MUSOU)
707 set_action(ACTION_NONE);
710 item_tester_no_ryoute = TRUE;
713 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
714 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
716 q = "Take off which item? ";
717 s = "You are not wearing anything to take off.";
720 if (!get_item(&item, q, s, (USE_EQUIP))) return;
722 /* Get the item (in the pack) */
725 o_ptr = &inventory[item];
728 /* Get the item (on the floor) */
731 o_ptr = &o_list[0 - item];
738 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
742 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
744 msg_print("Hmmm, it seems to be cursed.");
751 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
754 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
756 msg_print("You teared a cursed equipment off by sheer strength!");
759 /* Hack -- Assume felt */
760 o_ptr->ident |= (IDENT_SENSE);
762 o_ptr->curse_flags = 0L;
765 o_ptr->feeling = FEEL_NONE;
767 /* Recalculate the bonuses */
768 p_ptr->update |= (PU_BONUS);
771 p_ptr->window |= (PW_EQUIP);
774 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
776 msg_print("You break the curse.");
782 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
784 msg_print("You couldn't remove the equipment.");
791 /* Take a partial turn */
794 /* Take off the item */
795 (void)inven_takeoff(item, 255);
801 p_ptr->redraw |= (PR_EQUIPPY);
808 void do_cmd_drop(void)
816 if (p_ptr->special_defense & KATA_MUSOU)
818 set_action(ACTION_NONE);
821 item_tester_no_ryoute = TRUE;
824 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
825 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
827 q = "Drop which item? ";
828 s = "You have nothing to drop.";
831 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
833 /* Get the item (in the pack) */
836 o_ptr = &inventory[item];
839 /* Get the item (on the floor) */
842 o_ptr = &o_list[0 - item];
846 /* Hack -- Cannot remove cursed items */
847 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
851 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
853 msg_print("Hmmm, it seems to be cursed.");
862 /* See how many items */
863 if (o_ptr->number > 1)
866 amt = get_quantity(NULL, o_ptr->number);
868 /* Allow user abort */
869 if (amt <= 0) return;
873 /* Take a partial turn */
876 /* Drop (some of) the item */
877 inven_drop(item, amt);
879 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
881 if (item >= INVEN_RARM) calc_android_exp();
883 p_ptr->redraw |= (PR_EQUIPPY);
887 static bool high_level_book(object_type *o_ptr)
889 if ((o_ptr->tval == TV_LIFE_BOOK) ||
890 (o_ptr->tval == TV_SORCERY_BOOK) ||
891 (o_ptr->tval == TV_NATURE_BOOK) ||
892 (o_ptr->tval == TV_CHAOS_BOOK) ||
893 (o_ptr->tval == TV_DEATH_BOOK) ||
894 (o_ptr->tval == TV_TRUMP_BOOK) ||
895 (o_ptr->tval == TV_ENCHANT_BOOK) ||
896 (o_ptr->tval == TV_DAEMON_BOOK) ||
897 (o_ptr->tval == TV_CRUSADE_BOOK) ||
898 (o_ptr->tval == TV_MUSIC_BOOK))
913 void do_cmd_destroy(void)
922 object_type *q_ptr = &forge;
924 char o_name[MAX_NLEN];
926 char out_val[MAX_NLEN+40];
930 if (p_ptr->special_defense & KATA_MUSOU)
932 set_action(ACTION_NONE);
935 /* Hack -- force destruction */
936 if (command_arg > 0) force = TRUE;
941 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
942 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
944 q = "Destroy which item? ";
945 s = "You have nothing to destroy.";
948 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
950 /* Get the item (in the pack) */
953 o_ptr = &inventory[item];
956 /* Get the item (on the floor) */
959 o_ptr = &o_list[0 - item];
963 /* See how many items */
964 if (o_ptr->number > 1)
967 amt = get_quantity(NULL, o_ptr->number);
969 /* Allow user abort */
970 if (amt <= 0) return;
974 /* Describe the object */
975 old_number = o_ptr->number;
977 object_desc(o_name, o_ptr, TRUE, 3);
978 o_ptr->number = old_number;
980 /* Verify unless quantity given */
983 if (confirm_destroy || (object_value(o_ptr) > 0))
985 /* Make a verification */
987 sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
989 sprintf(out_val, "Really destroy %s? ", o_name);
992 if (!get_check(out_val)) return;
999 /* Artifacts cannot be destroyed */
1000 if (!can_player_destroy_object(o_ptr))
1006 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1008 msg_format("You cannot destroy %s.", o_name);
1015 object_copy(q_ptr, o_ptr);
1019 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1021 msg_format("You destroy %s.", o_name);
1024 sound(SOUND_DESTITEM);
1026 /* Reduce the charges of rods/wands */
1027 reduce_charges(o_ptr, amt);
1029 /* Eliminate the item (from the pack) */
1032 inven_item_increase(item, -amt);
1033 inven_item_describe(item);
1034 inven_item_optimize(item);
1037 /* Eliminate the item (from the floor) */
1040 floor_item_increase(0 - item, -amt);
1041 floor_item_describe(0 - item);
1042 floor_item_optimize(0 - item);
1045 if (high_level_book(q_ptr))
1047 bool gain_expr = FALSE;
1049 if (p_ptr->prace == RACE_ANDROID)
1052 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1056 else if (p_ptr->pclass == CLASS_PALADIN)
1058 if (is_good_realm(p_ptr->realm1))
1060 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1064 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1068 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1070 s32b tester_exp = p_ptr->max_exp / 20;
1071 if (tester_exp > 10000) tester_exp = 10000;
1072 if (q_ptr->sval < 3) tester_exp /= 4;
1073 if (tester_exp<1) tester_exp = 1;
1076 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1078 msg_print("You feel more experienced.");
1081 gain_exp(tester_exp * amt);
1083 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1085 chg_virtue(V_UNLIFE, 1);
1086 chg_virtue(V_VITALITY, -1);
1088 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1090 chg_virtue(V_UNLIFE, -1);
1091 chg_virtue(V_VITALITY, 1);
1094 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1095 chg_virtue(V_ENCHANT, -1);
1097 if (object_value_real(q_ptr) > 30000)
1098 chg_virtue(V_SACRIFICE, 2);
1100 else if (object_value_real(q_ptr) > 10000)
1101 chg_virtue(V_SACRIFICE, 1);
1104 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1105 chg_virtue(V_HARMONY, 1);
1107 if (item >= INVEN_RARM) calc_android_exp();
1112 * Observe an item which has been *identify*-ed
1114 void do_cmd_observe(void)
1120 char o_name[MAX_NLEN];
1124 item_tester_no_ryoute = TRUE;
1127 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1128 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1130 q = "Examine which item? ";
1131 s = "You have nothing to examine.";
1134 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1136 /* Get the item (in the pack) */
1139 o_ptr = &inventory[item];
1142 /* Get the item (on the floor) */
1145 o_ptr = &o_list[0 - item];
1149 /* Require full knowledge */
1150 if (!(o_ptr->ident & IDENT_MENTAL))
1153 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1155 msg_print("You have no special knowledge about that item.");
1163 object_desc(o_name, o_ptr, TRUE, 3);
1167 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1169 msg_format("Examining %s...", o_name);
1172 /* Describe it fully */
1174 if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1176 if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
1184 * Remove the inscription from an object
1185 * XXX Mention item (when done)?
1187 void do_cmd_uninscribe(void)
1195 item_tester_no_ryoute = TRUE;
1198 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1199 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1201 q = "Un-inscribe which item? ";
1202 s = "You have nothing to un-inscribe.";
1205 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1207 /* Get the item (in the pack) */
1210 o_ptr = &inventory[item];
1213 /* Get the item (on the floor) */
1216 o_ptr = &o_list[0 - item];
1219 /* Nothing to remove */
1220 if (!o_ptr->inscription)
1223 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1225 msg_print("That item had no inscription to remove.");
1233 msg_print("Ìäò¾Ã¤·¤¿¡£");
1235 msg_print("Inscription removed.");
1239 /* Remove the incription */
1240 o_ptr->inscription = 0;
1242 /* Combine the pack */
1243 p_ptr->notice |= (PN_COMBINE);
1246 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1248 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1249 p_ptr->update |= (PU_BONUS);
1255 * Inscribe an object with a comment
1257 void do_cmd_inscribe(void)
1263 char o_name[MAX_NLEN];
1269 item_tester_no_ryoute = TRUE;
1272 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1273 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1275 q = "Inscribe which item? ";
1276 s = "You have nothing to inscribe.";
1279 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1281 /* Get the item (in the pack) */
1284 o_ptr = &inventory[item];
1287 /* Get the item (on the floor) */
1290 o_ptr = &o_list[0 - item];
1293 /* Describe the activity */
1294 object_desc(o_name, o_ptr, TRUE, 2);
1298 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1300 msg_format("Inscribing %s.", o_name);
1305 /* Start with nothing */
1306 strcpy(out_val, "");
1308 /* Use old inscription */
1309 if (o_ptr->inscription)
1311 /* Start with the old inscription */
1312 strcpy(out_val, quark_str(o_ptr->inscription));
1315 /* Get a new inscription (possibly empty) */
1317 if (get_string("ÌÃ: ", out_val, 80))
1319 if (get_string("Inscription: ", out_val, 80))
1322 /* Save the inscription */
1323 o_ptr->inscription = quark_add(out_val);
1325 /* Combine the pack */
1326 p_ptr->notice |= (PN_COMBINE);
1329 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1331 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1332 p_ptr->update |= (PU_BONUS);
1339 * An "item_tester_hook" for refilling lanterns
1341 static bool item_tester_refill_lantern(object_type *o_ptr)
1343 /* Flasks of oil are okay */
1344 if (o_ptr->tval == TV_FLASK) return (TRUE);
1346 /* Laterns are okay */
1347 if ((o_ptr->tval == TV_LITE) &&
1348 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1350 /* Assume not okay */
1356 * Refill the players lamp (from the pack or floor)
1358 static void do_cmd_refill_lamp(void)
1368 /* Restrict the choices */
1369 item_tester_hook = item_tester_refill_lantern;
1373 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1374 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1376 q = "Refill with which flask? ";
1377 s = "You have no flasks of oil.";
1380 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1382 /* Get the item (in the pack) */
1385 o_ptr = &inventory[item];
1388 /* Get the item (on the floor) */
1391 o_ptr = &o_list[0 - item];
1395 /* Take a partial turn */
1398 /* Access the lantern */
1399 j_ptr = &inventory[INVEN_LITE];
1402 j_ptr->xtra4 += o_ptr->xtra4;
1406 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1408 msg_print("You fuel your lamp.");
1412 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1416 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1418 msg_print("Your lamp has gone out!");
1421 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1425 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1427 msg_print("Curiously, your lamp doesn't light.");
1430 else if (j_ptr->xtra4 >= FUEL_LAMP)
1432 j_ptr->xtra4 = FUEL_LAMP;
1434 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1436 msg_print("Your lamp is full.");
1441 /* Decrease the item (from the pack) */
1444 inven_item_increase(item, -1);
1445 inven_item_describe(item);
1446 inven_item_optimize(item);
1449 /* Decrease the item (from the floor) */
1452 floor_item_increase(0 - item, -1);
1453 floor_item_describe(0 - item);
1454 floor_item_optimize(0 - item);
1457 /* Recalculate torch */
1458 p_ptr->update |= (PU_TORCH);
1463 * An "item_tester_hook" for refilling torches
1465 static bool item_tester_refill_torch(object_type *o_ptr)
1467 /* Torches are okay */
1468 if ((o_ptr->tval == TV_LITE) &&
1469 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1471 /* Assume not okay */
1477 * Refuel the players torch (from the pack or floor)
1479 static void do_cmd_refill_torch(void)
1489 /* Restrict the choices */
1490 item_tester_hook = item_tester_refill_torch;
1494 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1495 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1497 q = "Refuel with which torch? ";
1498 s = "You have no extra torches.";
1501 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1503 /* Get the item (in the pack) */
1506 o_ptr = &inventory[item];
1509 /* Get the item (on the floor) */
1512 o_ptr = &o_list[0 - item];
1516 /* Take a partial turn */
1519 /* Access the primary torch */
1520 j_ptr = &inventory[INVEN_LITE];
1523 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1527 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1529 msg_print("You combine the torches.");
1534 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1538 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1540 msg_print("Your torch has gone out!");
1543 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1547 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1549 msg_print("Curiously, your torche don't light.");
1552 /* Over-fuel message */
1553 else if (j_ptr->xtra4 >= FUEL_TORCH)
1555 j_ptr->xtra4 = FUEL_TORCH;
1557 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1559 msg_print("Your torch is fully fueled.");
1564 /* Refuel message */
1568 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1570 msg_print("Your torch glows more brightly.");
1575 /* Decrease the item (from the pack) */
1578 inven_item_increase(item, -1);
1579 inven_item_describe(item);
1580 inven_item_optimize(item);
1583 /* Decrease the item (from the floor) */
1586 floor_item_increase(0 - item, -1);
1587 floor_item_describe(0 - item);
1588 floor_item_optimize(0 - item);
1591 /* Recalculate torch */
1592 p_ptr->update |= (PU_TORCH);
1597 * Refill the players lamp, or restock his torches
1599 void do_cmd_refill(void)
1604 o_ptr = &inventory[INVEN_LITE];
1606 if (p_ptr->special_defense & KATA_MUSOU)
1608 set_action(ACTION_NONE);
1612 if (o_ptr->tval != TV_LITE)
1615 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1617 msg_print("You are not wielding a light.");
1623 else if (o_ptr->sval == SV_LITE_LANTERN)
1625 do_cmd_refill_lamp();
1629 else if (o_ptr->sval == SV_LITE_TORCH)
1631 do_cmd_refill_torch();
1634 /* No torch to refill */
1638 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1640 msg_print("Your light cannot be refilled.");
1650 void do_cmd_target(void)
1653 if (target_set(TARGET_KILL))
1656 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1658 msg_print("Target Selected.");
1663 /* Target aborted */
1667 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1669 msg_print("Target Aborted.");
1680 void do_cmd_look(void)
1683 if (target_set(TARGET_LOOK))
1686 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1688 msg_print("Target Selected.");
1697 * Allow the player to examine other sectors on the map
1699 void do_cmd_locate(void)
1701 int dir, y1, x1, y2, x2;
1710 get_screen_size(&wid, &hgt);
1713 /* Start at current panel */
1714 y2 = y1 = panel_row_min;
1715 x2 = x1 = panel_col_min;
1717 /* Show panels until done */
1720 /* Describe the location */
1721 if ((y2 == y1) && (x2 == x1))
1724 strcpy(tmp_val, "¿¿¾å");
1733 sprintf(tmp_val, "%s%s",
1734 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1735 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1737 sprintf(tmp_val, "%s%s of",
1738 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1739 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1744 /* Prepare to ask which way to look */
1747 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1749 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1752 y2 / (hgt / 2), y2 % (hgt / 2),
1753 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1755 /* Assume no direction */
1758 /* Get a direction */
1763 /* Get a command (or Cancel) */
1764 if (!get_com(out_val, &command, TRUE)) break;
1766 /* Extract the action (if any) */
1767 dir = get_keymap_dir(command);
1776 /* Apply the motion */
1777 if (change_panel(ddy[dir], ddx[dir]))
1785 /* Recenter the map around the player */
1789 p_ptr->update |= (PU_MONSTERS);
1792 p_ptr->redraw |= (PR_MAP);
1795 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1804 * Sorting hook -- Comp function -- see below
1806 * We use "u" to point to array of monster indexes,
1807 * and "v" to select the type of sorting to perform on "u".
1809 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1811 u16b *who = (u16b*)(u);
1813 u16b *why = (u16b*)(v);
1820 /* Sort by player kills */
1823 /* Extract player kills */
1824 z1 = r_info[w1].r_pkills;
1825 z2 = r_info[w2].r_pkills;
1827 /* Compare player kills */
1828 if (z1 < z2) return (TRUE);
1829 if (z1 > z2) return (FALSE);
1833 /* Sort by total kills */
1836 /* Extract total kills */
1837 z1 = r_info[w1].r_tkills;
1838 z2 = r_info[w2].r_tkills;
1840 /* Compare total kills */
1841 if (z1 < z2) return (TRUE);
1842 if (z1 > z2) return (FALSE);
1846 /* Sort by monster level */
1849 /* Extract levels */
1850 z1 = r_info[w1].level;
1851 z2 = r_info[w2].level;
1853 /* Compare levels */
1854 if (z1 < z2) return (TRUE);
1855 if (z1 > z2) return (FALSE);
1859 /* Sort by monster experience */
1862 /* Extract experience */
1863 z1 = r_info[w1].mexp;
1864 z2 = r_info[w2].mexp;
1866 /* Compare experience */
1867 if (z1 < z2) return (TRUE);
1868 if (z1 > z2) return (FALSE);
1872 /* Compare indexes */
1878 * Sorting hook -- Swap function -- see below
1880 * We use "u" to point to array of monster indexes,
1881 * and "v" to select the type of sorting to perform.
1883 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1885 u16b *who = (u16b*)(u);
1901 * Identify a character, allow recall of monsters
1903 * Several "special" responses recall "multiple" monsters:
1905 * ^U (all unique monsters)
1906 * ^N (all non-unique monsters)
1908 * The responses may be sorted in several ways, see below.
1910 * Note that the player ghosts are ignored. XXX XXX XXX
1912 void do_cmd_query_symbol(void)
1923 bool recall = FALSE;
1928 /* Get a character, or abort */
1930 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
1932 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1936 /* Find that character info, and describe it */
1937 for (i = 0; ident_info[i]; ++i)
1939 if (sym == ident_info[i][0]) break;
1943 if (sym == KTRL('A'))
1947 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1949 strcpy(buf, "Full monster list.");
1953 else if (sym == KTRL('U'))
1957 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1959 strcpy(buf, "Unique monster list.");
1963 else if (sym == KTRL('N'))
1967 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1969 strcpy(buf, "Non-unique monster list.");
1973 /* XTRA HACK WHATSEARCH */
1974 else if (sym == KTRL('M'))
1978 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
1980 if (!get_string("Enter name:",temp, 70))
1987 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
1989 sprintf(buf, "Monsters with a name \"%s\"",temp);
1992 else if (ident_info[i])
1994 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
1999 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2001 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2006 /* Display the result */
2009 /* Allocate the "who" array */
2010 C_MAKE(who, max_r_idx, u16b);
2012 /* Collect matching monsters */
2013 for (n = 0, i = 1; i < max_r_idx; i++)
2015 monster_race *r_ptr = &r_info[i];
2017 /* Nothing to recall */
2018 if (!cheat_know && !r_ptr->r_sights) continue;
2020 /* Require non-unique monsters if needed */
2021 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2023 /* Require unique monsters if needed */
2024 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2026 /* XTRA HACK WHATSEARCH */
2031 for (xx=0; temp[xx] && xx<80; xx++){
2033 if (iskanji( temp[xx])) { xx++; continue; }
2035 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2039 strcpy(temp2, r_name+r_ptr->E_name);
2041 strcpy(temp2, r_name+r_ptr->name);
2043 for (xx=0; temp2[xx] && xx<80; xx++)
2044 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2047 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
2049 if (strstr(temp2, temp))
2053 /* Collect "appropriate" monsters */
2054 if (all || (r_ptr->d_char == sym)) who[n++] = i;
2057 /* Nothing to recall */
2060 /* Free the "who" array */
2061 C_KILL(who, max_r_idx, u16b);
2067 /* Prompt XXX XXX XXX */
2069 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2071 put_str("Recall details? (k/y/n): ", 0, 40);
2083 /* Select the sort method */
2084 ang_sort_comp = ang_sort_comp_hook;
2085 ang_sort_swap = ang_sort_swap_hook;
2087 /* Sort the array */
2088 ang_sort(who, &why, n);
2090 /* Sort by kills (and level) */
2097 /* Catch "escape" */
2100 /* Free the "who" array */
2101 C_KILL(who, max_r_idx, u16b);
2106 /* Sort if needed */
2109 /* Select the sort method */
2110 ang_sort_comp = ang_sort_comp_hook;
2111 ang_sort_swap = ang_sort_swap_hook;
2113 /* Sort the array */
2114 ang_sort(who, &why, n);
2118 /* Start at the end */
2121 /* Scan the monster memory */
2124 /* Extract a race */
2127 /* Hack -- Auto-recall */
2128 monster_race_track(r_idx);
2130 /* Hack -- Handle stuff */
2139 /* Save the screen */
2142 /* Recall on screen */
2143 screen_roff(who[i], 0);
2146 /* Hack -- Begin the prompt */
2149 /* Hack -- Complete the prompt */
2151 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2153 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2166 /* Normal commands */
2167 if (query != 'r') break;
2174 if (query == ESCAPE) break;
2176 /* Move to "prev" monster */
2182 if (!expand_list) break;
2186 /* Move to "next" monster */
2192 if (!expand_list) break;
2197 /* Free the "who" array */
2198 C_KILL(who, max_r_idx, u16b);
2200 /* Re-display the identity */