3 /* Purpose: Object code, part 1 */
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.
21 * Reset the "visual" lists
23 * This involves resetting various things to their "default" state.
25 * If the "prefs" flag is TRUE, then we will also load the appropriate
26 * "user pref file" based on the current setting of the "use_graphics"
27 * flag. This is useful for switching "graphics" on/off.
29 * The features, objects, and monsters, should all be encoded in the
30 * relevant "font.pref" and/or "graf.prf" files. XXX XXX XXX
32 * The "prefs" parameter is no longer meaningful. XXX XXX XXX
34 void reset_visuals(void)
38 /* Extract some info about terrain features */
39 for (i = 0; i < max_f_idx; i++)
41 feature_type *f_ptr = &f_info[i];
43 /* Assume we will use the underlying values */
44 f_ptr->x_attr = f_ptr->d_attr;
45 f_ptr->x_char = f_ptr->d_char;
48 /* Extract default attr/char code for objects */
49 for (i = 0; i < max_k_idx; i++)
51 object_kind *k_ptr = &k_info[i];
53 /* Default attr/char */
54 k_ptr->x_attr = k_ptr->d_attr;
55 k_ptr->x_char = k_ptr->d_char;
58 /* Extract default attr/char code for monsters */
59 for (i = 0; i < max_r_idx; i++)
61 monster_race *r_ptr = &r_info[i];
63 /* Default attr/char */
64 r_ptr->x_attr = r_ptr->d_attr;
65 r_ptr->x_char = r_ptr->d_char;
72 /* Process "graf.prf" */
73 process_pref_file("graf.prf");
75 /* Access the "character" pref file */
76 sprintf(buf, "graf-%s.prf", player_base);
78 /* Process "graf-<playername>.prf" */
79 process_pref_file(buf);
87 /* Process "font.prf" */
88 process_pref_file("font.prf");
90 /* Access the "character" pref file */
91 sprintf(buf, "font-%s.prf", player_base);
93 /* Process "font-<playername>.prf" */
94 process_pref_file(buf);
100 * Obtain the "flags" for an item
102 void object_flags(object_type *o_ptr, u32b *f1, u32b *f2, u32b *f3)
104 object_kind *k_ptr = &k_info[o_ptr->k_idx];
107 (*f1) = k_ptr->flags1;
108 (*f2) = k_ptr->flags2;
109 (*f3) = k_ptr->flags3;
114 artifact_type *a_ptr = &a_info[o_ptr->name1];
116 (*f1) = a_ptr->flags1;
117 (*f2) = a_ptr->flags2;
118 (*f3) = a_ptr->flags3;
124 ego_item_type *e_ptr = &e_info[o_ptr->name2];
126 (*f1) |= e_ptr->flags1;
127 (*f2) |= e_ptr->flags2;
128 (*f3) |= e_ptr->flags3;
130 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
132 (*f3) &= ~(TR3_SH_FIRE);
134 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
136 (*f1) &= ~(TR1_INFRA);
138 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
140 (*f2) &= ~(TR2_RES_BLIND);
141 (*f3) &= ~(TR3_SEE_INVIS);
145 /* Random artifact ! */
146 if (o_ptr->art_flags1 || o_ptr->art_flags2 || o_ptr->art_flags3)
148 (*f1) |= o_ptr->art_flags1;
149 (*f2) |= o_ptr->art_flags2;
150 (*f3) |= o_ptr->art_flags3;
153 if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
155 if (o_ptr->xtra3 < 33)
157 (*f1) |= (0x00000001 << (o_ptr->xtra3-1));
159 else if (o_ptr->xtra3 < 65)
161 (*f2) |= (0x00000001 << (o_ptr->xtra3-33));
163 else if (o_ptr->xtra3 < 97)
165 (*f3) |= (0x00000001 << (o_ptr->xtra3-65));
167 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID)
169 (*f2) |= TR2_RES_ACID;
171 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC)
173 (*f2) |= TR2_RES_ELEC;
175 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE)
177 (*f2) |= TR2_RES_FIRE;
179 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD)
181 (*f2) |= TR2_RES_COLD;
183 else if (o_ptr->xtra3 == ESSENCE_SH_FIRE)
185 (*f2) |= TR2_RES_FIRE;
186 (*f3) |= TR3_SH_FIRE;
188 else if (o_ptr->xtra3 == ESSENCE_SH_ELEC)
190 (*f2) |= TR2_RES_ELEC;
191 (*f3) |= TR3_SH_ELEC;
193 else if (o_ptr->xtra3 == ESSENCE_SH_COLD)
195 (*f2) |= TR2_RES_COLD;
196 (*f3) |= TR3_SH_COLD;
198 else if (o_ptr->xtra3 == ESSENCE_RESISTANCE)
200 (*f2) |= (TR2_RES_ACID | TR2_RES_ELEC | TR2_RES_FIRE | TR2_RES_COLD);;
208 * Obtain the "flags" for an item which are known to the player
210 void object_flags_known(object_type *o_ptr, u32b *f1, u32b *f2, u32b *f3)
214 object_kind *k_ptr = &k_info[o_ptr->k_idx];
217 (*f1) = (*f2) = (*f3) = 0L;
219 if (!object_aware_p(o_ptr)) return;
222 (*f1) = k_ptr->flags1;
223 (*f2) = k_ptr->flags2;
224 (*f3) = k_ptr->flags3;
226 /* Must be identified */
227 if (!object_known_p(o_ptr)) return;
229 /* Ego-item (known basic flags) */
232 ego_item_type *e_ptr = &e_info[o_ptr->name2];
234 (*f1) |= e_ptr->flags1;
235 (*f2) |= e_ptr->flags2;
236 (*f3) |= e_ptr->flags3;
238 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
240 (*f3) &= ~(TR3_SH_FIRE);
242 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
244 (*f1) &= ~(TR1_INFRA);
246 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
248 (*f2) &= ~(TR2_RES_BLIND);
249 (*f3) &= ~(TR3_SEE_INVIS);
254 #ifdef SPOIL_ARTIFACTS
255 /* Full knowledge for some artifacts */
256 if (artifact_p(o_ptr) || o_ptr->art_name) spoil = TRUE;
257 #endif /* SPOIL_ARTIFACTS */
259 #ifdef SPOIL_EGO_ITEMS
260 /* Full knowledge for some ego-items */
261 if (ego_item_p(o_ptr)) spoil = TRUE;
262 #endif /* SPOIL_EGO_ITEMS */
264 /* Need full knowledge or spoilers */
265 if (spoil || (o_ptr->ident & IDENT_MENTAL))
270 artifact_type *a_ptr = &a_info[o_ptr->name1];
272 (*f1) = a_ptr->flags1;
273 (*f2) = a_ptr->flags2;
274 (*f3) = a_ptr->flags3;
277 /* Random artifact ! */
278 if (o_ptr->art_flags1 || o_ptr->art_flags2 || o_ptr->art_flags3)
280 (*f1) |= o_ptr->art_flags1;
281 (*f2) |= o_ptr->art_flags2;
282 (*f3) |= o_ptr->art_flags3;
286 if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
288 if (o_ptr->xtra3 < 33)
290 (*f1) |= (0x00000001 << (o_ptr->xtra3-1));
292 else if (o_ptr->xtra3 < 65)
294 (*f2) |= (0x00000001 << (o_ptr->xtra3-33));
296 else if (o_ptr->xtra3 < 97)
298 (*f3) |= (0x00000001 << (o_ptr->xtra3-65));
300 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID)
302 (*f2) |= TR2_RES_ACID;
304 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC)
306 (*f2) |= TR2_RES_ELEC;
308 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE)
310 (*f2) |= TR2_RES_FIRE;
312 else if (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD)
314 (*f2) |= TR2_RES_COLD;
316 else if (o_ptr->xtra3 == ESSENCE_SH_FIRE)
318 (*f2) |= TR2_RES_FIRE;
319 (*f3) |= TR3_SH_FIRE;
321 else if (o_ptr->xtra3 == ESSENCE_SH_ELEC)
323 (*f2) |= TR2_RES_ELEC;
324 (*f3) |= TR3_SH_ELEC;
326 else if (o_ptr->xtra3 == ESSENCE_SH_COLD)
328 (*f2) |= TR2_RES_COLD;
329 (*f3) |= TR3_SH_COLD;
331 else if (o_ptr->xtra3 == ESSENCE_RESISTANCE)
333 (*f2) |= (TR2_RES_ACID | TR2_RES_ELEC | TR2_RES_FIRE | TR2_RES_COLD);;
340 * Hack -- describe an item currently in a store's inventory
341 * This allows an item to *look* like the player is "aware" of it
343 void object_desc_store(char *buf, object_type *o_ptr, int pref, int mode)
345 /* Save the "aware" flag */
346 bool hack_aware = object_aware_p(o_ptr);
348 /* Save the "known" flag */
349 bool hack_known = (o_ptr->ident & (IDENT_KNOWN)) ? TRUE : FALSE;
352 /* Set the "known" flag */
353 o_ptr->ident |= (IDENT_KNOWN);
355 /* Force "aware" for description */
356 k_info[o_ptr->k_idx].aware = TRUE;
359 /* Describe the object */
360 object_desc(buf, o_ptr, pref, mode);
363 /* Restore "aware" flag */
364 k_info[o_ptr->k_idx].aware = hack_aware;
366 /* Clear the known flag */
367 if (!hack_known) o_ptr->ident &= ~(IDENT_KNOWN);
374 * Determine the "Activation" (if any) for an artifact
375 * Return a string, or NULL for "no activation"
377 cptr item_activation(object_type *o_ptr)
381 /* Extract the flags */
382 object_flags(o_ptr, &f1, &f2, &f3);
384 /* Require activation ability */
386 if (!(f3 & (TR3_ACTIVATE))) return ("¤Ê¤·");
388 if (!(f3 & (TR3_ACTIVATE))) return ("nothing");
394 * We need to deduce somehow that it is a random artifact -- one
395 * problem: It could be a random artifact which has NOT YET received
396 * a name. Thus we eliminate other possibilities instead of checking
400 if (!(o_ptr->name1) &&
405 switch (o_ptr->xtra2)
410 return "ÂÀÍÛ¸÷Àþ : 10 ¥¿¡¼¥óËè";
412 return "beam of sunlight every 10 turns";
419 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
421 return "magic missile (2d6) every 2 turns";
428 return "°½±À (12), Ⱦ·Â 3 , 4+d4 ¥¿¡¼¥óËè";
430 return "stinking cloud (12), rad. 3, every 4+d4 turns";
437 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
439 return "lightning bolt (4d8) every 5+d5 turns";
446 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
448 return "acid bolt (5d8) every 6+d6 turns";
455 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
457 return "frost bolt (6d8) every 7+d7 turns";
464 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
466 return "fire bolt (9d8) every 8+d8 turns";
473 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (48) : 400 ¥¿¡¼¥óËè";
475 return "ball of cold (48) every 400 turns";
482 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (72) : 400 ¥¿¡¼¥óËè";
484 return "ball of fire (72) every 400 turns";
491 return "¥Ò¥Ã¥È¥Ý¥¤¥ó¥ÈµÛ¼ý (100) : 100+d100 ¥¿¡¼¥óËè";
493 return "drain life (100) every 100+d100 turns";
500 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (100) : 300 ¥¿¡¼¥óËè";
502 return "ball of cold (100) every 300 turns";
509 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 500 ¥¿¡¼¥óËè";
511 return "ball of lightning (100) every 500 turns";
518 return "¥Ò¥Ã¥È¥Ý¥¤¥ó¥ÈµÛ¼ý(120) : 400 ¥¿¡¼¥óËè";
520 return "drain life (120) every 400 turns";
527 return "µÛ·ì¥É¥ì¥¤¥ó (3*50) : 400 ¥¿¡¼¥óËè";
529 return "vampiric drain (3*50) every 400 turns";
536 return "Ìð (150) : 90+d90 ¥¿¡¼¥óËè";
538 return "arrows (150) every 90+d90 turns";
545 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (120) : 225+d225 ¥¿¡¼¥óËè";
547 return "fire ball (120) every 225+d225 turns";
554 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (200) : 325+d325 ¥¿¡¼¥óËè";
556 return "ball of cold (200) every 325+d325 turns";
563 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (250) : 425+d425 ¥¿¡¼¥óËè";
565 return "ball of lightning (250) every 425+d425 turns";
572 return "¥«¥Þ¥¤¥¿¥Á : 250 ¥¿¡¼¥óËè";
574 return "whirlwind attack every 250 turns";
581 return "µÛ·ì¥É¥ì¥¤¥ó (3*100) : 400 ¥¿¡¼¥óËè";
583 return "vampiric drain (3*100) every 400 turns";
590 return "call chaos : 350 ¥¿¡¼¥óËè"; /*nuke me*/
592 return "call chaos every 350 turns";
599 return "¥í¥±¥Ã¥È (120+level) : 400 ¥¿¡¼¥óËè";
601 return "launch rocket (120+level) every 400 turns";
608 return "¼Ù°Â໶ (level*5) : 300+d300 ¥¿¡¼¥óËè";
610 return "dispel evil (level*5) every 300+d300 turns";
617 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹ (300) : 500 ¥¿¡¼¥óËè";
619 return "elemental breath (300) every 500 turns";
626 return "Á±ÎÉÂ໶ (level*5) : 300+d300 ¥¿¡¼¥óËè";
628 return "dispel good (level*5) every 300+d300 turns";
635 return "¥Ñ¥Ë¥Ã¥¯¡¦¥â¥ó¥¹¥¿¡¼ : 15 ¥¿¡¼¥óËè";
637 return "confuse monster every 15 turns";
644 return "¼þ°Ï¤Î¥â¥ó¥¹¥¿¡¼¤ò̲¤é¤»¤ë : 55 ¥¿¡¼¥óËè";
646 return "sleep nearby monsters every 55 turns";
653 return "ÃÏ¿Ì (Ⱦ·Â 10) : 50 ¥¿¡¼¥óËè";
655 return "earthquake (rad 10) every 50 turns";
662 return "¶²¹² : 3 * (level+10) ¥¿¡¼¥óËè";
664 return "terror every 3 * (level+10) turns";
671 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
673 return "teleport away every 200 turns";
677 case ACT_BANISH_EVIL:
680 return "¼Ù°¾ÃÌÇ : 250+d250 ¥¿¡¼¥óËè";
682 return "banish evil every 250+d250 turns";
689 return "Ëõ»¦ : 500 ¥¿¡¼¥óËè";
691 return "genocide every 500 turns";
698 return "¼þÊÕËõ»¦ : 1000 ¥¿¡¼¥óËè";
700 return "mass genocide every 1000 turns";
704 case ACT_CHARM_ANIMAL:
707 return "ưʪ̥λ : 300 ¥¿¡¼¥óËè";
709 return "charm animal every 300 turns";
713 case ACT_CHARM_UNDEAD:
716 return "ÉԻཾ° : 333 ¥¿¡¼¥óËè";
718 return "enslave undead every 333 turns";
722 case ACT_CHARM_OTHER:
725 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 400 ¥¿¡¼¥óËè";
727 return "charm monster every 400 turns";
731 case ACT_CHARM_ANIMALS:
734 return "ưʪͧÏ : 500 ¥¿¡¼¥óËè";
736 return "animal friendship every 500 turns";
740 case ACT_CHARM_OTHERS:
743 return "¼þÊÕ̥λ : 750 ¥¿¡¼¥óËè";
745 return "mass charm every 750 turns";
749 case ACT_SUMMON_ANIMAL:
752 return "ưʪ¾¤´ : 200+d300 ¥¿¡¼¥óËè";
754 return "summon animal every 200+d300 turns";
758 case ACT_SUMMON_PHANTOM:
761 return "»È¤¤Î´ : 200+d200 ¥¿¡¼¥óËè";
763 return "summon phantasmal servant every 200+d200 turns";
767 case ACT_SUMMON_ELEMENTAL:
770 return "¥¨¥ì¥á¥ó¥¿¥ë¾¤´ : 750 ¥¿¡¼¥óËè";
772 return "summon elemental every 750 turns";
776 case ACT_SUMMON_DEMON:
779 return "°Ë⾤´ : 666+d333 ¥¿¡¼¥óËè";
781 return "summon demon every 666+d333 turns";
785 case ACT_SUMMON_UNDEAD:
788 return "ÉԻྤ´ : 666+d333 ¥¿¡¼¥óËè";
790 return "summon undead every 666+d333 turns";
797 return "ͦµ¤²óÉü & 30 hp ²óÉü : 10 ¥¿¡¼¥óËè";
799 return "remove fear & heal 30 hp every 10 turns";
806 return "4d8 hp & ½ý²óÉü : 3+d3 ¥¿¡¼¥óËè";
808 return "heal 4d8 & wounds every 3+d3 turns";
812 case ACT_CURE_POISON:
815 return "ͦµ¤²óÉü/ÆǾä· : 5 ¥¿¡¼¥óËè";
817 return "remove fear and cure poison every 5 turns";
824 return "·Ð¸³ÃÍÉü³è : 450 ¥¿¡¼¥óËè";
826 return "restore life levels every 450 turns";
833 return "Á´¥¹¥Æ¡¼¥¿¥¹¤È·Ð¸³ÃͲóÉü : 750 ¥¿¡¼¥óËè";
835 return "restore stats and life levels every 750 turns";
842 return "700 hp ²óÉü : 250 ¥¿¡¼¥óËè";
844 return "heal 700 hit points every 250 turns";
851 return "1000 hp ²óÉü : 888 ¥¿¡¼¥óËè";
853 return "heal 1000 hit points every 888 turns";
860 return "°ì»þŪ¤Ê ESP (´ü´Ö 25+d30) : 200 ¥¿¡¼¥óËè";
862 return "temporary ESP (dur 25+d30) every 200 turns";
869 return "»Îµ¤¹âÍȤȽËÊ¡ (´ü´Ö 50+d50) : 100+d100 ¥¿¡¼¥óËè";
871 return "heroism and blessed (dur 50+d50) every 100+d100 turns";
878 return "Âмٰ·ë³¦ (´ü´Ö level*3 + d25) : 225+d225 ¥¿¡¼¥óËè";
880 return "protect evil (dur level*3 + d25) every 225+d225 turns";
887 return "±êÎä»ÀÅÅÆǤؤÎÂÑÀ (´ü´Ö 40+d40) : 200 ¥¿¡¼¥óËè";
889 return "resist elements (dur 40+d40) every 200 turns";
896 return "²Ã® (´ü´Ö 20+d20) : 250 ¥¿¡¼¥óËè";
898 return "speed (dur 20+d20) every 250 turns";
905 return "²Ã® (´ü´Ö 75+d75) : 200+d200 ¥¿¡¼¥óËè";
907 return "speed (dur 75+d75) every 200+d200 turns";
914 return "¥ì¥¤¥¹²½ (level/2 + d(level/2)) : 1000 ¥¿¡¼¥óËè";
916 return "wraith form (level/2 + d(level/2)) every 1000 turns";
923 return "̵Ũ (´ü´Ö 8+d8) : 1000 ¥¿¡¼¥óËè";
925 return "invulnerability (dur 8+d8) every 1000 turns";
932 return "¼þÊÕ¾ÈÌÀ (¥À¥á¡¼¥¸ 2d15) : 10+d10 ¥¿¡¼¥óËè";
934 return "light area (dam 2d15) every 10+d10 turns";
941 return "¼þÊÕ¾ÈÌÀ (¥À¥á¡¼¥¸ 2d15) & ¼þÊÕ¥Þ¥Ã¥× : 50+d50 ¥¿¡¼¥óËè";
943 return "light (dam 2d15) & map area every 50+d50 turns";
950 return "Á´´¶ÃÎ : 55+d55 ¥¿¡¼¥óËè";
952 return "detection every 55+d55 turns";
956 case ACT_DETECT_XTRA:
959 return "Á´´¶ÃΡ¢Ãµº÷¡¢*´ÕÄê* : 1000 ¥¿¡¼¥óËè";
961 return "detection, probing and identify true every 1000 turns";
968 return "*´ÕÄê* : 750 ¥¿¡¼¥óËè";
970 return "identify true every 750 turns";
977 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
979 return "identify spell every 10 turns";
986 return "Çúȯ¥ë¡¼¥ó : 200 ¥¿¡¼¥óËè";
988 return "explosive rune every 200 turns";
995 return "¼é¤ê¤Î¥ë¡¼¥ó : 400 ¥¿¡¼¥óËè";
997 return "rune of protection every 400 turns";
1004 return "¶õÊ¢½¼Â : 200 ¥¿¡¼¥óËè";
1006 return "satisfy hunger every 200 turns";
1013 return "¥É¥¢Ç˲õ : 10 ¥¿¡¼¥óËè";
1015 return "destroy doors every 10 turns";
1022 return "´äÀÐÍϲò : 5 ¥¿¡¼¥óËè";
1024 return "stone to mud every 5 turns";
1031 return "ºÆ½¼Å¶ : 70 ¥¿¡¼¥óËè";
1033 return "recharging every 70 turns";
1040 return "Ï£¶â½Ñ : 500 ¥¿¡¼¥óËè";
1042 return "alchemy every 500 turns";
1049 return "¼¡¸µ¤ÎÈâ : 100 ¥¿¡¼¥óËè";
1051 return "dimension door every 100 turns";
1058 return "¥Æ¥ì¥Ý¡¼¥È (range 100) : 45 ¥¿¡¼¥óËè";
1060 return "teleport (range 100) every 45 turns";
1067 return "µ¢´Ô¤Î¾Û : 200 ¥¿¡¼¥óËè";
1069 return "word of recall every 200 turns";
1078 return "something undefined";
1085 /* Some artifacts can be activated */
1086 switch (o_ptr->name1)
1091 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
1093 return "fire bolt (9d8) every 8+d8 turns";
1100 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
1102 return "frost bolt (6d8) every 7+d7 turns";
1109 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
1111 return "lightning bolt (4d8) every 6+d6 turns";
1118 return "°½±À(12) : 4+d4 ¥¿¡¼¥óËè";
1120 return "stinking cloud (12) every 4+d4 turns";
1127 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë(48) : 5+d5 ¥¿¡¼¥óËè";
1129 return "frost ball (48) every 5+d5 turns";
1136 return "¶²Éݽüµî/ÆǾä· : 5 ¥¿¡¼¥óËè";
1138 return "remove fear and cure poison every 5 turns";
1145 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë(100) : 200 ¥¿¡¼¥óËè";
1147 return "frost ball (100) every 200 turns";
1154 return "¶Ç¤Î»ÕÃľ¤´ : 500+d500 ¥¿¡¼¥óËè";
1156 return "summon the Legion of the Dawn every 500+d500 turns";
1163 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(72) : 400 ¥¿¡¼¥óËè";
1165 return "fire ball (72) every 400 turns";
1172 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(72) : 100 ¥¿¡¼¥óËè";
1174 return "large fire ball (72) every 100 turns";
1181 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(120) : 15 ¥¿¡¼¥óËè";
1183 return "large fire ball (120) every 15 turns";
1190 return "¥¹¥Ô¡¼¥É(20+d20¥¿¡¼¥ó) : 200 ¥¿¡¼¥óËè";
1192 return "haste self (20+d20 turns) every 200 turns";
1199 return "À¸Ì¿Îϵۼý(120) : 400 ¥¿¡¼¥óËè";
1201 return "drain life (120) every 400 turns";
1208 return "À¸Ì¿Îϵۼý(90) : 70 ¥¿¡¼¥óËè";
1210 return "drain life (90) every 70 turns";
1217 return "¥É¥¢/¥È¥é¥Ã¥×Ê´ºÕ : 10 ¥¿¡¼¥óËè";
1219 return "door and trap destruction every 10 turns";
1227 return "µ¢´Ô¤Î¾Û : 200 ¥¿¡¼¥óËè";
1229 return "word of recall every 200 turns";
1236 return "¥¹¥Ô¡¼¥É(20+d20¥¿¡¼¥ó) : 100+d100 ¥¿¡¼¥óËè";
1238 return "haste self (20+d20 turns) every 100+d100 turns";
1245 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
1247 return "identify every 10 turns";
1254 return "õº÷¡¢Á´´¶ÃΡ¢Á´´ÕÄê : 1000 ¥¿¡¼¥óËè";
1256 return "probing, detection and full id every 1000 turns";
1263 return "¼þÊÕËõ»¦ : 1000 ¥¿¡¼¥óËè";
1265 return "mass genocide every 1000 turns";
1272 return "½ý¤Î¼£Ìþ(4d7) : 3+d3 ¥¿¡¼¥óËè";
1274 return "cure wounds (4d7) every 3+d3 turns";
1281 return "¿ÏÀè¤Î¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È : 999 ¥¿¡¼¥óËè";
1283 return "fire branding of bolts every 999 turns";
1290 return "¥Õ¥¡¥¤¥¢¡ª : 15 ¥¿¡¼¥óËè";
1292 return "fire! every 15 turns";
1297 case ART_WEREWINDLE:
1300 return "ƨÁö : 35 ¥¿¡¼¥óËè";
1302 return "a getaway every 35 turns";
1309 return "¥Æ¥ì¥Ý¡¼¥È : 25 ¥¿¡¼¥óËè";
1311 return "a teleport every 25 turns";
1318 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 200 ¥¿¡¼¥óËè";
1320 return "lightning ball (100) every 200 turns";
1327 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) : 200 ¥¿¡¼¥óËè";
1329 return "Frost ball (100) every 200 turns";
1336 return "´äÀÐÍϲò : 5 ¥¿¡¼¥óËè";
1338 return "stone to mud every 5 turns";
1345 return "´äÀÐÍϲò : 2 ¥¿¡¼¥óËè";
1347 return "stone to mud every 2 turns";
1351 case ART_SOULKEEPER:
1354 return "ÂÎÎϲóÉü(1000) : 888 ¥¿¡¼¥óËè";
1356 return "heal (1000) every 888 turns";
1363 return ("²óÉü (777)¡¢Ìþ¤·¡¢»Îµ¤¹âÍÈ : 300 ¥¿¡¼¥óËè");
1365 return ("heal (777), curing and heroism every 300 turns");
1372 return "Ëõ»¦ : 500 ¥¿¡¼¥óËè";
1374 return "genocide every 500 turns";
1381 return "·Ð¸³ÃÍÉü³è : 450 ¥¿¡¼¥óËè";
1383 return "restore life levels every 450 turns";
1390 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
1392 return "teleport away every 150 turns";
1400 return "Á´ÂÑÀ(20+d20¥¿¡¼¥ó) : 111 ¥¿¡¼¥óËè";
1402 return "resistance (20+d20 turns) every 111 turns";
1406 case ART_HOLCOLLETH:
1409 return "¥¹¥ê¡¼¥×(II) : 55 ¥¿¡¼¥óËè";
1411 return "Sleep II every 55 turns";
1418 return "ËâÎϽ¼Å¶ : 70 ¥¿¡¼¥óËè";
1420 return "recharge item I every 70 turns";
1427 return "¥Æ¥ì¥Ý¡¼¥È : 45 ¥¿¡¼¥óËè";
1429 return "teleport every 45 turns";
1436 return "¥Ñ¥Ë¥Ã¥¯¡¦¥â¥ó¥¹¥¿¡¼ : 15 ¥¿¡¼¥óËè";
1438 return "confuse monster every 15 turns";
1442 case ART_CAMMITHRIM:
1445 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
1447 return "magic missile (2d6) every 2 turns";
1454 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
1456 return "fire bolt (9d8) every 8+d8 turns";
1460 case ART_PAURNIMMEN:
1463 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
1465 return "frost bolt (6d8) every 7+d7 turns";
1472 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
1474 return "lightning bolt (4d8) every 5+d5 turns";
1481 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
1483 return "acid bolt (5d8) every 6+d6 turns";
1490 return "ËâË¡¤ÎÌð(150) : 90+d90 ¥¿¡¼¥óËè";
1492 return "a magical arrow (150) every 90+d90 turns";
1496 case ART_HOLHENNETH:
1499 return "Á´´¶ÃÎ : 55+d55 ¥¿¡¼¥óËè";
1501 return "detection every 55+d55 turns";
1508 return "ÂÎÎϲóÉü(500) : 500 ¥¿¡¼¥óËè";
1510 return "heal (700) every 250 turns";
1517 return "¥¹¥¿¡¼¡¦¥Ü¡¼¥ë(150) : 1000 ¥¿¡¼¥óËè";
1519 return "star ball (150) every 1000 turns";
1523 case ART_BLADETURNER:
1526 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹ (300), »Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢ÂÑÀ";
1528 return "breathe elements (300), hero, bless, and resistance";
1535 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
1537 return "illumination every 10+d10 turns";
1544 return "ËâË¡¤ÎÃϿޤȸ÷ : 50+d50 ¥¿¡¼¥óËè";
1546 return "magic mapping and light every 50+d50 turns";
1553 return "ÂÎÎϤȰú¤Âؤ¨¤ËÀéΤ´ã¤Èµ¢´Ô : 20+d20 ¥¿¡¼¥óËè";
1555 return "clairvoyance and recall, draining you every 20+d20 turns";
1563 return "¼Ù°Â໶(x5) : 200+d200 ¥¿¡¼¥óËè";
1565 return "dispel evil (x5) every 200+d200 turns";
1572 return "¼Ù°Â໶(x5) : 100+d100 ¥¿¡¼¥óËè";
1574 return "dispel evil (x5) every 100+d100 turns";
1582 return "Âмٰ·ë³¦ : 225+d225 ¥¿¡¼¥óËè";
1584 return "protection from evil every 225+d225 turns";
1591 return "Ã⩹¶·â(100) : 100+d100 ¥¿¡¼¥óËè";
1593 return "a strangling attack (100) every 100+d100 turns";
1600 return "¥¹¥Ô¡¼¥É(75+d75¥¿¡¼¥ó) : 100+d100 ¥¿¡¼¥óËè";
1602 return "haste self (75+d75 turns) every 150+d150 turns";
1609 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(300) : 225+d225 ¥¿¡¼¥óËè";
1611 return "large fire ball (300) every 225+d225 turns";
1618 return "µðÂ祢¥¤¥¹¡¦¥Ü¡¼¥ë(400) : 325+d325 ¥¿¡¼¥óËè";
1620 return "large frost ball (400) every 325+d325 turns";
1628 return "µðÂ祵¥ó¥À¡¼¡¦¥Ü¡¼¥ë(500) : 425+d425 ¥¿¡¼¥óËè";
1630 return "large lightning ball (500) every 425+d425 turns";
1638 return "¿®¤¸Æñ¤¤¤³¤È : 450+d450 ¥¿¡¼¥óËè";
1640 return "bizarre things every 450+d450 turns";
1644 case ART_DOR: case ART_TERROR: case ART_STONEMASK:
1647 return "Á´Êý¸þ¤Ø¤Î¶²Éݤθ÷Àþ : 3*(¥ì¥Ù¥ë+10) ¥¿¡¼¥óËè";
1649 return "rays of fear in every direction every 3*(level+10) turns";
1656 return "¤³¤Î³¬¤Ë¤¤¤ë¥æ¥Ë¡¼¥¯¥â¥ó¥¹¥¿¡¼¤òɽ¼¨ : 200¥¿¡¼¥óËè";
1658 return "list of the uniques on the level every 200 turns";
1661 case ART_STONE_LORE:
1664 return "´í¸±¤òȼ¤¦´ÕÄê : ¤¤¤Ä¤Ç¤â";
1666 return "perilous identify every turn";
1672 return "³²Ãî¤Î¶î½ü : 55+d55¥¿¡¼¥óËè";
1674 return "dispel small life every 55+d55 turns";
1680 return "¥â¥ó¥¹¥¿¡¼¶²¹² : 40+d40¥¿¡¼¥óËè";
1682 return "frighten monsters every 40+d40 turns";
1688 return "Âмٰ·ë³¦ : 200+d200 ¥¿¡¼¥óËè";
1690 return "protection from evil every 200 + d200 turns";
1696 return "ËâÎϤÎÌð(120) : 120+d120 ¥¿¡¼¥óËè";
1698 return "a mana bolt (120) every 120+d120 turns";
1704 return "»Îµ¤¹âÍÈ, ¥¹¥Ô¡¼¥É(50+d50¥¿¡¼¥ó) : 100+d200 ¥¿¡¼¥óËè";
1706 return "hero and +10 to speed (50) every 100+200d turns";
1712 return "âÁ¤·¤¤¸÷ : 250 ¥¿¡¼¥óËè";
1714 return "blinding light every 250 turns";
1720 return "ËâÎϽ¼Å¶ : 200 ¥¿¡¼¥óËè";
1722 return "Recharge item every 200 turns";
1728 return "ÏÓÎϤξ徺 : ³ÎΨ50%¤Ç²õ¤ì¤ë¡£";
1730 return "Increase STR (destroyed 50%)";
1736 return "ËâÎϤÎÍò(400) : 250+d250¥¿¡¼¥óËè";
1738 return "a mana storm every 250+d250 turns";
1744 return "ʪÂΤò°ú¤´ó¤»¤ë(½ÅÎÌ25kg¤Þ¤Ç) : 25+d25¥¿¡¼¥óËè";
1746 return "a telekinesis (500 lb) every 25+d25 turns";
1752 return "¥Ï¥¦¥ó¥É¾¤´ : 300+d150¥¿¡¼¥óËè";
1754 return "summon hound every 300+d150 turns";
1760 return "µðÂ祹¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 200+d200 ¥¿¡¼¥óËè";
1762 return "large star ball (200) every 200+d200 turns";
1769 return "Îã¤Î¥¢¥ì : 150+d150 ¥¿¡¼¥óËè";
1771 return "reveal your identity every 150+d150 turns";
1778 return "Çï»ÒÌÚ¤òÂǤÁ¤Ê¤é¤¹ : ¤¤¤Ä¤Ç¤â";
1780 return "beat wooden clappers every turn";
1788 return "»Îµ¤¹âÍÈ : 30+d30¥¿¡¼¥óËè";
1790 return "heroism every 30+d30 turns";
1798 return "Ìþ¤· : 100¥¿¡¼¥óËè";
1800 return "curing every 100 turns";
1808 return "ưʪ̥λ : 200¥¿¡¼¥óËè";
1810 return "charm animal every 200 turns";
1817 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(12d8) : 50 ¥¿¡¼¥óËè";
1819 return "frost bolt (12d8) every 50 turns";
1826 return "°ÀÊѹ¹ : 3333 ¥¿¡¼¥óËè";
1828 return "change zokusei every 3333 turns";
1835 return "¥¦¥©¡¼¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 250 ¥¿¡¼¥óËè";
1837 return "water ball (200) every 250 turns";
1844 return "»Í¸ÔƧ¤ß : 100+d100¥¿¡¼¥óËè";
1846 return "shiko every 100+d100 turns";
1853 return "Î䵤¤ÎÂÑÀ : 40+d40¥¿¡¼¥óËè";
1855 return "resist cold every 40+d40 turns";
1862 return "Âý¤ÎÂç·²¾¤´ : 300+d150¥¿¡¼¥óËè";
1864 return "summon octopus every 300+d150 turns";
1870 return "°Å¹õ¤ÎÍò(250) : 150+d150 ¥¿¡¼¥óËè";
1872 return "darkness storm (250) every 150+d150 turns";
1879 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_TSURIZAO))
1882 return "Äà¤ê¤ò¤¹¤ë : ¤¤¤Ä¤Ç¤â";
1884 return "fishing : every time";
1889 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID))
1892 return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
1894 return "resist acid every 50+d50 turns";
1898 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC))
1901 return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
1903 return "resist elec every 50+d50 turns";
1907 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE))
1910 return "²Ð¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
1912 return "resist fire every 50+d50 turns";
1916 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD))
1919 return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
1921 return "resist cold every 50+d50 turns";
1925 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_EARTHQUAKE))
1928 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
1930 return "earthquake every 100+d100 turns";
1934 if (o_ptr->name2 == EGO_TRUMP)
1937 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
1939 return "teleport every 50+d50 turns";
1944 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
1947 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
1949 return "illumination every 10+d10 turns";
1953 else if (o_ptr->name2 == EGO_EARTHQUAKES)
1956 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
1958 return "earthquake every 100+d100 turns";
1963 else if (o_ptr->name2 == EGO_JUMP)
1966 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
1968 return "blink every 10+d10 turns";
1973 if (o_ptr->tval == TV_RING)
1977 switch (o_ptr->name2)
1981 return "»Îµ¤¹âÍÈ : 100+d100¥¿¡¼¥óËè";
1983 return "heroism every 100+d100 turns";
1985 case EGO_RING_MAGIC_MIS:
1987 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
1989 return "magic missile (2d6) every 2 turns";
1991 case EGO_RING_FIRE_BOLT:
1993 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
1995 return "fire bolt (9d8) every 8+d8 turns";
1997 case EGO_RING_COLD_BOLT:
1999 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
2001 return "frost bolt (6d8) every 7+d7 turns";
2003 case EGO_RING_ELEC_BOLT:
2005 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
2007 return "lightning bolt (4d8) every 5+d5 turns";
2009 case EGO_RING_ACID_BOLT:
2011 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
2013 return "acid bolt (5d8) every 6+d6 turns";
2015 case EGO_RING_MANA_BOLT:
2017 return "ËâÎϤÎÌð(120) : 120+d120 ¥¿¡¼¥óËè";
2019 return "a mana bolt (120) every 120+d120 turns";
2021 case EGO_RING_FIRE_BALL:
2023 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2025 return "fire ball (100) every 80+d80 turns";
2027 case EGO_RING_COLD_BALL:
2029 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2031 return "cold ball (100) every 80+d80 turns";
2033 case EGO_RING_ELEC_BALL:
2035 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2037 return "elec ball (100) every 80+d80 turns";
2039 case EGO_RING_ACID_BALL:
2041 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2043 return "acid ball (100) every 80+d80 turns";
2045 case EGO_RING_MANA_BALL:
2047 return "ËâÎϤÎÍò (250) : 300 ¥¿¡¼¥óËè";
2049 return "mana storm (250) every 300 turns";
2051 case EGO_RING_DRAGON_F:
2052 if (o_ptr->sval == SV_RING_FLAMES)
2054 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ : 200 ¥¿¡¼¥óËè";
2056 return "breath of fire (200) and resist fire every 200 turns";
2060 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
2062 return "fire breath (200) every 250 turns";
2064 case EGO_RING_DRAGON_C:
2065 if (o_ptr->sval == SV_RING_ICE)
2067 return "Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ : 200 ¥¿¡¼¥óËè";
2069 return "breath of cold (200) and resist cold every 200 turns";
2073 return "Î䵤¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
2075 return "cold breath (200) every 250 turns";
2077 case EGO_RING_M_DETECT:
2079 return "Á´¥â¥ó¥¹¥¿¡¼´¶ÃÎ : 150 ¥¿¡¼¥óËè";
2081 return "detect all monsters every 150 turns";
2083 case EGO_RING_D_SPEED:
2085 return "¥¹¥Ô¡¼¥É(15+d30¥¿¡¼¥ó) : 100 ¥¿¡¼¥óËè";
2087 return "haste self (15+d30 turns) every 100 turns";
2089 case EGO_RING_BERSERKER:
2091 return "¶¸Àï»Î²½(25+d25¥¿¡¼¥ó) : 75+d75 ¥¿¡¼¥óËè";
2093 return "berserk (25+d25 turns) every 75+d75 turns";
2095 case EGO_RING_TELE_AWAY:
2097 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
2099 return "teleport away every 150 turns";
2103 return "»Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢µæ¶Ë¤ÎÂÑÀ : 777 ¥¿¡¼¥óËè";
2105 return "hero, bless, and ultimate resistance every 777 turns";
2109 switch (o_ptr->sval)
2111 case SV_RING_FLAMES:
2113 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ : 50+d50 ¥¿¡¼¥óËè";
2115 return "ball of fire (100) and resist fire every 50+d50 turns";
2120 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ : 50+d50 ¥¿¡¼¥óËè";
2122 return "ball of cold (100) and resist cold every 50+d50 turns";
2127 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ : 50+d50 ¥¿¡¼¥óËè";
2129 return "ball of acid (100) and resist acid every 50+d50 turns";
2134 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50 ¥¿¡¼¥óËè";
2136 return "ball of elec (100) and resist elec every 50+d50 turns";
2144 if (o_ptr->tval == TV_AMULET)
2148 switch (o_ptr->name2)
2152 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
2154 return "identify every 10 turns";
2159 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
2161 return "charm monster every 200 turns";
2166 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
2168 return "blink every 10+d10 turns";
2171 case EGO_AMU_TELEPORT:
2173 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
2175 return "teleport every 50+d50 turns";
2178 case EGO_AMU_D_DOOR:
2180 return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
2182 return "dimension door every 200 turns";
2185 case EGO_AMU_RES_FIRE_:
2187 return "²Ð±ê¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
2189 return "resist fire every 50+d50 turns";
2192 case EGO_AMU_RES_COLD_:
2194 return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
2196 return "resist cold every 50+d50 turns";
2199 case EGO_AMU_RES_ELEC_:
2201 return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
2203 return "resist elec every 50+d50 turns";
2206 case EGO_AMU_RES_ACID_:
2208 return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
2210 return "resist acid every 50+d50 turns";
2213 case EGO_AMU_DETECTION:
2215 return "Á´´¶ÃÎ : 55+d55¥¿¡¼¥óËè";
2217 return "detect all floor every 55+d55 turns";
2224 if (o_ptr->tval == TV_WHISTLE)
2227 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
2229 return "call pet every 100+d100 turns";
2233 if (o_ptr->tval == TV_CAPTURE)
2236 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
2238 return "captures or releases a monster.";
2242 /* Require dragon scale mail */
2244 if (o_ptr->tval != TV_DRAG_ARMOR) return ("´ñ̯¤Ê¸÷");
2246 if (o_ptr->tval != TV_DRAG_ARMOR) return ("a strange glow");
2250 /* Branch on the sub-type */
2251 switch (o_ptr->sval)
2253 case SV_DRAGON_BLUE:
2256 return "°ðºÊ¤Î¥Ö¥ì¥¹(100) : 150+d150 ¥¿¡¼¥óËè";
2258 return "breathe lightning (100) every 150+d150 turns";
2262 case SV_DRAGON_WHITE:
2265 return "Î䵤¤Î¥Ö¥ì¥¹(110) : 150+d150 ¥¿¡¼¥óËè";
2267 return "breathe frost (110) every 150+d150 turns";
2271 case SV_DRAGON_BLACK:
2274 return "»À¤Î¥Ö¥ì¥¹(130) : 150+d150 ¥¿¡¼¥óËè";
2276 return "breathe acid (130) every 150+d150 turns";
2280 case SV_DRAGON_GREEN:
2283 return "ÆǤΥ¬¥¹¤Î¥Ö¥ì¥¹(150) : 180+d180 ¥¿¡¼¥óËè";
2285 return "breathe poison gas (150) every 180+d180 turns";
2292 return "²Ð±ê¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
2294 return "breathe fire (200) every 200+d200 turns";
2298 case SV_DRAGON_MULTIHUED:
2301 return "Ëü¿§¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè";
2303 return "breathe multi-hued (250) every 200+d200 turns";
2307 case SV_DRAGON_BRONZE:
2310 return "º®Íð¤Î¥Ö¥ì¥¹(120) : 180+d180 ¥¿¡¼¥óËè";
2312 return "breathe confusion (120) every 180+d180 turns";
2316 case SV_DRAGON_GOLD:
2319 return "¹ì²»¤Î¥Ö¥ì¥¹(130) : 180+d180 ¥¿¡¼¥óËè";
2321 return "breathe sound (130) every 180+d180 turns";
2325 case SV_DRAGON_CHAOS:
2328 return "¥«¥ª¥¹/Îô²½¤Î¥Ö¥ì¥¹(220) : 200+d200 ¥¿¡¼¥óËè";
2330 return "breathe chaos/disenchant (220) every 200+d200 turns";
2337 return "¹ì²»/ÇËÊҤΥ֥쥹(230) : 200+d200 ¥¿¡¼¥óËè";
2339 return "breathe sound/shards (230) every 200+d200 turns";
2343 case SV_DRAGON_BALANCE:
2346 return "¥Ð¥é¥ó¥¹¤Î¥Ö¥ì¥¹ (250) 200+d200 ¥¿¡¼¥óËè";
2348 return "breathe balance (250) every 200+d200 turns";
2352 case SV_DRAGON_SHINING:
2355 return "Á®¸÷/°Å¹õ¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
2357 return "breathe light/darkness (200) every 200+d200 turns";
2361 case SV_DRAGON_POWER:
2364 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
2366 return "breathe the elements (300) every 200+d200 turns";
2376 return "breathe air";
2383 * Describe a "fully identified" item
2385 bool identify_fully_aux(object_type *o_ptr)
2393 char o_name[MAX_NLEN];
2396 /* Extract the flags */
2397 object_flags(o_ptr, &f1, &f2, &f3);
2399 /* Extract the description */
2403 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
2404 (k_text + k_info[lookup_kind(o_ptr->tval, o_ptr->sval)].text),
2406 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
2407 { info[i] = &temp[j]; i++;}
2410 /* Mega-Hack -- describe activation */
2411 if (f3 & (TR3_ACTIVATE))
2414 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
2416 info[i++] = "It can be activated for...";
2419 info[i++] = item_activation(o_ptr);
2421 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
2423 info[i++] = "...if it is being worn.";
2428 /* Figurines, a hack */
2429 if (o_ptr->tval == TV_FIGURINE)
2432 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
2434 info[i++] = "It will transform into a pet when thrown.";
2439 /* Figurines, a hack */
2440 if (o_ptr->name1 == ART_STONEMASK)
2443 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
2445 info[i++] = "It makes you turn into a vampire permanently.";
2450 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
2453 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
2455 info[i++] = "It will attempts to kill a monster instantly.";
2460 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
2463 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
2465 info[i++] = "It strikes yourself sometimes.";
2469 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
2471 info[i++] = "It will always penetrates invulnerability barrier.";
2475 if (o_ptr->name2 == EGO_2WEAPON)
2478 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
2480 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
2485 if (o_ptr->name2 == EGO_RING_WIZARD)
2488 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
2490 info[i++] = "It affects your ability to use magic devices.";
2494 if (o_ptr->name2 == EGO_AMU_FOOL)
2497 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
2499 info[i++] = "It prevents you from using magic items.";
2503 if (o_ptr->name2 == EGO_RING_THROW)
2506 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
2508 info[i++] = "It provides great strength when you throw an item.";
2512 if (o_ptr->name2 == EGO_AMU_NAIVETY)
2515 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
2517 info[i++] = "It decreases your magic resistance.";
2521 if (o_ptr->tval == TV_STATUE)
2523 monster_race *r_ptr = &r_info[o_ptr->pval];
2525 if (o_ptr->pval == MON_BULLGATES)
2527 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
2529 info[i++] = "It is shameful.";
2531 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
2533 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
2535 info[i++] = "It is fearful.";
2539 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
2541 info[i++] = "It is cheerful.";
2545 /* Hack -- describe lite's */
2546 if (o_ptr->tval == TV_LITE)
2548 if (o_ptr->name2 == EGO_LITE_DARKNESS)
2551 info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
2553 info[i++] = "It provides no light..";
2556 else if (artifact_p(o_ptr))
2559 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2561 info[i++] = "It provides light (radius 3) forever.";
2565 else if (o_ptr->name2 == EGO_LITE_SHINE)
2567 if (o_ptr->sval == SV_LITE_FEANOR)
2570 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2572 info[i++] = "It provides light (radius 3) forever.";
2576 else if (o_ptr->sval == SV_LITE_LANTERN)
2579 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2581 info[i++] = "It provides light (radius 3) when fueled.";
2588 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2590 info[i++] = "It provides light (radius 2) when fueled.";
2597 if (o_ptr->sval == SV_LITE_FEANOR)
2600 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2602 info[i++] = "It provides light (radius 2) forever.";
2606 else if (o_ptr->sval == SV_LITE_LANTERN)
2609 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2611 info[i++] = "It provides light (radius 2) when fueled.";
2618 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
2620 info[i++] = "It provides light (radius 1) when fueled.";
2625 if (o_ptr->name2 == EGO_LITE_LONG)
2628 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
2630 info[i++] = "It provides light for much longer time.";
2636 /* And then describe it fully */
2638 if (f2 & (TR2_RIDING))
2640 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
2642 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
2644 info[i++] = "It is made for use while riding.";
2648 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
2650 info[i++] = "It is suitable for use while riding.";
2657 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2659 info[i++] = "It affects your strength.";
2666 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2668 info[i++] = "It affects your intelligence.";
2675 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2677 info[i++] = "It affects your wisdom.";
2684 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2686 info[i++] = "It affects your dexterity.";
2693 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2695 info[i++] = "It affects your constitution.";
2702 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2704 info[i++] = "It affects your charisma.";
2709 if (f1 & (TR1_MAGIC_MASTERY))
2712 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2714 info[i++] = "It affects your ability to use magic devices.";
2718 if (f1 & (TR1_STEALTH))
2721 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2723 info[i++] = "It affects your stealth.";
2727 if (f1 & (TR1_SEARCH))
2730 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2732 info[i++] = "It affects your searching.";
2736 if (f1 & (TR1_INFRA))
2739 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2741 info[i++] = "It affects your infravision.";
2745 if (f1 & (TR1_TUNNEL))
2748 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2750 info[i++] = "It affects your ability to tunnel.";
2754 if (f1 & (TR1_SPEED))
2757 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2759 info[i++] = "It affects your speed.";
2763 if (f1 & (TR1_BLOWS))
2766 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2768 info[i++] = "It affects your attack speed.";
2773 if (f1 & (TR1_BRAND_ACID))
2776 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2778 info[i++] = "It does extra damage from acid.";
2782 if (f1 & (TR1_BRAND_ELEC))
2785 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2787 info[i++] = "It does extra damage from electricity.";
2791 if (f1 & (TR1_BRAND_FIRE))
2794 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2796 info[i++] = "It does extra damage from fire.";
2800 if (f1 & (TR1_BRAND_COLD))
2803 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2805 info[i++] = "It does extra damage from frost.";
2810 if (f1 & (TR1_BRAND_POIS))
2813 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
2815 info[i++] = "It poisons your foes.";
2820 if (f1 & (TR1_CHAOTIC))
2823 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
2825 info[i++] = "It produces chaotic effects.";
2830 if (f1 & (TR1_VAMPIRIC))
2833 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
2835 info[i++] = "It drains life from your foes.";
2840 if (f1 & (TR1_IMPACT))
2843 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
2845 info[i++] = "It can cause earthquakes.";
2850 if (f1 & (TR1_VORPAL))
2853 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
2855 info[i++] = "It is very sharp and can cut your foes.";
2860 if (f1 & (TR1_KILL_DRAGON))
2863 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2865 info[i++] = "It is a great bane of dragons.";
2869 else if (f1 & (TR1_SLAY_DRAGON))
2872 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2874 info[i++] = "It is especially deadly against dragons.";
2878 if (f1 & (TR1_SLAY_ORC))
2881 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2883 info[i++] = "It is especially deadly against orcs.";
2887 if (f1 & (TR1_SLAY_TROLL))
2890 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2892 info[i++] = "It is especially deadly against trolls.";
2896 if (f1 & (TR1_SLAY_GIANT))
2898 if (o_ptr->name1 == ART_HRUNTING)
2900 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2902 info[i++] = "It is a great bane of giants.";
2906 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2908 info[i++] = "It is especially deadly against giants.";
2912 if (f1 & (TR1_SLAY_DEMON))
2915 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
2917 info[i++] = "It strikes at demons with holy wrath.";
2921 if (f1 & (TR1_SLAY_UNDEAD))
2924 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
2926 info[i++] = "It strikes at undead with holy wrath.";
2930 if (f1 & (TR1_SLAY_EVIL))
2933 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
2935 info[i++] = "It fights against evil with holy fury.";
2939 if (f1 & (TR1_SLAY_ANIMAL))
2942 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2944 info[i++] = "It is especially deadly against natural creatures.";
2948 if (f3 & (TR3_SLAY_HUMAN))
2951 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
2953 info[i++] = "It is especially deadly against humans.";
2958 if (f1 & (TR1_FORCE_WEAPON))
2961 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
2963 info[i++] = "It powerfully strikes at a monster using your mana.";
2967 if (f3 & (TR3_DEC_MANA))
2970 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
2972 info[i++] = "It decreases your mana consumption.";
2976 if (f2 & (TR2_SUST_STR))
2979 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
2981 info[i++] = "It sustains your strength.";
2985 if (f2 & (TR2_SUST_INT))
2988 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
2990 info[i++] = "It sustains your intelligence.";
2994 if (f2 & (TR2_SUST_WIS))
2997 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
2999 info[i++] = "It sustains your wisdom.";
3003 if (f2 & (TR2_SUST_DEX))
3006 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
3008 info[i++] = "It sustains your dexterity.";
3012 if (f2 & (TR2_SUST_CON))
3015 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
3017 info[i++] = "It sustains your constitution.";
3021 if (f2 & (TR2_SUST_CHR))
3024 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
3026 info[i++] = "It sustains your charisma.";
3031 if (f2 & (TR2_IM_ACID))
3034 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3036 info[i++] = "It provides immunity to acid.";
3040 if (f2 & (TR2_IM_ELEC))
3043 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3045 info[i++] = "It provides immunity to electricity.";
3049 if (f2 & (TR2_IM_FIRE))
3052 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3054 info[i++] = "It provides immunity to fire.";
3058 if (f2 & (TR2_IM_COLD))
3061 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3063 info[i++] = "It provides immunity to cold.";
3068 if (f2 & (TR2_THROW))
3071 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
3073 info[i++] = "It is perfectly balanced for throwing.";
3077 if (f2 & (TR2_FREE_ACT))
3080 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3082 info[i++] = "It provides immunity to paralysis.";
3086 if (f2 & (TR2_HOLD_LIFE))
3089 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
3091 info[i++] = "It provides resistance to life draining.";
3095 if (f2 & (TR2_RES_FEAR))
3098 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
3100 info[i++] = "It makes you completely fearless.";
3104 if (f2 & (TR2_RES_ACID))
3107 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3109 info[i++] = "It provides resistance to acid.";
3113 if (f2 & (TR2_RES_ELEC))
3116 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3118 info[i++] = "It provides resistance to electricity.";
3122 if (f2 & (TR2_RES_FIRE))
3125 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3127 info[i++] = "It provides resistance to fire.";
3131 if (f2 & (TR2_RES_COLD))
3134 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3136 info[i++] = "It provides resistance to cold.";
3140 if (f2 & (TR2_RES_POIS))
3143 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3145 info[i++] = "It provides resistance to poison.";
3150 if (f2 & (TR2_RES_LITE))
3153 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3155 info[i++] = "It provides resistance to light.";
3159 if (f2 & (TR2_RES_DARK))
3162 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3164 info[i++] = "It provides resistance to dark.";
3169 if (f2 & (TR2_RES_BLIND))
3172 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3174 info[i++] = "It provides resistance to blindness.";
3178 if (f2 & (TR2_RES_CONF))
3181 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3183 info[i++] = "It provides resistance to confusion.";
3187 if (f2 & (TR2_RES_SOUND))
3190 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3192 info[i++] = "It provides resistance to sound.";
3196 if (f2 & (TR2_RES_SHARDS))
3199 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3201 info[i++] = "It provides resistance to shards.";
3206 if (f2 & (TR2_RES_NETHER))
3209 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3211 info[i++] = "It provides resistance to nether.";
3215 if (f2 & (TR2_RES_NEXUS))
3218 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3220 info[i++] = "It provides resistance to nexus.";
3224 if (f2 & (TR2_RES_CHAOS))
3227 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3229 info[i++] = "It provides resistance to chaos.";
3233 if (f2 & (TR2_RES_DISEN))
3236 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
3238 info[i++] = "It provides resistance to disenchantment.";
3243 if (f3 & (TR3_FEATHER))
3246 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
3248 info[i++] = "It allows you to levitate.";
3252 if (f3 & (TR3_LITE))
3254 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
3256 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë¡£";
3258 info[i++] = "It decreases radius of your light source.";
3262 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
3264 info[i++] = "It provides permanent light.";
3268 if (f3 & (TR3_SEE_INVIS))
3271 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
3273 info[i++] = "It allows you to see invisible monsters.";
3277 if (f3 & (TR3_TELEPATHY))
3280 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
3282 info[i++] = "It gives telepathic powers.";
3286 if (f3 & (TR3_SLOW_DIGEST))
3289 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
3291 info[i++] = "It slows your metabolism.";
3295 if (f3 & (TR3_REGEN))
3298 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
3300 info[i++] = "It speeds your regenerative powers.";
3304 if (f3 & (TR3_WARNING))
3307 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
3309 info[i++] = "It warns you of danger";
3313 if (f2 & (TR2_REFLECT))
3316 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
3318 info[i++] = "It reflects bolts and arrows.";
3322 if (f3 & (TR3_SH_FIRE))
3325 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3327 info[i++] = "It produces a fiery sheath.";
3331 if (f3 & (TR3_SH_ELEC))
3334 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3336 info[i++] = "It produces an electric sheath.";
3340 if (f3 & (TR3_SH_COLD))
3343 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3345 info[i++] = "It produces a coldly sheath.";
3349 if (f3 & (TR3_NO_MAGIC))
3352 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3354 info[i++] = "It produces an anti-magic shell.";
3358 if (f3 & (TR3_NO_TELE))
3361 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
3363 info[i++] = "It prevents teleportation.";
3367 if (f3 & (TR3_XTRA_MIGHT))
3370 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
3372 info[i++] = "It fires missiles with extra might.";
3376 if (f3 & (TR3_XTRA_SHOTS))
3379 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
3381 info[i++] = "It fires missiles excessively fast.";
3386 if (f3 & TR3_BLESSED)
3389 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
3391 info[i++] = "It has been blessed by the gods.";
3396 if (cursed_p(o_ptr))
3398 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
3401 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
3403 info[i++] = "It is permanently cursed.";
3407 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
3410 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
3412 info[i++] = "It is heavily cursed.";
3419 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
3421 info[i++] = "It is cursed.";
3427 if ((f3 & TR3_TY_CURSE) || (o_ptr->curse_flags & TRC_TY_CURSE))
3430 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
3432 info[i++] = "It carries an ancient foul curse.";
3436 if ((f3 & TR3_AGGRAVATE) || (o_ptr->curse_flags & TRC_AGGRAVATE))
3439 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
3441 info[i++] = "It aggravates nearby creatures.";
3445 if ((f3 & (TR3_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
3448 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
3450 info[i++] = "It drains experience.";
3454 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
3457 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
3459 info[i++] = "It slows your regenerative powers.";
3463 if (o_ptr->curse_flags & TRC_ADD_L_CURSE)
3466 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
3468 info[i++] = "It adds weak curses.";
3472 if (o_ptr->curse_flags & TRC_ADD_H_CURSE)
3475 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
3477 info[i++] = "It adds heavy curses.";
3481 if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
3484 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3486 info[i++] = "It attracts animals.";
3490 if (o_ptr->curse_flags & TRC_CALL_DEMON)
3493 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3495 info[i++] = "It attracts demons.";
3499 if (o_ptr->curse_flags & TRC_CALL_DRAGON)
3502 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3504 info[i++] = "It attracts dragons.";
3508 if (o_ptr->curse_flags & TRC_COWARDICE)
3511 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£";
3513 info[i++] = "It makes you subject to cowardice.";
3517 if ((f3 & (TR3_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
3520 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£";
3522 info[i++] = "It induces random teleportation.";
3526 if (o_ptr->curse_flags & TRC_LOW_MELEE)
3529 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
3531 info[i++] = "It causes you miss blows.";
3535 if (o_ptr->curse_flags & TRC_LOW_AC)
3538 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
3540 info[i++] = "It helps your enemys' blows.";
3544 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
3547 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
3549 info[i++] = "It encumbers you while spellcasting.";
3553 if (o_ptr->curse_flags & TRC_FAST_DIGEST)
3556 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
3558 info[i++] = "It speeds your metabolism.";
3562 if (o_ptr->curse_flags & TRC_DRAIN_HP)
3565 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
3567 info[i++] = "It drains you.";
3571 if (o_ptr->curse_flags & TRC_DRAIN_MANA)
3574 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
3576 info[i++] = "It drains your mana.";
3581 /* XTRA HACK ARTDESC */
3582 flag = TR3_IGNORE_ACID | TR3_IGNORE_ELEC | TR3_IGNORE_FIRE | TR3_IGNORE_COLD ;
3583 if ((f3 & flag) == flag)
3586 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3588 info[i++] = "It cannot be harmed by the elements.";
3591 if (f3 & (TR3_IGNORE_ACID))
3594 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3596 info[i++] = "It cannot be harmed by acid.";
3600 if (f3 & (TR3_IGNORE_ELEC))
3603 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3605 info[i++] = "It cannot be harmed by electricity.";
3609 if (f3 & (TR3_IGNORE_FIRE))
3612 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3614 info[i++] = "It cannot be harmed by fire.";
3618 if (f3 & (TR3_IGNORE_COLD))
3621 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3623 info[i++] = "It cannot be harmed by cold.";
3628 /* XTRA HACK ARTDESC */
3631 /* No special effects */
3632 if (!i) return (FALSE);
3634 /* Save the screen */
3638 Term_get_size(&wid, &hgt);
3640 /* Display Item name */
3641 object_desc(o_name, o_ptr, TRUE, 3);
3642 prt(format("%s", o_name), 0, 0);
3644 /* Erase the screen */
3645 for (k = 1; k < hgt; k++) prt("", k, 13);
3647 /* Label the information */
3648 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
3650 monster_race *r_ptr = &r_info[o_ptr->pval];
3651 int namelen = strlen(r_name + r_ptr->name);
3652 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
3653 c_prt(r_ptr->d_attr, format("%c", r_ptr->d_char), 1, 18+namelen);
3654 prt("'", 1, 19+namelen);
3658 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
3660 prt(" Item Attributes:", 1, 15);
3663 /* We will print on top of the map (column 13) */
3664 for (k = 2, j = 0; j < i; j++)
3667 prt(info[j], k++, 15);
3669 /* Every 20 entries (lines 2 to 21), start over */
3670 if ((k == hgt - 2) && (j+1 < i))
3673 prt("-- ³¤¯ --", k, 15);
3675 prt("-- more --", k, 15);
3678 for (; k > 2; k--) prt("", k, 15);
3684 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
3686 prt("[Press any key to continue]", k, 15);
3691 /* Restore the screen */
3694 /* Gave knowledge */
3701 * Convert an inventory index into a one character label
3702 * Note that the label does NOT distinguish inven/equip.
3704 char index_to_label(int i)
3706 /* Indexes for "inven" are easy */
3707 if (i < INVEN_RARM) return (I2A(i));
3709 /* Indexes for "equip" are offset */
3710 return (I2A(i - INVEN_RARM));
3715 * Convert a label into the index of an item in the "inven"
3716 * Return "-1" if the label does not indicate a real item
3718 s16b label_to_inven(int c)
3723 i = (islower(c) ? A2I(c) : -1);
3725 /* Verify the index */
3726 if ((i < 0) || (i > INVEN_PACK)) return (-1);
3728 /* Empty slots can never be chosen */
3729 if (!inventory[i].k_idx) return (-1);
3731 /* Return the index */
3737 * Convert a label into the index of a item in the "equip"
3738 * Return "-1" if the label does not indicate a real item
3740 s16b label_to_equip(int c)
3745 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
3747 /* Verify the index */
3748 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
3750 /* Empty slots can never be chosen */
3751 if (!inventory[i].k_idx) return (-1);
3753 /* Return the index */
3760 * Determine which equipment slot (if any) an item likes
3762 s16b wield_slot(object_type *o_ptr)
3764 /* Slot for equipment */
3765 switch (o_ptr->tval)
3772 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
3773 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
3774 return (INVEN_LARM);
3781 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
3782 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
3783 return (INVEN_RARM);
3793 /* Use the right hand first */
3794 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
3796 /* Use the left hand for swapping (by default) */
3797 return (INVEN_LEFT);
3803 return (INVEN_NECK);
3808 return (INVEN_LITE);
3815 return (INVEN_BODY);
3820 return (INVEN_OUTER);
3826 return (INVEN_HEAD);
3831 return (INVEN_HANDS);
3836 return (INVEN_FEET);
3840 /* No slot available */
3846 * Return a string mentioning how a given item is carried
3848 cptr mention_use(int i)
3852 /* Examine the location */
3856 case INVEN_RARM: p = p_ptr->ryoute ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê"); break;
3858 case INVEN_RARM: p = "Wielding"; break;
3862 case INVEN_LARM: p = (left_hander ? " ±¦¼ê" : " º¸¼ê"); break;
3864 case INVEN_LARM: p = "On arm"; break;
3868 case INVEN_BOW: p = "¼Í·âÍÑ"; break;
3870 case INVEN_BOW: p = "Shooting"; break;
3874 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
3876 case INVEN_LEFT: p = "On left hand"; break;
3880 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
3882 case INVEN_RIGHT: p = "On right hand"; break;
3886 case INVEN_NECK: p = " ¼ó"; break;
3888 case INVEN_NECK: p = "Around neck"; break;
3892 case INVEN_LITE: p = " ¸÷¸»"; break;
3894 case INVEN_LITE: p = "Light source"; break;
3898 case INVEN_BODY: p = " ÂÎ"; break;
3900 case INVEN_BODY: p = "On body"; break;
3904 case INVEN_OUTER: p = "ÂΤξå"; break;
3906 case INVEN_OUTER: p = "About body"; break;
3910 case INVEN_HEAD: p = " Ƭ"; break;
3912 case INVEN_HEAD: p = "On head"; break;
3916 case INVEN_HANDS: p = " ¼ê"; break;
3918 case INVEN_HANDS: p = "On hands"; break;
3922 case INVEN_FEET: p = " "; break;
3924 case INVEN_FEET: p = "On feet"; break;
3928 default: p = "¥¶¥Ã¥¯"; break;
3930 default: p = "In pack"; break;
3935 /* Hack -- Heavy weapon */
3936 if (i == INVEN_RARM)
3938 if (p_ptr->heavy_wield[0])
3949 /* Hack -- Heavy weapon */
3950 if (i == INVEN_LARM)
3952 if (p_ptr->heavy_wield[1])
3963 /* Hack -- Heavy bow */
3967 o_ptr = &inventory[i];
3968 if (adj_str_hold[p_ptr->stat_ind[A_STR]] < o_ptr->weight / 10)
3979 /* Return the result */
3985 * Return a string describing how a given item is being worn.
3986 * Currently, only used for items in the equipment, not inventory.
3988 cptr describe_use(int i)
3995 case INVEN_RARM: p = p_ptr->ryoute ? " ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? " º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : " ±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë"); break;
3997 case INVEN_RARM: p = "attacking monsters with"; break;
4001 case INVEN_LARM: p = (left_hander ? " ±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : " º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë"); break;
4003 case INVEN_LARM: p = "wearing on your arm"; break;
4007 case INVEN_BOW: p = "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
4009 case INVEN_BOW: p = "shooting missiles with"; break;
4013 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
4015 case INVEN_LEFT: p = "wearing on your left hand"; break;
4019 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
4021 case INVEN_RIGHT: p = "wearing on your right hand"; break;
4025 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
4027 case INVEN_NECK: p = "wearing around your neck"; break;
4031 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
4033 case INVEN_LITE: p = "using to light the way"; break;
4037 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
4039 case INVEN_BODY: p = "wearing on your body"; break;
4043 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
4045 case INVEN_OUTER: p = "wearing on your back"; break;
4049 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
4051 case INVEN_HEAD: p = "wearing on your head"; break;
4055 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
4057 case INVEN_HANDS: p = "wearing on your hands"; break;
4061 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
4063 case INVEN_FEET: p = "wearing on your feet"; break;
4067 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
4069 default: p = "carrying in your pack"; break;
4074 /* Hack -- Heavy weapon */
4075 if (i == INVEN_RARM)
4078 int hold = adj_str_hold[p_ptr->stat_ind[A_STR]];
4080 if (p_ptr->ryoute) hold *= 2;
4081 o_ptr = &inventory[i];
4082 if (hold < o_ptr->weight / 10)
4093 /* Hack -- Heavy bow */
4097 o_ptr = &inventory[i];
4098 if (adj_str_hold[p_ptr->stat_ind[A_STR]] < o_ptr->weight / 10)
4101 p = "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î";
4109 /* Return the result */
4114 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
4116 bool check_book_realm(const byte book_tval, const byte book_sval)
4118 if (book_tval < TV_LIFE_BOOK) return FALSE;
4119 if (p_ptr->pclass == CLASS_SORCERER)
4121 return is_magic(tval2realm(book_tval));
4123 else if (p_ptr->pclass == CLASS_RED_MAGE)
4125 if (is_magic(tval2realm(book_tval)))
4126 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
4128 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
4133 * Check an item against the item tester info
4135 bool item_tester_okay(object_type *o_ptr)
4137 /* Hack -- allow listing empty slots */
4138 if (item_tester_full) return (TRUE);
4140 /* Require an item */
4141 if (!o_ptr->k_idx) return (FALSE);
4143 /* Hack -- ignore "gold" */
4144 if (o_ptr->tval == TV_GOLD) return (FALSE);
4146 /* Check the tval */
4147 if (item_tester_tval)
4149 /* Is it a spellbook? If so, we need a hack -- TY */
4150 if ((item_tester_tval <= TV_DEATH_BOOK) &&
4151 (item_tester_tval >= TV_LIFE_BOOK))
4152 return check_book_realm(o_ptr->tval, o_ptr->sval);
4154 if (item_tester_tval != o_ptr->tval) return (FALSE);
4157 /* Check the hook */
4158 if (item_tester_hook)
4160 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
4171 * Choice window "shadow" of the "show_inven()" function
4173 void display_inven(void)
4175 register int i, n, z = 0;
4177 byte attr = TERM_WHITE;
4179 char o_name[MAX_NLEN];
4182 /* Find the "final" slot */
4183 for (i = 0; i < INVEN_PACK; i++)
4185 o_ptr = &inventory[i];
4187 /* Skip non-objects */
4188 if (!o_ptr->k_idx) continue;
4194 /* Display the pack */
4195 for (i = 0; i < z; i++)
4197 /* Examine the item */
4198 o_ptr = &inventory[i];
4200 /* Start with an empty "index" */
4201 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
4203 /* Is this item "acceptable"? */
4204 if (item_tester_okay(o_ptr))
4206 /* Prepare an "index" */
4207 tmp_val[0] = index_to_label(i);
4209 /* Bracket the "index" --(-- */
4213 /* Display the index (or blank space) */
4214 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
4216 /* Obtain an item description */
4217 object_desc(o_name, o_ptr, TRUE, 3);
4219 /* Obtain the length of the description */
4223 attr = tval_to_attr[o_ptr->tval % 128];
4225 /* Grey out charging items */
4231 /* Display the entry itself */
4232 Term_putstr(3, i, n, attr, o_name);
4234 /* Erase the rest of the line */
4235 Term_erase(3+n, i, 255);
4237 /* Display the weight if needed */
4238 if (show_weights && o_ptr->weight)
4240 int wgt = o_ptr->weight * o_ptr->number;
4242 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
4244 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4247 Term_putstr(71, i, -1, TERM_WHITE, tmp_val);
4251 /* Erase the rest of the window */
4252 for (i = z; i < Term->hgt; i++)
4254 /* Erase the line */
4255 Term_erase(0, i, 255);
4262 * Choice window "shadow" of the "show_equip()" function
4264 void display_equip(void)
4268 byte attr = TERM_WHITE;
4270 char o_name[MAX_NLEN];
4273 /* Display the equipment */
4274 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4276 /* Examine the item */
4277 o_ptr = &inventory[i];
4279 /* Start with an empty "index" */
4280 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
4282 /* Is this item "acceptable"? */
4283 if (item_tester_okay(o_ptr))
4285 /* Prepare an "index" */
4286 tmp_val[0] = index_to_label(i);
4288 /* Bracket the "index" --(-- */
4292 /* Display the index (or blank space) */
4293 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
4295 /* Obtain an item description */
4296 if ((i == INVEN_LARM) && p_ptr->ryoute)
4299 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
4301 strcpy(o_name, "(wielding with two-hands)");
4307 object_desc(o_name, o_ptr, TRUE, 3);
4308 attr = tval_to_attr[o_ptr->tval % 128];
4311 /* Obtain the length of the description */
4314 /* Grey out charging items */
4320 /* Display the entry itself */
4321 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
4323 /* Erase the rest of the line */
4324 Term_erase(3+n, i - INVEN_RARM, 255);
4326 /* Display the slot description (if needed) */
4329 Term_putstr(61, i - INVEN_RARM, -1, TERM_WHITE, "<--");
4330 Term_putstr(65, i - INVEN_RARM, -1, TERM_WHITE, mention_use(i));
4333 /* Display the weight (if needed) */
4334 if (show_weights && o_ptr->weight)
4336 int wgt = o_ptr->weight * o_ptr->number;
4337 int col = (show_labels ? 52 : 71);
4339 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
4341 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4344 Term_putstr(col, i - INVEN_RARM, -1, TERM_WHITE, tmp_val);
4348 /* Erase the rest of the window */
4349 for (i = INVEN_TOTAL - INVEN_RARM; i < Term->hgt; i++)
4351 /* Clear that line */
4352 Term_erase(0, i, 255);
4362 * Display the inventory.
4364 * Hack -- do not display "trailing" empty slots
4366 int show_inven(int target_item)
4368 int i, j, k, l, z = 0;
4369 int col, cur_col, len, lim;
4371 char o_name[MAX_NLEN];
4375 char out_desc[23][MAX_NLEN];
4376 int target_item_label = 0;
4378 char inven_spellbook_label[24];
4381 extern bool select_spellbook;
4383 /* Starting column */
4387 Term_get_size(&wid, &hgt);
4389 /* Default "max-length" */
4390 len = wid - col - 1;
4392 /* Maximum space allowed for descriptions */
4395 /* Require space for weight (if needed) */
4396 if (show_weights) lim -= 9;
4398 /* Require space for icon */
4399 if (show_item_graph)
4402 if (use_bigtile) lim--;
4405 /* Find the "final" slot */
4406 for (i = 0; i < INVEN_PACK; i++)
4408 o_ptr = &inventory[i];
4410 /* Skip non-objects */
4411 if (!o_ptr->k_idx) continue;
4417 if (select_spellbook)
4421 strcpy(inven_spellbook_label, "abcdefghijklmnopqrstuvw");
4422 for (i = 0; i < INVEN_PACK; i++)
4424 if (get_tag(&index, (char)('a' + i)))
4426 inven_spellbook_label[i] = ' ';
4427 inven_spellbook_label[index] = (char)('a' + i);
4432 /* Display the inventory */
4433 for (k = 0, i = 0; i < z; i++)
4435 o_ptr = &inventory[i];
4437 /* Is this item acceptable? */
4438 if (!item_tester_okay(o_ptr)) continue;
4440 /* Describe the object */
4441 object_desc(o_name, o_ptr, TRUE, 3);
4443 /* Hack -- enforce max length */
4446 /* Save the object index, color, and description */
4448 out_color[k] = tval_to_attr[o_ptr->tval % 128];
4450 /* Grey out charging items */
4453 out_color[k] = TERM_L_DARK;
4456 (void)strcpy(out_desc[k], o_name);
4458 /* Find the predicted "line length" */
4459 l = strlen(out_desc[k]) + 5;
4461 /* Be sure to account for the weight */
4462 if (show_weights) l += 9;
4464 /* Account for icon if displayed */
4465 if (show_item_graph)
4468 if (use_bigtile) l++;
4471 /* Maintain the maximum length */
4472 if (l > len) len = l;
4474 /* Advance to next "line" */
4478 /* Find the column to start in */
4479 col = (len > wid - 4) ? 0 : (wid - len - 1);
4481 /* Output each entry */
4482 for (j = 0; j < k; j++)
4488 o_ptr = &inventory[i];
4490 /* Clear the line */
4491 prt("", j + 1, col ? col - 2 : col);
4493 if (use_menu && target_item)
4495 if (j == (target_item-1))
4498 strcpy(tmp_val, "¡Õ");
4500 strcpy(tmp_val, "> ");
4502 target_item_label = i;
4504 else strcpy(tmp_val, " ");
4506 else if (i <= INVEN_PACK && select_spellbook)
4508 sprintf(tmp_val, "%c)", inven_spellbook_label[i]);
4512 /* Prepare an index --(-- */
4513 sprintf(tmp_val, "%c)", index_to_label(i));
4516 /* Clear the line with the (possibly indented) index */
4517 put_str(tmp_val, j + 1, col);
4521 /* Display graphics for object, if desired */
4522 if (show_item_graph)
4524 byte a = object_attr(o_ptr);
4525 char c = object_char(o_ptr);
4528 if (a & 0x80) a |= 0x40;
4531 Term_draw(cur_col, j + 1, a, c);
4536 Term_draw(cur_col, j + 1, 255, -1);
4542 /* Display the entry itself */
4543 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
4545 /* Display the weight if needed */
4548 int wgt = o_ptr->weight * o_ptr->number;
4550 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4552 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4555 put_str(tmp_val, j + 1, wid - 9);
4559 /* Make a "shadow" below the list (only if needed) */
4560 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4562 /* Save the new column */
4565 return target_item_label;
4571 * Display the equipment.
4573 int show_equip(int target_item)
4576 int col, cur_col, len, lim;
4579 char o_name[MAX_NLEN];
4582 char out_desc[23][MAX_NLEN];
4583 int target_item_label = 0;
4587 /* Starting column */
4591 Term_get_size(&wid, &hgt);
4593 /* Maximal length */
4594 len = wid - col - 1;
4596 /* Maximum space allowed for descriptions */
4599 /* Require space for labels (if needed) */
4601 if (show_labels) lim -= (7 + 2);
4603 if (show_labels) lim -= (14 + 2);
4607 /* Require space for weight (if needed) */
4609 if (show_weights) lim -= 10;
4611 if (show_weights) lim -= 9;
4615 if (show_item_graph) lim -= 2;
4617 /* Scan the equipment list */
4618 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
4620 o_ptr = &inventory[i];
4622 /* Is this item acceptable? */
4623 if (!item_tester_okay(o_ptr) && (!((i == INVEN_LARM) && p_ptr->ryoute) || item_tester_no_ryoute)) continue;
4626 object_desc(o_name, o_ptr, TRUE, 3);
4628 /* Truncate the description */
4631 if ((i == INVEN_LARM) && p_ptr->ryoute)
4634 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
4636 (void)strcpy(out_desc[k],"(wielding with two-hands)");
4642 (void)strcpy(out_desc[k], o_name);
4643 out_color[k] = tval_to_attr[o_ptr->tval % 128];
4647 /* Grey out charging items */
4650 out_color[k] = TERM_L_DARK;
4653 /* Extract the maximal length (see below) */
4655 l = strlen(out_desc[k]) + (2 + 1);
4657 l = strlen(out_desc[k]) + (2 + 3);
4661 /* Increase length for labels (if needed) */
4663 if (show_labels) l += (7 + 2);
4665 if (show_labels) l += (14 + 2);
4669 /* Increase length for weight (if needed) */
4670 if (show_weights) l += 9;
4672 if (show_item_graph) l += 2;
4674 /* Maintain the max-length */
4675 if (l > len) len = l;
4677 /* Advance the entry */
4681 /* Hack -- Find a column to start in */
4683 col = (len > wid - 6) ? 0 : (wid - len - 1);
4685 col = (len > wid - 4) ? 0 : (wid - len - 1);
4689 /* Output each entry */
4690 for (j = 0; j < k; j++)
4696 o_ptr = &inventory[i];
4698 /* Clear the line */
4699 prt("", j + 1, col ? col - 2 : col);
4701 if (use_menu && target_item)
4703 if (j == (target_item-1))
4706 strcpy(tmp_val, "¡Õ");
4708 strcpy(tmp_val, "> ");
4710 target_item_label = i;
4712 else strcpy(tmp_val, " ");
4715 /* Prepare an index --(-- */
4716 sprintf(tmp_val, "%c)", index_to_label(i));
4718 /* Clear the line with the (possibly indented) index */
4719 put_str(tmp_val, j+1, col);
4723 /* Display graphics for object, if desired */
4724 if (show_item_graph)
4726 byte a = object_attr(o_ptr);
4727 char c = object_char(o_ptr);
4730 if (a & 0x80) a |= 0x40;
4733 Term_draw(cur_col, j + 1, a, c);
4738 Term_draw(cur_col, j + 1, 255, -1);
4746 /* Mention the use */
4748 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
4750 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
4753 put_str(tmp_val, j+1, cur_col);
4755 /* Display the entry itself */
4757 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
4759 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
4766 /* Display the entry itself */
4767 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
4770 /* Display the weight if needed */
4773 int wgt = o_ptr->weight * o_ptr->number;
4775 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4777 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
4780 put_str(tmp_val, j+1, wid - 9);
4784 /* Make a "shadow" below the list (only if needed) */
4785 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4787 /* Save the new column */
4790 return target_item_label;
4797 * Flip "inven" and "equip" in any sub-windows
4799 void toggle_inven_equip(void)
4804 for (j = 0; j < 8; j++)
4807 if (!angband_term[j]) continue;
4809 /* Flip inven to equip */
4810 if (window_flag[j] & (PW_INVEN))
4813 window_flag[j] &= ~(PW_INVEN);
4814 window_flag[j] |= (PW_EQUIP);
4817 p_ptr->window |= (PW_EQUIP);
4820 /* Flip inven to equip */
4821 else if (window_flag[j] & (PW_EQUIP))
4824 window_flag[j] &= ~(PW_EQUIP);
4825 window_flag[j] |= (PW_INVEN);
4828 p_ptr->window |= (PW_INVEN);
4836 * Verify the choice of an item.
4838 * The item can be negative to mean "item on floor".
4840 static bool verify(cptr prompt, int item)
4842 char o_name[MAX_NLEN];
4843 char out_val[MAX_NLEN+20];
4850 o_ptr = &inventory[item];
4856 o_ptr = &o_list[0 - item];
4860 object_desc(o_name, o_ptr, TRUE, 3);
4864 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
4866 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
4871 return (get_check(out_val));
4876 * Hack -- allow user to "prevent" certain choices
4878 * The item can be negative to mean "item on floor".
4880 static bool get_item_allow(int item)
4889 o_ptr = &inventory[item];
4895 o_ptr = &o_list[0 - item];
4898 /* No inscription */
4899 if (!o_ptr->inscription) return (TRUE);
4902 s = strchr(quark_str(o_ptr->inscription), '!');
4904 /* Process preventions */
4907 /* Check the "restriction" */
4908 if ((s[1] == command_cmd) || (s[1] == '*'))
4910 /* Verify the choice */
4912 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
4914 if (!verify("Really try", item)) return (FALSE);
4919 /* Find another '!' */
4920 s = strchr(s + 1, '!');
4930 * Auxiliary function for "get_item()" -- test an index
4932 static bool get_item_okay(int i)
4935 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
4937 /* Verify the item */
4938 if (!item_tester_okay(&inventory[i])) return (FALSE);
4947 * Find the "first" inventory object with the given "tag".
4949 * A "tag" is a char "n" appearing as "@n" anywhere in the
4950 * inscription of an object.
4952 * Also, the tag "@xn" will work as well, where "n" is a tag-char,
4953 * and "x" is the "current" command_cmd code.
4955 int get_tag(int *cp, char tag)
4960 /* Check every object */
4961 for (i = 0; i < INVEN_TOTAL; ++i)
4963 object_type *o_ptr = &inventory[i];
4965 /* Skip non-objects */
4966 if (!o_ptr->k_idx) continue;
4968 /* Skip empty inscriptions */
4969 if (!o_ptr->inscription) continue;
4971 /* Skip non-choice */
4972 if (!item_tester_okay(o_ptr)) continue;
4975 s = strchr(quark_str(o_ptr->inscription), '@');
4977 /* Process all tags */
4980 /* Check the special tags */
4981 if ((s[1] == command_cmd) && (s[2] == tag))
4983 /* Save the actual inventory ID */
4990 /* Find another '@' */
4991 s = strchr(s + 1, '@');
4995 /* Check every object */
4996 for (i = 0; i < INVEN_TOTAL; ++i)
4998 object_type *o_ptr = &inventory[i];
5000 /* Skip non-objects */
5001 if (!o_ptr->k_idx) continue;
5003 /* Skip empty inscriptions */
5004 if (!o_ptr->inscription) continue;
5006 /* Skip non-choice */
5007 if (!item_tester_okay(o_ptr)) continue;
5010 s = strchr(quark_str(o_ptr->inscription), '@');
5012 /* Process all tags */
5015 /* Check the normal tags */
5016 if (s[1] == tag && !((s[2] >= '0' && s[2] <= '9') || (s[2] >= 'a' && s[2] <= 'z') || (s[2] >= 'A' && s[2] <= 'Z')))
5018 /* Save the actual inventory ID */
5025 /* Find another '@' */
5026 s = strchr(s + 1, '@');
5035 * Determine whether get_item() can get some item or not
5036 * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
5038 bool can_get_item(void)
5040 int j, floor_list[23], floor_num = 0;
5042 for (j = 0; j < INVEN_TOTAL; j++)
5043 if (item_tester_okay(&inventory[j]))
5046 floor_num = scan_floor(floor_list, py, px, 0x01);
5054 * Let the user select an item, save its "index"
5056 * Return TRUE only if an acceptable item was chosen by the user.
5058 * The selected item must satisfy the "item_tester_hook()" function,
5059 * if that hook is set, and the "item_tester_tval", if that value is set.
5061 * All "item_tester" restrictions are cleared before this function returns.
5063 * The user is allowed to choose acceptable items from the equipment,
5064 * inventory, or floor, respectively, if the proper flag was given,
5065 * and there are any acceptable items in that location.
5067 * The equipment or inventory are displayed (even if no acceptable
5068 * items are in that location) if the proper flag was given.
5070 * If there are no acceptable items available anywhere, and "str" is
5071 * not NULL, then it will be used as the text of a warning message
5072 * before the function returns.
5074 * Note that the user must press "-" to specify the item on the floor,
5075 * and there is no way to "examine" the item on the floor, while the
5076 * use of "capital" letters will "examine" an inventory/equipment item,
5077 * and prompt for its use.
5079 * If a legal item is selected from the inventory, we save it in "cp"
5080 * directly (0 to 35), and return TRUE.
5082 * If a legal item is selected from the floor, we save it in "cp" as
5083 * a negative (-1 to -511), and return TRUE.
5085 * If no item is available, we do nothing to "cp", and we display a
5086 * warning message, using "str" if available, and return FALSE.
5088 * If no item is selected, we do nothing to "cp", and return FALSE.
5090 * Global "p_ptr->command_new" is used when viewing the inventory or equipment
5091 * to allow the user to enter a command while viewing those screens, and
5092 * also to induce "auto-enter" of stores, and other such stuff.
5094 * Global "p_ptr->command_see" may be set before calling this function to start
5095 * out in "browse" mode. It is cleared before this function returns.
5097 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
5098 * If it is TRUE then we are viewing inventory, else equipment.
5100 * We always erase the prompt when we are done, leaving a blank line,
5101 * or a warning message, if appropriate, if no items are available.
5103 bool get_item(int *cp, cptr pmt, cptr str, int mode)
5105 s16b this_o_idx, next_o_idx = 0;
5107 char n1, n2, which = ' ';
5109 int j, k, i1, i2, e1, e2;
5119 bool allow_floor = FALSE;
5121 bool toggle = FALSE;
5127 extern bool select_spellbook;
5128 extern bool select_the_force;
5130 int menu_line = (use_menu ? 1 : 0);
5134 #ifdef ALLOW_EASY_FLOOR /* TNB */
5136 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
5138 #endif /* ALLOW_EASY_FLOOR -- TNB */
5142 /* Get the item index */
5143 if (repeat_pull(cp))
5145 if (*cp == 1111) { /* the_force */
5146 item_tester_tval = 0;
5147 item_tester_hook = NULL;
5158 /* Acquire object */
5161 /* Validate the item */
5162 if (item_tester_okay(o_ptr))
5164 /* Forget the item_tester_tval restriction */
5165 item_tester_tval = 0;
5167 /* Forget the item_tester_hook restriction */
5168 item_tester_hook = NULL;
5175 /* Verify the item */
5176 else if (get_item_okay(*cp))
5178 /* Forget the item_tester_tval restriction */
5179 item_tester_tval = 0;
5181 /* Forget the item_tester_hook restriction */
5182 item_tester_hook = NULL;
5189 #endif /* ALLOW_REPEAT */
5192 if (mode & (USE_EQUIP)) equip = TRUE;
5193 if (mode & (USE_INVEN)) inven = TRUE;
5194 if (mode & (USE_FLOOR)) floor = TRUE;
5197 /* Paranoia XXX XXX XXX */
5204 /* No item selected */
5208 /* Full inventory */
5210 i2 = INVEN_PACK - 1;
5212 /* Forbid inventory */
5213 if (!inven) i2 = -1;
5216 for (j = 0; j < INVEN_PACK; j++)
5217 if (item_tester_okay(&inventory[j])) max_inven++;
5220 /* Restrict inventory indexes */
5221 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
5222 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
5225 /* Full equipment */
5227 e2 = INVEN_TOTAL - 1;
5229 /* Forbid equipment */
5230 if (!equip) e2 = -1;
5233 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
5234 if (item_tester_okay(&inventory[j])) max_equip++;
5235 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
5238 /* Restrict equipment indexes */
5239 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
5240 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
5244 /* Restrict floor usage */
5247 /* Scan all objects in the grid */
5248 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5252 /* Acquire object */
5253 o_ptr = &o_list[this_o_idx];
5255 /* Acquire next object */
5256 next_o_idx = o_ptr->next_o_idx;
5258 /* Accept the item on the floor if legal */
5259 if (item_tester_okay(o_ptr)) allow_floor = TRUE;
5263 /* Require at least one legal choice */
5264 if (!allow_floor && (i1 > i2) && (e1 > e2))
5266 /* Cancel p_ptr->command_see */
5267 command_see = FALSE;
5275 if (select_the_force) {
5281 /* Analyze choices */
5284 /* Hack -- Start on equipment if requested */
5285 if (command_see && command_wrk && equip)
5291 /* Use inventory if allowed */
5294 command_wrk = FALSE;
5297 /* Use equipment if allowed */
5303 /* Use inventory for floor */
5306 command_wrk = FALSE;
5312 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
5314 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
5316 /* Hack -- start out in "display" mode */
5324 /* Repeat until done */
5327 int get_item_label = 0;
5336 for (j = 0; j < 8; j++)
5339 if (!angband_term[j]) continue;
5341 /* Count windows displaying inven */
5342 if (window_flag[j] & (PW_INVEN)) ni++;
5344 /* Count windows displaying equip */
5345 if (window_flag[j] & (PW_EQUIP)) ne++;
5348 /* Toggle if needed */
5349 if ((command_wrk && ni && !ne) ||
5350 (!command_wrk && !ni && ne))
5353 toggle_inven_equip();
5360 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5362 /* Redraw windows */
5366 /* Inventory screen */
5369 /* Extract the legal requests */
5373 /* Redraw if needed */
5374 if (command_see) get_item_label = show_inven(menu_line);
5377 /* Equipment screen */
5380 /* Extract the legal requests */
5381 n1 = I2A(e1 - INVEN_RARM);
5382 n2 = I2A(e2 - INVEN_RARM);
5384 /* Redraw if needed */
5385 if (command_see) get_item_label = show_equip(menu_line);
5388 /* Viewing inventory */
5391 /* Begin the prompt */
5393 sprintf(out_val, "»ý¤Áʪ:");
5395 sprintf(out_val, "Inven:");
5399 /* Some legal items */
5400 if ((i1 <= i2) && !use_menu)
5402 /* Build the prompt */
5404 sprintf(tmp_val, "%c-%c,",
5406 sprintf(tmp_val, " %c-%c,",
5409 index_to_label(i1), index_to_label(i2));
5412 strcat(out_val, tmp_val);
5415 /* Indicate ability to "view" */
5417 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5419 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5425 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
5426 else if (select_the_force)
5427 strcat(out_val, " 'w'Îýµ¤½Ñ,");
5429 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
5430 else if (select_the_force)
5431 strcat(out_val, " w for the Force,");
5436 /* Viewing equipment */
5439 /* Begin the prompt */
5441 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5443 sprintf(out_val, "Equip:");
5447 /* Some legal items */
5448 if ((e1 <= e2) && !use_menu)
5450 /* Build the prompt */
5452 sprintf(tmp_val, "%c-%c,",
5454 sprintf(tmp_val, " %c-%c,",
5457 index_to_label(e1), index_to_label(e2));
5460 strcat(out_val, tmp_val);
5463 /* Indicate ability to "view" */
5465 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5467 if (!command_see) strcat(out_val, " * to see,");
5473 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
5475 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
5480 /* Indicate legality of the "floor" item */
5482 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
5484 if (allow_floor) strcat(out_val, " - for floor,");
5488 /* Finish the prompt */
5489 strcat(out_val, " ESC");
5491 /* Build the prompt */
5492 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5494 /* Show the prompt */
5503 int max_line = (command_wrk ? max_equip : max_inven);
5519 menu_line += (max_line - 1);
5538 /* Verify legality */
5539 if (!inven || !equip)
5545 /* Hack -- Fix screen */
5555 /* Switch inven/equip */
5556 command_wrk = !command_wrk;
5557 max_line = (command_wrk ? max_equip : max_inven);
5558 if (menu_line > max_line) menu_line = max_line;
5560 /* Need to redraw */
5569 if (command_wrk == USE_FLOOR)
5572 (*cp) = -get_item_label;
5576 /* Validate the item */
5577 if (!get_item_okay(get_item_label))
5583 /* Allow player to "refuse" certain actions */
5584 if (!get_item_allow(get_item_label))
5590 /* Accept that choice */
5591 (*cp) = get_item_label;
5600 if (select_the_force) {
5608 if (menu_line > max_line) menu_line -= max_line;
5629 command_see = FALSE;
5649 /* Verify legality */
5650 if (!inven || !equip)
5656 /* Hack -- Fix screen */
5666 /* Switch inven/equip */
5667 command_wrk = !command_wrk;
5669 /* Need to redraw */
5675 /* Use floor item */
5678 /* Scan all objects in the grid */
5679 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5683 /* Acquire object */
5684 o_ptr = &o_list[this_o_idx];
5686 /* Acquire next object */
5687 next_o_idx = o_ptr->next_o_idx;
5689 /* Validate the item */
5690 if (!item_tester_okay(o_ptr)) continue;
5695 /* Verify the item (if required) */
5697 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
5699 if (other_query_flag && !verify("Try", k)) continue;
5703 /* Allow player to "refuse" certain actions */
5704 if (!get_item_allow(k)) continue;
5706 /* Accept that choice */
5723 case '1': case '2': case '3':
5724 case '4': case '5': case '6':
5725 case '7': case '8': case '9':
5727 /* Look up the tag */
5728 if (!get_tag(&k, which))
5734 /* Hack -- Validate the item */
5735 if ((k < INVEN_RARM) ? !inven : !equip)
5741 /* Validate the item */
5742 if (!get_item_okay(k))
5748 /* Allow player to "refuse" certain actions */
5749 if (!get_item_allow(k))
5755 /* Accept that choice */
5767 /* Choose "default" inventory item */
5770 k = ((i1 == i2) ? i1 : -1);
5773 /* Choose "default" equipment item */
5776 k = ((e1 == e2) ? e1 : -1);
5779 /* Validate the item */
5780 if (!get_item_okay(k))
5786 /* Allow player to "refuse" certain actions */
5787 if (!get_item_allow(k))
5793 /* Accept that choice */
5802 if (select_the_force) {
5814 if(select_spellbook){
5815 bool not_found = FALSE;
5816 /* Look up the tag */
5817 if (!get_tag(&k, which))
5822 /* Hack -- Validate the item */
5823 if ((k < INVEN_RARM) ? !inven : !equip)
5828 /* Validate the item */
5829 if (!get_item_okay(k))
5835 /* Accept that choice */
5843 /* Extract "query" setting */
5844 ver = isupper(which);
5845 which = tolower(which);
5847 /* Convert letter to inventory index */
5850 k = label_to_inven(which);
5853 /* Convert letter to equipment index */
5856 k = label_to_equip(which);
5859 /* Validate the item */
5860 if (!get_item_okay(k))
5866 /* Verify the item */
5868 if (ver && !verify("ËÜÅö¤Ë", k))
5870 if (ver && !verify("Try", k))
5878 /* Allow player to "refuse" certain actions */
5879 if (!get_item_allow(k))
5885 /* Accept that choice */
5896 /* Fix the screen if necessary */
5902 /* Hack -- Cancel "display" */
5903 command_see = FALSE;
5907 /* Forget the item_tester_tval restriction */
5908 item_tester_tval = 0;
5910 item_tester_no_ryoute = FALSE;
5912 /* Forget the item_tester_hook restriction */
5913 item_tester_hook = NULL;
5919 /* Toggle again if needed */
5920 if (toggle) toggle_inven_equip();
5923 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5930 /* Clear the prompt line */
5933 /* Warning if needed */
5934 if (oops && str) msg_print(str);
5937 if (item) repeat_push(*cp);
5938 #endif /* ALLOW_REPEAT */
5945 #ifdef ALLOW_EASY_FLOOR
5950 * Return a list of o_list[] indexes of items at the given cave
5951 * location. Valid flags are:
5953 * mode & 0x01 -- Item tester
5954 * mode & 0x02 -- Marked items only
5955 * mode & 0x04 -- Stop after first
5957 int scan_floor(int *items, int y, int x, int mode)
5959 int this_o_idx, next_o_idx;
5964 if (!in_bounds(y, x)) return 0;
5966 /* Scan all objects in the grid */
5967 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
5971 /* Acquire object */
5972 o_ptr = &o_list[this_o_idx];
5974 /* Acquire next object */
5975 next_o_idx = o_ptr->next_o_idx;
5978 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
5981 if ((mode & 0x02) && !o_ptr->marked) continue;
5983 /* Accept this item */
5984 /* XXX Hack -- Enforce limit */
5986 items[num] = this_o_idx;
5991 if (mode & 0x04) break;
5999 * Display a list of the items on the floor at the given location.
6001 int show_floor(int target_item, int y, int x, int *min_width)
6008 char o_name[MAX_NLEN];
6014 char out_desc[23][MAX_NLEN];
6015 int target_item_label = 0;
6017 int floor_list[23], floor_num;
6021 Term_get_size(&wid, &hgt);
6023 /* Default length */
6024 len = MAX((*min_width), 20);
6026 /* Maximum space allowed for descriptions */
6029 /* Require space for weight (if needed) */
6030 if (show_weights) lim -= 9;
6032 /* Scan for objects in the grid, using item_tester_okay() */
6033 floor_num = scan_floor(floor_list, y, x, 0x01);
6035 /* Display the inventory */
6036 for (k = 0, i = 0; i < floor_num && i < 23; i++)
6038 o_ptr = &o_list[floor_list[i]];
6040 /* Describe the object */
6041 object_desc(o_name, o_ptr, TRUE, 3);
6043 /* Hack -- enforce max length */
6046 /* Save the index */
6049 /* Acquire inventory color */
6050 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
6052 /* Save the object description */
6053 strcpy(out_desc[k], o_name);
6055 /* Find the predicted "line length" */
6056 l = strlen(out_desc[k]) + 5;
6058 /* Be sure to account for the weight */
6059 if (show_weights) l += 9;
6061 /* Maintain the maximum length */
6062 if (l > len) len = l;
6064 /* Advance to next "line" */
6071 /* Find the column to start in */
6072 col = (len > wid - 4) ? 0 : (wid - len - 1);
6074 /* Output each entry */
6075 for (j = 0; j < k; j++)
6078 i = floor_list[out_index[j]];
6083 /* Clear the line */
6084 prt("", j + 1, col ? col - 2 : col);
6086 if (use_menu && target_item)
6088 if (j == (target_item-1))
6091 strcpy(tmp_val, "¡Õ");
6093 strcpy(tmp_val, "> ");
6095 target_item_label = i;
6097 else strcpy(tmp_val, " ");
6100 /* Prepare an index --(-- */
6101 sprintf(tmp_val, "%c)", index_to_label(j));
6103 /* Clear the line with the (possibly indented) index */
6104 put_str(tmp_val, j + 1, col);
6106 /* Display the entry itself */
6107 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
6109 /* Display the weight if needed */
6112 int wgt = o_ptr->weight * o_ptr->number;
6114 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
6116 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
6119 put_str(tmp_val, j + 1, wid - 9);
6123 /* Make a "shadow" below the list (only if needed) */
6124 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
6126 return target_item_label;
6130 * This version of get_item() is called by get_item() when
6131 * the easy_floor is on.
6133 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
6135 char n1 = ' ', n2 = ' ', which = ' ';
6137 int j, k, i1, i2, e1, e2;
6147 bool allow_equip = FALSE;
6148 bool allow_inven = FALSE;
6149 bool allow_floor = FALSE;
6151 bool toggle = FALSE;
6156 int floor_num, floor_list[23], floor_top = 0;
6159 extern bool select_spellbook;
6160 extern bool select_the_force;
6162 int menu_line = (use_menu ? 1 : 0);
6168 /* Get the item index */
6169 if (repeat_pull(cp))
6171 if (*cp == 1111) { /* the_force */
6172 item_tester_tval = 0;
6173 item_tester_hook = NULL;
6184 /* Acquire object */
6187 /* Validate the item */
6188 if (item_tester_okay(o_ptr))
6190 /* Forget the item_tester_tval restriction */
6191 item_tester_tval = 0;
6193 /* Forget the item_tester_hook restriction */
6194 item_tester_hook = NULL;
6201 /* Verify the item */
6202 else if (get_item_okay(*cp))
6204 /* Forget the item_tester_tval restriction */
6205 item_tester_tval = 0;
6207 /* Forget the item_tester_hook restriction */
6208 item_tester_hook = NULL;
6215 #endif /* ALLOW_REPEAT */
6218 if (mode & (USE_EQUIP)) equip = TRUE;
6219 if (mode & (USE_INVEN)) inven = TRUE;
6220 if (mode & (USE_FLOOR)) floor = TRUE;
6223 /* Paranoia XXX XXX XXX */
6230 /* No item selected */
6234 /* Full inventory */
6236 i2 = INVEN_PACK - 1;
6238 /* Forbid inventory */
6239 if (!inven) i2 = -1;
6242 for (j = 0; j < INVEN_PACK; j++)
6243 if (item_tester_okay(&inventory[j])) max_inven++;
6246 /* Restrict inventory indexes */
6247 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
6248 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
6251 /* Full equipment */
6253 e2 = INVEN_TOTAL - 1;
6255 /* Forbid equipment */
6256 if (!equip) e2 = -1;
6259 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
6260 if (item_tester_okay(&inventory[j])) max_equip++;
6261 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
6264 /* Restrict equipment indexes */
6265 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
6266 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
6269 /* Count "okay" floor items */
6272 /* Restrict floor usage */
6275 /* Scan all objects in the grid */
6276 floor_num = scan_floor(floor_list, py, px, 0x01);
6279 /* Accept inventory */
6280 if (i1 <= i2) allow_inven = TRUE;
6282 /* Accept equipment */
6283 if (e1 <= e2) allow_equip = TRUE;
6286 if (floor_num) allow_floor = TRUE;
6288 /* Require at least one legal choice */
6289 if (!allow_inven && !allow_equip && !allow_floor)
6291 /* Cancel p_ptr->command_see */
6292 command_see = FALSE;
6300 if (select_the_force) {
6306 /* Analyze choices */
6309 /* Hack -- Start on equipment if requested */
6310 if (command_see && (command_wrk == (USE_EQUIP))
6313 command_wrk = (USE_EQUIP);
6316 /* Use inventory if allowed */
6317 else if (allow_inven)
6319 command_wrk = (USE_INVEN);
6322 /* Use equipment if allowed */
6323 else if (allow_equip)
6325 command_wrk = (USE_EQUIP);
6328 /* Use floor if allowed */
6329 else if (allow_floor)
6331 command_wrk = (USE_FLOOR);
6336 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
6338 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
6340 /* Hack -- start out in "display" mode */
6347 /* Repeat until done */
6350 int get_item_label = 0;
6359 for (j = 0; j < 8; j++)
6362 if (!angband_term[j]) continue;
6364 /* Count windows displaying inven */
6365 if (window_flag[j] & (PW_INVEN)) ni++;
6367 /* Count windows displaying equip */
6368 if (window_flag[j] & (PW_EQUIP)) ne++;
6371 /* Toggle if needed */
6372 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
6373 (command_wrk == (USE_INVEN) && !ni && ne))
6376 toggle_inven_equip();
6383 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6385 /* Redraw windows */
6389 /* Inventory screen */
6390 if (command_wrk == (USE_INVEN))
6392 /* Extract the legal requests */
6396 /* Redraw if needed */
6397 if (command_see) get_item_label = show_inven(menu_line);
6400 /* Equipment screen */
6401 else if (command_wrk == (USE_EQUIP))
6403 /* Extract the legal requests */
6404 n1 = I2A(e1 - INVEN_RARM);
6405 n2 = I2A(e2 - INVEN_RARM);
6407 /* Redraw if needed */
6408 if (command_see) get_item_label = show_equip(menu_line);
6412 else if (command_wrk == (USE_FLOOR))
6415 k = MIN(floor_top + 23, floor_num) - 1;
6417 /* Extract the legal requests */
6418 n1 = I2A(j - floor_top);
6419 n2 = I2A(k - floor_top);
6421 /* Redraw if needed */
6422 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
6425 /* Viewing inventory */
6426 if (command_wrk == (USE_INVEN))
6428 /* Begin the prompt */
6430 sprintf(out_val, "»ý¤Áʪ:");
6432 sprintf(out_val, "Inven:");
6437 /* Build the prompt */
6439 sprintf(tmp_val, "%c-%c,",
6441 sprintf(tmp_val, " %c-%c,",
6444 index_to_label(i1), index_to_label(i2));
6447 strcat(out_val, tmp_val);
6450 /* Indicate ability to "view" */
6452 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6454 if (!command_see && !use_menu) strcat(out_val, " * to see,");
6463 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
6464 else if (allow_floor)
6465 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
6467 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6469 else if (select_the_force)
6470 strcat(out_val, " 'w'Îýµ¤½Ñ,");
6475 strcat(out_val, " / for Equip,");
6476 else if (allow_floor)
6477 strcat(out_val, " 6 for Equip,");
6479 strcat(out_val, " 4 or 6 for Equip,");
6481 else if (select_the_force)
6482 strcat(out_val, " w for the Force,");
6490 strcat(out_val, " '-'¾²¾å,");
6491 else if (allow_equip)
6492 strcat(out_val, " '4' ¾²¾å,");
6494 strcat(out_val, " '4'or'6' ¾²¾å,");
6497 strcat(out_val, " - for floor,");
6498 else if (allow_equip)
6499 strcat(out_val, " 4 for floor,");
6501 strcat(out_val, " 4 or 6 for floor,");
6507 /* Viewing equipment */
6508 else if (command_wrk == (USE_EQUIP))
6510 /* Begin the prompt */
6512 sprintf(out_val, "ÁõÈ÷ÉÊ:");
6514 sprintf(out_val, "Equip:");
6520 /* Build the prompt */
6522 sprintf(tmp_val, "%c-%c,",
6524 sprintf(tmp_val, " %c-%c,",
6527 index_to_label(e1), index_to_label(e2));
6530 strcat(out_val, tmp_val);
6533 /* Indicate ability to "view" */
6535 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6537 if (!command_see && !use_menu) strcat(out_val, " * to see,");
6546 strcat(out_val, " '/' »ý¤Áʪ,");
6547 else if (allow_floor)
6548 strcat(out_val, " '4' »ý¤Áʪ,");
6550 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6554 strcat(out_val, " / for Inven,");
6555 else if (allow_floor)
6556 strcat(out_val, " 4 for Inven,");
6558 strcat(out_val, " 4 or 6 for Inven,");
6567 strcat(out_val, " '-'¾²¾å,");
6568 else if (allow_inven)
6569 strcat(out_val, " '6' ¾²¾å,");
6571 strcat(out_val, " '4'or'6' ¾²¾å,");
6574 strcat(out_val, " - for floor,");
6575 else if (allow_inven)
6576 strcat(out_val, " 6 for floor,");
6578 strcat(out_val, " 4 or 6 for floor,");
6584 else if (command_wrk == (USE_FLOOR))
6586 /* Begin the prompt */
6588 sprintf(out_val, "¾²¾å:");
6590 sprintf(out_val, "Floor:");
6596 /* Build the prompt */
6598 sprintf(tmp_val, "%c-%c,", n1, n2);
6600 sprintf(tmp_val, " %c-%c,", n1, n2);
6605 strcat(out_val, tmp_val);
6608 /* Indicate ability to "view" */
6610 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6612 if (!command_see && !use_menu) strcat(out_val, " * to see,");
6618 if (allow_inven && allow_equip)
6621 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
6623 strcat(out_val, " 4 for Equip, 6 for Inven,");
6627 else if (allow_inven)
6630 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6632 strcat(out_val, " 4 or 6 for Inven,");
6636 else if (allow_equip)
6639 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6641 strcat(out_val, " 4 or 6 for Equip,");
6647 else if (allow_inven)
6650 strcat(out_val, " '/' »ý¤Áʪ,");
6652 strcat(out_val, " / for Inven,");
6656 else if (allow_equip)
6659 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
6661 strcat(out_val, " / for Equip,");
6667 if (command_see && !use_menu)
6670 strcat(out_val, " Enter ¼¡,");
6672 strcat(out_val, " Enter for scroll down,");
6677 /* Finish the prompt */
6678 strcat(out_val, " ESC");
6680 /* Build the prompt */
6681 sprintf(tmp_val, "(%s) %s", out_val, pmt);
6683 /* Show the prompt */
6692 if (command_wrk == USE_INVEN) max_line = max_inven;
6693 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6694 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6710 menu_line += (max_line - 1);
6726 /* Verify legality */
6727 if (command_wrk == (USE_INVEN))
6729 if (allow_floor) command_wrk = USE_FLOOR;
6730 else if (allow_equip) command_wrk = USE_EQUIP;
6737 else if (command_wrk == (USE_EQUIP))
6739 if (allow_inven) command_wrk = USE_INVEN;
6740 else if (allow_floor) command_wrk = USE_FLOOR;
6747 else if (command_wrk == (USE_FLOOR))
6749 if (allow_equip) command_wrk = USE_EQUIP;
6750 else if (allow_inven) command_wrk = USE_INVEN;
6763 /* Hack -- Fix screen */
6773 /* Switch inven/equip */
6774 if (command_wrk == USE_INVEN) max_line = max_inven;
6775 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6776 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6777 if (menu_line > max_line) menu_line = max_line;
6779 /* Need to redraw */
6787 /* Verify legality */
6788 if (command_wrk == (USE_INVEN))
6790 if (allow_equip) command_wrk = USE_EQUIP;
6791 else if (allow_floor) command_wrk = USE_FLOOR;
6798 else if (command_wrk == (USE_EQUIP))
6800 if (allow_floor) command_wrk = USE_FLOOR;
6801 else if (allow_inven) command_wrk = USE_INVEN;
6808 else if (command_wrk == (USE_FLOOR))
6810 if (allow_inven) command_wrk = USE_INVEN;
6811 else if (allow_equip) command_wrk = USE_EQUIP;
6824 /* Hack -- Fix screen */
6834 /* Switch inven/equip */
6835 if (command_wrk == USE_INVEN) max_line = max_inven;
6836 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6837 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6838 if (menu_line > max_line) menu_line = max_line;
6840 /* Need to redraw */
6849 if (command_wrk == USE_FLOOR)
6852 (*cp) = -get_item_label;
6856 /* Validate the item */
6857 if (!get_item_okay(get_item_label))
6863 /* Allow player to "refuse" certain actions */
6864 if (!get_item_allow(get_item_label))
6870 /* Accept that choice */
6871 (*cp) = get_item_label;
6880 if (select_the_force) {
6888 if (menu_line > max_line) menu_line -= max_line;
6909 command_see = FALSE;
6932 cave_type *c_ptr = &cave[py][px];
6934 if (command_wrk != (USE_FLOOR)) break;
6936 /* Get the object being moved. */
6937 o_idx = c_ptr->o_idx;
6939 /* Only rotate a pile of two or more objects. */
6940 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
6942 /* Remove the first object from the list. */
6943 excise_object_idx(o_idx);
6945 /* Find end of the list. */
6947 while (o_list[i].next_o_idx)
6948 i = o_list[i].next_o_idx;
6950 /* Add after the last object. */
6951 o_list[i].next_o_idx = o_idx;
6953 /* Re-scan floor list */
6954 floor_num = scan_floor(floor_list, py, px, 0x01);
6956 /* Hack -- Fix screen */
6971 if (command_wrk == (USE_INVEN))
6978 command_wrk = (USE_EQUIP);
6980 else if (command_wrk == (USE_EQUIP))
6987 command_wrk = (USE_INVEN);
6989 else if (command_wrk == (USE_FLOOR))
6993 command_wrk = (USE_INVEN);
6995 else if (allow_equip)
6997 command_wrk = (USE_EQUIP);
7006 /* Hack -- Fix screen */
7016 /* Need to redraw */
7029 * If we are already examining the floor, and there
7030 * is only one item, we will always select it.
7031 * If we aren't examining the floor and there is only
7032 * one item, we will select it if floor_query_flag
7037 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
7040 k = 0 - floor_list[0];
7042 /* Allow player to "refuse" certain actions */
7043 if (!get_item_allow(k))
7049 /* Accept that choice */
7058 /* Hack -- Fix screen */
7068 command_wrk = (USE_FLOOR);
7074 case '1': case '2': case '3':
7075 case '4': case '5': case '6':
7076 case '7': case '8': case '9':
7078 /* Look up the tag */
7079 if (!get_tag(&k, which))
7085 /* Hack -- Validate the item */
7086 if ((k < INVEN_RARM) ? !inven : !equip)
7092 /* Validate the item */
7093 if (!get_item_okay(k))
7099 /* Allow player to "refuse" certain actions */
7100 if (!get_item_allow(k))
7106 /* Accept that choice */
7117 /* Choose "default" inventory item */
7118 if (command_wrk == (USE_INVEN))
7120 k = ((i1 == i2) ? i1 : -1);
7123 /* Choose "default" equipment item */
7124 else if (command_wrk == (USE_EQUIP))
7126 k = ((e1 == e2) ? e1 : -1);
7129 /* Choose "default" floor item */
7130 else if (command_wrk == (USE_FLOOR))
7135 k = 0 - floor_list[0];
7137 /* Allow player to "refuse" certain actions */
7138 if (!get_item_allow(k))
7144 /* Accept that choice */
7152 /* Validate the item */
7153 if (!get_item_okay(k))
7159 /* Allow player to "refuse" certain actions */
7160 if (!get_item_allow(k))
7166 /* Accept that choice */
7176 if (select_the_force) {
7188 if(select_spellbook){
7189 bool not_found = FALSE;
7190 /* Look up the tag */
7191 if (!get_tag(&k, which))
7196 /* Hack -- Validate the item */
7197 if ((k < INVEN_RARM) ? !inven : !equip)
7202 /* Validate the item */
7203 if (!get_item_okay(k))
7209 /* Accept that choice */
7217 /* Extract "query" setting */
7218 ver = isupper(which);
7219 which = tolower(which);
7221 /* Convert letter to inventory index */
7222 if (command_wrk == (USE_INVEN))
7224 k = label_to_inven(which);
7227 /* Convert letter to equipment index */
7228 else if (command_wrk == (USE_EQUIP))
7230 k = label_to_equip(which);
7233 /* Convert letter to floor index */
7234 else if (command_wrk == USE_FLOOR)
7236 k = islower(which) ? A2I(which) : -1;
7237 if (k < 0 || k >= floor_num || k >= 23)
7244 k = 0 - floor_list[k];
7247 /* Validate the item */
7248 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
7254 /* Verify the item */
7256 if (ver && !verify("ËÜÅö¤Ë", k))
7258 if (ver && !verify("Try", k))
7266 /* Allow player to "refuse" certain actions */
7267 if (!get_item_allow(k))
7273 /* Accept that choice */
7283 /* Fix the screen if necessary */
7289 /* Hack -- Cancel "display" */
7290 command_see = FALSE;
7294 /* Forget the item_tester_tval restriction */
7295 item_tester_tval = 0;
7297 /* Forget the item_tester_hook restriction */
7298 item_tester_hook = NULL;
7304 /* Toggle again if needed */
7305 if (toggle) toggle_inven_equip();
7308 p_ptr->window |= (PW_INVEN | PW_EQUIP);
7315 /* Clear the prompt line */
7318 /* Warning if needed */
7319 if (oops && str) msg_print(str);
7322 if (item) repeat_push(*cp);
7323 #endif /* ALLOW_REPEAT */
7330 static bool py_pickup_floor_aux(void)
7340 /* Restrict the choices */
7341 item_tester_hook = inven_carry_okay;
7345 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
7346 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
7348 q = "Get which item? ";
7349 s = "You no longer have any room for the objects on the floor.";
7352 if (get_item(&item, q, s, (USE_FLOOR)))
7354 this_o_idx = 0 - item;
7361 /* Access the object */
7362 o_ptr = &o_list[this_o_idx];
7364 /* Pick up the object */
7365 py_pickup_aux(this_o_idx);
7372 * Make the player carry everything in a grid
7374 * If "pickup" is FALSE then only gold will be picked up
7376 * This is called by py_pickup() when easy_floor is TRUE.
7378 void py_pickup_floor(int pickup)
7380 s16b this_o_idx, next_o_idx = 0;
7382 char o_name[MAX_NLEN];
7385 int floor_num = 0, floor_list[23], floor_o_idx = 0;
7389 /* Scan the pile of objects */
7390 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
7394 /* Access the object */
7395 o_ptr = &o_list[this_o_idx];
7397 /* Describe the object */
7398 object_desc(o_name, o_ptr, TRUE, 3);
7400 /* Access the next object */
7401 next_o_idx = o_ptr->next_o_idx;
7403 /* Hack -- disturb */
7407 if (o_ptr->tval == TV_GOLD)
7411 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
7412 (long)o_ptr->pval, o_name);
7414 msg_format("You have found %ld gold pieces worth of %s.",
7415 (long) o_ptr->pval, o_name);
7419 /* Collect the gold */
7420 p_ptr->au += o_ptr->pval;
7423 p_ptr->redraw |= (PR_GOLD);
7426 p_ptr->window |= (PW_PLAYER);
7428 /* Delete the gold */
7429 delete_object_idx(this_o_idx);
7431 /* Check the next object */
7435 /* Count non-gold objects that can be picked up. */
7436 if (inven_carry_okay(o_ptr))
7441 /* Remember this object index */
7443 floor_list[floor_num] = this_o_idx;
7445 /* Count non-gold objects */
7448 /* Remember this index */
7449 floor_o_idx = this_o_idx;
7452 /* There are no non-gold objects */
7456 /* Mention the number of objects */
7462 /* Access the object */
7463 o_ptr = &o_list[floor_o_idx];
7465 #ifdef ALLOW_EASY_SENSE
7467 /* Option: Make object sensing easy */
7470 /* Sense the object */
7471 (void) sense_object(o_ptr);
7474 #endif /* ALLOW_EASY_SENSE */
7476 /* Describe the object */
7477 object_desc(o_name, o_ptr, TRUE, 3);
7481 msg_format("%s¤¬¤¢¤ë¡£", o_name);
7483 msg_format("You see %s.", o_name);
7488 /* Multiple objects */
7493 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
7495 msg_format("You see a pile of %d items.", floor_num);
7504 /* The player has no room for anything on the floor. */
7510 /* Access the object */
7511 o_ptr = &o_list[floor_o_idx];
7513 #ifdef ALLOW_EASY_SENSE
7515 /* Option: Make object sensing easy */
7518 /* Sense the object */
7519 (void) sense_object(o_ptr);
7522 #endif /* ALLOW_EASY_SENSE */
7524 /* Describe the object */
7525 object_desc(o_name, o_ptr, TRUE, 3);
7529 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
7531 msg_format("You have no room for %s.", o_name);
7536 /* Multiple objects */
7541 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
7543 msg_print("You have no room for any of the objects on the floor.");
7555 /* Hack -- query every object */
7556 if (carry_query_flag)
7558 char out_val[MAX_NLEN+20];
7560 /* Access the object */
7561 o_ptr = &o_list[floor_o_idx];
7563 #ifdef ALLOW_EASY_SENSE
7565 /* Option: Make object sensing easy */
7568 /* Sense the object */
7569 (void) sense_object(o_ptr);
7572 #endif /* ALLOW_EASY_SENSE */
7574 /* Describe the object */
7575 object_desc(o_name, o_ptr, TRUE, 3);
7577 /* Build a prompt */
7579 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
7581 (void) sprintf(out_val, "Pick up %s? ", o_name);
7585 /* Ask the user to confirm */
7586 if (!get_check(out_val))
7593 /* Access the object */
7594 o_ptr = &o_list[floor_o_idx];
7596 #ifdef ALLOW_EASY_SENSE
7598 /* Option: Make object sensing easy */
7601 /* Sense the object */
7602 (void) sense_object(o_ptr);
7605 #endif /* ALLOW_EASY_SENSE */
7607 /* Pick up the object */
7608 py_pickup_aux(floor_o_idx);
7611 /* Allow the user to choose an object */
7614 while (can_pickup--)
7616 if (!py_pickup_floor_aux()) break;
7621 #endif /* ALLOW_EASY_FLOOR */