3 * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¢¥¤¥Æ¥à¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ1 / 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.
19 * @brief »ý¤Áʪ°ìÍ÷¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Display inventory
22 void do_cmd_inven(void)
27 /* Note that we are in "inventory" mode */
30 #ifdef ALLOW_EASY_FLOOR
32 /* Note that we are in "inventory" mode */
33 if (easy_floor) command_wrk = (USE_INVEN);
35 #endif /* ALLOW_EASY_FLOOR */
40 /* Hack -- show empty slots */
41 item_tester_full = TRUE;
43 /* Display the inventory */
46 /* Hack -- hide empty slots */
47 item_tester_full = FALSE;
50 sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
51 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
52 (long int)((p_ptr->total_weight * 100) / weight_limit()));
54 sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
55 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
56 (p_ptr->total_weight * 100) / weight_limit());
63 /* Get a new command */
64 command_new = inkey();
70 /* Process "Escape" */
71 if (command_new == ESCAPE)
76 Term_get_size(&wid, &hgt);
80 command_gap = wid - 30;
83 /* Process normal keys */
86 /* Hack -- Use "display" mode */
93 * @brief ÁõÈ÷°ìÍ÷¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Display equipment
96 void do_cmd_equip(void)
101 /* Note that we are in "equipment" mode */
104 #ifdef ALLOW_EASY_FLOOR
106 /* Note that we are in "equipment" mode */
107 if (easy_floor) command_wrk = (USE_EQUIP);
109 #endif /* ALLOW_EASY_FLOOR */
111 /* Save the screen */
114 /* Hack -- show empty slots */
115 item_tester_full = TRUE;
117 /* Display the equipment */
120 /* Hack -- undo the hack above */
121 item_tester_full = FALSE;
125 sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
126 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
127 (long int)((p_ptr->total_weight * 100) / weight_limit()));
129 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
130 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
131 (long int)((p_ptr->total_weight * 100) / weight_limit()));
138 /* Get a new command */
139 command_new = inkey();
141 /* Restore the screen */
145 /* Process "Escape" */
146 if (command_new == ESCAPE)
151 Term_get_size(&wid, &hgt);
155 command_gap = wid - 30;
158 /* Process normal keys */
161 /* Enter "display" mode */
168 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤òËɶñ¤È¤·¤ÆÁõÈ÷¤Ç¤¤ë¤«¤ÎȽÄê / The "wearable" tester
169 * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
170 * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ëɶñ¤È¤·¤ÆÁõÈ÷¤Ç¤¤ë¤Ê¤éTRUE¤òÊÖ¤¹¡£
172 static bool item_tester_hook_wear(object_type *o_ptr)
174 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
175 if (p_ptr->psex == SEX_MALE) return FALSE;
177 /* Check for a usable slot */
178 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
180 /* Assume not wearable */
186 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¤É¤Á¤é¤Î¼ê¤Ë¤âÁõÈ÷¤Ç¤¤ëÉð´ï¤«¤É¤¦¤«¤ÎȽÄê
187 * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
188 * @return º¸±¦Î¾Êý¤Î¼ê¤ÇÁõÈ÷¤Ç¤¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
190 static bool item_tester_hook_mochikae(object_type *o_ptr)
192 /* Check for a usable slot */
193 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
194 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
195 (o_ptr->tval == TV_CARD)) return (TRUE);
197 /* Assume not wearable */
202 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬±¦¼ê¤«º¸¼ê¤ËÁõÈ÷¤Ç¤¤ëÉð´ï¤«¤É¤¦¤«¤ÎȽÄê
203 * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
204 * @return ±¦¼ê¤«º¸¼ê¤ÎÉð´ï¤È¤·¤ÆÁõÈ÷¤Ç¤¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
206 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
208 /* Check for a usable slot */
209 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
211 /* Assume not wearable */
216 bool select_ring_slot = FALSE;
219 * @brief ÁõÈ÷¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Wield or wear a single item from the pack or floor
222 void do_cmd_wield(void)
233 char o_name[MAX_NLEN];
237 int need_switch_wielding = 0;
239 if (p_ptr->special_defense & KATA_MUSOU)
241 set_action(ACTION_NONE);
244 /* Restrict the choices */
245 item_tester_hook = item_tester_hook_wear;
249 q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
250 s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
252 q = "Wear/Wield which item? ";
253 s = "You have nothing you can wear or wield.";
256 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
258 /* Get the item (in the pack) */
261 o_ptr = &inventory[item];
264 /* Get the item (on the floor) */
267 o_ptr = &o_list[0 - item];
272 slot = wield_slot(o_ptr);
276 /* Shields and some misc. items */
281 if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
283 /* Restrict the choices */
284 item_tester_hook = item_tester_hook_melee_weapon;
285 item_tester_no_ryoute = TRUE;
287 /* Choose a weapon from the equipment only */
289 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
292 q = "Replace which weapon? ";
296 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
297 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
300 else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
302 /* Both arms are already used by non-weapon */
303 else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
304 inventory[INVEN_LARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_LARM]))
306 /* Restrict the choices */
307 item_tester_hook = item_tester_hook_mochikae;
311 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
314 q = "Equip which hand? ";
318 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
327 /* Asking for dual wielding */
328 if (slot == INVEN_LARM)
331 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM;
333 if (!get_check("Dual wielding? ")) slot = INVEN_RARM;
337 else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
340 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_LARM;
342 if (!get_check("Dual wielding? ")) slot = INVEN_LARM;
346 /* Both arms are already used */
347 else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
349 /* Restrict the choices */
350 item_tester_hook = item_tester_hook_mochikae;
354 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
357 q = "Equip which hand? ";
361 if (!get_item(&slot, q, s, (USE_EQUIP))) return;
362 if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
363 need_switch_wielding = INVEN_RARM;
369 /* Choose a ring slot */
370 if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
373 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
375 q = "Replace which ring? ";
381 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
383 q = "Equip which hand? ";
393 /* Restrict the choices */
394 select_ring_slot = TRUE;
395 item_tester_no_ryoute = TRUE;
397 if (!get_item(&slot, q, s, (USE_EQUIP)))
399 select_ring_slot = FALSE;
402 select_ring_slot = FALSE;
406 /* Prevent wielding into a cursed slot */
407 if (object_is_cursed(&inventory[slot]))
410 object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
414 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
415 describe_use(slot) , o_name );
417 msg_format("The %s you are %s appears to be cursed.",
418 o_name, describe_use(slot));
421 /* Cancel the command */
426 ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
427 ((o_ptr->ident & IDENT_SENSE) &&
428 (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
430 char dummy[MAX_NLEN+80];
433 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
436 sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
438 sprintf(dummy, "Really use the %s {cursed}? ", o_name);
441 if (!get_check(dummy)) return;
444 if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
446 char dummy[MAX_NLEN+80];
449 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
452 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
454 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
455 sprintf(dummy, "Do you become a vampire?");
458 if (!get_check(dummy)) return;
461 if (need_switch_wielding && !object_is_cursed(&inventory[need_switch_wielding]))
463 object_type *slot_o_ptr = &inventory[slot];
464 object_type *switch_o_ptr = &inventory[need_switch_wielding];
465 object_type object_tmp;
466 object_type *otmp_ptr = &object_tmp;
467 char switch_name[MAX_NLEN];
469 object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
471 object_copy(otmp_ptr, switch_o_ptr);
472 object_copy(switch_o_ptr, slot_o_ptr);
473 object_copy(slot_o_ptr, otmp_ptr);
475 msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", switch_name, (slot == INVEN_RARM) ? (left_hander ? "º¸¼ê" : "±¦¼ê") : (left_hander ? "±¦¼ê" : "º¸¼ê"));
477 msg_format("You wield %s at %s hand.", switch_name, (slot == INVEN_RARM) ? (left_hander ? "left" : "right") : (left_hander ? "right" : "left"));
480 slot = need_switch_wielding;
483 check_find_art_quest_completion(o_ptr);
485 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
487 identify_item(o_ptr);
489 /* Auto-inscription */
490 autopick_alter_item(item, FALSE);
496 /* Get local object */
499 /* Obtain local object */
500 object_copy(q_ptr, o_ptr);
502 /* Modify quantity */
505 /* Decrease the item (from the pack) */
508 inven_item_increase(item, -1);
509 inven_item_optimize(item);
512 /* Decrease the item (from the floor) */
515 floor_item_increase(0 - item, -1);
516 floor_item_optimize(0 - item);
519 /* Access the wield slot */
520 o_ptr = &inventory[slot];
522 /* Take off existing item */
525 /* Take off existing item */
526 (void)inven_takeoff(slot, 255);
529 /* Wear the new stuff */
530 object_copy(o_ptr, q_ptr);
532 /* Player touches it */
533 o_ptr->marked |= OM_TOUCHED;
535 /* Increase the weight */
536 p_ptr->total_weight += q_ptr->weight;
538 /* Increment the equip counter by hand */
542 #define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£"
543 #define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£"
544 #define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£"
546 #define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
547 #define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
548 #define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
551 /* Where is the item now */
555 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
556 act = STR_WIELD_ARMS;
558 act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
562 if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
563 act = STR_WIELD_ARMS;
565 act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
570 act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£";
572 act = "You are shooting with %s (%c).";
578 act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£";
580 act = "Your light source is %s (%c).";
586 act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£";
588 act = "You are wearing %s (%c).";
593 /* Describe the result */
594 object_desc(o_name, o_ptr, 0);
597 msg_format(act, o_name, index_to_label(slot));
601 if (object_is_cursed(o_ptr))
603 /* Warn the player */
605 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
607 msg_print("Oops! It feels deathly cold!");
611 chg_virtue(V_HARMONY, -1);
614 o_ptr->ident |= (IDENT_SENSE);
617 /* The Stone Mask make the player turn into a vampire! */
618 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
620 /* Turn into a vampire */
621 change_race(RACE_VAMPIRE, "");
624 /* Recalculate bonuses */
625 p_ptr->update |= (PU_BONUS);
627 /* Recalculate torch */
628 p_ptr->update |= (PU_TORCH);
630 /* Recalculate mana */
631 p_ptr->update |= (PU_MANA);
633 p_ptr->redraw |= (PR_EQUIPPY);
636 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
642 * @brief »ý¤ÁÂؤ¨½èÍý
643 * @param item »ý¤ÁÂؤ¨¤ò¹Ô¤¤¤¿¤¤ÁõÈ÷Éô°ÌID
646 void kamaenaoshi(int item)
648 object_type *o_ptr, *new_o_ptr;
649 char o_name[MAX_NLEN];
651 if (item == INVEN_RARM)
653 if (buki_motteruka(INVEN_LARM))
655 o_ptr = &inventory[INVEN_LARM];
656 object_desc(o_name, o_ptr, 0);
658 if (!object_is_cursed(o_ptr))
660 new_o_ptr = &inventory[INVEN_RARM];
661 object_copy(new_o_ptr, o_ptr);
662 p_ptr->total_weight += o_ptr->weight;
663 inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
664 inven_item_optimize(INVEN_LARM);
665 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
667 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
669 msg_format("You are wielding %s with both hands.", o_name);
673 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
675 msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right"));
680 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
682 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
684 msg_format("You are wielding %s with both hands.", o_name);
689 else if (item == INVEN_LARM)
691 o_ptr = &inventory[INVEN_RARM];
692 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
694 if (buki_motteruka(INVEN_RARM))
696 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
698 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
700 msg_format("You are wielding %s with both hands.", o_name);
703 else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
705 new_o_ptr = &inventory[INVEN_LARM];
706 object_copy(new_o_ptr, o_ptr);
707 p_ptr->total_weight += o_ptr->weight;
708 inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
709 inven_item_optimize(INVEN_RARM);
711 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
713 msg_format("You switched hand of %s.", o_name);
721 * @brief ÁõÈ÷¤ò³°¤¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Take off an item
724 void do_cmd_takeoff(void)
732 if (p_ptr->special_defense & KATA_MUSOU)
734 set_action(ACTION_NONE);
737 item_tester_no_ryoute = TRUE;
740 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
741 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
743 q = "Take off which item? ";
744 s = "You are not wearing anything to take off.";
747 if (!get_item(&item, q, s, (USE_EQUIP))) return;
749 /* Get the item (in the pack) */
752 o_ptr = &inventory[item];
755 /* Get the item (on the floor) */
758 o_ptr = &o_list[0 - item];
763 if (object_is_cursed(o_ptr))
765 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
769 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
771 msg_print("Hmmm, it seems to be cursed.");
778 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
781 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
783 msg_print("You teared a cursed equipment off by sheer strength!");
786 /* Hack -- Assume felt */
787 o_ptr->ident |= (IDENT_SENSE);
789 o_ptr->curse_flags = 0L;
792 o_ptr->feeling = FEEL_NONE;
794 /* Recalculate the bonuses */
795 p_ptr->update |= (PU_BONUS);
798 p_ptr->window |= (PW_EQUIP);
801 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
803 msg_print("You break the curse.");
809 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
811 msg_print("You couldn't remove the equipment.");
818 /* Take a partial turn */
821 /* Take off the item */
822 (void)inven_takeoff(item, 255);
828 p_ptr->redraw |= (PR_EQUIPPY);
833 * @brief ¥¢¥¤¥Æ¥à¤òÍî¤È¤¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Drop an item
836 void do_cmd_drop(void)
844 if (p_ptr->special_defense & KATA_MUSOU)
846 set_action(ACTION_NONE);
849 item_tester_no_ryoute = TRUE;
852 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
853 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
855 q = "Drop which item? ";
856 s = "You have nothing to drop.";
859 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
861 /* Get the item (in the pack) */
864 o_ptr = &inventory[item];
867 /* Get the item (on the floor) */
870 o_ptr = &o_list[0 - item];
874 /* Hack -- Cannot remove cursed items */
875 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
879 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
881 msg_print("Hmmm, it seems to be cursed.");
890 /* See how many items */
891 if (o_ptr->number > 1)
894 amt = get_quantity(NULL, o_ptr->number);
896 /* Allow user abort */
897 if (amt <= 0) return;
901 /* Take a partial turn */
904 /* Drop (some of) the item */
905 inven_drop(item, amt);
907 if (item >= INVEN_RARM)
913 p_ptr->redraw |= (PR_EQUIPPY);
917 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¹â°Ì¤ÎËâË¡½ñ¤«¤É¤¦¤«¤òȽÄꤹ¤ë
918 * @param o_ptr ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
919 * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬¹â°Ì¤ÎËâË¡½ñ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
921 static bool high_level_book(object_type *o_ptr)
923 if ((o_ptr->tval == TV_LIFE_BOOK) ||
924 (o_ptr->tval == TV_SORCERY_BOOK) ||
925 (o_ptr->tval == TV_NATURE_BOOK) ||
926 (o_ptr->tval == TV_CHAOS_BOOK) ||
927 (o_ptr->tval == TV_DEATH_BOOK) ||
928 (o_ptr->tval == TV_TRUMP_BOOK) ||
929 (o_ptr->tval == TV_CRAFT_BOOK) ||
930 (o_ptr->tval == TV_DAEMON_BOOK) ||
931 (o_ptr->tval == TV_CRUSADE_BOOK) ||
932 (o_ptr->tval == TV_MUSIC_BOOK) ||
933 (o_ptr->tval == TV_HEX_BOOK))
946 * @brief ¥¢¥¤¥Æ¥à¤òÇ˲õ¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Destroy an item
949 void do_cmd_destroy(void)
958 object_type *q_ptr = &forge;
960 char o_name[MAX_NLEN];
962 char out_val[MAX_NLEN+40];
966 if (p_ptr->special_defense & KATA_MUSOU)
968 set_action(ACTION_NONE);
971 /* Hack -- force destruction */
972 if (command_arg > 0) force = TRUE;
977 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
978 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
980 q = "Destroy which item? ";
981 s = "You have nothing to destroy.";
984 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
986 /* Get the item (in the pack) */
989 o_ptr = &inventory[item];
992 /* Get the item (on the floor) */
995 o_ptr = &o_list[0 - item];
998 /* Verify unless quantity given beforehand */
999 if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
1001 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
1003 /* Make a verification */
1006 "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
1008 "Really destroy %s? [y/n/Auto]",
1014 /* HACK : Add the line to message buffer */
1015 message_add(out_val);
1016 p_ptr->window |= (PW_MESSAGE);
1019 /* Get an acceptable answer */
1029 /* Erase the prompt */
1033 if (i == 'y' || i == 'Y')
1037 if (i == ESCAPE || i == 'n' || i == 'N')
1044 /* Add an auto-destroy preference line */
1045 if (autopick_autoregister(o_ptr))
1047 /* Auto-destroy it */
1048 autopick_alter_item(item, TRUE);
1051 /* The object is already destroyed. */
1054 } /* while (TRUE) */
1057 /* See how many items */
1058 if (o_ptr->number > 1)
1060 /* Get a quantity */
1061 amt = get_quantity(NULL, o_ptr->number);
1063 /* Allow user abort */
1064 if (amt <= 0) return;
1068 /* Describe the object */
1069 old_number = o_ptr->number;
1070 o_ptr->number = amt;
1071 object_desc(o_name, o_ptr, 0);
1072 o_ptr->number = old_number;
1077 /* Artifacts cannot be destroyed */
1078 if (!can_player_destroy_object(o_ptr))
1084 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1086 msg_format("You cannot destroy %s.", o_name);
1093 object_copy(q_ptr, o_ptr);
1097 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1099 msg_format("You destroy %s.", o_name);
1102 sound(SOUND_DESTITEM);
1104 /* Reduce the charges of rods/wands */
1105 reduce_charges(o_ptr, amt);
1107 /* Eliminate the item (from the pack) */
1110 inven_item_increase(item, -amt);
1111 inven_item_describe(item);
1112 inven_item_optimize(item);
1115 /* Eliminate the item (from the floor) */
1118 floor_item_increase(0 - item, -amt);
1119 floor_item_describe(0 - item);
1120 floor_item_optimize(0 - item);
1123 if (high_level_book(q_ptr))
1125 bool gain_expr = FALSE;
1127 if (p_ptr->prace == RACE_ANDROID)
1130 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1134 else if (p_ptr->pclass == CLASS_PALADIN)
1136 if (is_good_realm(p_ptr->realm1))
1138 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1142 if (is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
1146 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1148 s32b tester_exp = p_ptr->max_exp / 20;
1149 if (tester_exp > 10000) tester_exp = 10000;
1150 if (q_ptr->sval < 3) tester_exp /= 4;
1151 if (tester_exp<1) tester_exp = 1;
1154 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1156 msg_print("You feel more experienced.");
1159 gain_exp(tester_exp * amt);
1161 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1163 chg_virtue(V_UNLIFE, 1);
1164 chg_virtue(V_VITALITY, -1);
1166 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1168 chg_virtue(V_UNLIFE, -1);
1169 chg_virtue(V_VITALITY, 1);
1172 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1173 chg_virtue(V_ENCHANT, -1);
1175 if (object_value_real(q_ptr) > 30000)
1176 chg_virtue(V_SACRIFICE, 2);
1178 else if (object_value_real(q_ptr) > 10000)
1179 chg_virtue(V_SACRIFICE, 1);
1182 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1183 chg_virtue(V_HARMONY, 1);
1185 if (item >= INVEN_RARM) calc_android_exp();
1190 * @brief ¥¢¥¤¥Æ¥à¤òÄ´ºº¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Observe an item which has been *identify*-ed
1193 void do_cmd_observe(void)
1199 char o_name[MAX_NLEN];
1203 item_tester_no_ryoute = TRUE;
1206 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1207 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1209 q = "Examine which item? ";
1210 s = "You have nothing to examine.";
1213 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1215 /* Get the item (in the pack) */
1218 o_ptr = &inventory[item];
1221 /* Get the item (on the floor) */
1224 o_ptr = &o_list[0 - item];
1228 /* Require full knowledge */
1229 if (!(o_ptr->ident & IDENT_MENTAL))
1232 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1234 msg_print("You have no special knowledge about that item.");
1242 object_desc(o_name, o_ptr, 0);
1246 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1248 msg_format("Examining %s...", o_name);
1251 /* Describe it fully */
1253 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1255 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
1263 * @brief ¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1264 * Remove the inscription from an object XXX Mention item (when done)?
1267 void do_cmd_uninscribe(void)
1275 item_tester_no_ryoute = TRUE;
1278 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1279 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1281 q = "Un-inscribe which item? ";
1282 s = "You have nothing to un-inscribe.";
1285 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1287 /* Get the item (in the pack) */
1290 o_ptr = &inventory[item];
1293 /* Get the item (on the floor) */
1296 o_ptr = &o_list[0 - item];
1299 /* Nothing to remove */
1300 if (!o_ptr->inscription)
1303 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1305 msg_print("That item had no inscription to remove.");
1313 msg_print("Ìäò¾Ã¤·¤¿¡£");
1315 msg_print("Inscription removed.");
1319 /* Remove the incription */
1320 o_ptr->inscription = 0;
1322 /* Combine the pack */
1323 p_ptr->notice |= (PN_COMBINE);
1326 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1328 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1329 p_ptr->update |= (PU_BONUS);
1335 * @brief ¥¢¥¤¥Æ¥à¤ÎÌäò¹ï¤à¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1336 * Inscribe an object with a comment
1339 void do_cmd_inscribe(void)
1345 char o_name[MAX_NLEN];
1351 item_tester_no_ryoute = TRUE;
1354 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1355 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1357 q = "Inscribe which item? ";
1358 s = "You have nothing to inscribe.";
1361 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1363 /* Get the item (in the pack) */
1366 o_ptr = &inventory[item];
1369 /* Get the item (on the floor) */
1372 o_ptr = &o_list[0 - item];
1375 /* Describe the activity */
1376 object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
1380 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1382 msg_format("Inscribing %s.", o_name);
1387 /* Start with nothing */
1388 strcpy(out_val, "");
1390 /* Use old inscription */
1391 if (o_ptr->inscription)
1393 /* Start with the old inscription */
1394 strcpy(out_val, quark_str(o_ptr->inscription));
1397 /* Get a new inscription (possibly empty) */
1399 if (get_string("ÌÃ: ", out_val, 80))
1401 if (get_string("Inscription: ", out_val, 80))
1404 /* Save the inscription */
1405 o_ptr->inscription = quark_add(out_val);
1407 /* Combine the pack */
1408 p_ptr->notice |= (PN_COMBINE);
1411 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1413 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1414 p_ptr->update |= (PU_BONUS);
1421 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¥é¥ó¥¿¥ó¤ÎdzÎÁ¤Ë¤Ê¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë
1422 * An "item_tester_hook" for refilling lanterns
1423 * @param o_ptr ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
1424 * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬¥é¥ó¥¿¥ó¤ÎdzÎÁ¤Ë¤Ê¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
1426 static bool item_tester_refill_lantern(object_type *o_ptr)
1428 /* Flasks of oil are okay */
1429 if (o_ptr->tval == TV_FLASK) return (TRUE);
1431 /* Laterns are okay */
1432 if ((o_ptr->tval == TV_LITE) &&
1433 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1435 /* Assume not okay */
1441 * @brief ¥é¥ó¥¿¥ó¤ËdzÎÁ¤ò²Ã¤¨¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1442 * Refill the players lamp (from the pack or floor)
1445 static void do_cmd_refill_lamp(void)
1455 /* Restrict the choices */
1456 item_tester_hook = item_tester_refill_lantern;
1460 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1461 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1463 q = "Refill with which flask? ";
1464 s = "You have no flasks of oil.";
1467 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1469 /* Get the item (in the pack) */
1472 o_ptr = &inventory[item];
1475 /* Get the item (on the floor) */
1478 o_ptr = &o_list[0 - item];
1482 /* Take a partial turn */
1485 /* Access the lantern */
1486 j_ptr = &inventory[INVEN_LITE];
1489 j_ptr->xtra4 += o_ptr->xtra4;
1493 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1495 msg_print("You fuel your lamp.");
1499 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1503 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1505 msg_print("Your lamp has gone out!");
1508 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1512 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1514 msg_print("Curiously, your lamp doesn't light.");
1517 else if (j_ptr->xtra4 >= FUEL_LAMP)
1519 j_ptr->xtra4 = FUEL_LAMP;
1521 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1523 msg_print("Your lamp is full.");
1528 /* Decrease the item (from the pack) */
1531 inven_item_increase(item, -1);
1532 inven_item_describe(item);
1533 inven_item_optimize(item);
1536 /* Decrease the item (from the floor) */
1539 floor_item_increase(0 - item, -1);
1540 floor_item_describe(0 - item);
1541 floor_item_optimize(0 - item);
1544 /* Recalculate torch */
1545 p_ptr->update |= (PU_TORCH);
1550 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¾¾ÌÀ¤Ë«¤Í¤é¤ì¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë
1551 * An "item_tester_hook" for refilling torches
1552 * @param o_ptr ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
1553 * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬¾¾ÌÀ¤Ë«¤Í¤é¤ì¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
1555 static bool item_tester_refill_torch(object_type *o_ptr)
1557 /* Torches are okay */
1558 if ((o_ptr->tval == TV_LITE) &&
1559 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1561 /* Assume not okay */
1567 * @brief ¾¾ÌÀ¤ò«¤Í¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1568 * Refuel the players torch (from the pack or floor)
1571 static void do_cmd_refill_torch(void)
1581 /* Restrict the choices */
1582 item_tester_hook = item_tester_refill_torch;
1586 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1587 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1589 q = "Refuel with which torch? ";
1590 s = "You have no extra torches.";
1593 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1595 /* Get the item (in the pack) */
1598 o_ptr = &inventory[item];
1601 /* Get the item (on the floor) */
1604 o_ptr = &o_list[0 - item];
1608 /* Take a partial turn */
1611 /* Access the primary torch */
1612 j_ptr = &inventory[INVEN_LITE];
1615 j_ptr->xtra4 += o_ptr->xtra4 + 5;
1619 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
1621 msg_print("You combine the torches.");
1626 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1630 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1632 msg_print("Your torch has gone out!");
1635 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1639 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1641 msg_print("Curiously, your torche don't light.");
1644 /* Over-fuel message */
1645 else if (j_ptr->xtra4 >= FUEL_TORCH)
1647 j_ptr->xtra4 = FUEL_TORCH;
1649 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
1651 msg_print("Your torch is fully fueled.");
1656 /* Refuel message */
1660 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
1662 msg_print("Your torch glows more brightly.");
1667 /* Decrease the item (from the pack) */
1670 inven_item_increase(item, -1);
1671 inven_item_describe(item);
1672 inven_item_optimize(item);
1675 /* Decrease the item (from the floor) */
1678 floor_item_increase(0 - item, -1);
1679 floor_item_describe(0 - item);
1680 floor_item_optimize(0 - item);
1683 /* Recalculate torch */
1684 p_ptr->update |= (PU_TORCH);
1689 * @brief dzÎÁ¤òÊä½¼¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1690 * Refill the players lamp, or restock his torches
1693 void do_cmd_refill(void)
1698 o_ptr = &inventory[INVEN_LITE];
1700 if (p_ptr->special_defense & KATA_MUSOU)
1702 set_action(ACTION_NONE);
1706 if (o_ptr->tval != TV_LITE)
1709 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
1711 msg_print("You are not wielding a light.");
1717 else if (o_ptr->sval == SV_LITE_LANTERN)
1719 do_cmd_refill_lamp();
1723 else if (o_ptr->sval == SV_LITE_TORCH)
1725 do_cmd_refill_torch();
1728 /* No torch to refill */
1732 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
1734 msg_print("Your light cannot be refilled.");
1742 * @brief ¥¿¡¼¥²¥Ã¥È¤òÀßÄꤹ¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1746 void do_cmd_target(void)
1749 if (target_set(TARGET_KILL))
1752 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1754 msg_print("Target Selected.");
1759 /* Target aborted */
1763 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
1765 msg_print("Target Aborted.");
1774 * @brief ¼þ°Ï¤ò¸«ÅϤ¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1778 void do_cmd_look(void)
1781 p_ptr->window |= PW_MONSTER_LIST;
1786 if (target_set(TARGET_LOOK))
1789 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
1791 msg_print("Target Selected.");
1799 * @brief °ÌÃÖ¤ò³Îǧ¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
1800 * Allow the player to examine other sectors on the map
1803 void do_cmd_locate(void)
1805 int dir, y1, x1, y2, x2;
1814 get_screen_size(&wid, &hgt);
1817 /* Start at current panel */
1818 y2 = y1 = panel_row_min;
1819 x2 = x1 = panel_col_min;
1821 /* Show panels until done */
1824 /* Describe the location */
1825 if ((y2 == y1) && (x2 == x1))
1828 strcpy(tmp_val, "¿¿¾å");
1837 sprintf(tmp_val, "%s%s",
1838 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
1839 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
1841 sprintf(tmp_val, "%s%s of",
1842 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
1843 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
1848 /* Prepare to ask which way to look */
1851 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
1853 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
1856 y2 / (hgt / 2), y2 % (hgt / 2),
1857 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
1859 /* Assume no direction */
1862 /* Get a direction */
1867 /* Get a command (or Cancel) */
1868 if (!get_com(out_val, &command, TRUE)) break;
1870 /* Extract the action (if any) */
1871 dir = get_keymap_dir(command);
1880 /* Apply the motion */
1881 if (change_panel(ddy[dir], ddx[dir]))
1889 /* Recenter the map around the player */
1893 p_ptr->update |= (PU_MONSTERS);
1896 p_ptr->redraw |= (PR_MAP);
1899 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1908 * @brief ¥â¥ó¥¹¥¿¡¼¼ï²¾ðÊó¤òÆÃÄê¤Î´ð½à¤Ë¤è¤ê¥½¡¼¥È¤¹¤ë¤¿¤á¤ÎÈæ³Ó½èÍý
1909 * Sorting hook -- Comp function -- see below
1910 * @param u ¥â¥ó¥¹¥¿¡¼¼ï²¾ðÊó¤ÎÆþ¤ì¤ë¥Ý¥¤¥ó¥¿
1911 * @param v ¾ò·ï´ð½àID
1912 * @param a Èæ³Ó¤¹¤ë¥â¥ó¥¹¥¿¡¼¼ï²¤ÎID1
1913 * @param b Èæ³Ó¤¹¤ë¥â¥ó¥¹¥¿¡¼¼ï²¤ÎID2
1914 * @return 2¤ÎÊý¤¬Â礤±¤ì¤ÐTRUE¤òÊÖ¤¹
1915 * We use "u" to point to array of monster indexes,
1916 * and "v" to select the type of sorting to perform on "u".
1918 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
1920 u16b *who = (u16b*)(u);
1922 u16b *why = (u16b*)(v);
1929 /* Sort by player kills */
1932 /* Extract player kills */
1933 z1 = r_info[w1].r_pkills;
1934 z2 = r_info[w2].r_pkills;
1936 /* Compare player kills */
1937 if (z1 < z2) return (TRUE);
1938 if (z1 > z2) return (FALSE);
1942 /* Sort by total kills */
1945 /* Extract total kills */
1946 z1 = r_info[w1].r_tkills;
1947 z2 = r_info[w2].r_tkills;
1949 /* Compare total kills */
1950 if (z1 < z2) return (TRUE);
1951 if (z1 > z2) return (FALSE);
1955 /* Sort by monster level */
1958 /* Extract levels */
1959 z1 = r_info[w1].level;
1960 z2 = r_info[w2].level;
1962 /* Compare levels */
1963 if (z1 < z2) return (TRUE);
1964 if (z1 > z2) return (FALSE);
1968 /* Sort by monster experience */
1971 /* Extract experience */
1972 z1 = r_info[w1].mexp;
1973 z2 = r_info[w2].mexp;
1975 /* Compare experience */
1976 if (z1 < z2) return (TRUE);
1977 if (z1 > z2) return (FALSE);
1981 /* Compare indexes */
1987 * @brief ¥â¥ó¥¹¥¿¡¼¼ï²¾ðÊó¤òÆÃÄê¤Î´ð½à¤Ë¤è¤ê¥½¡¼¥È¤¹¤ë¤¿¤á¤Î¥¹¥ï¥Ã¥×½èÍý
1988 * Sorting hook -- Swap function -- see below
1989 * @param u ¥â¥ó¥¹¥¿¡¼¼ï²¾ðÊó¤ÎÆþ¤ì¤ë¥Ý¥¤¥ó¥¿
1991 * @param a ¥¹¥ï¥Ã¥×¤¹¤ë¥â¥ó¥¹¥¿¡¼¼ï²¤ÎID1
1992 * @param b ¥¹¥ï¥Ã¥×¤¹¤ë¥â¥ó¥¹¥¿¡¼¼ï²¤ÎID2
1995 * We use "u" to point to array of monster indexes,
1996 * and "v" to select the type of sorting to perform.
1998 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
2000 u16b *who = (u16b*)(u);
2016 * @brief ¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤ò¸«¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó
2017 * Identify a character, allow recall of monsters
2021 * Several "special" responses recall "multiple" monsters:
2023 * ^U (all unique monsters)
2024 * ^N (all non-unique monsters)
2026 * The responses may be sorted in several ways, see below.
2028 * Note that the player ghosts are ignored. XXX XXX XXX
2031 void do_cmd_query_symbol(void)
2043 bool recall = FALSE;
2048 /* Get a character, or abort */
2050 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^R¾èÇÏ,^M̾Á°): ", &sym, FALSE)) return;
2052 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
2055 /* Find that character info, and describe it */
2056 for (i = 0; ident_info[i]; ++i)
2058 if (sym == ident_info[i][0]) break;
2062 if (sym == KTRL('A'))
2066 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2068 strcpy(buf, "Full monster list.");
2071 else if (sym == KTRL('U'))
2075 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2077 strcpy(buf, "Unique monster list.");
2080 else if (sym == KTRL('N'))
2084 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2086 strcpy(buf, "Non-unique monster list.");
2089 else if (sym == KTRL('R'))
2093 strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2095 strcpy(buf, "Ridable monster list.");
2098 /* XTRA HACK WHATSEARCH */
2099 else if (sym == KTRL('M'))
2103 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2105 if (!get_string("Enter name:",temp, 70))
2112 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2114 sprintf(buf, "Monsters with a name \"%s\"",temp);
2117 else if (ident_info[i])
2119 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2124 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2126 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2130 /* Display the result */
2133 /* Allocate the "who" array */
2134 C_MAKE(who, max_r_idx, u16b);
2136 /* Collect matching monsters */
2137 for (n = 0, i = 1; i < max_r_idx; i++)
2139 monster_race *r_ptr = &r_info[i];
2141 /* Nothing to recall */
2142 if (!cheat_know && !r_ptr->r_sights) continue;
2144 /* Require non-unique monsters if needed */
2145 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2147 /* Require unique monsters if needed */
2148 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2150 /* Require ridable monsters if needed */
2151 if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
2153 /* XTRA HACK WHATSEARCH */
2159 for (xx=0; temp[xx] && xx<80; xx++)
2162 if (iskanji( temp[xx])) { xx++; continue; }
2164 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2168 strcpy(temp2, r_name+r_ptr->E_name);
2170 strcpy(temp2, r_name+r_ptr->name);
2172 for (xx=0; temp2[xx] && xx<80; xx++)
2173 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2176 if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
2178 if (my_strstr(temp2, temp))
2183 /* Collect "appropriate" monsters */
2184 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
2187 /* Nothing to recall */
2190 /* Free the "who" array */
2191 C_KILL(who, max_r_idx, u16b);
2197 /* Prompt XXX XXX XXX */
2199 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2201 put_str("Recall details? (k/y/n): ", 0, 40);
2213 /* Select the sort method */
2214 ang_sort_comp = ang_sort_comp_hook;
2215 ang_sort_swap = ang_sort_swap_hook;
2217 /* Sort the array */
2218 ang_sort(who, &why, n);
2220 /* Sort by kills (and level) */
2227 /* Catch "escape" */
2230 /* Free the "who" array */
2231 C_KILL(who, max_r_idx, u16b);
2236 /* Sort if needed */
2239 /* Select the sort method */
2240 ang_sort_comp = ang_sort_comp_hook;
2241 ang_sort_swap = ang_sort_swap_hook;
2243 /* Sort the array */
2244 ang_sort(who, &why, n);
2248 /* Start at the end */
2251 /* Scan the monster memory */
2254 /* Extract a race */
2257 /* Hack -- Auto-recall */
2258 monster_race_track(r_idx);
2260 /* Hack -- Handle stuff */
2269 /* Save the screen */
2272 /* Recall on screen */
2273 screen_roff(who[i], 0);
2276 /* Hack -- Begin the prompt */
2279 /* Hack -- Complete the prompt */
2281 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2283 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2296 /* Normal commands */
2297 if (query != 'r') break;
2304 if (query == ESCAPE) break;
2306 /* Move to "prev" monster */
2312 if (!expand_list) break;
2316 /* Move to "next" monster */
2322 if (!expand_list) break;
2327 /* Free the "who" array */
2328 C_KILL(who, max_r_idx, u16b);
2330 /* Re-display the identity */