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)
77 /* Process normal keys */
80 /* Hack -- Use "display" mode */
89 void do_cmd_equip(void)
94 /* Note that we are in "equipment" mode */
97 #ifdef ALLOW_EASY_FLOOR
99 /* Note that we are in "equipment" mode */
100 if (easy_floor) command_wrk = (USE_EQUIP);
102 #endif /* ALLOW_EASY_FLOOR */
104 /* Save the screen */
107 /* Hack -- show empty slots */
108 item_tester_full = TRUE;
110 /* Display the equipment */
113 /* Hack -- undo the hack above */
114 item_tester_full = FALSE;
118 sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
119 lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
120 (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))
123 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
124 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
125 (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
132 /* Get a new command */
133 command_new = inkey();
135 /* Restore the screen */
139 /* Process "Escape" */
140 if (command_new == ESCAPE)
147 /* Process normal keys */
150 /* Enter "display" mode */
157 * The "wearable" tester
159 static bool item_tester_hook_wear(object_type *o_ptr)
161 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI))
162 if (p_ptr->psex == SEX_MALE) return FALSE;
164 /* Check for a usable slot */
165 if (wield_slot(o_ptr) >= INVEN_RARM) return (TRUE);
167 /* Assume not wearable */
172 static bool item_tester_hook_mochikae(object_type *o_ptr)
174 /* Check for a usable slot */
175 if (((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD)) ||
176 (o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CAPTURE) ||
177 (o_ptr->tval == TV_CARD)) return (TRUE);
179 /* Assume not wearable */
184 static bool item_tester_hook_melee_weapon(object_type *o_ptr)
186 /* Check for a usable slot */
187 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD))return (TRUE);
189 /* Assume not wearable */
195 * Wield or wear a single item from the pack or floor
197 void do_cmd_wield(void)
208 char o_name[MAX_NLEN];
212 if (p_ptr->special_defense & KATA_MUSOU)
214 set_action(ACTION_NONE);
217 /* Restrict the choices */
218 item_tester_hook = item_tester_hook_wear;
222 q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
223 s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
225 q = "Wear/Wield which item? ";
226 s = "You have nothing you can wear or wield.";
229 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
231 /* Get the item (in the pack) */
234 o_ptr = &inventory[item];
237 /* Get the item (on the floor) */
240 o_ptr = &o_list[0 - item];
245 slot = wield_slot(o_ptr);
246 #if 1 /* EASY_RING -- TNB */
248 if ((o_ptr->tval == TV_RING) && inventory[INVEN_LEFT].k_idx &&
249 inventory[INVEN_RIGHT].k_idx)
251 /* Restrict the choices */
252 item_tester_tval = TV_RING;
253 item_tester_no_ryoute = TRUE;
255 /* Choose a ring from the equipment only */
257 q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
259 q = "Replace which ring? ";
268 if (!get_item(&slot, q, s, (USE_EQUIP)))
272 #endif /* EASY_RING -- TNB */
274 if (((o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CARD) || (o_ptr->tval == TV_CAPTURE)) &&
275 buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
277 /* Restrict the choices */
278 item_tester_hook = item_tester_hook_melee_weapon;
279 item_tester_no_ryoute = TRUE;
281 /* Choose a weapon from the equipment only */
283 q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
285 q = "Replace which weapon? ";
294 if (!get_item(&slot, q, s, (USE_EQUIP)))
296 if (slot == INVEN_RARM)
298 object_type *or_ptr = &inventory[INVEN_RARM];
299 object_type *ol_ptr = &inventory[INVEN_LARM];
300 object_type *otmp_ptr;
301 object_type object_tmp;
302 char ol_name[MAX_NLEN];
304 otmp_ptr = &object_tmp;
306 object_desc(ol_name, ol_ptr, FALSE, 0);
308 object_copy(otmp_ptr, ol_ptr);
309 object_copy(ol_ptr, or_ptr);
310 object_copy(or_ptr, otmp_ptr);
312 msg_format("%s¤ò±¦¼ê¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name);
314 msg_format("You wield %s at right hand.", ol_name);
321 /* ÆóÅáή¤Ë¤¹¤ë¤«¤É¤¦¤« */
322 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) && (slot == INVEN_LARM))
325 if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©"))
327 if (!get_check("Dual wielding? "))
334 if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) &&
335 inventory[INVEN_LARM].k_idx &&
336 inventory[INVEN_RARM].k_idx)
338 /* Restrict the choices */
339 item_tester_hook = item_tester_hook_mochikae;
341 /* Choose a ring from the equipment only */
343 q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
345 q = "Equip which hand? ";
354 if (!get_item(&slot, q, s, (USE_EQUIP)))
358 /* Prevent wielding into a cursed slot */
359 if (cursed_p(&inventory[slot]))
362 object_desc(o_name, &inventory[slot], FALSE, 0);
366 msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
367 describe_use(slot) , o_name );
369 msg_format("The %s you are %s appears to be cursed.",
370 o_name, describe_use(slot));
374 /* Cancel the command */
378 if (cursed_p(o_ptr) && wear_confirm &&
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);
393 if (!get_check(dummy))
397 if ((o_ptr->name1 == ART_STONEMASK) && object_known_p(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
399 char dummy[MAX_NLEN+80];
402 object_desc(o_name, o_ptr, FALSE, 0);
405 sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
407 msg_format("%s will transforms you into a vampire permanently when equiped.", o_name);
408 sprintf(dummy, "Do you become a vampire?");
412 if (!get_check(dummy))
416 /* Check if completed a quest */
417 for (i = 0; i < max_quests; i++)
419 if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
420 (quest[i].status == QUEST_STATUS_TAKEN) &&
421 (quest[i].k_idx == o_ptr->name1))
423 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
424 quest[i].status = QUEST_STATUS_COMPLETED;
425 quest[i].complev = (byte)p_ptr->lev;
427 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
429 msg_print("You completed the quest!");
436 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) identify_item(o_ptr);
441 /* Get local object */
444 /* Obtain local object */
445 object_copy(q_ptr, o_ptr);
447 /* Modify quantity */
450 /* Decrease the item (from the pack) */
453 inven_item_increase(item, -1);
454 inven_item_optimize(item);
457 /* Decrease the item (from the floor) */
460 floor_item_increase(0 - item, -1);
461 floor_item_optimize(0 - item);
464 /* Access the wield slot */
465 o_ptr = &inventory[slot];
467 /* Take off existing item */
470 /* Take off existing item */
471 (void)inven_takeoff(slot, 255);
474 /* Wear the new stuff */
475 object_copy(o_ptr, q_ptr);
477 /* Increase the weight */
478 p_ptr->total_weight += q_ptr->weight;
480 /* Increment the equip counter by hand */
483 /* Where is the item now */
484 if (slot == INVEN_RARM)
486 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)))
488 act = "¤òξ¼ê¤Ç¹½¤¨¤¿";
490 act = "You are wielding";
494 act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
496 act = "You are wielding";
500 else if (slot == INVEN_LARM)
503 act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
505 act = "You are wielding";
509 else if (slot == INVEN_BOW)
512 act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
514 act = "You are shooting with";
518 else if (slot == INVEN_LITE)
521 act = "¤ò¸÷¸»¤Ë¤·¤¿";
523 act = "Your light source is";
532 act = "You are wearing";
537 /* Describe the result */
538 object_desc(o_name, o_ptr, TRUE, 3);
542 msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
544 msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
551 /* Warn the player */
553 msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
555 msg_print("Oops! It feels deathly cold!");
559 chg_virtue(V_HARMONY, -1);
562 o_ptr->ident |= (IDENT_SENSE);
565 if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
568 if (p_ptr->prace < 32)
570 p_ptr->old_race1 |= 1L << p_ptr->prace;
574 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
576 p_ptr->prace = RACE_VAMPIRE;
578 msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
580 msg_format("You polymorphed into a vampire!");
583 rp_ptr = &race_info[p_ptr->prace];
585 /* Experience factor */
586 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
588 /* Calculate the height/weight for males */
589 if (p_ptr->psex == SEX_MALE)
591 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
592 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
593 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
594 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
597 /* Calculate the height/weight for females */
598 else if (p_ptr->psex == SEX_FEMALE)
600 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
601 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
602 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
603 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
609 if (p_ptr->pclass == CLASS_SORCERER)
610 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
612 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
614 do_cmd_rerate(FALSE);
616 p_ptr->redraw |= (PR_BASIC);
618 p_ptr->update |= (PU_BONUS);
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 void kamaenaoshi(int item)
644 object_type *o_ptr, *o2_ptr;
645 char o_name[MAX_NLEN];
647 if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
649 o_ptr = &inventory[INVEN_RARM];
650 o2_ptr = &inventory[INVEN_LARM];
651 object_copy(o_ptr, o2_ptr);
652 p_ptr->total_weight += o2_ptr->weight;
653 inven_item_increase(INVEN_LARM,-1);
654 inven_item_optimize(INVEN_LARM);
655 object_desc(o_name, o_ptr, TRUE, 3);
656 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
658 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
660 msg_format("You are wielding %s with two-handed.", o_name );
664 msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
666 msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
669 else if ((item == INVEN_LARM) && buki_motteruka(INVEN_RARM))
671 o_ptr = &inventory[INVEN_RARM];
672 object_desc(o_name, o_ptr, TRUE, 3);
673 if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
675 msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
677 msg_format("You are wielding %s with two-handed.", o_name );
680 else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & 0x0002))
682 o_ptr = &inventory[INVEN_LARM];
683 o2_ptr = &inventory[INVEN_RARM];
684 object_copy(o_ptr, o2_ptr);
685 p_ptr->total_weight += o2_ptr->weight;
686 inven_item_increase(INVEN_RARM,-1);
687 inven_item_optimize(INVEN_RARM);
688 object_desc(o_name, o_ptr, TRUE, 3);
690 msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name );
692 msg_format("You switched hand of %s.", o_name );
701 void do_cmd_takeoff(void)
709 if (p_ptr->special_defense & KATA_MUSOU)
711 set_action(ACTION_NONE);
714 item_tester_no_ryoute = TRUE;
717 q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
718 s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
720 q = "Take off which item? ";
721 s = "You are not wearing anything to take off.";
724 if (!get_item(&item, q, s, (USE_EQUIP))) return;
726 /* Get the item (in the pack) */
729 o_ptr = &inventory[item];
732 /* Get the item (on the floor) */
735 o_ptr = &o_list[0 - item];
744 /* Extract the flags */
745 object_flags(o_ptr, &f1, &f2, &f3);
747 if ((f3 & TR3_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
751 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
753 msg_print("Hmmm, it seems to be cursed.");
760 if (((f3 & TR3_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
763 msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
765 msg_print("You teared a cursed equipment off by sheer strength!");
769 o_ptr->ident &= ~(IDENT_CURSED);
771 /* Hack -- Assume felt */
772 o_ptr->ident |= (IDENT_SENSE);
774 if (o_ptr->art_flags3 & TR3_CURSED)
775 o_ptr->art_flags3 &= ~(TR3_CURSED);
777 if (o_ptr->art_flags3 & TR3_HEAVY_CURSE)
778 o_ptr->art_flags3 &= ~(TR3_HEAVY_CURSE);
781 o_ptr->feeling = FEEL_NONE;
783 /* Recalculate the bonuses */
784 p_ptr->update |= (PU_BONUS);
787 p_ptr->window |= (PW_EQUIP);
790 msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
792 msg_print("You break the curse.");
798 msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
800 msg_print("You couldn't remove the equipment.");
807 /* Take a partial turn */
810 /* Take off the item */
811 (void)inven_takeoff(item, 255);
817 p_ptr->redraw |= (PR_EQUIPPY);
824 void do_cmd_drop(void)
832 if (p_ptr->special_defense & KATA_MUSOU)
834 set_action(ACTION_NONE);
837 item_tester_no_ryoute = TRUE;
840 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
841 s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
843 q = "Drop which item? ";
844 s = "You have nothing to drop.";
847 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN))) return;
849 /* Get the item (in the pack) */
852 o_ptr = &inventory[item];
855 /* Get the item (on the floor) */
858 o_ptr = &o_list[0 - item];
862 /* Hack -- Cannot remove cursed items */
863 if ((item >= INVEN_RARM) && cursed_p(o_ptr))
867 msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
869 msg_print("Hmmm, it seems to be cursed.");
878 /* See how many items */
879 if (o_ptr->number > 1)
882 amt = get_quantity(NULL, o_ptr->number);
884 /* Allow user abort */
885 if (amt <= 0) return;
889 /* Take a partial turn */
892 /* Drop (some of) the item */
893 inven_drop(item, amt);
895 if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
897 if (item >= INVEN_RARM) calc_android_exp();
899 p_ptr->redraw |= (PR_EQUIPPY);
903 static bool high_level_book(object_type *o_ptr)
905 if ((o_ptr->tval == TV_LIFE_BOOK) ||
906 (o_ptr->tval == TV_SORCERY_BOOK) ||
907 (o_ptr->tval == TV_NATURE_BOOK) ||
908 (o_ptr->tval == TV_CHAOS_BOOK) ||
909 (o_ptr->tval == TV_DEATH_BOOK) ||
910 (o_ptr->tval == TV_TRUMP_BOOK) ||
911 (o_ptr->tval == TV_ENCHANT_BOOK) ||
912 (o_ptr->tval == TV_DAEMON_BOOK) ||
913 (o_ptr->tval == TV_MUSIC_BOOK))
928 void do_cmd_destroy(void)
937 object_type *q_ptr = &forge;
939 char o_name[MAX_NLEN];
941 char out_val[MAX_NLEN+40];
945 if (p_ptr->special_defense & KATA_MUSOU)
947 set_action(ACTION_NONE);
950 /* Hack -- force destruction */
951 if (command_arg > 0) force = TRUE;
956 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
957 s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
959 q = "Destroy which item? ";
960 s = "You have nothing to destroy.";
963 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
965 /* Get the item (in the pack) */
968 o_ptr = &inventory[item];
971 /* Get the item (on the floor) */
974 o_ptr = &o_list[0 - item];
978 /* See how many items */
979 if (o_ptr->number > 1)
982 amt = get_quantity(NULL, o_ptr->number);
984 /* Allow user abort */
985 if (amt <= 0) return;
989 /* Describe the object */
990 old_number = o_ptr->number;
992 object_desc(o_name, o_ptr, TRUE, 3);
993 o_ptr->number = old_number;
995 /* Verify unless quantity given */
998 if (confirm_destroy || (object_value(o_ptr) > 0))
1000 /* Make a verification */
1002 sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
1004 sprintf(out_val, "Really destroy %s? ", o_name);
1007 if (!get_check(out_val)) return;
1014 /* Artifacts cannot be destroyed */
1015 if (artifact_p(o_ptr) || o_ptr->art_name)
1017 byte feel = FEEL_SPECIAL;
1023 msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
1025 msg_format("You cannot destroy %s.", o_name);
1029 /* Hack -- Handle icky artifacts */
1030 if (cursed_p(o_ptr) || broken_p(o_ptr)) feel = FEEL_TERRIBLE;
1032 /* Hack -- inscribe the artifact */
1033 o_ptr->feeling = feel;
1035 /* We have "felt" it (again) */
1036 o_ptr->ident |= (IDENT_SENSE);
1038 /* Combine the pack */
1039 p_ptr->notice |= (PN_COMBINE);
1041 p_ptr->redraw |= (PR_EQUIPPY);
1044 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1050 object_copy(q_ptr, o_ptr);
1054 msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
1056 msg_format("You destroy %s.", o_name);
1059 sound(SOUND_DESTITEM);
1061 /* Reduce the charges of rods/wands */
1062 reduce_charges(o_ptr, amt);
1064 /* Eliminate the item (from the pack) */
1067 inven_item_increase(item, -amt);
1068 inven_item_describe(item);
1069 inven_item_optimize(item);
1072 /* Eliminate the item (from the floor) */
1075 floor_item_increase(0 - item, -amt);
1076 floor_item_describe(0 - item);
1077 floor_item_optimize(0 - item);
1080 if (high_level_book(q_ptr))
1082 bool gain_expr = FALSE;
1084 if (p_ptr->prace == RACE_ANDROID)
1087 else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
1091 else if (p_ptr->pclass == CLASS_PALADIN)
1093 if (p_ptr->realm1 == REALM_LIFE)
1095 if (q_ptr->tval != TV_LIFE_BOOK) gain_expr = TRUE;
1099 if (q_ptr->tval == TV_LIFE_BOOK) gain_expr = TRUE;
1103 if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
1105 s32b tester_exp = p_ptr->max_exp / 20;
1106 if (tester_exp > 10000) tester_exp = 10000;
1107 if (q_ptr->sval < 3) tester_exp /= 4;
1108 if (tester_exp<1) tester_exp = 1;
1111 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1113 msg_print("You feel more experienced.");
1116 gain_exp(tester_exp * amt);
1118 if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
1120 chg_virtue(V_UNLIFE, 1);
1121 chg_virtue(V_VITALITY, -1);
1123 else if (high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
1125 chg_virtue(V_UNLIFE, -1);
1126 chg_virtue(V_VITALITY, 1);
1129 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
1130 chg_virtue(V_ENCHANT, -1);
1132 if (object_value_real(q_ptr) > 30000)
1133 chg_virtue(V_SACRIFICE, 2);
1135 else if (object_value_real(q_ptr) > 10000)
1136 chg_virtue(V_SACRIFICE, 1);
1139 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
1140 chg_virtue(V_HARMONY, 1);
1142 if (item >= INVEN_RARM) calc_android_exp();
1147 * Observe an item which has been *identify*-ed
1149 void do_cmd_observe(void)
1155 char o_name[MAX_NLEN];
1159 item_tester_no_ryoute = TRUE;
1162 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
1163 s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1165 q = "Examine which item? ";
1166 s = "You have nothing to examine.";
1169 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1171 /* Get the item (in the pack) */
1174 o_ptr = &inventory[item];
1177 /* Get the item (on the floor) */
1180 o_ptr = &o_list[0 - item];
1184 /* Require full knowledge */
1185 if (!(o_ptr->ident & IDENT_MENTAL))
1188 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
1190 msg_print("You have no special knowledge about that item.");
1198 object_desc(o_name, o_ptr, TRUE, 3);
1202 msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
1204 msg_format("Examining %s...", o_name);
1208 /* Describe it fully */
1210 if (!identify_fully_aux(o_ptr)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
1212 if (!identify_fully_aux(o_ptr)) msg_print("You see nothing special.");
1220 * Remove the inscription from an object
1221 * XXX Mention item (when done)?
1223 void do_cmd_uninscribe(void)
1231 item_tester_no_ryoute = TRUE;
1234 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
1235 s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1237 q = "Un-inscribe which item? ";
1238 s = "You have nothing to un-inscribe.";
1241 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1243 /* Get the item (in the pack) */
1246 o_ptr = &inventory[item];
1249 /* Get the item (on the floor) */
1252 o_ptr = &o_list[0 - item];
1255 /* Nothing to remove */
1256 if (!o_ptr->inscription)
1259 msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
1261 msg_print("That item had no inscription to remove.");
1269 msg_print("Ìäò¾Ã¤·¤¿¡£");
1271 msg_print("Inscription removed.");
1275 /* Remove the incription */
1276 o_ptr->inscription = 0;
1278 /* Combine the pack */
1279 p_ptr->notice |= (PN_COMBINE);
1282 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1286 * Auto flag inscribe
1289 typedef struct flag_insc_table
1301 static flag_insc_table flag_insc_plus[] =
1303 { "¹¶", "At", TR1_BLOWS, 1, 0 },
1304 { "®", "Sp", TR1_SPEED, 1, 0 },
1305 { "ÏÓ", "St", TR1_STR, 1, 0 },
1306 { "ÃÎ", "In", TR1_INT, 1, 0 },
1307 { "¸", "Wi", TR1_WIS, 1, 0 },
1308 { "´ï", "Dx", TR1_DEX, 1, 0 },
1309 { "ÂÑ", "Cn", TR1_CON, 1, 0 },
1310 { "̥", "Ch", TR1_CHR, 1, 0 },
1311 { "±£", "Sl", TR1_STEALTH, 1, 0 },
1312 { "õ", "Sr", TR1_SEARCH, 1, 0 },
1313 { "ÀÖ", "If", TR1_INFRA, 1, 0 },
1314 { "·¡", "Dg", TR1_TUNNEL, 1, 0 },
1318 static flag_insc_table flag_insc_immune[] =
1320 { "»À", "Ac", TR2_IM_ACID, 2, 0 },
1321 { "ÅÅ", "El", TR2_IM_ELEC, 2, 0 },
1322 { "²Ð", "Fi", TR2_IM_FIRE, 2, 0 },
1323 { "Îä", "Co", TR2_IM_COLD, 2, 0 },
1327 static flag_insc_table flag_insc_resistance[] =
1329 { "»À", "Ac", TR2_RES_ACID, 2, TR2_IM_ACID },
1330 { "ÅÅ", "El", TR2_RES_ELEC, 2, TR2_IM_ELEC },
1331 { "²Ð", "Fi", TR2_RES_FIRE, 2, TR2_IM_FIRE },
1332 { "Îä", "Co", TR2_RES_COLD, 2, TR2_IM_COLD },
1333 { "ÆÇ", "Po", TR2_RES_POIS, 2, 0 },
1334 { "Á®", "Li", TR2_RES_LITE, 2, 0 },
1335 { "°Å", "Dk", TR2_RES_DARK, 2, 0 },
1336 { "ÇË", "Sh", TR2_RES_SHARDS, 2, 0 },
1337 { "ÌÕ", "Bl", TR2_RES_BLIND, 2, 0 },
1338 { "Íð", "Cf", TR2_RES_CONF, 2, 0 },
1339 { "¹ì", "So", TR2_RES_SOUND, 2, 0 },
1340 { "¹ö", "Nt", TR2_RES_NETHER, 2, 0 },
1341 { "°ø", "Nx", TR2_RES_NEXUS, 2, 0 },
1342 { "ÆÙ", "Ca", TR2_RES_CHAOS, 2, 0 },
1343 { "Îô", "Di", TR2_RES_DISEN, 2, 0 },
1344 { "¶²", "Fe", TR2_RES_FEAR, 2, 0 },
1348 static flag_insc_table flag_insc_misc[] =
1350 { "ËâÎÏ", "Ma", TR3_DEC_MANA, 3, 0 },
1351 { "Åê", "Th", TR2_THROW, 2, 0 },
1352 { "ȿ", "Rf", TR2_REFLECT, 2, 0 },
1353 { "Ëã", "Fa", TR2_FREE_ACT, 2, 0 },
1354 { "ȑ", "Si", TR3_SEE_INVIS, 3, 0 },
1355 { "·Ð", "Hl", TR2_HOLD_LIFE, 2, 0 },
1356 { "´¶", "Esp", TR3_TELEPATHY, 3, 0 },
1357 { "ÃÙ", "Sd", TR3_SLOW_DIGEST, 3, 0 },
1358 { "³è", "Rg", TR3_REGEN, 3, 0 },
1359 { "Éâ", "Lv", TR3_FEATHER, 3, 0 },
1360 { "ÌÀ", "Lu", TR3_LITE, 3, 0 },
1361 { "·Ù", "Wr", TR3_WARNING, 3, 0 },
1362 { "ÇÜ", "Xm", TR3_XTRA_MIGHT, 3, 0 },
1363 { "¼Í", "Xs", TR3_XTRA_SHOTS, 3, 0 },
1364 { "ÅÜ", "Ag", TR3_AGGRAVATE, 3, 0 },
1365 { "½Ë", "Bs", TR3_BLESSED, 3, 0 },
1366 { "±Ê¼ö", "Pc", TR3_PERMA_CURSE, 3, 0 },
1367 { "¼ö", "Cu", TR3_HEAVY_CURSE, 3, TR3_PERMA_CURSE },
1368 { "´÷", "Ty", TR3_TY_CURSE, 3, 0 },
1372 static flag_insc_table flag_insc_aura[] =
1374 { "±ê", "F", TR3_SH_FIRE, 3, 0 },
1375 { "ÅÅ", "E", TR3_SH_ELEC, 3, 0 },
1376 { "Îä", "C", TR3_SH_COLD, 3, 0 },
1377 { "Ëâ", "M", TR3_NO_MAGIC, 3, 0 },
1378 { "½Ö", "T", TR3_NO_TELE, 3, 0 },
1382 static flag_insc_table flag_insc_brand[] =
1384 { "»À", "A", TR1_BRAND_ACID, 1, 0 },
1385 { "ÅÅ", "E", TR1_BRAND_ELEC, 1, 0 },
1386 { "¾Æ", "F", TR1_BRAND_FIRE, 1, 0 },
1387 { "Åà", "Co", TR1_BRAND_COLD, 1, 0 },
1388 { "ÆÇ", "P", TR1_BRAND_POIS, 1, 0 },
1389 { "ÆÙ", "Ca", TR1_CHAOTIC, 1, 0 },
1390 { "µÛ", "V", TR1_VAMPIRIC, 1, 0 },
1391 { "¿Ì", "Q", TR1_IMPACT, 1, 0 },
1392 { "ÀÚ", "S", TR1_VORPAL, 1, 0 },
1393 { "Íý", "M", TR1_FORCE_WEAPON, 1, 0 },
1394 { NULL, NULL, 0, 0, 0 }
1397 static flag_insc_table flag_insc_slay[] =
1399 { "¼Ù", "*", TR1_SLAY_EVIL, 1, 0 },
1400 { "ζ", "D", TR1_KILL_DRAGON, 1, 0 },
1401 { "ε", "d", TR1_SLAY_DRAGON, 1, TR1_KILL_DRAGON },
1402 { "¥ª", "o", TR1_SLAY_ORC, 1, 0 },
1403 { "¥È", "T", TR1_SLAY_TROLL, 1, 0 },
1404 { "µð", "P", TR1_SLAY_GIANT, 1, 0 },
1405 { "¥Ç", "U", TR1_SLAY_DEMON, 1, 0 },
1406 { "Ȉ", "L", TR1_SLAY_UNDEAD, 1, 0 },
1407 { "ư", "Z", TR1_SLAY_ANIMAL, 1, 0 },
1408 { NULL, NULL, 0, 0, 0 }
1411 static flag_insc_table flag_insc_sust[] =
1413 { "ÏÓ", "St", TR2_SUST_STR, 2, 0 },
1414 { "ÃÎ", "In", TR2_SUST_INT, 2, 0 },
1415 { "¸", "Wi", TR2_SUST_WIS, 2, 0 },
1416 { "´ï", "Dx", TR2_SUST_DEX, 2, 0 },
1417 { "ÂÑ", "Cn", TR2_SUST_CON, 2, 0 },
1418 { "̥", "Ch", TR2_SUST_CHR, 2, 0 },
1419 { NULL, NULL, 0, 0, 0 }
1423 static flag_insc_table flag_insc_plus[] =
1425 { "At", TR1_BLOWS, 1, 0 },
1426 { "Sp", TR1_SPEED, 1, 0 },
1427 { "St", TR1_STR, 1, 0 },
1428 { "In", TR1_INT, 1, 0 },
1429 { "Wi", TR1_WIS, 1, 0 },
1430 { "Dx", TR1_DEX, 1, 0 },
1431 { "Cn", TR1_CON, 1, 0 },
1432 { "Ch", TR1_CHR, 1, 0 },
1433 { "Sl", TR1_STEALTH, 1, 0 },
1434 { "Sr", TR1_SEARCH, 1, 0 },
1435 { "If", TR1_INFRA, 1, 0 },
1436 { "Dg", TR1_TUNNEL, 1, 0 },
1440 static flag_insc_table flag_insc_immune[] =
1442 { "Ac", TR2_IM_ACID, 2, 0 },
1443 { "El", TR2_IM_ELEC, 2, 0 },
1444 { "Fi", TR2_IM_FIRE, 2, 0 },
1445 { "Co", TR2_IM_COLD, 2, 0 },
1449 static flag_insc_table flag_insc_resistance[] =
1451 { "Ac", TR2_RES_ACID, 2, TR2_IM_ACID },
1452 { "El", TR2_RES_ELEC, 2, TR2_IM_ELEC },
1453 { "Fi", TR2_RES_FIRE, 2, TR2_IM_FIRE },
1454 { "Co", TR2_RES_COLD, 2, TR2_IM_COLD },
1455 { "Po", TR2_RES_POIS, 2, 0 },
1456 { "Li", TR2_RES_LITE, 2, 0 },
1457 { "Dk", TR2_RES_DARK, 2, 0 },
1458 { "Sh", TR2_RES_SHARDS, 2, 0 },
1459 { "Bl", TR2_RES_BLIND, 2, 0 },
1460 { "Cf", TR2_RES_CONF, 2, 0 },
1461 { "So", TR2_RES_SOUND, 2, 0 },
1462 { "Nt", TR2_RES_NETHER, 2, 0 },
1463 { "Nx", TR2_RES_NEXUS, 2, 0 },
1464 { "Ca", TR2_RES_CHAOS, 2, 0 },
1465 { "Di", TR2_RES_DISEN, 2, 0 },
1466 { "Fe", TR2_RES_FEAR, 2, 0 },
1470 static flag_insc_table flag_insc_misc[] =
1472 { "Ma", TR3_DEC_MANA, 3, 0 },
1473 { "Th", TR2_THROW, 2, 0 },
1474 { "Rf", TR2_REFLECT, 2, 0 },
1475 { "Fa", TR2_FREE_ACT, 2, 0 },
1476 { "Si", TR3_SEE_INVIS, 3, 0 },
1477 { "Hl", TR2_HOLD_LIFE, 2, 0 },
1478 { "Esp", TR3_TELEPATHY, 3, 0 },
1479 { "Sd", TR3_SLOW_DIGEST, 3, 0 },
1480 { "Rg", TR3_REGEN, 3, 0 },
1481 { "Lv", TR3_FEATHER, 3, 0 },
1482 { "Lu", TR3_LITE, 3, 0 },
1483 { "Wr", TR3_WARNING, 3, 0 },
1484 { "Xm", TR3_XTRA_MIGHT, 3, 0 },
1485 { "Xs", TR3_XTRA_SHOTS, 3, 0 },
1486 { "Ag", TR3_AGGRAVATE, 3, 0 },
1487 { "Bs", TR3_BLESSED, 3, 0 },
1488 { "Pc", TR3_PERMA_CURSE, 3, 0 },
1489 { "Cu", TR3_HEAVY_CURSE, 3, TR3_PERMA_CURSE },
1490 { "Ty", TR3_TY_CURSE, 3, 0 },
1492 { "De", TR3_DRAIN_EXP, 3, 0 },
1497 static flag_insc_table flag_insc_aura[] =
1499 { "F", TR3_SH_FIRE, 3, 0 },
1500 { "E", TR3_SH_ELEC, 3, 0 },
1501 { "C", TR3_SH_COLD, 3, 0 },
1502 { "M", TR3_NO_MAGIC, 3, 0 },
1503 { "T", TR3_NO_TELE, 3, 0 },
1507 static flag_insc_table flag_insc_brand[] =
1509 { "A", TR1_BRAND_ACID, 1, 0 },
1510 { "E", TR1_BRAND_ELEC, 1, 0 },
1511 { "F", TR1_BRAND_FIRE, 1, 0 },
1512 { "Co", TR1_BRAND_COLD, 1, 0 },
1513 { "P", TR1_BRAND_POIS, 1, 0 },
1514 { "Ca", TR1_CHAOTIC, 1, 0 },
1515 { "V", TR1_VAMPIRIC, 1, 0 },
1516 { "Q", TR1_IMPACT, 1, 0 },
1517 { "S", TR1_VORPAL, 1, 0 },
1518 { "M", TR1_FORCE_WEAPON, 1, 0 },
1522 static flag_insc_table flag_insc_slay[] =
1524 { "*", TR1_SLAY_EVIL, 1, 0 },
1525 { "D", TR1_KILL_DRAGON, 1, 0 },
1526 { "d", TR1_SLAY_DRAGON, 1, TR1_KILL_DRAGON },
1527 { "o", TR1_SLAY_ORC, 1, 0 },
1528 { "T", TR1_SLAY_TROLL, 1, 0 },
1529 { "P", TR1_SLAY_GIANT, 1, 0 },
1530 { "U", TR1_SLAY_DEMON, 1, 0 },
1531 { "L", TR1_SLAY_UNDEAD, 1, 0 },
1532 { "Z", TR1_SLAY_ANIMAL, 1, 0 },
1536 static flag_insc_table flag_insc_sust[] =
1538 { "St", TR2_SUST_STR, 2, 0 },
1539 { "In", TR2_SUST_INT, 2, 0 },
1540 { "Wi", TR2_SUST_WIS, 2, 0 },
1541 { "Dx", TR2_SUST_DEX, 2, 0 },
1542 { "Cn", TR2_SUST_CON, 2, 0 },
1543 { "Ch", TR2_SUST_CHR, 2, 0 },
1548 #define ADD_INSC(STR) (void)(strcat(ptr, (STR)), ptr += strlen(STR))
1550 static char *inscribe_flags_aux(flag_insc_table *f_ptr, u32b flag[], bool kanji, char *ptr)
1554 if ((flag[f_ptr->num-1] & f_ptr->flag) &&
1555 !(flag[f_ptr->num-1] & f_ptr->except_flag))
1557 ADD_INSC(kanji ? f_ptr->japanese : f_ptr->english);
1559 ADD_INSC(f_ptr->english);
1567 static bool have_flag_of(flag_insc_table *f_ptr, u32b flag[])
1571 if ((flag[f_ptr->num-1] & f_ptr->flag) &&
1572 !(flag[f_ptr->num-1] & f_ptr->except_flag))
1580 s16b inscribe_flags(object_type *o_ptr, cptr out_val)
1584 char *prev_ptr = buff;
1591 /* not fully identified */
1592 if (!(o_ptr->ident & IDENT_MENTAL))
1593 return quark_add(out_val);
1595 /* Extract the flags */
1596 object_flags(o_ptr, &flag[0], &flag[1], &flag[2]);
1600 for (i = 0; out_val[i]; i++)
1602 if ('%' == out_val[i] )
1604 cptr start_percent = ptr;
1606 if ('%' == out_val[i+1])
1616 if ('a' == out_val[i+1] && 'l' == out_val[i+2] && 'l' == out_val[i+3])
1626 /* check for too long inscription */
1627 if (ptr >= buff + MAX_NLEN) continue;
1629 /* Remove obvious flags */
1632 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1635 flag[0] &= ~k_ptr->flags1;
1636 flag[1] &= ~k_ptr->flags2;
1637 flag[2] &= ~k_ptr->flags3;
1641 artifact_type *a_ptr = &a_info[o_ptr->name1];
1643 flag[0] &= ~a_ptr->flags1;
1644 flag[1] &= ~a_ptr->flags2;
1645 flag[2] &= ~(a_ptr->flags3 & ~TR3_TELEPORT);
1650 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1652 flag[0] &= ~e_ptr->flags1;
1653 flag[1] &= ~e_ptr->flags2;
1654 flag[2] &= ~(e_ptr->flags3 & ~TR3_TELEPORT);
1660 if (have_flag_of(flag_insc_plus, flag))
1665 ptr = inscribe_flags_aux(flag_insc_plus, flag, kanji, ptr);
1668 if (have_flag_of(flag_insc_immune, flag))
1670 if (!kanji && ptr != prev_ptr)
1677 ptr = inscribe_flags_aux(flag_insc_immune, flag, kanji, ptr);
1680 if (have_flag_of(flag_insc_resistance, flag))
1684 else if (ptr != prev_ptr)
1690 ptr = inscribe_flags_aux(flag_insc_resistance, flag, kanji, ptr);
1693 if (have_flag_of(flag_insc_misc, flag))
1695 if (ptr != prev_ptr)
1701 ptr = inscribe_flags_aux(flag_insc_misc, flag, kanji, ptr);
1704 if (have_flag_of(flag_insc_aura, flag))
1708 ptr = inscribe_flags_aux(flag_insc_aura, flag, kanji, ptr);
1711 if (have_flag_of(flag_insc_brand, flag))
1713 ptr = inscribe_flags_aux(flag_insc_brand, flag, kanji, ptr);
1716 if (have_flag_of(flag_insc_slay, flag))
1718 ptr = inscribe_flags_aux(flag_insc_slay, flag, kanji, ptr);
1720 /* Random Teleport */
1721 if (flag[2] & (TR3_TELEPORT))
1727 if (have_flag_of(flag_insc_sust, flag))
1731 ptr = inscribe_flags_aux(flag_insc_sust, flag, kanji, ptr);
1733 if (ptr == start_percent)
1738 *ptr++ = out_val[i];
1743 /* cut too long inscription */
1744 if (strlen(buff) >= MAX_NLEN-1)
1748 for (n = 0; n < MAX_NLEN; n++)
1749 if(iskanji(buff[n])) n++;
1750 if (n == MAX_NLEN) n = MAX_NLEN-2; /* ºÇ¸å¤¬´Á»úȾʬ */
1753 buff[MAX_NLEN-1] = '\0';
1756 return quark_add(buff);
1760 * Inscribe an object with a comment
1762 void do_cmd_inscribe(void)
1768 char o_name[MAX_NLEN];
1774 item_tester_no_ryoute = TRUE;
1777 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
1778 s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
1780 q = "Inscribe which item? ";
1781 s = "You have nothing to inscribe.";
1784 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1786 /* Get the item (in the pack) */
1789 o_ptr = &inventory[item];
1792 /* Get the item (on the floor) */
1795 o_ptr = &o_list[0 - item];
1798 /* Describe the activity */
1799 object_desc(o_name, o_ptr, TRUE, 2);
1803 msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
1805 msg_format("Inscribing %s.", o_name);
1810 /* Start with nothing */
1811 strcpy(out_val, "");
1813 /* Use old inscription */
1814 if (o_ptr->inscription)
1816 /* Start with the old inscription */
1817 strcpy(out_val, quark_str(o_ptr->inscription));
1820 /* Get a new inscription (possibly empty) */
1822 if (get_string("ÌÃ: ", out_val, 80))
1824 if (get_string("Inscription: ", out_val, 80))
1827 /* Save the inscription */
1828 o_ptr->inscription = inscribe_flags(o_ptr, out_val);
1830 /* Combine the pack */
1831 p_ptr->notice |= (PN_COMBINE);
1834 p_ptr->window |= (PW_INVEN | PW_EQUIP);
1841 * An "item_tester_hook" for refilling lanterns
1843 static bool item_tester_refill_lantern(object_type *o_ptr)
1845 /* Flasks of oil are okay */
1846 if (o_ptr->tval == TV_FLASK) return (TRUE);
1848 /* Laterns are okay */
1849 if ((o_ptr->tval == TV_LITE) &&
1850 (o_ptr->sval == SV_LITE_LANTERN)) return (TRUE);
1852 /* Assume not okay */
1858 * Refill the players lamp (from the pack or floor)
1860 static void do_cmd_refill_lamp(void)
1870 /* Restrict the choices */
1871 item_tester_hook = item_tester_refill_lantern;
1875 q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
1876 s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
1878 q = "Refill with which flask? ";
1879 s = "You have no flasks of oil.";
1882 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1884 /* Get the item (in the pack) */
1887 o_ptr = &inventory[item];
1890 /* Get the item (on the floor) */
1893 o_ptr = &o_list[0 - item];
1897 /* Take a partial turn */
1900 /* Access the lantern */
1901 j_ptr = &inventory[INVEN_LITE];
1904 j_ptr->xtra4 += o_ptr->xtra4;
1908 msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
1910 msg_print("You fuel your lamp.");
1914 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
1918 msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1920 msg_print("Your lamp has gone out!");
1923 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
1927 msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
1929 msg_print("Curiously, your lamp doesn't light.");
1932 else if (j_ptr->xtra4 >= FUEL_LAMP)
1934 j_ptr->xtra4 = FUEL_LAMP;
1936 msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
1938 msg_print("Your lamp is full.");
1943 /* Decrease the item (from the pack) */
1946 inven_item_increase(item, -1);
1947 inven_item_describe(item);
1948 inven_item_optimize(item);
1951 /* Decrease the item (from the floor) */
1954 floor_item_increase(0 - item, -1);
1955 floor_item_describe(0 - item);
1956 floor_item_optimize(0 - item);
1959 /* Recalculate torch */
1960 p_ptr->update |= (PU_TORCH);
1965 * An "item_tester_hook" for refilling torches
1967 static bool item_tester_refill_torch(object_type *o_ptr)
1969 /* Torches are okay */
1970 if ((o_ptr->tval == TV_LITE) &&
1971 (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
1973 /* Assume not okay */
1979 * Refuel the players torch (from the pack or floor)
1981 static void do_cmd_refill_torch(void)
1991 /* Restrict the choices */
1992 item_tester_hook = item_tester_refill_torch;
1996 q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
1997 s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
1999 q = "Refuel with which torch? ";
2000 s = "You have no extra torches.";
2003 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2005 /* Get the item (in the pack) */
2008 o_ptr = &inventory[item];
2011 /* Get the item (on the floor) */
2014 o_ptr = &o_list[0 - item];
2018 /* Take a partial turn */
2021 /* Access the primary torch */
2022 j_ptr = &inventory[INVEN_LITE];
2025 j_ptr->xtra4 += o_ptr->xtra4 + 5;
2029 msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
2031 msg_print("You combine the torches.");
2036 if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
2040 msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
2042 msg_print("Your torch has gone out!");
2045 else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
2049 msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
2051 msg_print("Curiously, your torche don't light.");
2054 /* Over-fuel message */
2055 else if (j_ptr->xtra4 >= FUEL_TORCH)
2057 j_ptr->xtra4 = FUEL_TORCH;
2059 msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
2061 msg_print("Your torch is fully fueled.");
2066 /* Refuel message */
2070 msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
2072 msg_print("Your torch glows more brightly.");
2077 /* Decrease the item (from the pack) */
2080 inven_item_increase(item, -1);
2081 inven_item_describe(item);
2082 inven_item_optimize(item);
2085 /* Decrease the item (from the floor) */
2088 floor_item_increase(0 - item, -1);
2089 floor_item_describe(0 - item);
2090 floor_item_optimize(0 - item);
2093 /* Recalculate torch */
2094 p_ptr->update |= (PU_TORCH);
2099 * Refill the players lamp, or restock his torches
2101 void do_cmd_refill(void)
2106 o_ptr = &inventory[INVEN_LITE];
2108 if (p_ptr->special_defense & KATA_MUSOU)
2110 set_action(ACTION_NONE);
2114 if (o_ptr->tval != TV_LITE)
2117 msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
2119 msg_print("You are not wielding a light.");
2125 else if (o_ptr->sval == SV_LITE_LANTERN)
2127 do_cmd_refill_lamp();
2131 else if (o_ptr->sval == SV_LITE_TORCH)
2133 do_cmd_refill_torch();
2136 /* No torch to refill */
2140 msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
2142 msg_print("Your light cannot be refilled.");
2152 void do_cmd_target(void)
2155 if (target_set(TARGET_KILL))
2158 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
2160 msg_print("Target Selected.");
2165 /* Target aborted */
2169 msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
2171 msg_print("Target Aborted.");
2182 void do_cmd_look(void)
2185 if (target_set(TARGET_LOOK))
2188 msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
2190 msg_print("Target Selected.");
2199 * Allow the player to examine other sectors on the map
2201 void do_cmd_locate(void)
2203 int dir, y1, x1, y2, x2;
2210 /* Start at current panel */
2211 y2 = y1 = panel_row_min;
2212 x2 = x1 = panel_col_min;
2214 /* Show panels until done */
2217 /* Describe the location */
2218 if ((y2 == y1) && (x2 == x1))
2221 strcpy(tmp_val, "¿¿¾å");
2230 sprintf(tmp_val, "%s%s",
2231 ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
2232 ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
2234 sprintf(tmp_val, "%s%s of",
2235 ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
2236 ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
2241 /* Prepare to ask which way to look */
2244 "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
2246 "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
2249 y2 / (SCREEN_HGT / 2), y2 % (SCREEN_HGT / 2),
2250 x2 / (SCREEN_WID / 2), x2 % (SCREEN_WID / 2), tmp_val);
2252 /* Assume no direction */
2255 /* Get a direction */
2260 /* Get a command (or Cancel) */
2261 if (!get_com(out_val, &command, TRUE)) break;
2263 /* Extract the action (if any) */
2264 dir = get_keymap_dir(command);
2273 /* Apply the motion */
2274 if (change_panel(ddy[dir], ddx[dir]))
2282 /* Recenter the map around the player */
2286 p_ptr->update |= (PU_MONSTERS);
2289 p_ptr->redraw |= (PR_MAP);
2292 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
2301 * The table of "symbol info" -- each entry is a string of the form
2302 * "X:desc" where "X" is the trigger, and "desc" is the "info".
2304 static cptr ident_info[] =
2309 "\":¥¢¥ß¥å¥ì¥Ã¥È, ðô¾þ¤ê",
2310 "#:ÊÉ(±£¤·¥É¥¢)Ëô¤Ï¿¢Êª",
2312 "%:¹ÛÌ®(Íϴ䤫ÀбÑ)",
2317 "*:ºâÊõ¤ò´Þ¤ó¤À¹ÛÌ®¤Þ¤¿¤Ïµå·Á¤Î²øʪ",
2319 ",:¿©¤Ùʪ, ¤ª¤Ð¤±¥¥Î¥³",
2322 "/:´È¾õÉð´ï(¥¢¥Ã¥¯¥¹/¥Ñ¥¤¥¯/Åù)",
2326 "3:Éð´ïÀìÌ珤ÎÆþ¸ý",
2328 "5:Ï£¶â½Ñ¤ÎŹ¤ÎÆþ¸ý",
2330 "7:¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤ÎÆþ¸ý",
2334 ";:²óÈò¤Î³¨Ê¸»ú/Çúȯ¤Î¥ë¡¼¥ó",
2343 "D:¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à",
2350 "K:¥¥é¡¼¡¦¥Ó¡¼¥È¥ë",
2356 "Q:¥¯¥¤¥ë¥¹¥ë¥°(Ì®ÂǤÄÆù²ô)",
2358 "S:ÃØéá/¥µ¥½¥ê/¥À¥Ë",
2362 "W:¥ï¥¤¥È/¥ì¥¤¥¹/Åù",
2363 "X:¥¾¡¼¥ó/¥¶¥ì¥ó/Åù",
2367 "\\:Æß´ï(¥á¥¤¥¹/¥à¥Á/Åù)",
2379 "h:¥Û¥Ó¥Ã¥È/¥¨¥ë¥Õ/¥É¥ï¡¼¥Õ",
2398 "{:Èô¤ÓÆ»¶ñ¤ÎÃÆ(Ìð/ÃÆ)",
2399 "|:Åá·õÎà(¥½¡¼¥É/¥À¥¬¡¼/Åù)",
2400 "}:Èô¤ÓÆ»¶ñ(µÝ/¥¯¥í¥¹¥Ü¥¦/¥¹¥ê¥ó¥°)",
2401 "~:¿å/ÍÏ´äή(¼ï¡¹¤Î¥¢¥¤¥Æ¥à)",
2404 "!:A potion (or oil)",
2405 "\":An amulet (or necklace)",
2406 "#:A wall (or secret door)",
2407 "$:Treasure (gold or gems)",
2408 "%:A vein (magma or quartz)",
2413 "*:A vein with treasure or a ball monster",
2415 ",:Food (or mushroom patch)",
2416 "-:A wand (or rod)",
2418 "/:A polearm (Axe/Pike/etc)",
2419 "0:Entrance to Museum",
2420 "1:Entrance to General Store",
2421 "2:Entrance to Armory",
2422 "3:Entrance to Weaponsmith",
2423 "4:Entrance to Temple",
2424 "5:Entrance to Alchemy shop",
2425 "6:Entrance to Magic store",
2426 "7:Entrance to Black Market",
2427 "8:Entrance to your home",
2428 "9:Entrance to the bookstore",
2430 ";:A glyph of warding / explosive rune",
2431 "<:An up staircase",
2433 ">:A down staircase",
2439 "D:Ancient Dragon/Wyrm",
2448 "M:Multi-Headed Reptile",
2452 "Q:Quylthulg (Pulsing Flesh Mound)",
2453 "R:Reptile/Amphibian",
2454 "S:Spider/Scorpion/Tick",
2458 "W:Wight/Wraith/etc",
2463 "\\:A hafted weapon (mace/whip/etc)",
2467 "`:A figurine or statue",
2475 "h:Hobbit/Elf/Dwarf",
2479 "l:Aquatic monster",
2494 "{:A missile (arrow/bolt/shot)",
2495 "|:An edged weapon (sword/dagger/etc)",
2496 "}:A launcher (bow/crossbow/sling)",
2497 "~:Fluid terrain (or miscellaneous item)",
2505 * Sorting hook -- Comp function -- see below
2507 * We use "u" to point to array of monster indexes,
2508 * and "v" to select the type of sorting to perform on "u".
2510 bool ang_sort_comp_hook(vptr u, vptr v, int a, int b)
2512 u16b *who = (u16b*)(u);
2514 u16b *why = (u16b*)(v);
2522 /* Sort by player kills */
2525 /* Extract player kills */
2526 z1 = r_info[w1].r_pkills;
2527 z2 = r_info[w2].r_pkills;
2529 /* Compare player kills */
2530 if (z1 < z2) return (TRUE);
2531 if (z1 > z2) return (FALSE);
2535 /* Sort by total kills */
2538 /* Extract total kills */
2539 z1 = r_info[w1].r_tkills;
2540 z2 = r_info[w2].r_tkills;
2542 /* Compare total kills */
2543 if (z1 < z2) return (TRUE);
2544 if (z1 > z2) return (FALSE);
2548 /* Sort by monster level */
2551 /* Extract levels */
2552 z1 = r_info[w1].level;
2553 z2 = r_info[w2].level;
2555 /* Compare levels */
2556 if (z1 < z2) return (TRUE);
2557 if (z1 > z2) return (FALSE);
2561 /* Sort by monster experience */
2564 /* Extract experience */
2565 z1 = r_info[w1].mexp;
2566 z2 = r_info[w2].mexp;
2568 /* Compare experience */
2569 if (z1 < z2) return (TRUE);
2570 if (z1 > z2) return (FALSE);
2574 /* Compare indexes */
2580 * Sorting hook -- Swap function -- see below
2582 * We use "u" to point to array of monster indexes,
2583 * and "v" to select the type of sorting to perform.
2585 void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
2587 u16b *who = (u16b*)(u);
2600 * Hack -- Display the "name" and "attr/chars" of a monster race
2602 static void roff_top(int r_idx)
2604 monster_race *r_ptr = &r_info[r_idx];
2610 /* Access the chars */
2614 /* Access the attrs */
2618 /* Clear the top line */
2619 Term_erase(0, 0, 255);
2621 /* Reset the cursor */
2624 /* A title (use "The" for non-uniques) */
2626 /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½¤ËÈóÂбþ */
2629 if (!(r_ptr->flags1 & (RF1_UNIQUE)))
2633 Term_addstr(-1, TERM_WHITE, "The ");
2637 Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
2640 /* Append the "standard" attr/char info */
2641 Term_addstr(-1, TERM_WHITE, " ('");
2643 Term_addstr(-1, TERM_WHITE, "')");
2645 /* Append the "optional" attr/char info */
2646 Term_addstr(-1, TERM_WHITE, "/('");
2648 Term_addstr(-1, TERM_WHITE, "'):");
2653 * Identify a character, allow recall of monsters
2655 * Several "special" responses recall "multiple" monsters:
2657 * ^U (all unique monsters)
2658 * ^N (all non-unique monsters)
2660 * The responses may be sorted in several ways, see below.
2662 * Note that the player ghosts are ignored. XXX XXX XXX
2664 void do_cmd_query_symbol(void)
2675 bool recall = FALSE;
2680 /* Get a character, or abort */
2682 if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
2684 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
2688 /* Find that character info, and describe it */
2689 for (i = 0; ident_info[i]; ++i)
2691 if (sym == ident_info[i][0]) break;
2695 if (sym == KTRL('A'))
2699 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2701 strcpy(buf, "Full monster list.");
2705 else if (sym == KTRL('U'))
2709 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2711 strcpy(buf, "Unique monster list.");
2715 else if (sym == KTRL('N'))
2719 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
2721 strcpy(buf, "Non-unique monster list.");
2725 /* XTRA HACK WHATSEARCH */
2726 else if (sym == KTRL('M'))
2730 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
2732 if (!get_string("Enter name:",temp, 70))
2739 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
2741 sprintf(buf, "Monsters with a name \"%s\"",temp);
2744 else if (ident_info[i])
2746 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
2751 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
2753 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
2758 /* Display the result */
2761 /* Allocate the "who" array */
2762 C_MAKE(who, max_r_idx, u16b);
2764 /* Collect matching monsters */
2765 for (n = 0, i = 1; i < max_r_idx; i++)
2767 monster_race *r_ptr = &r_info[i];
2769 /* Nothing to recall */
2770 if (!cheat_know && !r_ptr->r_sights) continue;
2772 /* Require non-unique monsters if needed */
2773 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
2775 /* Require unique monsters if needed */
2776 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
2778 /* XTRA HACK WHATSEARCH */
2783 for (xx=0; temp[xx] && xx<80; xx++){
2785 if (iskanji( temp[xx])) { xx++; continue; }
2787 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
2791 strcpy(temp2, r_name+r_ptr->E_name);
2793 strcpy(temp2, r_name+r_ptr->name);
2795 for (xx=0; temp2[xx] && xx<80; xx++)
2796 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
2799 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
2801 if (strstr(temp2, temp))
2805 /* Collect "appropriate" monsters */
2806 if (all || (r_ptr->d_char == sym)) who[n++] = i;
2809 /* Nothing to recall */
2812 /* Free the "who" array */
2813 C_KILL(who, max_r_idx, u16b);
2819 /* Prompt XXX XXX XXX */
2821 put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
2823 put_str("Recall details? (k/y/n): ", 0, 40);
2835 /* Select the sort method */
2836 ang_sort_comp = ang_sort_comp_hook;
2837 ang_sort_swap = ang_sort_swap_hook;
2839 /* Sort the array */
2840 ang_sort(who, &why, n);
2842 /* Sort by kills (and level) */
2849 /* Catch "escape" */
2852 /* Free the "who" array */
2853 C_KILL(who, max_r_idx, u16b);
2858 /* Sort if needed */
2861 /* Select the sort method */
2862 ang_sort_comp = ang_sort_comp_hook;
2863 ang_sort_swap = ang_sort_swap_hook;
2865 /* Sort the array */
2866 ang_sort(who, &why, n);
2870 /* Start at the end */
2873 /* Scan the monster memory */
2876 /* Extract a race */
2879 /* Hack -- Auto-recall */
2880 monster_race_track(FALSE, r_idx);
2882 /* Hack -- Handle stuff */
2885 /* Hack -- Begin the prompt */
2888 /* Hack -- Complete the prompt */
2890 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2892 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2902 /* Save the screen */
2905 /* Recall on screen */
2906 screen_roff(who[i], 0);
2908 /* Hack -- Complete the prompt (again) */
2910 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
2912 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
2927 /* Normal commands */
2928 if (query != 'r') break;
2935 if (query == ESCAPE) break;
2937 /* Move to "prev" monster */
2943 if (!expand_list) break;
2947 /* Move to "next" monster */
2953 if (!expand_list) break;
2958 /* Free the "who" array */
2959 C_KILL(who, max_r_idx, u16b);
2961 /* Re-display the identity */
2970 bool research_mon(void)
2982 bool recall = FALSE;
2986 monster_race *r2_ptr;
2990 /* XTRA HACK WHATSEARCH */
2996 /* XTRA HACK REMEMBER_IDX */
2997 static int old_sym = '\0';
2998 static int old_i = 0;
3000 oldcheat = cheat_know;
3003 /* Save the screen */
3006 /* Get a character, or abort */
3008 if (!get_com("¥â¥ó¥¹¥¿¡¼¤Îʸ»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°):", &sym, FALSE))
3010 if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE))
3020 /* Find that character info, and describe it */
3021 for (i = 0; ident_info[i]; ++i)
3023 if (sym == ident_info[i][0]) break;
3026 /* XTRA HACK WHATSEARCH */
3027 if (sym == KTRL('A'))
3031 strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
3033 strcpy(buf, "Full monster list.");
3036 else if (sym == KTRL('U'))
3040 strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
3042 strcpy(buf, "Unique monster list.");
3045 else if (sym == KTRL('N'))
3049 strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
3051 strcpy(buf, "Non-unique monster list.");
3054 else if (sym == KTRL('M'))
3058 if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
3060 if (!get_string("Enter name:",temp, 70))
3067 sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
3069 sprintf(buf, "Monsters with a name \"%s\"",temp);
3072 else if (ident_info[i])
3074 sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
3079 sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
3081 sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
3086 /* Display the result */
3090 /* Allocate the "who" array */
3091 C_MAKE(who, max_r_idx, u16b);
3093 /* Collect matching monsters */
3094 for (n = 0, i = 1; i < max_r_idx; i++)
3096 monster_race *r_ptr = &r_info[i];
3100 /* XTRA HACK WHATSEARCH */
3101 /* Require non-unique monsters if needed */
3102 if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
3104 /* Require unique monsters if needed */
3105 if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
3112 for (xx=0; temp[xx] && xx<80; xx++){
3114 if (iskanji( temp[xx])) { xx++; continue; }
3116 if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
3120 strcpy(temp2, r_name+r_ptr->E_name);
3122 strcpy(temp2, r_name+r_ptr->name);
3124 for (xx=0; temp2[xx] && xx<80; xx++)
3125 if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
3128 if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
3130 if (strstr(temp2, temp))
3134 else if (all || (r_ptr->d_char == sym)) who[n++] = i;
3137 /* Nothing to recall */
3140 cheat_know = oldcheat;
3142 /* Free the "who" array */
3143 C_KILL(who, max_r_idx, u16b);
3155 /* Sort if needed */
3158 /* Select the sort method */
3159 ang_sort_comp = ang_sort_comp_hook;
3160 ang_sort_swap = ang_sort_swap_hook;
3162 /* Sort the array */
3163 ang_sort(who, &why, n);
3167 /* Start at the end */
3168 /* XTRA HACK REMEMBER_IDX */
3169 if (old_sym == sym && old_i < n) i = old_i;
3174 /* Scan the monster memory */
3177 /* Extract a race */
3180 /* Save this monster ID */
3181 p_ptr->monster_race_idx = r_idx;
3183 /* Hack -- Handle stuff */
3186 /* Hack -- Begin the prompt */
3189 /* Hack -- Complete the prompt */
3191 Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ' '¤Ç³¹Ô, ESC]");
3193 Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC, space to continue]");
3203 /* Recall on screen */
3204 r2_ptr = &r_info[r_idx];
3206 oldkills = r2_ptr->r_tkills;
3207 oldwake = r2_ptr->r_wake;
3208 screen_roff(who[i], 1);
3209 r2_ptr->r_tkills = oldkills;
3210 r2_ptr->r_wake = oldwake;
3211 cheat_know = oldcheat;
3214 /* XTRA HACK REMEMBER_IDX */
3222 /* Normal commands */
3223 if (query != 'r') break;
3230 if (query == ESCAPE) break;
3232 /* Move to "prev" monster */
3238 if (!expand_list) break;
3242 /* Move to "next" monster */
3248 if (!expand_list) break;
3254 /* Re-display the identity */
3255 /* prt(buf, 5, 5);*/
3257 cheat_know = oldcheat;
3259 /* Free the "who" array */
3260 C_KILL(who, max_r_idx, u16b);
3265 return (!notpicked);