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);
256 #if 1 /* EASY_RING -- TNB */
258 if ((o_ptr->tval == TV_RING) && inventory[INVEN_LEFT].k_idx &&
259 inventory[INVEN_RIGHT].k_idx)
261 /* Restrict the choices */
262 item_tester_tval = TV_RING;
263 item_tester_no_ryoute = TRUE;
265 /* Choose a ring from the equipment only */
267 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
269 q = "Replace which ring? ";
278 if (!get_item(&slot, q, s, (USE_EQUIP)))
282 #endif /* EASY_RING -- TNB */
284 if (((o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CARD) || (o_ptr->tval == TV_CAPTURE)) &&
285 buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
287 /* Restrict the choices */
288 item_tester_hook = item_tester_hook_melee_weapon;
289 item_tester_no_ryoute = TRUE;
291 /* Choose a weapon from the equipment only */
293 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
295 q = "Replace which weapon? ";
304 if (!get_item(&slot, q, s, (USE_EQUIP)))
306 if (slot == INVEN_RARM)
308 object_type *or_ptr = &inventory[INVEN_RARM];
309 object_type *ol_ptr = &inventory[INVEN_LARM];
310 object_type *otmp_ptr;
311 object_type object_tmp;
312 char ol_name[MAX_NLEN];
314 otmp_ptr = &object_tmp;
316 object_desc(ol_name, ol_ptr, FALSE, 0);
318 object_copy(otmp_ptr, ol_ptr);
319 object_copy(ol_ptr, or_ptr);
320 object_copy(or_ptr, otmp_ptr);
322 msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name, left_hander ? "º¸¼ê" : "±¦¼ê");
324 msg_format("You wield %s at %s hand.", ol_name, left_hander ? "left" : "right");
331 /* ÆóÅáή¤Ë¤¹¤ë¤«¤É¤¦¤« */
332 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) && (slot == INVEN_LARM))
335 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©"))
337 if (!get_check("Dual wielding? "))
344 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) &&
345 inventory[INVEN_LARM].k_idx &&
346 inventory[INVEN_RARM].k_idx)
348 /* Restrict the choices */
349 item_tester_hook = item_tester_hook_mochikae;
351 /* Choose a ring from the equipment only */
353 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
355 q = "Equip which hand? ";
364 if (!get_item(&slot, q, s, (USE_EQUIP)))
368 /* Prevent wielding into a cursed slot */
369 if (cursed_p(&inventory[slot]))
372 object_desc(o_name, &inventory[slot], FALSE, 0);
376 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
377 describe_use(slot) , o_name );
379 msg_format("The %s you are %s appears to be cursed.",
380 o_name, describe_use(slot));
384 /* Cancel the command */
388 if (cursed_p(o_ptr) && confirm_wear &&
389 (object_known_p(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
391 char dummy[MAX_NLEN+80];
394 object_desc(o_name, o_ptr, FALSE, 0);
397 sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
399 sprintf(dummy, "Really use the %s {cursed}? ", o_name);
403 if (!get_check(dummy))
407 if ((o_ptr->name1 == ART_STONEMASK) && object_known_p(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
409 char dummy[MAX_NLEN+80];
412 object_desc(o_name, o_ptr, FALSE, 0);
415 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
417 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
418 sprintf(dummy, "Do you become a vampire?");
422 if (!get_check(dummy))
426 /* Check if completed a quest */
427 for (i = 0; i < max_quests; i++)
429 if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
430 (quest[i].status == QUEST_STATUS_TAKEN) &&
431 (quest[i].k_idx == o_ptr->name1))
433 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
434 quest[i].status = QUEST_STATUS_COMPLETED;
435 quest[i].complev = (byte)p_ptr->lev;
437 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
439 msg_print("You completed the quest!");
446 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
448 identify_item(o_ptr);
450 /* Auto-inscription */
451 auto_inscribe_item(item, is_autopick(o_ptr));
457 /* Get local object */
460 /* Obtain local object */
461 object_copy(q_ptr, o_ptr);
463 /* Modify quantity */
466 /* Decrease the item (from the pack) */
469 inven_item_increase(item, -1);
470 inven_item_optimize(item);
473 /* Decrease the item (from the floor) */
476 floor_item_increase(0 - item, -1);
477 floor_item_optimize(0 - item);
480 /* Access the wield slot */
481 o_ptr = &inventory[slot];
483 /* Take off existing item */
486 /* Take off existing item */
487 (void)inven_takeoff(slot, 255);
490 /* Wear the new stuff */
491 object_copy(o_ptr, q_ptr);
493 /* Increase the weight */
494 p_ptr->total_weight += q_ptr->weight;
496 /* Increment the equip counter by hand */
499 /* Where is the item now */
500 if (slot == INVEN_RARM)
502 if((o_ptr->tval != TV_SHIELD) && (o_ptr->tval != TV_CAPTURE) && (o_ptr->tval != TV_CARD) && (empty_hands(FALSE) & 0x00000001) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
504 act = "¤òξ¼ê¤Ç¹½¤¨¤¿";
506 act = "You are wielding";
510 act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
512 act = "You are wielding";
516 else if (slot == INVEN_LARM)
519 act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
521 act = "You are wielding";
525 else if (slot == INVEN_BOW)
528 act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
530 act = "You are shooting with";
534 else if (slot == INVEN_LITE)
537 act = "¤ò¸÷¸»¤Ë¤·¤¿";
539 act = "Your light source is";
548 act = "You are wearing";
553 /* Describe the result */
554 object_desc(o_name, o_ptr, TRUE, 3);
558 msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
560 msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
567 /* Warn the player */
569 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
571 msg_print("Oops! It feels deathly cold!");
575 chg_virtue(V_HARMONY, -1);
578 o_ptr->ident |= (IDENT_SENSE);
581 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
584 if (p_ptr->prace < 32)
586 p_ptr->old_race1 |= 1L << p_ptr->prace;
590 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
592 p_ptr->prace = RACE_VAMPIRE;
594 msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
596 msg_format("You polymorphed into a vampire!");
599 rp_ptr = &race_info[p_ptr->prace];
601 /* Experience factor */
602 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
604 /* Calculate the height/weight for males */
605 if (p_ptr->psex == SEX_MALE)
607 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
608 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
609 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
610 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
613 /* Calculate the height/weight for females */
614 else if (p_ptr->psex == SEX_FEMALE)
616 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
617 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
618 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
619 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
625 if (p_ptr->pclass == CLASS_SORCERER)
626 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
628 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
630 do_cmd_rerate(FALSE);
632 p_ptr->redraw |= (PR_BASIC);
634 p_ptr->update |= (PU_BONUS);
640 /* Recalculate bonuses */
641 p_ptr->update |= (PU_BONUS);
643 /* Recalculate torch */
644 p_ptr->update |= (PU_TORCH);
646 /* Recalculate mana */
647 p_ptr->update |= (PU_MANA);
649 p_ptr->redraw |= (PR_EQUIPPY);
652 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
658 void kamaenaoshi(int item)
660 object_type *o_ptr, *o2_ptr;
661 char o_name[MAX_NLEN];
663 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
665 o_ptr = &inventory[INVEN_RARM];
666 o2_ptr = &inventory[INVEN_LARM];
667 object_copy(o_ptr, o2_ptr);
668 p_ptr->total_weight += o2_ptr->weight;
669 inven_item_increase(INVEN_LARM,-1);
670 inven_item_optimize(INVEN_LARM);
671 object_desc(o_name, o_ptr, TRUE, 3);
672 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
674 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
676 msg_format("You are wielding %s with two-handed.", o_name );
680 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
682 msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
685 else if ((item == INVEN_LARM) && buki_motteruka(INVEN_RARM))
687 o_ptr = &inventory[INVEN_RARM];
688 object_desc(o_name, o_ptr, TRUE, 3);
689 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
691 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
693 msg_format("You are wielding %s with two-handed.", o_name );
696 else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & 0x0002))
698 o_ptr = &inventory[INVEN_LARM];
699 o2_ptr = &inventory[INVEN_RARM];
700 object_copy(o_ptr, o2_ptr);
701 p_ptr->total_weight += o2_ptr->weight;
702 inven_item_increase(INVEN_RARM,-1);
703 inven_item_optimize(INVEN_RARM);
704 object_desc(o_name, o_ptr, TRUE, 3);
706 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name );
708 msg_format("You switched hand of %s.", o_name );
717 void do_cmd_takeoff(void)
725 if (p_ptr->special_defense & KATA_MUSOU)
727 set_action(ACTION_NONE);
730 item_tester_no_ryoute = TRUE;
733 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
734 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
736 q = "Take off which item? ";
737 s = "You are not wearing anything to take off.";
740 if (!get_item(&item, q, s, (USE_EQUIP))) return;
742 /* Get the item (in the pack) */
745 o_ptr = &inventory[item];
748 /* Get the item (on the floor) */
751 o_ptr = &o_list[0 - item];
758 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
762 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
764 msg_print("Hmmm, it seems to be cursed.");
771 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
774 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
776 msg_print("You teared a cursed equipment off by sheer strength!");
779 /* Hack -- Assume felt */
780 o_ptr->ident |= (IDENT_SENSE);
782 o_ptr->curse_flags = 0L;
785 o_ptr->feeling = FEEL_NONE;
787 /* Recalculate the bonuses */
788 p_ptr->update |= (PU_BONUS);
791 p_ptr->window |= (PW_EQUIP);
794 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
796 msg_print("You break the curse.");
802 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
804 msg_print("You couldn't remove the equipment.");
811 /* Take a partial turn */
814 /* Take off the item */
815 (void)inven_takeoff(item, 255);
821 p_ptr->redraw |= (PR_EQUIPPY);
828 void do_cmd_drop(void)
836 if (p_ptr->special_defense & KATA_MUSOU)
838 set_action(ACTION_NONE);
841 item_tester_no_ryoute = TRUE;
844 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
845 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
847 q = "Drop which item? ";
848 s = "You have nothing to drop.";
851 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
853 /* Get the item (in the pack) */
856 o_ptr = &inventory[item];
859 /* Get the item (on the floor) */
862 o_ptr = &o_list[0 - item];
866 /* Hack -- Cannot remove cursed items */
867 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
871 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
873 msg_print("Hmmm, it seems to be cursed.");
882 /* See how many items */
883 if (o_ptr->number > 1)
886 amt = get_quantity(NULL, o_ptr->number);
888 /* Allow user abort */
889 if (amt <= 0) return;
893 /* Take a partial turn */
896 /* Drop (some of) the item */
897 inven_drop(item, amt);
899 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
901 if (item >= INVEN_RARM) calc_android_exp();
903 p_ptr->redraw |= (PR_EQUIPPY);
907 static bool high_level_book(object_type *o_ptr)
909 if ((o_ptr->tval == TV_LIFE_BOOK) ||
910 (o_ptr->tval == TV_SORCERY_BOOK) ||
911 (o_ptr->tval == TV_NATURE_BOOK) ||
912 (o_ptr->tval == TV_CHAOS_BOOK) ||
913 (o_ptr->tval == TV_DEATH_BOOK) ||
914 (o_ptr->tval == TV_TRUMP_BOOK) ||
915 (o_ptr->tval == TV_ENCHANT_BOOK) ||
916 (o_ptr->tval == TV_DAEMON_BOOK) ||
917 (o_ptr->tval == TV_CRUSADE_BOOK) ||
918 (o_ptr->tval == TV_MUSIC_BOOK))
933 void do_cmd_destroy(void)
942 object_type *q_ptr = &forge;
944 char o_name[MAX_NLEN];
946 char out_val[MAX_NLEN+40];
950 if (p_ptr->special_defense & KATA_MUSOU)
952 set_action(ACTION_NONE);
955 /* Hack -- force destruction */
956 if (command_arg > 0) force = TRUE;
961 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
962 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
964 q = "Destroy which item? ";
965 s = "You have nothing to destroy.";
968 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
970 /* Get the item (in the pack) */
973 o_ptr = &inventory[item];
976 /* Get the item (on the floor) */
979 o_ptr = &o_list[0 - item];
983 /* See how many items */
984 if (o_ptr->number > 1)
987 amt = get_quantity(NULL, o_ptr->number);
989 /* Allow user abort */
990 if (amt <= 0) return;
994 /* Describe the object */
995 old_number = o_ptr->number;
997 object_desc(o_name, o_ptr, TRUE, 3);
998 o_ptr->number = old_number;
1000 /* Verify unless quantity given */
1003 if (confirm_destroy || (object_value(o_ptr) > 0))
1005 /* Make a verification */
1007 sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
1009 sprintf(out_val, "Really destroy %s? ", o_name);
1012 if (!get_check(out_val)) return;
1019 /* Artifacts cannot be destroyed */
1020 if (!can_player_destroy_object(o_ptr))
1026 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1028 msg_format("You cannot destroy %s.", o_name);
1035 object_copy(q_ptr, o_ptr);
1039 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1041 msg_format("You destroy %s.", o_name);
1044 sound(SOUND_DESTITEM);
1046 /* Reduce the charges of rods/wands */
1047 reduce_charges(o_ptr, amt);
1049 /* Eliminate the item (from the pack) */
1052 inven_item_increase(item, -amt);
1053 inven_item_describe(item);
1054 inven_item_optimize(item);
1057 /* Eliminate the item (from the floor) */
1060 floor_item_increase(0 - item, -amt);
1061 floor_item_describe(0 - item);
1062 floor_item_optimize(0 - item);
1065 if (high_level_book(q_ptr))
1067 bool gain_expr = FALSE;
1069 if (p_ptr->prace == RACE_ANDROID)
1072 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1076 else if (p_ptr->pclass == CLASS_PALADIN)
1078 if (is_good_realm(p_ptr->realm1))
1080 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1084 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1088 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1090 s32b tester_exp = p_ptr->max_exp / 20;
1091 if (tester_exp > 10000) tester_exp = 10000;
1092 if (q_ptr->sval < 3) tester_exp /= 4;
1093 if (tester_exp<1) tester_exp = 1;
1096 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1098 msg_print("You feel more experienced.");
1101 gain_exp(tester_exp * amt);
1103 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1105 chg_virtue(V_UNLIFE, 1);
1106 chg_virtue(V_VITALITY, -1);
1108 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1110 chg_virtue(V_UNLIFE, -1);
1111 chg_virtue(V_VITALITY, 1);
1114 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1115 chg_virtue(V_ENCHANT, -1);
1117 if (object_value_real(q_ptr) > 30000)
1118 chg_virtue(V_SACRIFICE, 2);
1120 else if (object_value_real(q_ptr) > 10000)
1121 chg_virtue(V_SACRIFICE, 1);
1124 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1125 chg_virtue(V_HARMONY, 1);
1127 if (item >= INVEN_RARM) calc_android_exp();
1132 * Observe an item which has been *identify*-ed
1134 void do_cmd_observe(void)
1140 char o_name[MAX_NLEN];
1144 item_tester_no_ryoute = TRUE;
1147 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1148 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1150 q = "Examine which item? ";
1151 s = "You have nothing to examine.";
1154 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1156 /* Get the item (in the pack) */
1159 o_ptr = &inventory[item];
1162 /* Get the item (on the floor) */
1165 o_ptr = &o_list[0 - item];
1169 /* Require full knowledge */
1170 if (!(o_ptr->ident & IDENT_MENTAL))
1173 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1175 msg_print("You have no special knowledge about that item.");
1183 object_desc(o_name, o_ptr, TRUE, 3);
1187 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1189 msg_format("Examining %s...", o_name);
1192 /* Describe it fully */
1194 if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1196 if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
1204 * Remove the inscription from an object
1205 * XXX Mention item (when done)?
1207 void do_cmd_uninscribe(void)
1215 item_tester_no_ryoute = TRUE;
1218 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1219 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1221 q = "Un-inscribe which item? ";
1222 s = "You have nothing to un-inscribe.";
1225 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1227 /* Get the item (in the pack) */
1230 o_ptr = &inventory[item];
1233 /* Get the item (on the floor) */
1236 o_ptr = &o_list[0 - item];
1239 /* Nothing to remove */
1240 if (!o_ptr->inscription)
1243 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1245 msg_print("That item had no inscription to remove.");
1253 msg_print("Ìäò¾Ã¤·¤¿¡£");
1255 msg_print("Inscription removed.");
1259 /* Remove the incription */
1260 o_ptr->inscription = 0;
1262 /* Combine the pack */
1263 p_ptr->notice |= (PN_COMBINE);
1266 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1268 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1269 p_ptr->update |= (PU_BONUS);
1275 * Inscribe an object with a comment
1277 void do_cmd_inscribe(void)
1283 char o_name[MAX_NLEN];
1289 item_tester_no_ryoute = TRUE;
1292 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1293 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1295 q = "Inscribe which item? ";
1296 s = "You have nothing to inscribe.";
1299 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1301 /* Get the item (in the pack) */
1304 o_ptr = &inventory[item];
1307 /* Get the item (on the floor) */
1310 o_ptr = &o_list[0 - item];
1313 /* Describe the activity */
1314 object_desc(o_name, o_ptr, TRUE, 2);
1318 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1320 msg_format("Inscribing %s.", o_name);
1325 /* Start with nothing */
1326 strcpy(out_val, "");
1328 /* Use old inscription */
1329 if (o_ptr->inscription)
1331 /* Start with the old inscription */
1332 strcpy(out_val, quark_str(o_ptr->inscription));
1335 /* Get a new inscription (possibly empty) */
1337 if (get_string("ÌÃ: ", out_val, 80))
1339 if (get_string("Inscription: ", out_val, 80))
1342 /* Save the inscription */
1343 o_ptr->inscription = quark_add(out_val);
1345 /* Combine the pack */
1346 p_ptr->notice |= (PN_COMBINE);
1349 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1351 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1352 p_ptr->update |= (PU_BONUS);
1359 * An "item_tester_hook" for refilling lanterns
1361 static bool item_tester_refill_lantern(object_type *o_ptr)
1363 /* Flasks of oil are okay */
1364 if (o_ptr->tval == TV_FLASK) return (TRUE);
1366 /* Laterns are okay */
1367 if ((o_ptr->tval == TV_LITE) &&
1368 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1370 /* Assume not okay */
1376 * Refill the players lamp (from the pack or floor)
1378 static void do_cmd_refill_lamp(void)
1388 /* Restrict the choices */
1389 item_tester_hook = item_tester_refill_lantern;
1393 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1394 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1396 q = "Refill with which flask? ";
1397 s = "You have no flasks of oil.";
1400 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1402 /* Get the item (in the pack) */
1405 o_ptr = &inventory[item];
1408 /* Get the item (on the floor) */
1411 o_ptr = &o_list[0 - item];
1415 /* Take a partial turn */
1418 /* Access the lantern */
1419 j_ptr = &inventory[INVEN_LITE];
1422 j_ptr->xtra4 += o_ptr->xtra4;
1426 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1428 msg_print("You fuel your lamp.");
1432 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1436 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1438 msg_print("Your lamp has gone out!");
1441 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1445 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1447 msg_print("Curiously, your lamp doesn't light.");
1450 else if (j_ptr->xtra4 >= FUEL_LAMP)
1452 j_ptr->xtra4 = FUEL_LAMP;
1454 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1456 msg_print("Your lamp is full.");
1461 /* Decrease the item (from the pack) */
1464 inven_item_increase(item, -1);
1465 inven_item_describe(item);
1466 inven_item_optimize(item);
1469 /* Decrease the item (from the floor) */
1472 floor_item_increase(0 - item, -1);
1473 floor_item_describe(0 - item);
1474 floor_item_optimize(0 - item);
1477 /* Recalculate torch */
1478 p_ptr->update |= (PU_TORCH);
1483 * An "item_tester_hook" for refilling torches
1485 static bool item_tester_refill_torch(object_type *o_ptr)
1487 /* Torches are okay */
1488 if ((o_ptr->tval == TV_LITE) &&
1489 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1491 /* Assume not okay */
1497 * Refuel the players torch (from the pack or floor)
1499 static void do_cmd_refill_torch(void)
1509 /* Restrict the choices */
1510 item_tester_hook = item_tester_refill_torch;
1514 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1515 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1517 q = "Refuel with which torch? ";
1518 s = "You have no extra torches.";
1521 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1523 /* Get the item (in the pack) */
1526 o_ptr = &inventory[item];
1529 /* Get the item (on the floor) */
1532 o_ptr = &o_list[0 - item];
1536 /* Take a partial turn */
1539 /* Access the primary torch */
1540 j_ptr = &inventory[INVEN_LITE];
1543 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1547 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1549 msg_print("You combine the torches.");
1554 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1558 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1560 msg_print("Your torch has gone out!");
1563 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1567 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1569 msg_print("Curiously, your torche don't light.");
1572 /* Over-fuel message */
1573 else if (j_ptr->xtra4 >= FUEL_TORCH)
1575 j_ptr->xtra4 = FUEL_TORCH;
1577 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1579 msg_print("Your torch is fully fueled.");
1584 /* Refuel message */
1588 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1590 msg_print("Your torch glows more brightly.");
1595 /* Decrease the item (from the pack) */
1598 inven_item_increase(item, -1);
1599 inven_item_describe(item);
1600 inven_item_optimize(item);
1603 /* Decrease the item (from the floor) */
1606 floor_item_increase(0 - item, -1);
1607 floor_item_describe(0 - item);
1608 floor_item_optimize(0 - item);
1611 /* Recalculate torch */
1612 p_ptr->update |= (PU_TORCH);
1617 * Refill the players lamp, or restock his torches
1619 void do_cmd_refill(void)
1624 o_ptr = &inventory[INVEN_LITE];
1626 if (p_ptr->special_defense & KATA_MUSOU)
1628 set_action(ACTION_NONE);
1632 if (o_ptr->tval != TV_LITE)
1635 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1637 msg_print("You are not wielding a light.");
1643 else if (o_ptr->sval == SV_LITE_LANTERN)
1645 do_cmd_refill_lamp();
1649 else if (o_ptr->sval == SV_LITE_TORCH)
1651 do_cmd_refill_torch();
1654 /* No torch to refill */
1658 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1660 msg_print("Your light cannot be refilled.");
1670 void do_cmd_target(void)
1673 if (target_set(TARGET_KILL))
1676 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1678 msg_print("Target Selected.");
1683 /* Target aborted */
1687 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1689 msg_print("Target Aborted.");
1700 void do_cmd_look(void)
1703 if (target_set(TARGET_LOOK))
1706 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1708 msg_print("Target Selected.");
1717 * Allow the player to examine other sectors on the map
1719 void do_cmd_locate(void)
1721 int dir, y1, x1, y2, x2;
1730 get_screen_size(&wid, &hgt);
1733 /* Start at current panel */
1734 y2 = y1 = panel_row_min;
1735 x2 = x1 = panel_col_min;
1737 /* Show panels until done */
1740 /* Describe the location */
1741 if ((y2 == y1) && (x2 == x1))
1744 strcpy(tmp_val, "¿¿¾å");
1753 sprintf(tmp_val, "%s%s",
1754 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1755 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1757 sprintf(tmp_val, "%s%s of",
1758 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1759 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1764 /* Prepare to ask which way to look */
1767 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1769 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1772 y2 / (hgt / 2), y2 % (hgt / 2),
1773 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1775 /* Assume no direction */
1778 /* Get a direction */
1783 /* Get a command (or Cancel) */
1784 if (!get_com(out_val, &command, TRUE)) break;
1786 /* Extract the action (if any) */
1787 dir = get_keymap_dir(command);
1796 /* Apply the motion */
1797 if (change_panel(ddy[dir], ddx[dir]))
1805 /* Recenter the map around the player */
1809 p_ptr->update |= (PU_MONSTERS);
1812 p_ptr->redraw |= (PR_MAP);
1815 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1824 * Sorting hook -- Comp function -- see below
1826 * We use "u" to point to array of monster indexes,
1827 * and "v" to select the type of sorting to perform on "u".
1829 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1831 u16b *who = (u16b*)(u);
1833 u16b *why = (u16b*)(v);
1840 /* Sort by player kills */
1843 /* Extract player kills */
1844 z1 = r_info[w1].r_pkills;
1845 z2 = r_info[w2].r_pkills;
1847 /* Compare player kills */
1848 if (z1 < z2) return (TRUE);
1849 if (z1 > z2) return (FALSE);
1853 /* Sort by total kills */
1856 /* Extract total kills */
1857 z1 = r_info[w1].r_tkills;
1858 z2 = r_info[w2].r_tkills;
1860 /* Compare total kills */
1861 if (z1 < z2) return (TRUE);
1862 if (z1 > z2) return (FALSE);
1866 /* Sort by monster level */
1869 /* Extract levels */
1870 z1 = r_info[w1].level;
1871 z2 = r_info[w2].level;
1873 /* Compare levels */
1874 if (z1 < z2) return (TRUE);
1875 if (z1 > z2) return (FALSE);
1879 /* Sort by monster experience */
1882 /* Extract experience */
1883 z1 = r_info[w1].mexp;
1884 z2 = r_info[w2].mexp;
1886 /* Compare experience */
1887 if (z1 < z2) return (TRUE);
1888 if (z1 > z2) return (FALSE);
1892 /* Compare indexes */
1898 * Sorting hook -- Swap function -- see below
1900 * We use "u" to point to array of monster indexes,
1901 * and "v" to select the type of sorting to perform.
1903 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1905 u16b *who = (u16b*)(u);
1921 * Identify a character, allow recall of monsters
1923 * Several "special" responses recall "multiple" monsters:
1925 * ^U (all unique monsters)
1926 * ^N (all non-unique monsters)
1928 * The responses may be sorted in several ways, see below.
1930 * Note that the player ghosts are ignored. XXX XXX XXX
1932 void do_cmd_query_symbol(void)
1943 bool recall = FALSE;
1948 /* Get a character, or abort */
1950 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
1952 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1956 /* Find that character info, and describe it */
1957 for (i = 0; ident_info[i]; ++i)
1959 if (sym == ident_info[i][0]) break;
1963 if (sym == KTRL('A'))
1967 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1969 strcpy(buf, "Full monster list.");
1973 else if (sym == KTRL('U'))
1977 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1979 strcpy(buf, "Unique monster list.");
1983 else if (sym == KTRL('N'))
1987 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
1989 strcpy(buf, "Non-unique monster list.");
1993 /* XTRA HACK WHATSEARCH */
1994 else if (sym == KTRL('M'))
1998 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2000 if (!get_string("Enter name:",temp, 70))
2007 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2009 sprintf(buf, "Monsters with a name \"%s\"",temp);
2012 else if (ident_info[i])
2014 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2019 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2021 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2026 /* Display the result */
2029 /* Allocate the "who" array */
2030 C_MAKE(who, max_r_idx, u16b);
2032 /* Collect matching monsters */
2033 for (n = 0, i = 1; i < max_r_idx; i++)
2035 monster_race *r_ptr = &r_info[i];
2037 /* Nothing to recall */
2038 if (!cheat_know && !r_ptr->r_sights) continue;
2040 /* Require non-unique monsters if needed */
2041 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2043 /* Require unique monsters if needed */
2044 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2046 /* XTRA HACK WHATSEARCH */
2051 for (xx=0; temp[xx] && xx<80; xx++){
2053 if (iskanji( temp[xx])) { xx++; continue; }
2055 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2059 strcpy(temp2, r_name+r_ptr->E_name);
2061 strcpy(temp2, r_name+r_ptr->name);
2063 for (xx=0; temp2[xx] && xx<80; xx++)
2064 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2067 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
2069 if (strstr(temp2, temp))
2073 /* Collect "appropriate" monsters */
2074 if (all || (r_ptr->d_char == sym)) who[n++] = i;
2077 /* Nothing to recall */
2080 /* Free the "who" array */
2081 C_KILL(who, max_r_idx, u16b);
2087 /* Prompt XXX XXX XXX */
2089 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2091 put_str("Recall details? (k/y/n): ", 0, 40);
2103 /* Select the sort method */
2104 ang_sort_comp = ang_sort_comp_hook;
2105 ang_sort_swap = ang_sort_swap_hook;
2107 /* Sort the array */
2108 ang_sort(who, &why, n);
2110 /* Sort by kills (and level) */
2117 /* Catch "escape" */
2120 /* Free the "who" array */
2121 C_KILL(who, max_r_idx, u16b);
2126 /* Sort if needed */
2129 /* Select the sort method */
2130 ang_sort_comp = ang_sort_comp_hook;
2131 ang_sort_swap = ang_sort_swap_hook;
2133 /* Sort the array */
2134 ang_sort(who, &why, n);
2138 /* Start at the end */
2141 /* Scan the monster memory */
2144 /* Extract a race */
2147 /* Hack -- Auto-recall */
2148 monster_race_track(r_idx);
2150 /* Hack -- Handle stuff */
2159 /* Save the screen */
2162 /* Recall on screen */
2163 screen_roff(who[i], 0);
2166 /* Hack -- Begin the prompt */
2169 /* Hack -- Complete the prompt */
2171 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2173 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2186 /* Normal commands */
2187 if (query != 'r') break;
2194 if (query == ESCAPE) break;
2196 /* Move to "prev" monster */
2202 if (!expand_list) break;
2206 /* Move to "next" monster */
2212 if (!expand_list) break;
2217 /* Free the "who" array */
2218 C_KILL(who, max_r_idx, u16b);
2220 /* Re-display the identity */