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 */
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 = "¤òξ¼ê¤Ç¹½¤¨¤¿";
493 act = "You are wielding";
497 act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
499 act = "You are wielding";
505 act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
507 act = "You are wielding";
513 act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
515 act = "You are shooting with";
521 act = "¤ò¸÷¸»¤Ë¤·¤¿";
523 act = "Your light source is";
531 act = "You are wearing";
536 /* Describe the result */
537 object_desc(o_name, o_ptr, TRUE, 3);
541 msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
543 msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
550 /* Warn the player */
552 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
554 msg_print("Oops! It feels deathly cold!");
558 chg_virtue(V_HARMONY, -1);
561 o_ptr->ident |= (IDENT_SENSE);
564 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
567 if (p_ptr->prace < 32)
569 p_ptr->old_race1 |= 1L << p_ptr->prace;
573 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
575 p_ptr->prace = RACE_VAMPIRE;
577 msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
579 msg_format("You polymorphed into a vampire!");
582 rp_ptr = &race_info[p_ptr->prace];
584 /* Experience factor */
585 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
587 /* Calculate the height/weight for males */
588 if (p_ptr->psex == SEX_MALE)
590 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
591 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
592 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
593 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
596 /* Calculate the height/weight for females */
597 else if (p_ptr->psex == SEX_FEMALE)
599 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
600 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
601 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
602 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
608 if (p_ptr->pclass == CLASS_SORCERER)
609 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
611 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
613 do_cmd_rerate(FALSE);
615 p_ptr->redraw |= (PR_BASIC);
617 p_ptr->update |= (PU_BONUS);
623 /* Recalculate bonuses */
624 p_ptr->update |= (PU_BONUS);
626 /* Recalculate torch */
627 p_ptr->update |= (PU_TORCH);
629 /* Recalculate mana */
630 p_ptr->update |= (PU_MANA);
632 p_ptr->redraw |= (PR_EQUIPPY);
635 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
641 void kamaenaoshi(int item)
643 object_type *o_ptr, *o2_ptr;
644 char o_name[MAX_NLEN];
646 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
648 o_ptr = &inventory[INVEN_RARM];
649 o2_ptr = &inventory[INVEN_LARM];
650 object_copy(o_ptr, o2_ptr);
651 p_ptr->total_weight += o2_ptr->weight;
652 inven_item_increase(INVEN_LARM,-1);
653 inven_item_optimize(INVEN_LARM);
654 object_desc(o_name, o_ptr, TRUE, 3);
655 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
657 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
659 msg_format("You are wielding %s with two-handed.", o_name );
663 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
665 msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
668 else if (item == INVEN_LARM)
670 if (buki_motteruka(INVEN_RARM))
672 o_ptr = &inventory[INVEN_RARM];
673 object_desc(o_name, o_ptr, TRUE, 3);
674 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
676 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
678 msg_format("You are wielding %s with two-handed.", o_name );
681 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM))
683 o_ptr = &inventory[INVEN_LARM];
684 o2_ptr = &inventory[INVEN_RARM];
685 object_copy(o_ptr, o2_ptr);
686 p_ptr->total_weight += o2_ptr->weight;
687 inven_item_increase(INVEN_RARM,-1);
688 inven_item_optimize(INVEN_RARM);
689 object_desc(o_name, o_ptr, TRUE, 3);
691 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
693 msg_format("You switched hand of %s.", o_name);
703 void do_cmd_takeoff(void)
711 if (p_ptr->special_defense & KATA_MUSOU)
713 set_action(ACTION_NONE);
716 item_tester_no_ryoute = TRUE;
719 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
720 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
722 q = "Take off which item? ";
723 s = "You are not wearing anything to take off.";
726 if (!get_item(&item, q, s, (USE_EQUIP))) return;
728 /* Get the item (in the pack) */
731 o_ptr = &inventory[item];
734 /* Get the item (on the floor) */
737 o_ptr = &o_list[0 - item];
744 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
748 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
750 msg_print("Hmmm, it seems to be cursed.");
757 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
760 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
762 msg_print("You teared a cursed equipment off by sheer strength!");
765 /* Hack -- Assume felt */
766 o_ptr->ident |= (IDENT_SENSE);
768 o_ptr->curse_flags = 0L;
771 o_ptr->feeling = FEEL_NONE;
773 /* Recalculate the bonuses */
774 p_ptr->update |= (PU_BONUS);
777 p_ptr->window |= (PW_EQUIP);
780 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
782 msg_print("You break the curse.");
788 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
790 msg_print("You couldn't remove the equipment.");
797 /* Take a partial turn */
800 /* Take off the item */
801 (void)inven_takeoff(item, 255);
807 p_ptr->redraw |= (PR_EQUIPPY);
814 void do_cmd_drop(void)
822 if (p_ptr->special_defense & KATA_MUSOU)
824 set_action(ACTION_NONE);
827 item_tester_no_ryoute = TRUE;
830 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
831 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
833 q = "Drop which item? ";
834 s = "You have nothing to drop.";
837 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
839 /* Get the item (in the pack) */
842 o_ptr = &inventory[item];
845 /* Get the item (on the floor) */
848 o_ptr = &o_list[0 - item];
852 /* Hack -- Cannot remove cursed items */
853 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
857 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
859 msg_print("Hmmm, it seems to be cursed.");
868 /* See how many items */
869 if (o_ptr->number > 1)
872 amt = get_quantity(NULL, o_ptr->number);
874 /* Allow user abort */
875 if (amt <= 0) return;
879 /* Take a partial turn */
882 /* Drop (some of) the item */
883 inven_drop(item, amt);
885 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
887 if (item >= INVEN_RARM) calc_android_exp();
889 p_ptr->redraw |= (PR_EQUIPPY);
893 static bool high_level_book(object_type *o_ptr)
895 if ((o_ptr->tval == TV_LIFE_BOOK) ||
896 (o_ptr->tval == TV_SORCERY_BOOK) ||
897 (o_ptr->tval == TV_NATURE_BOOK) ||
898 (o_ptr->tval == TV_CHAOS_BOOK) ||
899 (o_ptr->tval == TV_DEATH_BOOK) ||
900 (o_ptr->tval == TV_TRUMP_BOOK) ||
901 (o_ptr->tval == TV_ENCHANT_BOOK) ||
902 (o_ptr->tval == TV_DAEMON_BOOK) ||
903 (o_ptr->tval == TV_CRUSADE_BOOK) ||
904 (o_ptr->tval == TV_MUSIC_BOOK))
919 void do_cmd_destroy(void)
928 object_type *q_ptr = &forge;
930 char o_name[MAX_NLEN];
932 char out_val[MAX_NLEN+40];
936 if (p_ptr->special_defense & KATA_MUSOU)
938 set_action(ACTION_NONE);
941 /* Hack -- force destruction */
942 if (command_arg > 0) force = TRUE;
947 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
948 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
950 q = "Destroy which item? ";
951 s = "You have nothing to destroy.";
954 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
956 /* Get the item (in the pack) */
959 o_ptr = &inventory[item];
962 /* Get the item (on the floor) */
965 o_ptr = &o_list[0 - item];
969 /* See how many items */
970 if (o_ptr->number > 1)
973 amt = get_quantity(NULL, o_ptr->number);
975 /* Allow user abort */
976 if (amt <= 0) return;
980 /* Describe the object */
981 old_number = o_ptr->number;
983 object_desc(o_name, o_ptr, TRUE, 3);
984 o_ptr->number = old_number;
986 /* Verify unless quantity given */
987 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
991 /* Make a verification */
994 "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
996 "Really destroy %s? [y/n/Auto]",
1005 /* HACK : Add the line to message buffer */
1006 message_add(out_val);
1007 p_ptr->window |= (PW_MESSAGE);
1010 /* Get an acceptable answer */
1015 if (i == 'y' || i == 'Y')
1020 if (i == ESCAPE || i == 'n' || i == 'N')
1026 if (i == 'a' || i == 'A')
1030 /* Add an auto-destroy preference line */
1031 if (add_auto_register(o_ptr))
1033 /* Auto-destroy it */
1034 idx = is_autopick(o_ptr);
1035 auto_destroy_item(item, idx);
1038 /* The object is already destroyed. */
1046 /* Erase the prompt */
1056 /* Artifacts cannot be destroyed */
1057 if (!can_player_destroy_object(o_ptr))
1063 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1065 msg_format("You cannot destroy %s.", o_name);
1072 object_copy(q_ptr, o_ptr);
1076 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1078 msg_format("You destroy %s.", o_name);
1081 sound(SOUND_DESTITEM);
1083 /* Reduce the charges of rods/wands */
1084 reduce_charges(o_ptr, amt);
1086 /* Eliminate the item (from the pack) */
1089 inven_item_increase(item, -amt);
1090 inven_item_describe(item);
1091 inven_item_optimize(item);
1094 /* Eliminate the item (from the floor) */
1097 floor_item_increase(0 - item, -amt);
1098 floor_item_describe(0 - item);
1099 floor_item_optimize(0 - item);
1102 if (high_level_book(q_ptr))
1104 bool gain_expr = FALSE;
1106 if (p_ptr->prace == RACE_ANDROID)
1109 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1113 else if (p_ptr->pclass == CLASS_PALADIN)
1115 if (is_good_realm(p_ptr->realm1))
1117 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1121 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1125 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1127 s32b tester_exp = p_ptr->max_exp / 20;
1128 if (tester_exp > 10000) tester_exp = 10000;
1129 if (q_ptr->sval < 3) tester_exp /= 4;
1130 if (tester_exp<1) tester_exp = 1;
1133 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1135 msg_print("You feel more experienced.");
1138 gain_exp(tester_exp * amt);
1140 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1142 chg_virtue(V_UNLIFE, 1);
1143 chg_virtue(V_VITALITY, -1);
1145 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1147 chg_virtue(V_UNLIFE, -1);
1148 chg_virtue(V_VITALITY, 1);
1151 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1152 chg_virtue(V_ENCHANT, -1);
1154 if (object_value_real(q_ptr) > 30000)
1155 chg_virtue(V_SACRIFICE, 2);
1157 else if (object_value_real(q_ptr) > 10000)
1158 chg_virtue(V_SACRIFICE, 1);
1161 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1162 chg_virtue(V_HARMONY, 1);
1164 if (item >= INVEN_RARM) calc_android_exp();
1169 * Observe an item which has been *identify*-ed
1171 void do_cmd_observe(void)
1177 char o_name[MAX_NLEN];
1181 item_tester_no_ryoute = TRUE;
1184 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1185 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1187 q = "Examine which item? ";
1188 s = "You have nothing to examine.";
1191 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1193 /* Get the item (in the pack) */
1196 o_ptr = &inventory[item];
1199 /* Get the item (on the floor) */
1202 o_ptr = &o_list[0 - item];
1206 /* Require full knowledge */
1207 if (!(o_ptr->ident & IDENT_MENTAL))
1210 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1212 msg_print("You have no special knowledge about that item.");
1220 object_desc(o_name, o_ptr, TRUE, 3);
1224 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1226 msg_format("Examining %s...", o_name);
1229 /* Describe it fully */
1231 if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1233 if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
1241 * Remove the inscription from an object
1242 * XXX Mention item (when done)?
1244 void do_cmd_uninscribe(void)
1252 item_tester_no_ryoute = TRUE;
1255 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1256 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1258 q = "Un-inscribe which item? ";
1259 s = "You have nothing to un-inscribe.";
1262 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1264 /* Get the item (in the pack) */
1267 o_ptr = &inventory[item];
1270 /* Get the item (on the floor) */
1273 o_ptr = &o_list[0 - item];
1276 /* Nothing to remove */
1277 if (!o_ptr->inscription)
1280 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1282 msg_print("That item had no inscription to remove.");
1290 msg_print("Ìäò¾Ã¤·¤¿¡£");
1292 msg_print("Inscription removed.");
1296 /* Remove the incription */
1297 o_ptr->inscription = 0;
1299 /* Combine the pack */
1300 p_ptr->notice |= (PN_COMBINE);
1303 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1305 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1306 p_ptr->update |= (PU_BONUS);
1312 * Inscribe an object with a comment
1314 void do_cmd_inscribe(void)
1320 char o_name[MAX_NLEN];
1326 item_tester_no_ryoute = TRUE;
1329 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1330 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1332 q = "Inscribe which item? ";
1333 s = "You have nothing to inscribe.";
1336 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1338 /* Get the item (in the pack) */
1341 o_ptr = &inventory[item];
1344 /* Get the item (on the floor) */
1347 o_ptr = &o_list[0 - item];
1350 /* Describe the activity */
1351 object_desc(o_name, o_ptr, TRUE, 2);
1355 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1357 msg_format("Inscribing %s.", o_name);
1362 /* Start with nothing */
1363 strcpy(out_val, "");
1365 /* Use old inscription */
1366 if (o_ptr->inscription)
1368 /* Start with the old inscription */
1369 strcpy(out_val, quark_str(o_ptr->inscription));
1372 /* Get a new inscription (possibly empty) */
1374 if (get_string("ÌÃ: ", out_val, 80))
1376 if (get_string("Inscription: ", out_val, 80))
1379 /* Save the inscription */
1380 o_ptr->inscription = quark_add(out_val);
1382 /* Combine the pack */
1383 p_ptr->notice |= (PN_COMBINE);
1386 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1388 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1389 p_ptr->update |= (PU_BONUS);
1396 * An "item_tester_hook" for refilling lanterns
1398 static bool item_tester_refill_lantern(object_type *o_ptr)
1400 /* Flasks of oil are okay */
1401 if (o_ptr->tval == TV_FLASK) return (TRUE);
1403 /* Laterns are okay */
1404 if ((o_ptr->tval == TV_LITE) &&
1405 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1407 /* Assume not okay */
1413 * Refill the players lamp (from the pack or floor)
1415 static void do_cmd_refill_lamp(void)
1425 /* Restrict the choices */
1426 item_tester_hook = item_tester_refill_lantern;
1430 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1431 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1433 q = "Refill with which flask? ";
1434 s = "You have no flasks of oil.";
1437 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1439 /* Get the item (in the pack) */
1442 o_ptr = &inventory[item];
1445 /* Get the item (on the floor) */
1448 o_ptr = &o_list[0 - item];
1452 /* Take a partial turn */
1455 /* Access the lantern */
1456 j_ptr = &inventory[INVEN_LITE];
1459 j_ptr->xtra4 += o_ptr->xtra4;
1463 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1465 msg_print("You fuel your lamp.");
1469 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1473 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1475 msg_print("Your lamp has gone out!");
1478 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1482 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1484 msg_print("Curiously, your lamp doesn't light.");
1487 else if (j_ptr->xtra4 >= FUEL_LAMP)
1489 j_ptr->xtra4 = FUEL_LAMP;
1491 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1493 msg_print("Your lamp is full.");
1498 /* Decrease the item (from the pack) */
1501 inven_item_increase(item, -1);
1502 inven_item_describe(item);
1503 inven_item_optimize(item);
1506 /* Decrease the item (from the floor) */
1509 floor_item_increase(0 - item, -1);
1510 floor_item_describe(0 - item);
1511 floor_item_optimize(0 - item);
1514 /* Recalculate torch */
1515 p_ptr->update |= (PU_TORCH);
1520 * An "item_tester_hook" for refilling torches
1522 static bool item_tester_refill_torch(object_type *o_ptr)
1524 /* Torches are okay */
1525 if ((o_ptr->tval == TV_LITE) &&
1526 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1528 /* Assume not okay */
1534 * Refuel the players torch (from the pack or floor)
1536 static void do_cmd_refill_torch(void)
1546 /* Restrict the choices */
1547 item_tester_hook = item_tester_refill_torch;
1551 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1552 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1554 q = "Refuel with which torch? ";
1555 s = "You have no extra torches.";
1558 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1560 /* Get the item (in the pack) */
1563 o_ptr = &inventory[item];
1566 /* Get the item (on the floor) */
1569 o_ptr = &o_list[0 - item];
1573 /* Take a partial turn */
1576 /* Access the primary torch */
1577 j_ptr = &inventory[INVEN_LITE];
1580 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1584 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1586 msg_print("You combine the torches.");
1591 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1595 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1597 msg_print("Your torch has gone out!");
1600 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1604 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1606 msg_print("Curiously, your torche don't light.");
1609 /* Over-fuel message */
1610 else if (j_ptr->xtra4 >= FUEL_TORCH)
1612 j_ptr->xtra4 = FUEL_TORCH;
1614 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1616 msg_print("Your torch is fully fueled.");
1621 /* Refuel message */
1625 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1627 msg_print("Your torch glows more brightly.");
1632 /* Decrease the item (from the pack) */
1635 inven_item_increase(item, -1);
1636 inven_item_describe(item);
1637 inven_item_optimize(item);
1640 /* Decrease the item (from the floor) */
1643 floor_item_increase(0 - item, -1);
1644 floor_item_describe(0 - item);
1645 floor_item_optimize(0 - item);
1648 /* Recalculate torch */
1649 p_ptr->update |= (PU_TORCH);
1654 * Refill the players lamp, or restock his torches
1656 void do_cmd_refill(void)
1661 o_ptr = &inventory[INVEN_LITE];
1663 if (p_ptr->special_defense & KATA_MUSOU)
1665 set_action(ACTION_NONE);
1669 if (o_ptr->tval != TV_LITE)
1672 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1674 msg_print("You are not wielding a light.");
1680 else if (o_ptr->sval == SV_LITE_LANTERN)
1682 do_cmd_refill_lamp();
1686 else if (o_ptr->sval == SV_LITE_TORCH)
1688 do_cmd_refill_torch();
1691 /* No torch to refill */
1695 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1697 msg_print("Your light cannot be refilled.");
1707 void do_cmd_target(void)
1710 if (target_set(TARGET_KILL))
1713 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1715 msg_print("Target Selected.");
1720 /* Target aborted */
1724 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1726 msg_print("Target Aborted.");
1737 void do_cmd_look(void)
1740 if (target_set(TARGET_LOOK))
1743 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1745 msg_print("Target Selected.");
1754 * Allow the player to examine other sectors on the map
1756 void do_cmd_locate(void)
1758 int dir, y1, x1, y2, x2;
1767 get_screen_size(&wid, &hgt);
1770 /* Start at current panel */
1771 y2 = y1 = panel_row_min;
1772 x2 = x1 = panel_col_min;
1774 /* Show panels until done */
1777 /* Describe the location */
1778 if ((y2 == y1) && (x2 == x1))
1781 strcpy(tmp_val, "¿¿¾å");
1790 sprintf(tmp_val, "%s%s",
1791 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1792 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1794 sprintf(tmp_val, "%s%s of",
1795 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1796 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1801 /* Prepare to ask which way to look */
1804 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1806 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1809 y2 / (hgt / 2), y2 % (hgt / 2),
1810 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1812 /* Assume no direction */
1815 /* Get a direction */
1820 /* Get a command (or Cancel) */
1821 if (!get_com(out_val, &command, TRUE)) break;
1823 /* Extract the action (if any) */
1824 dir = get_keymap_dir(command);
1833 /* Apply the motion */
1834 if (change_panel(ddy[dir], ddx[dir]))
1842 /* Recenter the map around the player */
1846 p_ptr->update |= (PU_MONSTERS);
1849 p_ptr->redraw |= (PR_MAP);
1852 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1861 * Sorting hook -- Comp function -- see below
1863 * We use "u" to point to array of monster indexes,
1864 * and "v" to select the type of sorting to perform on "u".
1866 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1868 u16b *who = (u16b*)(u);
1870 u16b *why = (u16b*)(v);
1877 /* Sort by player kills */
1880 /* Extract player kills */
1881 z1 = r_info[w1].r_pkills;
1882 z2 = r_info[w2].r_pkills;
1884 /* Compare player kills */
1885 if (z1 < z2) return (TRUE);
1886 if (z1 > z2) return (FALSE);
1890 /* Sort by total kills */
1893 /* Extract total kills */
1894 z1 = r_info[w1].r_tkills;
1895 z2 = r_info[w2].r_tkills;
1897 /* Compare total kills */
1898 if (z1 < z2) return (TRUE);
1899 if (z1 > z2) return (FALSE);
1903 /* Sort by monster level */
1906 /* Extract levels */
1907 z1 = r_info[w1].level;
1908 z2 = r_info[w2].level;
1910 /* Compare levels */
1911 if (z1 < z2) return (TRUE);
1912 if (z1 > z2) return (FALSE);
1916 /* Sort by monster experience */
1919 /* Extract experience */
1920 z1 = r_info[w1].mexp;
1921 z2 = r_info[w2].mexp;
1923 /* Compare experience */
1924 if (z1 < z2) return (TRUE);
1925 if (z1 > z2) return (FALSE);
1929 /* Compare indexes */
1935 * Sorting hook -- Swap function -- see below
1937 * We use "u" to point to array of monster indexes,
1938 * and "v" to select the type of sorting to perform.
1940 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
1942 u16b *who = (u16b*)(u);
1958 * Identify a character, allow recall of monsters
1960 * Several "special" responses recall "multiple" monsters:
1962 * ^U (all unique monsters)
1963 * ^N (all non-unique monsters)
1965 * The responses may be sorted in several ways, see below.
1967 * Note that the player ghosts are ignored. XXX XXX XXX
1969 void do_cmd_query_symbol(void)
1980 bool recall = FALSE;
1985 /* Get a character, or abort */
1987 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
1989 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
1993 /* Find that character info, and describe it */
1994 for (i = 0; ident_info[i]; ++i)
1996 if (sym == ident_info[i][0]) break;
2000 if (sym == KTRL('A'))
2004 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2006 strcpy(buf, "Full monster list.");
2010 else if (sym == KTRL('U'))
2014 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2016 strcpy(buf, "Unique monster list.");
2020 else if (sym == KTRL('N'))
2024 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2026 strcpy(buf, "Non-unique monster list.");
2030 /* XTRA HACK WHATSEARCH */
2031 else if (sym == KTRL('M'))
2035 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2037 if (!get_string("Enter name:",temp, 70))
2044 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2046 sprintf(buf, "Monsters with a name \"%s\"",temp);
2049 else if (ident_info[i])
2051 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2056 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2058 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2063 /* Display the result */
2066 /* Allocate the "who" array */
2067 C_MAKE(who, max_r_idx, u16b);
2069 /* Collect matching monsters */
2070 for (n = 0, i = 1; i < max_r_idx; i++)
2072 monster_race *r_ptr = &r_info[i];
2074 /* Nothing to recall */
2075 if (!cheat_know && !r_ptr->r_sights) continue;
2077 /* Require non-unique monsters if needed */
2078 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2080 /* Require unique monsters if needed */
2081 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2083 /* XTRA HACK WHATSEARCH */
2088 for (xx=0; temp[xx] && xx<80; xx++){
2090 if (iskanji( temp[xx])) { xx++; continue; }
2092 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2096 strcpy(temp2, r_name+r_ptr->E_name);
2098 strcpy(temp2, r_name+r_ptr->name);
2100 for (xx=0; temp2[xx] && xx<80; xx++)
2101 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2104 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
2106 if (strstr(temp2, temp))
2110 /* Collect "appropriate" monsters */
2111 if (all || (r_ptr->d_char == sym)) who[n++] = i;
2114 /* Nothing to recall */
2117 /* Free the "who" array */
2118 C_KILL(who, max_r_idx, u16b);
2124 /* Prompt XXX XXX XXX */
2126 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2128 put_str("Recall details? (k/y/n): ", 0, 40);
2140 /* Select the sort method */
2141 ang_sort_comp = ang_sort_comp_hook;
2142 ang_sort_swap = ang_sort_swap_hook;
2144 /* Sort the array */
2145 ang_sort(who, &why, n);
2147 /* Sort by kills (and level) */
2154 /* Catch "escape" */
2157 /* Free the "who" array */
2158 C_KILL(who, max_r_idx, u16b);
2163 /* Sort if needed */
2166 /* Select the sort method */
2167 ang_sort_comp = ang_sort_comp_hook;
2168 ang_sort_swap = ang_sort_swap_hook;
2170 /* Sort the array */
2171 ang_sort(who, &why, n);
2175 /* Start at the end */
2178 /* Scan the monster memory */
2181 /* Extract a race */
2184 /* Hack -- Auto-recall */
2185 monster_race_track(r_idx);
2187 /* Hack -- Handle stuff */
2196 /* Save the screen */
2199 /* Recall on screen */
2200 screen_roff(who[i], 0);
2203 /* Hack -- Begin the prompt */
2206 /* Hack -- Complete the prompt */
2208 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2210 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2223 /* Normal commands */
2224 if (query != 'r') break;
2231 if (query == ESCAPE) break;
2233 /* Move to "prev" monster */
2239 if (!expand_list) break;
2243 /* Move to "next" monster */
2249 if (!expand_list) break;
2254 /* Free the "who" array */
2255 C_KILL(who, max_r_idx, u16b);
2257 /* Re-display the identity */