3 /* Purpose: Inventory commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
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¤ò±¦¼ê¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name);
324 msg_format("You wield %s at right hand.", ol_name);
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) identify_item(o_ptr);
451 /* Get local object */
454 /* Obtain local object */
455 object_copy(q_ptr, o_ptr);
457 /* Modify quantity */
460 /* Decrease the item (from the pack) */
463 inven_item_increase(item, -1);
464 inven_item_optimize(item);
467 /* Decrease the item (from the floor) */
470 floor_item_increase(0 - item, -1);
471 floor_item_optimize(0 - item);
474 /* Access the wield slot */
475 o_ptr = &inventory[slot];
477 /* Take off existing item */
480 /* Take off existing item */
481 (void)inven_takeoff(slot, 255);
484 /* Wear the new stuff */
485 object_copy(o_ptr, q_ptr);
487 /* Increase the weight */
488 p_ptr->total_weight += q_ptr->weight;
490 /* Increment the equip counter by hand */
493 /* Where is the item now */
494 if (slot == INVEN_RARM)
496 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)))
498 act = "¤òξ¼ê¤Ç¹½¤¨¤¿";
500 act = "You are wielding";
504 act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
506 act = "You are wielding";
510 else if (slot == INVEN_LARM)
513 act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
515 act = "You are wielding";
519 else if (slot == INVEN_BOW)
522 act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
524 act = "You are shooting with";
528 else if (slot == INVEN_LITE)
531 act = "¤ò¸÷¸»¤Ë¤·¤¿";
533 act = "Your light source is";
542 act = "You are wearing";
547 /* Describe the result */
548 object_desc(o_name, o_ptr, TRUE, 3);
552 msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
554 msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
561 /* Warn the player */
563 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
565 msg_print("Oops! It feels deathly cold!");
569 chg_virtue(V_HARMONY, -1);
572 o_ptr->ident |= (IDENT_SENSE);
575 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
578 if (p_ptr->prace < 32)
580 p_ptr->old_race1 |= 1L << p_ptr->prace;
584 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
586 p_ptr->prace = RACE_VAMPIRE;
588 msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
590 msg_format("You polymorphed into a vampire!");
593 rp_ptr = &race_info[p_ptr->prace];
595 /* Experience factor */
596 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
598 /* Calculate the height/weight for males */
599 if (p_ptr->psex == SEX_MALE)
601 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
602 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
603 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
604 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
607 /* Calculate the height/weight for females */
608 else if (p_ptr->psex == SEX_FEMALE)
610 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
611 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
612 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
613 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
619 if (p_ptr->pclass == CLASS_SORCERER)
620 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
622 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
624 do_cmd_rerate(FALSE);
626 p_ptr->redraw |= (PR_BASIC);
628 p_ptr->update |= (PU_BONUS);
634 /* Recalculate bonuses */
635 p_ptr->update |= (PU_BONUS);
637 /* Recalculate torch */
638 p_ptr->update |= (PU_TORCH);
640 /* Recalculate mana */
641 p_ptr->update |= (PU_MANA);
643 p_ptr->redraw |= (PR_EQUIPPY);
646 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
652 void kamaenaoshi(int item)
654 object_type *o_ptr, *o2_ptr;
655 char o_name[MAX_NLEN];
657 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
659 o_ptr = &inventory[INVEN_RARM];
660 o2_ptr = &inventory[INVEN_LARM];
661 object_copy(o_ptr, o2_ptr);
662 p_ptr->total_weight += o2_ptr->weight;
663 inven_item_increase(INVEN_LARM,-1);
664 inven_item_optimize(INVEN_LARM);
665 object_desc(o_name, o_ptr, TRUE, 3);
666 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
668 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
670 msg_format("You are wielding %s with two-handed.", o_name );
674 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
676 msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
679 else if ((item == INVEN_LARM) && buki_motteruka(INVEN_RARM))
681 o_ptr = &inventory[INVEN_RARM];
682 object_desc(o_name, o_ptr, TRUE, 3);
683 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
685 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
687 msg_format("You are wielding %s with two-handed.", o_name );
690 else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & 0x0002))
692 o_ptr = &inventory[INVEN_LARM];
693 o2_ptr = &inventory[INVEN_RARM];
694 object_copy(o_ptr, o2_ptr);
695 p_ptr->total_weight += o2_ptr->weight;
696 inven_item_increase(INVEN_RARM,-1);
697 inven_item_optimize(INVEN_RARM);
698 object_desc(o_name, o_ptr, TRUE, 3);
700 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name );
702 msg_format("You switched hand of %s.", o_name );
711 void do_cmd_takeoff(void)
719 if (p_ptr->special_defense & KATA_MUSOU)
721 set_action(ACTION_NONE);
724 item_tester_no_ryoute = TRUE;
727 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
728 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
730 q = "Take off which item? ";
731 s = "You are not wearing anything to take off.";
734 if (!get_item(&item, q, s, (USE_EQUIP))) return;
736 /* Get the item (in the pack) */
739 o_ptr = &inventory[item];
742 /* Get the item (on the floor) */
745 o_ptr = &o_list[0 - item];
752 if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
756 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
758 msg_print("Hmmm, it seems to be cursed.");
765 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
768 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
770 msg_print("You teared a cursed equipment off by sheer strength!");
773 /* Hack -- Assume felt */
774 o_ptr->ident |= (IDENT_SENSE);
776 o_ptr->curse_flags = 0L;
779 o_ptr->feeling = FEEL_NONE;
781 /* Recalculate the bonuses */
782 p_ptr->update |= (PU_BONUS);
785 p_ptr->window |= (PW_EQUIP);
788 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
790 msg_print("You break the curse.");
796 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
798 msg_print("You couldn't remove the equipment.");
805 /* Take a partial turn */
808 /* Take off the item */
809 (void)inven_takeoff(item, 255);
815 p_ptr->redraw |= (PR_EQUIPPY);
822 void do_cmd_drop(void)
830 if (p_ptr->special_defense & KATA_MUSOU)
832 set_action(ACTION_NONE);
835 item_tester_no_ryoute = TRUE;
838 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
839 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
841 q = "Drop which item? ";
842 s = "You have nothing to drop.";
845 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
847 /* Get the item (in the pack) */
850 o_ptr = &inventory[item];
853 /* Get the item (on the floor) */
856 o_ptr = &o_list[0 - item];
860 /* Hack -- Cannot remove cursed items */
861 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
865 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
867 msg_print("Hmmm, it seems to be cursed.");
876 /* See how many items */
877 if (o_ptr->number > 1)
880 amt = get_quantity(NULL, o_ptr->number);
882 /* Allow user abort */
883 if (amt <= 0) return;
887 /* Take a partial turn */
890 /* Drop (some of) the item */
891 inven_drop(item, amt);
893 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
895 if (item >= INVEN_RARM) calc_android_exp();
897 p_ptr->redraw |= (PR_EQUIPPY);
901 static bool high_level_book(object_type *o_ptr)
903 if ((o_ptr->tval == TV_LIFE_BOOK) ||
904 (o_ptr->tval == TV_SORCERY_BOOK) ||
905 (o_ptr->tval == TV_NATURE_BOOK) ||
906 (o_ptr->tval == TV_CHAOS_BOOK) ||
907 (o_ptr->tval == TV_DEATH_BOOK) ||
908 (o_ptr->tval == TV_TRUMP_BOOK) ||
909 (o_ptr->tval == TV_ENCHANT_BOOK) ||
910 (o_ptr->tval == TV_DAEMON_BOOK) ||
911 (o_ptr->tval == TV_MUSIC_BOOK))
926 void do_cmd_destroy(void)
935 object_type *q_ptr = &forge;
937 char o_name[MAX_NLEN];
939 char out_val[MAX_NLEN+40];
943 if (p_ptr->special_defense & KATA_MUSOU)
945 set_action(ACTION_NONE);
948 /* Hack -- force destruction */
949 if (command_arg > 0) force = TRUE;
954 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
955 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
957 q = "Destroy which item? ";
958 s = "You have nothing to destroy.";
961 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
963 /* Get the item (in the pack) */
966 o_ptr = &inventory[item];
969 /* Get the item (on the floor) */
972 o_ptr = &o_list[0 - item];
976 /* See how many items */
977 if (o_ptr->number > 1)
980 amt = get_quantity(NULL, o_ptr->number);
982 /* Allow user abort */
983 if (amt <= 0) return;
987 /* Describe the object */
988 old_number = o_ptr->number;
990 object_desc(o_name, o_ptr, TRUE, 3);
991 o_ptr->number = old_number;
993 /* Verify unless quantity given */
996 if (confirm_destroy || (object_value(o_ptr) > 0))
998 /* Make a verification */
1000 sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
1002 sprintf(out_val, "Really destroy %s? ", o_name);
1005 if (!get_check(out_val)) return;
1012 /* Artifacts cannot be destroyed */
1013 if (!can_player_destroy_object(o_ptr))
1019 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1021 msg_format("You cannot destroy %s.", o_name);
1028 object_copy(q_ptr, o_ptr);
1032 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1034 msg_format("You destroy %s.", o_name);
1037 sound(SOUND_DESTITEM);
1039 /* Reduce the charges of rods/wands */
1040 reduce_charges(o_ptr, amt);
1042 /* Eliminate the item (from the pack) */
1045 inven_item_increase(item, -amt);
1046 inven_item_describe(item);
1047 inven_item_optimize(item);
1050 /* Eliminate the item (from the floor) */
1053 floor_item_increase(0 - item, -amt);
1054 floor_item_describe(0 - item);
1055 floor_item_optimize(0 - item);
1058 if (high_level_book(q_ptr))
1060 bool gain_expr = FALSE;
1062 if (p_ptr->prace == RACE_ANDROID)
1065 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1069 else if (p_ptr->pclass == CLASS_PALADIN)
1071 if (p_ptr->realm1 == REALM_LIFE)
1073 if (q_ptr->tval != TV_LIFE_BOOK) gain_expr = TRUE;
1077 if (q_ptr->tval == TV_LIFE_BOOK) gain_expr = TRUE;
1081 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1083 s32b tester_exp = p_ptr->max_exp / 20;
1084 if (tester_exp > 10000) tester_exp = 10000;
1085 if (q_ptr->sval < 3) tester_exp /= 4;
1086 if (tester_exp<1) tester_exp = 1;
1089 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1091 msg_print("You feel more experienced.");
1094 gain_exp(tester_exp * amt);
1096 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1098 chg_virtue(V_UNLIFE, 1);
1099 chg_virtue(V_VITALITY, -1);
1101 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1103 chg_virtue(V_UNLIFE, -1);
1104 chg_virtue(V_VITALITY, 1);
1107 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1108 chg_virtue(V_ENCHANT, -1);
1110 if (object_value_real(q_ptr) > 30000)
1111 chg_virtue(V_SACRIFICE, 2);
1113 else if (object_value_real(q_ptr) > 10000)
1114 chg_virtue(V_SACRIFICE, 1);
1117 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1118 chg_virtue(V_HARMONY, 1);
1120 if (item >= INVEN_RARM) calc_android_exp();
1125 * Observe an item which has been *identify*-ed
1127 void do_cmd_observe(void)
1133 char o_name[MAX_NLEN];
1137 item_tester_no_ryoute = TRUE;
1140 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1141 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1143 q = "Examine which item? ";
1144 s = "You have nothing to examine.";
1147 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1149 /* Get the item (in the pack) */
1152 o_ptr = &inventory[item];
1155 /* Get the item (on the floor) */
1158 o_ptr = &o_list[0 - item];
1162 /* Require full knowledge */
1163 if (!(o_ptr->ident & IDENT_MENTAL))
1166 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1168 msg_print("You have no special knowledge about that item.");
1176 object_desc(o_name, o_ptr, TRUE, 3);
1180 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1182 msg_format("Examining %s...", o_name);
1185 /* Describe it fully */
1187 if (!identify_fully_aux(o_ptr)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1189 if (!identify_fully_aux(o_ptr)) msg_print("You see nothing special.");
1197 * Remove the inscription from an object
1198 * XXX Mention item (when done)?
1200 void do_cmd_uninscribe(void)
1208 item_tester_no_ryoute = TRUE;
1211 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1212 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1214 q = "Un-inscribe which item? ";
1215 s = "You have nothing to un-inscribe.";
1218 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1220 /* Get the item (in the pack) */
1223 o_ptr = &inventory[item];
1226 /* Get the item (on the floor) */
1229 o_ptr = &o_list[0 - item];
1232 /* Nothing to remove */
1233 if (!o_ptr->inscription)
1236 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1238 msg_print("That item had no inscription to remove.");
1246 msg_print("Ìäò¾Ã¤·¤¿¡£");
1248 msg_print("Inscription removed.");
1252 /* Remove the incription */
1253 o_ptr->inscription = 0;
1255 /* Combine the pack */
1256 p_ptr->notice |= (PN_COMBINE);
1259 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1261 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1262 p_ptr->update |= (PU_BONUS);
1267 * Auto flag inscribe
1270 typedef struct flag_insc_table
1282 static flag_insc_table flag_insc_plus[] =
1284 { "¹¶", "At", TR1_BLOWS, 1, 0 },
1285 { "®", "Sp", TR1_SPEED, 1, 0 },
1286 { "ÏÓ", "St", TR1_STR, 1, 0 },
1287 { "ÃÎ", "In", TR1_INT, 1, 0 },
1288 { "¸", "Wi", TR1_WIS, 1, 0 },
1289 { "´ï", "Dx", TR1_DEX, 1, 0 },
1290 { "ÂÑ", "Cn", TR1_CON, 1, 0 },
1291 { "̥", "Ch", TR1_CHR, 1, 0 },
1292 { "±£", "Sl", TR1_STEALTH, 1, 0 },
1293 { "õ", "Sr", TR1_SEARCH, 1, 0 },
1294 { "ÀÖ", "If", TR1_INFRA, 1, 0 },
1295 { "·¡", "Dg", TR1_TUNNEL, 1, 0 },
1299 static flag_insc_table flag_insc_immune[] =
1301 { "»À", "Ac", TR2_IM_ACID, 2, 0 },
1302 { "ÅÅ", "El", TR2_IM_ELEC, 2, 0 },
1303 { "²Ð", "Fi", TR2_IM_FIRE, 2, 0 },
1304 { "Îä", "Co", TR2_IM_COLD, 2, 0 },
1308 static flag_insc_table flag_insc_resistance[] =
1310 { "»À", "Ac", TR2_RES_ACID, 2, TR2_IM_ACID },
1311 { "ÅÅ", "El", TR2_RES_ELEC, 2, TR2_IM_ELEC },
1312 { "²Ð", "Fi", TR2_RES_FIRE, 2, TR2_IM_FIRE },
1313 { "Îä", "Co", TR2_RES_COLD, 2, TR2_IM_COLD },
1314 { "ÆÇ", "Po", TR2_RES_POIS, 2, 0 },
1315 { "Á®", "Li", TR2_RES_LITE, 2, 0 },
1316 { "°Å", "Dk", TR2_RES_DARK, 2, 0 },
1317 { "ÇË", "Sh", TR2_RES_SHARDS, 2, 0 },
1318 { "ÌÕ", "Bl", TR2_RES_BLIND, 2, 0 },
1319 { "Íð", "Cf", TR2_RES_CONF, 2, 0 },
1320 { "¹ì", "So", TR2_RES_SOUND, 2, 0 },
1321 { "¹ö", "Nt", TR2_RES_NETHER, 2, 0 },
1322 { "°ø", "Nx", TR2_RES_NEXUS, 2, 0 },
1323 { "ÆÙ", "Ca", TR2_RES_CHAOS, 2, 0 },
1324 { "Îô", "Di", TR2_RES_DISEN, 2, 0 },
1325 { "¶²", "Fe", TR2_RES_FEAR, 2, 0 },
1329 static flag_insc_table flag_insc_misc[] =
1331 { "ËâÎÏ", "Ma", TR3_DEC_MANA, 3, 0 },
1332 { "Åê", "Th", TR2_THROW, 2, 0 },
1333 { "ȿ", "Rf", TR2_REFLECT, 2, 0 },
1334 { "Ëã", "Fa", TR2_FREE_ACT, 2, 0 },
1335 { "ȑ", "Si", TR3_SEE_INVIS, 3, 0 },
1336 { "·Ð", "Hl", TR2_HOLD_LIFE, 2, 0 },
1337 { "´¶", "Esp", TR3_TELEPATHY, 3, 0 },
1338 { "ÃÙ", "Sd", TR3_SLOW_DIGEST, 3, 0 },
1339 { "³è", "Rg", TR3_REGEN, 3, 0 },
1340 { "Éâ", "Lv", TR3_FEATHER, 3, 0 },
1341 { "ÌÀ", "Lu", TR3_LITE, 3, 0 },
1342 { "·Ù", "Wr", TR3_WARNING, 3, 0 },
1343 { "ÇÜ", "Xm", TR3_XTRA_MIGHT, 3, 0 },
1344 { "¼Í", "Xs", TR3_XTRA_SHOTS, 3, 0 },
1345 { "ÅÜ", "Ag", TR3_AGGRAVATE, 3, 0 },
1346 { "½Ë", "Bs", TR3_BLESSED, 3, 0 },
1348 { "±Ê¼ö", "Pc", TR3_PERMA_CURSE, 3, 0 },
1349 { "¼ö", "Cu", TR3_HEAVY_CURSE, 3, TR3_PERMA_CURSE },
1350 { "´÷", "Ty", TR3_TY_CURSE, 3, 0 },
1355 static flag_insc_table flag_insc_aura[] =
1357 { "±ê", "F", TR3_SH_FIRE, 3, 0 },
1358 { "ÅÅ", "E", TR3_SH_ELEC, 3, 0 },
1359 { "Îä", "C", TR3_SH_COLD, 3, 0 },
1360 { "Ëâ", "M", TR3_NO_MAGIC, 3, 0 },
1361 { "½Ö", "T", TR3_NO_TELE, 3, 0 },
1365 static flag_insc_table flag_insc_brand[] =
1367 { "»À", "A", TR1_BRAND_ACID, 1, 0 },
1368 { "ÅÅ", "E", TR1_BRAND_ELEC, 1, 0 },
1369 { "¾Æ", "F", TR1_BRAND_FIRE, 1, 0 },
1370 { "Åà", "Co", TR1_BRAND_COLD, 1, 0 },
1371 { "ÆÇ", "P", TR1_BRAND_POIS, 1, 0 },
1372 { "ÆÙ", "Ca", TR1_CHAOTIC, 1, 0 },
1373 { "µÛ", "V", TR1_VAMPIRIC, 1, 0 },
1374 { "¿Ì", "Q", TR1_IMPACT, 1, 0 },
1375 { "ÀÚ", "S", TR1_VORPAL, 1, 0 },
1376 { "Íý", "M", TR1_FORCE_WEAPON, 1, 0 },
1377 { NULL, NULL, 0, 0, 0 }
1380 static flag_insc_table flag_insc_slay[] =
1382 { "¼Ù", "*", TR1_SLAY_EVIL, 1, 0 },
1383 { "¿Í", "p", TR3_SLAY_HUMAN, 3, 0 },
1384 { "ζ", "D", TR1_KILL_DRAGON, 1, 0 },
1385 { "ε", "d", TR1_SLAY_DRAGON, 1, TR1_KILL_DRAGON },
1386 { "¥ª", "o", TR1_SLAY_ORC, 1, 0 },
1387 { "¥È", "T", TR1_SLAY_TROLL, 1, 0 },
1388 { "µð", "P", TR1_SLAY_GIANT, 1, 0 },
1389 { "¥Ç", "U", TR1_SLAY_DEMON, 1, 0 },
1390 { "Ȉ", "L", TR1_SLAY_UNDEAD, 1, 0 },
1391 { "ư", "Z", TR1_SLAY_ANIMAL, 1, 0 },
1392 { NULL, NULL, 0, 0, 0 }
1395 static flag_insc_table flag_insc_sust[] =
1397 { "ÏÓ", "St", TR2_SUST_STR, 2, 0 },
1398 { "ÃÎ", "In", TR2_SUST_INT, 2, 0 },
1399 { "¸", "Wi", TR2_SUST_WIS, 2, 0 },
1400 { "´ï", "Dx", TR2_SUST_DEX, 2, 0 },
1401 { "ÂÑ", "Cn", TR2_SUST_CON, 2, 0 },
1402 { "̥", "Ch", TR2_SUST_CHR, 2, 0 },
1403 { NULL, NULL, 0, 0, 0 }
1407 static flag_insc_table flag_insc_plus[] =
1409 { "At", TR1_BLOWS, 1, 0 },
1410 { "Sp", TR1_SPEED, 1, 0 },
1411 { "St", TR1_STR, 1, 0 },
1412 { "In", TR1_INT, 1, 0 },
1413 { "Wi", TR1_WIS, 1, 0 },
1414 { "Dx", TR1_DEX, 1, 0 },
1415 { "Cn", TR1_CON, 1, 0 },
1416 { "Ch", TR1_CHR, 1, 0 },
1417 { "Sl", TR1_STEALTH, 1, 0 },
1418 { "Sr", TR1_SEARCH, 1, 0 },
1419 { "If", TR1_INFRA, 1, 0 },
1420 { "Dg", TR1_TUNNEL, 1, 0 },
1424 static flag_insc_table flag_insc_immune[] =
1426 { "Ac", TR2_IM_ACID, 2, 0 },
1427 { "El", TR2_IM_ELEC, 2, 0 },
1428 { "Fi", TR2_IM_FIRE, 2, 0 },
1429 { "Co", TR2_IM_COLD, 2, 0 },
1433 static flag_insc_table flag_insc_resistance[] =
1435 { "Ac", TR2_RES_ACID, 2, TR2_IM_ACID },
1436 { "El", TR2_RES_ELEC, 2, TR2_IM_ELEC },
1437 { "Fi", TR2_RES_FIRE, 2, TR2_IM_FIRE },
1438 { "Co", TR2_RES_COLD, 2, TR2_IM_COLD },
1439 { "Po", TR2_RES_POIS, 2, 0 },
1440 { "Li", TR2_RES_LITE, 2, 0 },
1441 { "Dk", TR2_RES_DARK, 2, 0 },
1442 { "Sh", TR2_RES_SHARDS, 2, 0 },
1443 { "Bl", TR2_RES_BLIND, 2, 0 },
1444 { "Cf", TR2_RES_CONF, 2, 0 },
1445 { "So", TR2_RES_SOUND, 2, 0 },
1446 { "Nt", TR2_RES_NETHER, 2, 0 },
1447 { "Nx", TR2_RES_NEXUS, 2, 0 },
1448 { "Ca", TR2_RES_CHAOS, 2, 0 },
1449 { "Di", TR2_RES_DISEN, 2, 0 },
1450 { "Fe", TR2_RES_FEAR, 2, 0 },
1454 static flag_insc_table flag_insc_misc[] =
1456 { "Ma", TR3_DEC_MANA, 3, 0 },
1457 { "Th", TR2_THROW, 2, 0 },
1458 { "Rf", TR2_REFLECT, 2, 0 },
1459 { "Fa", TR2_FREE_ACT, 2, 0 },
1460 { "Si", TR3_SEE_INVIS, 3, 0 },
1461 { "Hl", TR2_HOLD_LIFE, 2, 0 },
1462 { "Esp", TR3_TELEPATHY, 3, 0 },
1463 { "Sd", TR3_SLOW_DIGEST, 3, 0 },
1464 { "Rg", TR3_REGEN, 3, 0 },
1465 { "Lv", TR3_FEATHER, 3, 0 },
1466 { "Lu", TR3_LITE, 3, 0 },
1467 { "Wr", TR3_WARNING, 3, 0 },
1468 { "Xm", TR3_XTRA_MIGHT, 3, 0 },
1469 { "Xs", TR3_XTRA_SHOTS, 3, 0 },
1470 { "Ag", TR3_AGGRAVATE, 3, 0 },
1471 { "Bs", TR3_BLESSED, 3, 0 },
1473 { "Pc", TR3_PERMA_CURSE, 3, 0 },
1474 { "Cu", TR3_HEAVY_CURSE, 3, TR3_PERMA_CURSE },
1475 { "Ty", TR3_TY_CURSE, 3, 0 },
1478 { "De", TR3_DRAIN_EXP, 3, 0 },
1483 static flag_insc_table flag_insc_aura[] =
1485 { "F", TR3_SH_FIRE, 3, 0 },
1486 { "E", TR3_SH_ELEC, 3, 0 },
1487 { "C", TR3_SH_COLD, 3, 0 },
1488 { "M", TR3_NO_MAGIC, 3, 0 },
1489 { "T", TR3_NO_TELE, 3, 0 },
1493 static flag_insc_table flag_insc_brand[] =
1495 { "A", TR1_BRAND_ACID, 1, 0 },
1496 { "E", TR1_BRAND_ELEC, 1, 0 },
1497 { "F", TR1_BRAND_FIRE, 1, 0 },
1498 { "Co", TR1_BRAND_COLD, 1, 0 },
1499 { "P", TR1_BRAND_POIS, 1, 0 },
1500 { "Ca", TR1_CHAOTIC, 1, 0 },
1501 { "V", TR1_VAMPIRIC, 1, 0 },
1502 { "Q", TR1_IMPACT, 1, 0 },
1503 { "S", TR1_VORPAL, 1, 0 },
1504 { "M", TR1_FORCE_WEAPON, 1, 0 },
1508 static flag_insc_table flag_insc_slay[] =
1510 { "*", TR1_SLAY_EVIL, 1, 0 },
1511 { "p", TR3_SLAY_HUMAN, 3, 0 },
1512 { "D", TR1_KILL_DRAGON, 1, 0 },
1513 { "d", TR1_SLAY_DRAGON, 1, TR1_KILL_DRAGON },
1514 { "o", TR1_SLAY_ORC, 1, 0 },
1515 { "T", TR1_SLAY_TROLL, 1, 0 },
1516 { "P", TR1_SLAY_GIANT, 1, 0 },
1517 { "U", TR1_SLAY_DEMON, 1, 0 },
1518 { "L", TR1_SLAY_UNDEAD, 1, 0 },
1519 { "Z", TR1_SLAY_ANIMAL, 1, 0 },
1523 static flag_insc_table flag_insc_sust[] =
1525 { "St", TR2_SUST_STR, 2, 0 },
1526 { "In", TR2_SUST_INT, 2, 0 },
1527 { "Wi", TR2_SUST_WIS, 2, 0 },
1528 { "Dx", TR2_SUST_DEX, 2, 0 },
1529 { "Cn", TR2_SUST_CON, 2, 0 },
1530 { "Ch", TR2_SUST_CHR, 2, 0 },
1535 #define ADD_INSC(STR) (void)(strcat(ptr, (STR)), ptr += strlen(STR))
1537 static char *inscribe_flags_aux(flag_insc_table *f_ptr, u32b flag[], bool kanji, char *ptr)
1541 if ((flag[f_ptr->num-1] & f_ptr->flag) &&
1542 !(flag[f_ptr->num-1] & f_ptr->except_flag))
1544 ADD_INSC(kanji ? f_ptr->japanese : f_ptr->english);
1546 ADD_INSC(f_ptr->english);
1554 static bool have_flag_of(flag_insc_table *f_ptr, u32b flag[])
1558 if ((flag[f_ptr->num-1] & f_ptr->flag) &&
1559 !(flag[f_ptr->num-1] & f_ptr->except_flag))
1567 s16b inscribe_flags(object_type *o_ptr, cptr out_val)
1571 char *prev_ptr = buff;
1578 /* not fully identified */
1579 if (!(o_ptr->ident & IDENT_MENTAL))
1580 return quark_add(out_val);
1582 /* Extract the flags */
1583 object_flags(o_ptr, &flag[0], &flag[1], &flag[2]);
1587 for (i = 0; out_val[i]; i++)
1589 if ('%' == out_val[i] )
1591 cptr start_percent = ptr;
1593 if ('%' == out_val[i+1])
1603 if ('a' == out_val[i+1] && 'l' == out_val[i+2] && 'l' == out_val[i+3])
1613 /* check for too long inscription */
1614 if (ptr >= buff + MAX_NLEN) continue;
1616 /* Remove obvious flags */
1619 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1622 flag[0] &= ~k_ptr->flags1;
1623 flag[1] &= ~k_ptr->flags2;
1624 flag[2] &= ~k_ptr->flags3;
1628 artifact_type *a_ptr = &a_info[o_ptr->name1];
1630 flag[0] &= ~a_ptr->flags1;
1631 flag[1] &= ~a_ptr->flags2;
1632 flag[2] &= ~(a_ptr->flags3 & ~TR3_TELEPORT);
1637 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1639 flag[0] &= ~e_ptr->flags1;
1640 flag[1] &= ~e_ptr->flags2;
1641 flag[2] &= ~(e_ptr->flags3 & ~TR3_TELEPORT);
1647 if (have_flag_of(flag_insc_plus, flag))
1652 ptr = inscribe_flags_aux(flag_insc_plus, flag, kanji, ptr);
1655 if (have_flag_of(flag_insc_immune, flag))
1657 if (!kanji && ptr != prev_ptr)
1664 ptr = inscribe_flags_aux(flag_insc_immune, flag, kanji, ptr);
1667 if (have_flag_of(flag_insc_resistance, flag))
1671 else if (ptr != prev_ptr)
1677 ptr = inscribe_flags_aux(flag_insc_resistance, flag, kanji, ptr);
1680 if (have_flag_of(flag_insc_misc, flag))
1682 if (ptr != prev_ptr)
1688 ptr = inscribe_flags_aux(flag_insc_misc, flag, kanji, ptr);
1691 if (have_flag_of(flag_insc_aura, flag))
1695 ptr = inscribe_flags_aux(flag_insc_aura, flag, kanji, ptr);
1698 if (have_flag_of(flag_insc_brand, flag))
1700 ptr = inscribe_flags_aux(flag_insc_brand, flag, kanji, ptr);
1703 if (have_flag_of(flag_insc_slay, flag))
1705 ptr = inscribe_flags_aux(flag_insc_slay, flag, kanji, ptr);
1707 /* Random Teleport */
1708 if (flag[2] & (TR3_TELEPORT))
1714 if (have_flag_of(flag_insc_sust, flag))
1718 ptr = inscribe_flags_aux(flag_insc_sust, flag, kanji, ptr);
1720 if (ptr == start_percent)
1725 *ptr++ = out_val[i];
1730 /* cut too long inscription */
1731 if (strlen(buff) >= MAX_NLEN-1)
1735 for (n = 0; n < MAX_NLEN; n++)
1736 if(iskanji(buff[n])) n++;
1737 if (n == MAX_NLEN) n = MAX_NLEN-2; /* ºÇ¸å¤¬´Á»úȾʬ */
1740 buff[MAX_NLEN-1] = '\0';
1744 return quark_add(buff);
1748 * Inscribe an object with a comment
1750 void do_cmd_inscribe(void)
1756 char o_name[MAX_NLEN];
1762 item_tester_no_ryoute = TRUE;
1765 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1766 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1768 q = "Inscribe which item? ";
1769 s = "You have nothing to inscribe.";
1772 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1774 /* Get the item (in the pack) */
1777 o_ptr = &inventory[item];
1780 /* Get the item (on the floor) */
1783 o_ptr = &o_list[0 - item];
1786 /* Describe the activity */
1787 object_desc(o_name, o_ptr, TRUE, 2);
1791 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1793 msg_format("Inscribing %s.", o_name);
1798 /* Start with nothing */
1799 strcpy(out_val, "");
1801 /* Use old inscription */
1802 if (o_ptr->inscription)
1804 /* Start with the old inscription */
1805 strcpy(out_val, quark_str(o_ptr->inscription));
1808 /* Get a new inscription (possibly empty) */
1810 if (get_string("ÌÃ: ", out_val, 80))
1812 if (get_string("Inscription: ", out_val, 80))
1815 /* Save the inscription */
1816 o_ptr->inscription = inscribe_flags(o_ptr, out_val);
1818 /* Combine the pack */
1819 p_ptr->notice |= (PN_COMBINE);
1822 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1824 /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
1825 p_ptr->update |= (PU_BONUS);
1832 * An "item_tester_hook" for refilling lanterns
1834 static bool item_tester_refill_lantern(object_type *o_ptr)
1836 /* Flasks of oil are okay */
1837 if (o_ptr->tval == TV_FLASK) return (TRUE);
1839 /* Laterns are okay */
1840 if ((o_ptr->tval == TV_LITE) &&
1841 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1843 /* Assume not okay */
1849 * Refill the players lamp (from the pack or floor)
1851 static void do_cmd_refill_lamp(void)
1861 /* Restrict the choices */
1862 item_tester_hook = item_tester_refill_lantern;
1866 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1867 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1869 q = "Refill with which flask? ";
1870 s = "You have no flasks of oil.";
1873 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1875 /* Get the item (in the pack) */
1878 o_ptr = &inventory[item];
1881 /* Get the item (on the floor) */
1884 o_ptr = &o_list[0 - item];
1888 /* Take a partial turn */
1891 /* Access the lantern */
1892 j_ptr = &inventory[INVEN_LITE];
1895 j_ptr->xtra4 += o_ptr->xtra4;
1899 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1901 msg_print("You fuel your lamp.");
1905 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1909 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1911 msg_print("Your lamp has gone out!");
1914 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1918 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1920 msg_print("Curiously, your lamp doesn't light.");
1923 else if (j_ptr->xtra4 >= FUEL_LAMP)
1925 j_ptr->xtra4 = FUEL_LAMP;
1927 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1929 msg_print("Your lamp is full.");
1934 /* Decrease the item (from the pack) */
1937 inven_item_increase(item, -1);
1938 inven_item_describe(item);
1939 inven_item_optimize(item);
1942 /* Decrease the item (from the floor) */
1945 floor_item_increase(0 - item, -1);
1946 floor_item_describe(0 - item);
1947 floor_item_optimize(0 - item);
1950 /* Recalculate torch */
1951 p_ptr->update |= (PU_TORCH);
1956 * An "item_tester_hook" for refilling torches
1958 static bool item_tester_refill_torch(object_type *o_ptr)
1960 /* Torches are okay */
1961 if ((o_ptr->tval == TV_LITE) &&
1962 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1964 /* Assume not okay */
1970 * Refuel the players torch (from the pack or floor)
1972 static void do_cmd_refill_torch(void)
1982 /* Restrict the choices */
1983 item_tester_hook = item_tester_refill_torch;
1987 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1988 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1990 q = "Refuel with which torch? ";
1991 s = "You have no extra torches.";
1994 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1996 /* Get the item (in the pack) */
1999 o_ptr = &inventory[item];
2002 /* Get the item (on the floor) */
2005 o_ptr = &o_list[0 - item];
2009 /* Take a partial turn */
2012 /* Access the primary torch */
2013 j_ptr = &inventory[INVEN_LITE];
2016 j_ptr->xtra4 += o_ptr->xtra4 + 5;
2020 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
2022 msg_print("You combine the torches.");
2027 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
2031 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
2033 msg_print("Your torch has gone out!");
2036 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
2040 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
2042 msg_print("Curiously, your torche don't light.");
2045 /* Over-fuel message */
2046 else if (j_ptr->xtra4 >= FUEL_TORCH)
2048 j_ptr->xtra4 = FUEL_TORCH;
2050 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
2052 msg_print("Your torch is fully fueled.");
2057 /* Refuel message */
2061 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
2063 msg_print("Your torch glows more brightly.");
2068 /* Decrease the item (from the pack) */
2071 inven_item_increase(item, -1);
2072 inven_item_describe(item);
2073 inven_item_optimize(item);
2076 /* Decrease the item (from the floor) */
2079 floor_item_increase(0 - item, -1);
2080 floor_item_describe(0 - item);
2081 floor_item_optimize(0 - item);
2084 /* Recalculate torch */
2085 p_ptr->update |= (PU_TORCH);
2090 * Refill the players lamp, or restock his torches
2092 void do_cmd_refill(void)
2097 o_ptr = &inventory[INVEN_LITE];
2099 if (p_ptr->special_defense & KATA_MUSOU)
2101 set_action(ACTION_NONE);
2105 if (o_ptr->tval != TV_LITE)
2108 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
2110 msg_print("You are not wielding a light.");
2116 else if (o_ptr->sval == SV_LITE_LANTERN)
2118 do_cmd_refill_lamp();
2122 else if (o_ptr->sval == SV_LITE_TORCH)
2124 do_cmd_refill_torch();
2127 /* No torch to refill */
2131 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
2133 msg_print("Your light cannot be refilled.");
2143 void do_cmd_target(void)
2146 if (target_set(TARGET_KILL))
2149 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
2151 msg_print("Target Selected.");
2156 /* Target aborted */
2160 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
2162 msg_print("Target Aborted.");
2173 void do_cmd_look(void)
2176 if (target_set(TARGET_LOOK))
2179 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
2181 msg_print("Target Selected.");
2190 * Allow the player to examine other sectors on the map
2192 void do_cmd_locate(void)
2194 int dir, y1, x1, y2, x2;
2203 get_screen_size(&wid, &hgt);
2206 /* Start at current panel */
2207 y2 = y1 = panel_row_min;
2208 x2 = x1 = panel_col_min;
2210 /* Show panels until done */
2213 /* Describe the location */
2214 if ((y2 == y1) && (x2 == x1))
2217 strcpy(tmp_val, "¿¿¾å");
2226 sprintf(tmp_val, "%s%s",
2227 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
2228 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
2230 sprintf(tmp_val, "%s%s of",
2231 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
2232 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
2237 /* Prepare to ask which way to look */
2240 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
2242 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
2245 y2 / (hgt / 2), y2 % (hgt / 2),
2246 x2 / (wid / 2), x2 % (wid / 2), tmp_val);
2248 /* Assume no direction */
2251 /* Get a direction */
2256 /* Get a command (or Cancel) */
2257 if (!get_com(out_val, &command, TRUE)) break;
2259 /* Extract the action (if any) */
2260 dir = get_keymap_dir(command);
2269 /* Apply the motion */
2270 if (change_panel(ddy[dir], ddx[dir]))
2278 /* Recenter the map around the player */
2282 p_ptr->update |= (PU_MONSTERS);
2285 p_ptr->redraw |= (PR_MAP);
2288 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
2297 * The table of "symbol info" -- each entry is a string of the form
2298 * "X:desc" where "X" is the trigger, and "desc" is the "info".
2300 static cptr ident_info[] =
2305 "\":¥¢¥ß¥å¥ì¥Ã¥È, ðô¾þ¤ê",
2306 "#:ÊÉ(±£¤·¥É¥¢)Ëô¤Ï¿¢Êª",
2308 "%:¹ÛÌ®(Íϴ䤫ÀбÑ)",
2313 "*:ºâÊõ¤ò´Þ¤ó¤À¹ÛÌ®¤Þ¤¿¤Ïµå·Á¤Î²øʪ",
2315 ",:¿©¤Ùʪ, ¤ª¤Ð¤±¥¥Î¥³",
2318 "/:´È¾õÉð´ï(¥¢¥Ã¥¯¥¹/¥Ñ¥¤¥¯/Åù)",
2322 "3:Éð´ïÀìÌ珤ÎÆþ¸ý",
2324 "5:Ï£¶â½Ñ¤ÎŹ¤ÎÆþ¸ý",
2326 "7:¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤ÎÆþ¸ý",
2330 ";:²óÈò¤Î³¨Ê¸»ú/Çúȯ¤Î¥ë¡¼¥ó",
2339 "D:¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à",
2346 "K:¥¥é¡¼¡¦¥Ó¡¼¥È¥ë",
2352 "Q:¥¯¥¤¥ë¥¹¥ë¥°(Ì®ÂǤÄÆù²ô)",
2354 "S:ÃØéá/¥µ¥½¥ê/¥À¥Ë",
2358 "W:¥ï¥¤¥È/¥ì¥¤¥¹/Åù",
2359 "X:¥¾¡¼¥ó/¥¶¥ì¥ó/Åù",
2363 "\\:Æß´ï(¥á¥¤¥¹/¥à¥Á/Åù)",
2375 "h:¥Û¥Ó¥Ã¥È/¥¨¥ë¥Õ/¥É¥ï¡¼¥Õ",
2394 "{:Èô¤ÓÆ»¶ñ¤ÎÃÆ(Ìð/ÃÆ)",
2395 "|:Åá·õÎà(¥½¡¼¥É/¥À¥¬¡¼/Åù)",
2396 "}:Èô¤ÓÆ»¶ñ(µÝ/¥¯¥í¥¹¥Ü¥¦/¥¹¥ê¥ó¥°)",
2397 "~:¿å/ÍÏ´äή(¼ï¡¹¤Î¥¢¥¤¥Æ¥à)",
2400 "!:A potion (or oil)",
2401 "\":An amulet (or necklace)",
2402 "#:A wall (or secret door)",
2403 "$:Treasure (gold or gems)",
2404 "%:A vein (magma or quartz)",
2409 "*:A vein with treasure or a ball monster",
2411 ",:Food (or mushroom patch)",
2412 "-:A wand (or rod)",
2414 "/:A polearm (Axe/Pike/etc)",
2415 "0:Entrance to Museum",
2416 "1:Entrance to General Store",
2417 "2:Entrance to Armory",
2418 "3:Entrance to Weaponsmith",
2419 "4:Entrance to Temple",
2420 "5:Entrance to Alchemy shop",
2421 "6:Entrance to Magic store",
2422 "7:Entrance to Black Market",
2423 "8:Entrance to your home",
2424 "9:Entrance to the bookstore",
2426 ";:A glyph of warding / explosive rune",
2427 "<:An up staircase",
2429 ">:A down staircase",
2435 "D:Ancient Dragon/Wyrm",
2444 "M:Multi-Headed Reptile",
2448 "Q:Quylthulg (Pulsing Flesh Mound)",
2449 "R:Reptile/Amphibian",
2450 "S:Spider/Scorpion/Tick",
2454 "W:Wight/Wraith/etc",
2459 "\\:A hafted weapon (mace/whip/etc)",
2463 "`:A figurine or statue",
2471 "h:Hobbit/Elf/Dwarf",
2475 "l:Aquatic monster",
2490 "{:A missile (arrow/bolt/shot)",
2491 "|:An edged weapon (sword/dagger/etc)",
2492 "}:A launcher (bow/crossbow/sling)",
2493 "~:Fluid terrain (or miscellaneous item)",
2501 * Sorting hook -- Comp function -- see below
2503 * We use "u" to point to array of monster indexes,
2504 * and "v" to select the type of sorting to perform on "u".
2506 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
2508 u16b *who = (u16b*)(u);
2510 u16b *why = (u16b*)(v);
2518 /* Sort by player kills */
2521 /* Extract player kills */
2522 z1 = r_info[w1].r_pkills;
2523 z2 = r_info[w2].r_pkills;
2525 /* Compare player kills */
2526 if (z1 < z2) return (TRUE);
2527 if (z1 > z2) return (FALSE);
2531 /* Sort by total kills */
2534 /* Extract total kills */
2535 z1 = r_info[w1].r_tkills;
2536 z2 = r_info[w2].r_tkills;
2538 /* Compare total kills */
2539 if (z1 < z2) return (TRUE);
2540 if (z1 > z2) return (FALSE);
2544 /* Sort by monster level */
2547 /* Extract levels */
2548 z1 = r_info[w1].level;
2549 z2 = r_info[w2].level;
2551 /* Compare levels */
2552 if (z1 < z2) return (TRUE);
2553 if (z1 > z2) return (FALSE);
2557 /* Sort by monster experience */
2560 /* Extract experience */
2561 z1 = r_info[w1].mexp;
2562 z2 = r_info[w2].mexp;
2564 /* Compare experience */
2565 if (z1 < z2) return (TRUE);
2566 if (z1 > z2) return (FALSE);
2570 /* Compare indexes */
2576 * Sorting hook -- Swap function -- see below
2578 * We use "u" to point to array of monster indexes,
2579 * and "v" to select the type of sorting to perform.
2581 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
2583 u16b *who = (u16b*)(u);
2596 * Identify a character, allow recall of monsters
2598 * Several "special" responses recall "multiple" monsters:
2600 * ^U (all unique monsters)
2601 * ^N (all non-unique monsters)
2603 * The responses may be sorted in several ways, see below.
2605 * Note that the player ghosts are ignored. XXX XXX XXX
2607 void do_cmd_query_symbol(void)
2618 bool recall = FALSE;
2623 /* Get a character, or abort */
2625 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
2627 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
2631 /* Find that character info, and describe it */
2632 for (i = 0; ident_info[i]; ++i)
2634 if (sym == ident_info[i][0]) break;
2638 if (sym == KTRL('A'))
2642 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2644 strcpy(buf, "Full monster list.");
2648 else if (sym == KTRL('U'))
2652 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2654 strcpy(buf, "Unique monster list.");
2658 else if (sym == KTRL('N'))
2662 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2664 strcpy(buf, "Non-unique monster list.");
2668 /* XTRA HACK WHATSEARCH */
2669 else if (sym == KTRL('M'))
2673 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2675 if (!get_string("Enter name:",temp, 70))
2682 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2684 sprintf(buf, "Monsters with a name \"%s\"",temp);
2687 else if (ident_info[i])
2689 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2694 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2696 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2701 /* Display the result */
2704 /* Allocate the "who" array */
2705 C_MAKE(who, max_r_idx, u16b);
2707 /* Collect matching monsters */
2708 for (n = 0, i = 1; i < max_r_idx; i++)
2710 monster_race *r_ptr = &r_info[i];
2712 /* Nothing to recall */
2713 if (!cheat_know && !r_ptr->r_sights) continue;
2715 /* Require non-unique monsters if needed */
2716 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2718 /* Require unique monsters if needed */
2719 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2721 /* XTRA HACK WHATSEARCH */
2726 for (xx=0; temp[xx] && xx<80; xx++){
2728 if (iskanji( temp[xx])) { xx++; continue; }
2730 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2734 strcpy(temp2, r_name+r_ptr->E_name);
2736 strcpy(temp2, r_name+r_ptr->name);
2738 for (xx=0; temp2[xx] && xx<80; xx++)
2739 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2742 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
2744 if (strstr(temp2, temp))
2748 /* Collect "appropriate" monsters */
2749 if (all || (r_ptr->d_char == sym)) who[n++] = i;
2752 /* Nothing to recall */
2755 /* Free the "who" array */
2756 C_KILL(who, max_r_idx, u16b);
2762 /* Prompt XXX XXX XXX */
2764 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2766 put_str("Recall details? (k/y/n): ", 0, 40);
2778 /* Select the sort method */
2779 ang_sort_comp = ang_sort_comp_hook;
2780 ang_sort_swap = ang_sort_swap_hook;
2782 /* Sort the array */
2783 ang_sort(who, &why, n);
2785 /* Sort by kills (and level) */
2792 /* Catch "escape" */
2795 /* Free the "who" array */
2796 C_KILL(who, max_r_idx, u16b);
2801 /* Sort if needed */
2804 /* Select the sort method */
2805 ang_sort_comp = ang_sort_comp_hook;
2806 ang_sort_swap = ang_sort_swap_hook;
2808 /* Sort the array */
2809 ang_sort(who, &why, n);
2813 /* Start at the end */
2816 /* Scan the monster memory */
2819 /* Extract a race */
2822 /* Hack -- Auto-recall */
2823 monster_race_track(r_idx);
2825 /* Hack -- Handle stuff */
2828 /* Hack -- Begin the prompt */
2831 /* Hack -- Complete the prompt */
2833 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2835 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2845 /* Save the screen */
2848 /* Recall on screen */
2849 screen_roff(who[i], 0);
2851 /* Hack -- Complete the prompt (again) */
2853 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2855 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2870 /* Normal commands */
2871 if (query != 'r') break;
2878 if (query == ESCAPE) break;
2880 /* Move to "prev" monster */
2886 if (!expand_list) break;
2890 /* Move to "next" monster */
2896 if (!expand_list) break;
2901 /* Free the "who" array */
2902 C_KILL(who, max_r_idx, u16b);
2904 /* Re-display the identity */
2913 bool research_mon(void)
2921 bool recall = FALSE;
2927 /* XTRA HACK WHATSEARCH */
2933 /* XTRA HACK REMEMBER_IDX */
2934 static int old_sym = '\0';
2935 static int old_i = 0;
2938 /* Save the screen */
2941 /* Get a character, or abort */
2943 if (!get_com("¥â¥ó¥¹¥¿¡¼¤Îʸ»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°):", &sym, FALSE))
2945 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE))
2955 /* Find that character info, and describe it */
2956 for (i = 0; ident_info[i]; ++i)
2958 if (sym == ident_info[i][0]) break;
2961 /* XTRA HACK WHATSEARCH */
2962 if (sym == KTRL('A'))
2966 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2968 strcpy(buf, "Full monster list.");
2971 else if (sym == KTRL('U'))
2975 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2977 strcpy(buf, "Unique monster list.");
2980 else if (sym == KTRL('N'))
2984 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2986 strcpy(buf, "Non-unique monster list.");
2989 else if (sym == KTRL('M'))
2993 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2995 if (!get_string("Enter name:",temp, 70))
3002 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
3004 sprintf(buf, "Monsters with a name \"%s\"",temp);
3007 else if (ident_info[i])
3009 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
3014 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
3016 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
3021 /* Display the result */
3025 /* Allocate the "who" array */
3026 C_MAKE(who, max_r_idx, u16b);
3028 /* Collect matching monsters */
3029 for (n = 0, i = 1; i < max_r_idx; i++)
3031 monster_race *r_ptr = &r_info[i];
3033 /* XTRA HACK WHATSEARCH */
3034 /* Require non-unique monsters if needed */
3035 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
3037 /* Require unique monsters if needed */
3038 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
3045 for (xx=0; temp[xx] && xx<80; xx++){
3047 if (iskanji( temp[xx])) { xx++; continue; }
3049 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
3053 strcpy(temp2, r_name+r_ptr->E_name);
3055 strcpy(temp2, r_name+r_ptr->name);
3057 for (xx=0; temp2[xx] && xx<80; xx++)
3058 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
3061 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
3063 if (strstr(temp2, temp))
3067 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
3070 /* Nothing to recall */
3073 /* Free the "who" array */
3074 C_KILL(who, max_r_idx, u16b);
3086 /* Sort if needed */
3089 /* Select the sort method */
3090 ang_sort_comp = ang_sort_comp_hook;
3091 ang_sort_swap = ang_sort_swap_hook;
3093 /* Sort the array */
3094 ang_sort(who, &why, n);
3098 /* Start at the end */
3099 /* XTRA HACK REMEMBER_IDX */
3100 if (old_sym == sym && old_i < n) i = old_i;
3105 /* Scan the monster memory */
3108 /* Extract a race */
3111 /* Save this monster ID */
3112 p_ptr->monster_race_idx = r_idx;
3114 /* Hack -- Handle stuff */
3117 /* Hack -- Begin the prompt */
3120 /* Hack -- Complete the prompt */
3122 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ' '¤Ç³¹Ô, ESC]");
3124 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC, space to continue]");
3134 /* Recall on screen */
3135 monster_race *r_ptr = &r_info[r_idx];
3138 /* Hack -- Maximal info */
3139 r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR;
3141 /* Observe "maximal" attacks */
3142 for (m = 0; m < 4; m++)
3144 /* Examine "actual" blows */
3145 if (r_ptr->blow[m].effect || r_ptr->blow[m].method)
3147 /* Hack -- maximal observations */
3148 r_ptr->r_blows[m] = MAX_UCHAR;
3152 /* Hack -- maximal drops */
3153 r_ptr->r_drop_gold = r_ptr->r_drop_item =
3154 (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) +
3155 ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) +
3156 ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) +
3157 ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) +
3158 ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) +
3159 ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
3161 /* Hack -- but only "valid" drops */
3162 if (r_ptr->flags1 & RF1_ONLY_GOLD) r_ptr->r_drop_item = 0;
3163 if (r_ptr->flags1 & RF1_ONLY_ITEM) r_ptr->r_drop_gold = 0;
3165 /* Hack -- observe many spells */
3166 r_ptr->r_cast_inate = MAX_UCHAR;
3167 r_ptr->r_cast_spell = MAX_UCHAR;
3169 /* Hack -- know all the flags */
3170 r_ptr->r_flags1 = r_ptr->flags1;
3171 r_ptr->r_flags2 = r_ptr->flags2;
3172 r_ptr->r_flags3 = r_ptr->flags3;
3173 r_ptr->r_flags4 = r_ptr->flags4;
3174 r_ptr->r_flags5 = r_ptr->flags5;
3175 r_ptr->r_flags6 = r_ptr->flags6;
3177 r_ptr->r_xtra1 |= MR1_SINKA;
3179 /* know every thing mode */
3180 screen_roff(r_idx, 0x01);
3183 /* XTRA HACK REMEMBER_IDX */
3191 /* Normal commands */
3192 if (query != 'r') break;
3199 if (query == ESCAPE) break;
3201 /* Move to "prev" monster */
3207 if (!expand_list) break;
3211 /* Move to "next" monster */
3217 if (!expand_list) break;
3223 /* Re-display the identity */
3224 /* prt(buf, 5, 5);*/
3226 /* Free the "who" array */
3227 C_KILL(who, max_r_idx, u16b);
3232 return (!notpicked);