4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Object code, part 1 */
15 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
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 for (j = 0; j < F_LIT_MAX; j++)
46 f_ptr->x_attr[j] = f_ptr->d_attr[j];
47 f_ptr->x_char[j] = f_ptr->d_char[j];
51 /* Extract default attr/char code for objects */
52 for (i = 0; i < max_k_idx; i++)
54 object_kind *k_ptr = &k_info[i];
56 /* Default attr/char */
57 k_ptr->x_attr = k_ptr->d_attr;
58 k_ptr->x_char = k_ptr->d_char;
61 /* Extract default attr/char code for monsters */
62 for (i = 0; i < max_r_idx; i++)
64 monster_race *r_ptr = &r_info[i];
66 /* Default attr/char */
67 r_ptr->x_attr = r_ptr->d_attr;
68 r_ptr->x_char = r_ptr->d_char;
75 /* Process "graf.prf" */
76 process_pref_file("graf.prf");
78 /* Access the "character" pref file */
79 sprintf(buf, "graf-%s.prf", player_base);
81 /* Process "graf-<playername>.prf" */
82 process_pref_file(buf);
90 /* Process "font.prf" */
91 process_pref_file("font.prf");
93 /* Access the "character" pref file */
94 sprintf(buf, "font-%s.prf", player_base);
96 /* Process "font-<playername>.prf" */
97 process_pref_file(buf);
103 * Obtain the "flags" for an item
105 void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
107 object_kind *k_ptr = &k_info[o_ptr->k_idx];
111 for (i = 0; i < TR_FLAG_SIZE; i++)
112 flgs[i] = k_ptr->flags[i];
115 if (object_is_fixed_artifact(o_ptr))
117 artifact_type *a_ptr = &a_info[o_ptr->name1];
119 for (i = 0; i < TR_FLAG_SIZE; i++)
120 flgs[i] = a_ptr->flags[i];
124 if (object_is_ego(o_ptr))
126 ego_item_type *e_ptr = &e_info[o_ptr->name2];
128 for (i = 0; i < TR_FLAG_SIZE; i++)
129 flgs[i] |= e_ptr->flags[i];
131 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
133 remove_flag(flgs, TR_SH_FIRE);
135 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
137 remove_flag(flgs, TR_INFRA);
139 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
141 remove_flag(flgs, TR_RES_BLIND);
142 remove_flag(flgs, TR_SEE_INVIS);
146 /* Random artifact ! */
147 for (i = 0; i < TR_FLAG_SIZE; i++)
148 flgs[i] |= o_ptr->art_flags[i];
150 if (object_is_smith(o_ptr))
152 int add = o_ptr->xtra3 - 1;
154 if (add < TR_FLAG_MAX)
158 else if (add == ESSENCE_TMP_RES_ACID)
160 add_flag(flgs, TR_RES_ACID);
161 add_flag(flgs, TR_ACTIVATE);
163 else if (add == ESSENCE_TMP_RES_ELEC)
165 add_flag(flgs, TR_RES_ELEC);
166 add_flag(flgs, TR_ACTIVATE);
168 else if (add == ESSENCE_TMP_RES_FIRE)
170 add_flag(flgs, TR_RES_FIRE);
171 add_flag(flgs, TR_ACTIVATE);
173 else if (add == ESSENCE_TMP_RES_COLD)
175 add_flag(flgs, TR_RES_COLD);
176 add_flag(flgs, TR_ACTIVATE);
178 else if (add == ESSENCE_SH_FIRE)
180 add_flag(flgs, TR_RES_FIRE);
181 add_flag(flgs, TR_SH_FIRE);
183 else if (add == ESSENCE_SH_ELEC)
185 add_flag(flgs, TR_RES_ELEC);
186 add_flag(flgs, TR_SH_ELEC);
188 else if (add == ESSENCE_SH_COLD)
190 add_flag(flgs, TR_RES_COLD);
191 add_flag(flgs, TR_SH_COLD);
193 else if (add == ESSENCE_RESISTANCE)
195 add_flag(flgs, TR_RES_ACID);
196 add_flag(flgs, TR_RES_ELEC);
197 add_flag(flgs, TR_RES_FIRE);
198 add_flag(flgs, TR_RES_COLD);
200 else if (add == TR_IMPACT)
202 add_flag(flgs, TR_ACTIVATE);
210 * Obtain the "flags" for an item which are known to the player
212 void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
217 object_kind *k_ptr = &k_info[o_ptr->k_idx];
220 for (i = 0; i < TR_FLAG_SIZE; i++)
223 if (!object_is_aware(o_ptr)) return;
226 for (i = 0; i < TR_FLAG_SIZE; i++)
227 flgs[i] = k_ptr->flags[i];
229 /* Must be identified */
230 if (!object_is_known(o_ptr)) return;
232 /* Ego-item (known basic flags) */
233 if (object_is_ego(o_ptr))
235 ego_item_type *e_ptr = &e_info[o_ptr->name2];
237 for (i = 0; i < TR_FLAG_SIZE; i++)
238 flgs[i] |= e_ptr->flags[i];
240 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
242 remove_flag(flgs, TR_SH_FIRE);
244 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
246 remove_flag(flgs, TR_INFRA);
248 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
250 remove_flag(flgs, TR_RES_BLIND);
251 remove_flag(flgs, TR_SEE_INVIS);
256 #ifdef SPOIL_ARTIFACTS
257 /* Full knowledge for some artifacts */
258 if (object_is_artifact(o_ptr)) spoil = TRUE;
259 #endif /* SPOIL_ARTIFACTS */
261 #ifdef SPOIL_EGO_ITEMS
262 /* Full knowledge for some ego-items */
263 if (object_is_ego(o_ptr)) spoil = TRUE;
264 #endif /* SPOIL_EGO_ITEMS */
266 /* Need full knowledge or spoilers */
267 if (spoil || (o_ptr->ident & IDENT_MENTAL))
270 if (object_is_fixed_artifact(o_ptr))
272 artifact_type *a_ptr = &a_info[o_ptr->name1];
274 for (i = 0; i < TR_FLAG_SIZE; i++)
275 flgs[i] = a_ptr->flags[i];
278 /* Random artifact ! */
279 for (i = 0; i < TR_FLAG_SIZE; i++)
280 flgs[i] |= o_ptr->art_flags[i];
283 if (object_is_smith(o_ptr))
285 int add = o_ptr->xtra3 - 1;
287 if (add < TR_FLAG_MAX)
291 else if (add == ESSENCE_TMP_RES_ACID)
293 add_flag(flgs, TR_RES_ACID);
295 else if (add == ESSENCE_TMP_RES_ELEC)
297 add_flag(flgs, TR_RES_ELEC);
299 else if (add == ESSENCE_TMP_RES_FIRE)
301 add_flag(flgs, TR_RES_FIRE);
303 else if (add == ESSENCE_TMP_RES_COLD)
305 add_flag(flgs, TR_RES_COLD);
307 else if (add == ESSENCE_SH_FIRE)
309 add_flag(flgs, TR_RES_FIRE);
310 add_flag(flgs, TR_SH_FIRE);
312 else if (add == ESSENCE_SH_ELEC)
314 add_flag(flgs, TR_RES_ELEC);
315 add_flag(flgs, TR_SH_ELEC);
317 else if (add == ESSENCE_SH_COLD)
319 add_flag(flgs, TR_RES_COLD);
320 add_flag(flgs, TR_SH_COLD);
322 else if (add == ESSENCE_RESISTANCE)
324 add_flag(flgs, TR_RES_ACID);
325 add_flag(flgs, TR_RES_ELEC);
326 add_flag(flgs, TR_RES_FIRE);
327 add_flag(flgs, TR_RES_COLD);
333 cptr item_activation_dragon_breath(object_type *o_ptr)
335 static char desc[256];
336 u32b flgs[4]; /* for resistance flags */
339 object_flags(o_ptr, flgs);
340 strcpy(desc, _("", "breath "));
342 for (i = 0; dragonbreath_info[i].flag != 0; i++)
344 if (have_flag(flgs, dragonbreath_info[i].flag))
346 if (n > 0) strcat(desc, _("¡¢", ", "));
347 strcat(desc, dragonbreath_info[i].name);
352 strcat(desc, _("¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè"," every 200+d200 turns"));
358 * Determine the "Activation" (if any) for an artifact
359 * Return a string, or NULL for "no activation"
361 cptr item_activation(object_type *o_ptr)
363 static char *buf[256];
364 u32b flgs[TR_FLAG_SIZE];
366 /* Extract the flags */
367 object_flags(o_ptr, flgs);
369 /* Require activation ability */
371 if (!(have_flag(flgs, TR_ACTIVATE))) return ("¤Ê¤·");
373 if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
377 * We need to deduce somehow that it is a random artifact -- one
378 * problem: It could be a random artifact which has NOT YET received
379 * a name. Thus we eliminate other possibilities instead of checking
383 /* Give priority to weaponsmith's essential activations */
384 if (object_is_smith(o_ptr))
386 switch (o_ptr->xtra3 - 1)
388 case ESSENCE_TMP_RES_ACID:
390 return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
392 return "resist acid every 50+d50 turns";
394 case ESSENCE_TMP_RES_ELEC:
396 return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
398 return "resist elec every 50+d50 turns";
400 case ESSENCE_TMP_RES_FIRE:
402 return "²Ð¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
404 return "resist fire every 50+d50 turns";
406 case ESSENCE_TMP_RES_COLD:
408 return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
410 return "resist cold every 50+d50 turns";
414 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
416 return "earthquake every 100+d100 turns";
421 /* Paranoia - Set activation index for older save data */
422 if (object_is_fixed_artifact(o_ptr))
424 if (!o_ptr->xtra2) o_ptr->xtra2 = a_info[o_ptr->name1].act_idx;
426 if (object_is_ego(o_ptr))
428 if (!o_ptr->xtra2) o_ptr->xtra2 = e_info[o_ptr->name2].act_idx;
431 /* Get an explain of an activation */
432 /* if ((object_is_artifact(o_ptr) || object_is_ego(o_ptr)) && (o_ptr->xtra2)) */
435 switch (o_ptr->xtra2)
438 /* General activation */
441 return "ÂÀÍÛ¸÷Àþ : 10 ¥¿¡¼¥óËè";
443 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
445 return "°½±À(12) : 4+d4 ¥¿¡¼¥óËè";
447 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
449 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
451 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
453 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
455 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë(48) : 6+d6 ¥¿¡¼¥óËè";
457 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(72) : 9+d9 ¥¿¡¼¥óËè";
459 return "Ã⩹¶·â(100) : 100+d100 ¥¿¡¼¥óËè";
461 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë(100) : 12+d12 ¥¿¡¼¥óËè";
463 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë(100) : 12+d12 ¥¿¡¼¥óËè";
465 return "À¸Ì¿Îϵۼý(120) : 400 ¥¿¡¼¥óËè";
467 return "µÛ·ì¥É¥ì¥¤¥ó(3*50) : 400 ¥¿¡¼¥óËè";
469 return "Ìð(150) : 90+d90 ¥¿¡¼¥óËè";
471 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(300) : 225+d225 ¥¿¡¼¥óËè";
473 return "µðÂ祢¥¤¥¹¡¦¥Ü¡¼¥ë(400) : 325+d325 ¥¿¡¼¥óËè";
475 return "µðÂ祵¥ó¥À¡¼¡¦¥Ü¡¼¥ë(500) : 425+d425 ¥¿¡¼¥óËè";
477 return "¥«¥Þ¥¤¥¿¥Á : 250 ¥¿¡¼¥óËè";
479 return "µÛ·ì¥É¥ì¥¤¥ó(3*100) : 400 ¥¿¡¼¥óËè";
481 return "º®ÆÙ¾¤Íè : 350 ¥¿¡¼¥óËè"; /*nuke me*/
483 return "¥í¥±¥Ã¥È(120+¥ì¥Ù¥ë) : 400 ¥¿¡¼¥óËè";
485 return "¼Ù°Â໶(x5) : 100+d100 ¥¿¡¼¥óËè";
487 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
489 return "Á±ÎÉÂ໶(x5) : 100+d100 ¥¿¡¼¥óËè";
491 return "ËâË¡¤ÎÌð(150) : 90+d90 ¥¿¡¼¥óËè";
493 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(120) : 15 ¥¿¡¼¥óËè";
495 return "¥¦¥©¡¼¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 250 ¥¿¡¼¥óËè";
497 return "µðÂ祹¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 200+d200 ¥¿¡¼¥óËè";
499 return "°Å¹õ¤ÎÍò(250) : 150+d150 ¥¿¡¼¥óËè";
501 return "ËâÎϤÎÍò(250) : 150+d150 ¥¿¡¼¥óËè";
503 return "³²Ãî¤Î¶î½ü : 55+d55¥¿¡¼¥óËè";
504 case ACT_BLINDING_LIGHT:
505 return "âÁ¤·¤¤¸÷ : 250 ¥¿¡¼¥óËè";
507 return "¿®¤¸Æñ¤¤¤³¤È : 450+d450 ¥¿¡¼¥óËè";
508 case ACT_CAST_BA_STAR:
509 return "¥¹¥¿¡¼¡¦¥Ü¡¼¥ë¡¦¥À¥¹¥È(150) : 1000 ¥¿¡¼¥óËè";
510 case ACT_BLADETURNER:
511 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300), »Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢ÂÑÀ : 400 ¥¿¡¼¥óËè";
513 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë(100) : 12+d12 ¥¿¡¼¥óËè";
515 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
516 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ : 200 ¥¿¡¼¥óËè";
517 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
519 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
520 return "Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ : 200 ¥¿¡¼¥óËè";
521 return "Î䵤¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
523 return item_activation_dragon_breath(o_ptr);
526 return "¥Ñ¥Ë¥Ã¥¯¡¦¥â¥ó¥¹¥¿¡¼ : 15 ¥¿¡¼¥óËè";
528 return "¼þ°Ï¤Î¥â¥ó¥¹¥¿¡¼¤ò̲¤é¤»¤ë : 55 ¥¿¡¼¥óËè";
530 return "ÃÏ¿Ì : 50 ¥¿¡¼¥óËè";
532 return "¶²¹² : 3*(¥ì¥Ù¥ë+10) ¥¿¡¼¥óËè";
534 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
535 case ACT_BANISH_EVIL:
536 return "¼Ù°¾ÃÌÇ : 250+d250 ¥¿¡¼¥óËè";
538 return "Ëõ»¦ : 500 ¥¿¡¼¥óËè";
540 return "¼þÊÕËõ»¦ : 1000 ¥¿¡¼¥óËè";
542 return "¥â¥ó¥¹¥¿¡¼¶²¹² : 40+d40¥¿¡¼¥óËè";
544 if(o_ptr->name1 != ART_HYOUSIGI) return "¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë : ¤¤¤Ä¤Ç¤â";
545 return "Çï»ÒÌÚ¤òÂǤÁ¤Ê¤é¤¹ : ¤¤¤Ä¤Ç¤â";
546 case ACT_CHARM_ANIMAL:
547 return "ưʪ̥λ : 200 ¥¿¡¼¥óËè";
548 case ACT_CHARM_UNDEAD:
549 return "¥¢¥ó¥Ç¥Ã¥É½¾Â° : 333 ¥¿¡¼¥óËè";
550 case ACT_CHARM_OTHER:
551 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 400 ¥¿¡¼¥óËè";
552 case ACT_CHARM_ANIMALS:
553 return "ưʪͧÏ : 500 ¥¿¡¼¥óËè";
554 case ACT_CHARM_OTHERS:
555 return "¼þÊÕ̥λ : 750 ¥¿¡¼¥óËè";
556 case ACT_SUMMON_ANIMAL:
557 return "ưʪ¾¤´ : 200+d300 ¥¿¡¼¥óËè";
558 case ACT_SUMMON_PHANTOM:
559 return "¸¸Î´ : 200+d200 ¥¿¡¼¥óËè";
560 case ACT_SUMMON_ELEMENTAL:
561 return "¥¨¥ì¥á¥ó¥¿¥ë¾¤´ : 750 ¥¿¡¼¥óËè";
562 case ACT_SUMMON_DEMON:
563 return "°Ë⾤´ : 666+d333 ¥¿¡¼¥óËè";
564 case ACT_SUMMON_UNDEAD:
565 return "¥¢¥ó¥Ç¥Ã¥É¾¤´ : 666+d333 ¥¿¡¼¥óËè";
566 case ACT_SUMMON_HOUND:
567 return "¥Ï¥¦¥ó¥É¾¤´ : 300+d150 ¥¿¡¼¥óËè";
568 case ACT_SUMMON_DAWN:
569 return "¶Ç¤Î»ÕÃľ¤´ : 500+d500 ¥¿¡¼¥óËè";
570 case ACT_SUMMON_OCTOPUS:
571 return "Âý¤ÎÂç·²¾¤´ : 300+d150¥¿¡¼¥óËè";
573 case ACT_CHOIR_SINGS:
574 return "²óÉü(777)¡¢Ìþ¤·¡¢»Îµ¤¹âÍÈ : 300 ¥¿¡¼¥óËè";
576 return "¶²Éݽüµî/ÂÎÎϲóÉü(30) : 10 ¥¿¡¼¥óËè";
578 return "½ý²óÉü(4d8) : 3+d3 ¥¿¡¼¥óËè";
579 case ACT_CURE_POISON:
580 return "¶²Éݽüµî/ÆǾä· : 5 ¥¿¡¼¥óËè";
582 return "·Ð¸³ÃÍÉü³è : 450 ¥¿¡¼¥óËè";
584 return "Á´¥¹¥Æ¡¼¥¿¥¹¤È·Ð¸³ÃÍÉü³è : 750 ¥¿¡¼¥óËè";
586 return "ÂÎÎϲóÉü(700) : 250 ¥¿¡¼¥óËè";
588 return "ÂÎÎϲóÉü(1000) : 888 ¥¿¡¼¥óËè";
590 return "Ìþ¤· : 100¥¿¡¼¥óËè";
591 case ACT_CURE_MANA_FULL:
592 return "ËâÎÏÉü³è: 777 ¥¿¡¼¥óËè";
594 return "¥Æ¥ì¥Ñ¥·¡¼(´ü´Ö 25+d30) : 200 ¥¿¡¼¥óËè";
596 /* return "»Îµ¤¹âÍȤȽËÊ¡(´ü´Ö 50+d50) : 100+d100 ¥¿¡¼¥óËè"; */
597 return "¶¸Àï»Î²½(25+d25¥¿¡¼¥ó) : 75+d75 ¥¿¡¼¥óËè";
599 return "Âмٰ·ë³¦(´ü´Ö 3*¥ì¥Ù¥ë+d25) : 200+d200 ¥¿¡¼¥óËè";
601 return "Á´ÂÑÀ(´ü´Ö 20+d20) : 111 ¥¿¡¼¥óËè";
603 return "²Ã®(´ü´Ö 20+d20) : 250 ¥¿¡¼¥óËè";
605 return "²Ã®(´ü´Ö 75+d75) : 200+d200 ¥¿¡¼¥óËè";
607 return "Í©Âβ½(´ü´Ö (¥ì¥Ù¥ë/2)+d(¥ì¥Ù¥ë/2)) : 1000 ¥¿¡¼¥óËè";
609 return "̵Ũ²½(´ü´Ö 8+d8) : 1000 ¥¿¡¼¥óËè";
611 return "»Îµ¤¹âÍÈ : 30+d30¥¿¡¼¥óËè";
613 return "»Îµ¤¹âÍÈ, ¥¹¥Ô¡¼¥É(´ü´Ö 50+d50¥¿¡¼¥ó) : 100+d200 ¥¿¡¼¥óËè";
614 case ACT_RESIST_ACID:
615 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
616 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ : 40+d40 ¥¿¡¼¥óËè";
617 return "»À¤Ø¤ÎÂÑÀ(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
618 case ACT_RESIST_FIRE:
619 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
620 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ : 40+d40 ¥¿¡¼¥óËè";
621 return "²Ð±ê¤Ø¤ÎÂÑÀ(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
622 case ACT_RESIST_COLD:
623 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
624 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ : 40+d40 ¥¿¡¼¥óËè";
625 return "Î䵤¤Ø¤ÎÂÑÀ(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
626 case ACT_RESIST_ELEC:
627 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
628 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ : 40+d40 ¥¿¡¼¥óËè";
629 return "ÅÅ·â¤Ø¤ÎÂÑÀ(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
630 case ACT_RESIST_POIS:
631 return "ÆǤؤÎÂÑÀ(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
634 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
636 return "ËâË¡¤ÎÃϿޤȸ÷ : 50+d50 ¥¿¡¼¥óËè";
638 return "Á´´¶ÃÎ : 55+d55 ¥¿¡¼¥óËè";
639 case ACT_DETECT_XTRA:
640 return "Á´´¶ÃΡ¢Ãµº÷¡¢*´ÕÄê* : 100 ¥¿¡¼¥óËè";
642 return "*´ÕÄê* : 75 ¥¿¡¼¥óËè";
644 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
646 return "Çúȯ¤Î¥ë¡¼¥ó : 200 ¥¿¡¼¥óËè";
648 return "¼é¤ê¤Î¥ë¡¼¥ó : 400 ¥¿¡¼¥óËè";
650 return "¶õÊ¢½¼Â : 200 ¥¿¡¼¥óËè";
652 return "¥É¥¢Ç˲õ : 10 ¥¿¡¼¥óËè";
654 return "´äÀÐÍϲò : 3 ¥¿¡¼¥óËè";
656 return "ËâÎϽ¼Å¶ : 70 ¥¿¡¼¥óËè";
658 return "Ï£¶â½Ñ : 500 ¥¿¡¼¥óËè";
660 return "¼¡¸µ¤ÎÈâ : 100 ¥¿¡¼¥óËè";
662 return "¥Æ¥ì¥Ý¡¼¥È : 25 ¥¿¡¼¥óËè";
664 return "µ¢´Ô¤Î¾Û : 200 ¥¿¡¼¥óËè";
666 return "ÂÎÎϤȰú¤Âؤ¨¤ËÀéΤ´ã¤Èµ¢´Ô : 20+d20 ¥¿¡¼¥óËè";
667 case ACT_TELEKINESIS:
668 return "ʪÂΤò°ú¤´ó¤»¤ë(½ÅÎÌ25kg¤Þ¤Ç) : 25+d25¥¿¡¼¥óËè";
669 case ACT_DETECT_UNIQUE:
670 return "¤³¤Î³¬¤Ë¤¤¤ë¥æ¥Ë¡¼¥¯¥â¥ó¥¹¥¿¡¼¤òɽ¼¨ : 200¥¿¡¼¥óËè";
672 return "ƨÁö : 35 ¥¿¡¼¥óËè";
673 case ACT_DISP_CURSE_XTRA:
674 return "*²ò¼ö*¤ÈÄ´ºº: ¤¤¤Ä¤Ç¤â";
675 case ACT_BRAND_FIRE_BOLTS:
676 return "¿ÏÀè¤Î¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È : 999 ¥¿¡¼¥óËè";
677 case ACT_RECHARGE_XTRA:
678 return "ËâÎϽ¼Å¶ : 200 ¥¿¡¼¥óËè";
680 return "´í¸±¤òȼ¤¦´ÕÄê : ¤¤¤Ä¤Ç¤â";
682 return "»Í¸ÔƧ¤ß : 100+d100 ¥¿¡¼¥óËè";
684 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10 ¥¿¡¼¥óËè";
685 case ACT_DETECT_ALL_MONS:
686 return "Á´¥â¥ó¥¹¥¿¡¼´¶ÃÎ : 150 ¥¿¡¼¥óËè";
687 case ACT_ULTIMATE_RESIST:
688 return "»Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢µæ¶Ë¤ÎÂÑÀ : 777 ¥¿¡¼¥óËè";
690 /* Unique activation */
692 return "Äà¤ê¤ò¤¹¤ë : ¤¤¤Ä¤Ç¤â";
694 return "Îã¤Î¥¢¥ì : 150+d150 ¥¿¡¼¥óËè";
696 return "ÏÓÎϤξ徺 : ³ÎΨ50%¤Ç²õ¤ì¤ë";
697 case ACT_BLOODY_MOON:
698 return "°ÀÊѹ¹ : 3333 ¥¿¡¼¥óËè";
700 return "¥Õ¥¡¥¤¥¢¡ª : 15 ¥¿¡¼¥óËè";
705 /* General activation */
708 return "beam of sunlight every 10 turns";
710 return "magic missile (2d6) every 2 turns";
712 return "stinking cloud (12) every 4+d4 turns";
714 return "lightning bolt (4d8) every 5+d5 turns";
716 return "acid bolt (5d8) every 6+d6 turns";
718 return "frost bolt (6d8) every 7+d7 turns";
720 return "fire bolt (9d8) every 8+d8 turns";
722 return "ball of cold (48) every 6+d6 turns";
724 return "ball of fire (72) every 9+d9 turns";
726 return "a strangling attack (100) every 100+d100 turns";
728 return "ball of cold (100) every 12+d12 turns";
730 return "ball of lightning (100) every 12+d12 turns";
732 return "drain life (120) every 400 turns";
734 return "vampiric drain (3*50) every 400 turns";
736 return "arrows (150) every 90+d90 turns";
738 return "fire ball (300) every 225+d225 turns";
740 return "ball of cold (400) every 325+d325 turns";
742 return "ball of lightning (500) every 425+d425 turns";
744 return "whirlwind attack every 250 turns";
746 return "vampiric drain (3*100) every 400 turns";
748 return "call chaos every 350 turns";
750 return "launch rocket (120+level) every 400 turns";
752 return "dispel evil (x5) every 100+d100 turns";
754 return "elemental breath (300) every 200+d200 turns";
756 return "dispel good (x5) every 100+d100 turns";
758 return "a magical arrow (150) every 90+d90 turns";
760 return "large fire ball (120) every 15 turns";
762 return "water ball (200) every 250 turns";
764 return "large star ball (200) every 200+d200 turns";
766 return "darkness storm (250) every 150+d150 turns";
768 return "a mana storm (250) every 150+d150 turns";
770 return "dispel small life every 55+d55 turns";
771 case ACT_BLINDING_LIGHT:
772 return "blinding light every 250 turns";
774 return "bizarre things every 450+d450 turns";
775 case ACT_CAST_BA_STAR:
776 return "cast star balls (150) every 1000 turns";
777 case ACT_BLADETURNER:
778 return "breathe elements (300), hero, bless, and resistance every 400 turns";
780 return "ball of acid (100) every 12+d12 turns";
782 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
783 return "breath of fire (200) and resist fire every 200 turns";
784 return "fire breath (200) every 250 turns";
786 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
787 return "breath of cold (200) and resist cold every 200 turns";
788 return "cold breath (200) every 250 turns";
790 return item_activation_dragon_breath(o_ptr);
793 return "confuse monster every 15 turns";
795 return "sleep nearby monsters every 55 turns";
797 return "earthquake every 50 turns";
799 return "terror every 3 * (level+10) turns";
801 return "teleport away every 200 turns";
802 case ACT_BANISH_EVIL:
803 return "banish evil every 250+d250 turns";
805 return "genocide every 500 turns";
807 return "mass genocide every 1000 turns";
809 return "frighten monsters every 40+d40 turns";
811 if (o_ptr->name1 == ART_HYOUSIGI) return "beat wooden clappers every turn";
812 return "aggravete monsters every turn";
814 case ACT_CHARM_ANIMAL:
815 return "charm animal every 200 turns";
816 case ACT_CHARM_UNDEAD:
817 return "enslave undead every 333 turns";
818 case ACT_CHARM_OTHER:
819 return "charm monster every 400 turns";
820 case ACT_CHARM_ANIMALS:
821 return "animal friendship every 500 turns";
822 case ACT_CHARM_OTHERS:
823 return "mass charm every 750 turns";
824 case ACT_SUMMON_ANIMAL:
825 return "summon animal every 200+d300 turns";
826 case ACT_SUMMON_PHANTOM:
827 return "summon phantasmal servant every 200+d200 turns";
828 case ACT_SUMMON_ELEMENTAL:
829 return "summon elemental every 750 turns";
830 case ACT_SUMMON_DEMON:
831 return "summon demon every 666+d333 turns";
832 case ACT_SUMMON_UNDEAD:
833 return "summon undead every 666+d333 turns";
834 case ACT_SUMMON_HOUND:
835 return "summon hound every 300+d150 turns";
836 case ACT_SUMMON_DAWN:
837 return "summon the Legion of the Dawn every 500+d500 turns";
838 case ACT_SUMMON_OCTOPUS:
839 return "summon octopus every 300+d150 turns";
841 case ACT_CHOIR_SINGS:
842 return "heal 777 hit points, curing and heloism every 300 turns";
844 return "remove fear and heal 30 hp every 10 turns";
846 return "heal 4d8 and wounds every 3+d3 turns";
847 case ACT_CURE_POISON:
848 return "remove fear and cure poison every 5 turns";
850 return "restore life levels every 450 turns";
852 return "restore stats and life levels every 750 turns";
854 return "heal 700 hit points every 250 turns";
856 return "heal 1000 hit points every 888 turns";
858 return "curing every 100 turns";
859 case ACT_CURE_MANA_FULL:
860 return "restore mana every 777 turns";
862 return "telepathy (dur 25+d30) every 200 turns";
864 /* return "heroism and blessed (dur 50+d50) every 100+d100 turns"; */
865 return "berserk (25+d25 turns) every 75+d75 turns";
867 return "protect evil (dur level*3 + d25) every 200+d200 turns";
869 return "resist elements (dur 20+d20) every 111 turns";
871 return "speed (dur 20+d20) every 100+d100 turns";
873 return "speed (dur 75+d75) every 100+d100 turns";
875 return "wraith form (dur level/2 + d(level/2)) every 1000 turns";
877 return "invulnerability (dur 8+d8) every 1000 turns";
879 return "heroism every 30+d30 turns";
881 return "hero and +10 to speed (50) every 100+200d turns";
882 case ACT_RESIST_ACID:
883 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
884 return "ball of acid (100) and resist acid every 40+d40 turns";
885 return "resist acid (dur 20+d20) every 40+d40 turns";
886 case ACT_RESIST_FIRE:
887 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
888 return "ball of fire (100) and resist fire every 40+d40 turns";
889 return "resist fire (dur 20+d20) every 40+d40 turns";
890 case ACT_RESIST_COLD:
891 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
892 return "ball of cold (100) and resist cold every 40+d40 turns";
893 return "resist cold (dur 20+d20) every 40+d40 turns";
894 case ACT_RESIST_ELEC:
895 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
896 return "ball of elec (100) and resist elec every 40+d40 turns";
897 return "resist thunder (dur 20+d20) every 40+d40 turns";
898 case ACT_RESIST_POIS:
899 return "resist poison (dur 20+d20) every 40+d40 turns";
902 return "light area (dam 2d15) every 10+d10 turns";
904 return "light (dam 2d15) & map area every 50+d50 turns";
906 return "detection every 55+d55 turns";
907 case ACT_DETECT_XTRA:
908 return "detection, probing and identify true every 100 turns";
910 return "identify true every 75 turns";
912 return "identify spell every 10 turns";
914 return "explosive rune every 200 turns";
916 return "rune of protection every 400 turns";
918 return "satisfy hunger every 200 turns";
920 return "destroy doors every 10 turns";
922 return "stone to mud every 3 turns";
924 return "recharging every 70 turns";
926 return "alchemy every 500 turns";
928 return "dimension door every 100 turns";
930 return "teleport every 25 turns";
932 return "word of recall every 200 turns";
933 case ACT_TELEKINESIS:
934 return "a telekinesis (500 lb) every 25+d25 turns";
936 return "clairvoyance and recall, draining you every 20+d20 turns";
937 case ACT_DETECT_UNIQUE:
938 return "list of the uniques on the level every 200 turns";
940 return "a getaway every 35 turns";
941 case ACT_DISP_CURSE_XTRA:
942 return "dispel curse and probing every turn";
943 case ACT_BRAND_FIRE_BOLTS:
944 return "fire branding of bolts every 999 turns";
945 case ACT_RECHARGE_XTRA:
946 return "recharge item every 200 turns";
948 return "perilous identify every turn";
950 return "shiko every 100+d100 turns";
952 return "blink every 10 turns";
953 case ACT_DETECT_ALL_MONS:
954 return "detect all monsters every 150 turns";
955 case ACT_ULTIMATE_RESIST:
956 return "hero, bless, and ultimate resistance every 777 turns";
958 /* Unique activation */
960 return "fishing : every time";
962 return "reveal your identity every 150+d150 turns";
964 return "increase STR (destroyed 50%)";
965 case ACT_BLOODY_MOON:
966 return "change zokusei every 3333 turns";
968 return "fire! every 15 turns";
971 return "something undefined";
977 if (o_ptr->tval == TV_WHISTLE)
980 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
982 return "call pet every 100+d100 turns";
986 if (o_ptr->tval == TV_CAPTURE)
989 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
991 return "captures or releases a monster.";
997 return "²¿¤âµ¯¤¤Ê¤¤";
1005 * Describe a "fully identified" item
1007 bool screen_object(object_type *o_ptr, u32b mode)
1011 u32b flgs[TR_FLAG_SIZE];
1015 char o_name[MAX_NLEN];
1018 int trivial_info = 0;
1020 /* Extract the flags */
1021 object_flags(o_ptr, flgs);
1023 /* Extract the description */
1025 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
1026 (k_text + k_info[o_ptr->k_idx].text),
1027 77 - 15, temp, sizeof(temp));
1028 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
1029 { info[i] = &temp[j]; i++;}
1032 if (object_is_equipment(o_ptr))
1034 /* Descriptions of a basic equipment is just a flavor */
1038 /* Mega-Hack -- describe activation */
1039 if (have_flag(flgs, TR_ACTIVATE))
1042 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
1044 info[i++] = "It can be activated for...";
1047 info[i++] = item_activation(o_ptr);
1049 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
1051 info[i++] = "...if it is being worn.";
1056 /* Figurines, a hack */
1057 if (o_ptr->tval == TV_FIGURINE)
1060 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
1062 info[i++] = "It will transform into a pet when thrown.";
1067 /* Figurines, a hack */
1068 if (o_ptr->name1 == ART_STONEMASK)
1071 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
1073 info[i++] = "It makes you turn into a vampire permanently.";
1078 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
1081 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
1083 info[i++] = "It will attempt to kill a monster instantly.";
1088 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
1091 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
1093 info[i++] = "It causes you to strike yourself sometimes.";
1097 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
1099 info[i++] = "It always penetrates invulnerability barriers.";
1103 if (o_ptr->name2 == EGO_2WEAPON)
1106 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
1108 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
1113 if (have_flag(flgs, TR_EASY_SPELL))
1116 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
1118 info[i++] = "It affects your ability to cast spells.";
1122 if (o_ptr->name2 == EGO_AMU_FOOL)
1125 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
1127 info[i++] = "It interferes with casting spells.";
1131 if (o_ptr->name2 == EGO_RING_THROW)
1134 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1136 info[i++] = "It provides great strength when you throw an item.";
1140 if (o_ptr->name2 == EGO_AMU_NAIVETY)
1143 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
1145 info[i++] = "It decreases your magic resistance.";
1149 if (o_ptr->tval == TV_STATUE)
1151 monster_race *r_ptr = &r_info[o_ptr->pval];
1153 if (o_ptr->pval == MON_BULLGATES)
1155 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
1157 info[i++] = "It is shameful.";
1159 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
1161 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
1163 info[i++] = "It is fearful.";
1167 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
1169 info[i++] = "It is cheerful.";
1173 /* Hack -- describe lite's */
1174 if (o_ptr->tval == TV_LITE)
1176 if (o_ptr->name2 == EGO_LITE_DARKNESS)
1179 info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
1181 info[i++] = "It provides no light.";
1184 if (o_ptr->sval == SV_LITE_FEANOR)
1187 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
1189 info[i++] = "It decreases radius of light source by 3.";
1192 else if (o_ptr->sval == SV_LITE_LANTERN)
1195 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
1197 info[i++] = "It decreases radius of light source by 2.";
1203 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1205 info[i++] = "It decreases radius of light source by 1.";
1209 else if (object_is_fixed_artifact(o_ptr))
1212 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1214 info[i++] = "It provides light (radius 3) forever.";
1218 else if (o_ptr->name2 == EGO_LITE_SHINE)
1220 if (o_ptr->sval == SV_LITE_FEANOR)
1223 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1225 info[i++] = "It provides light (radius 3) forever.";
1229 else if (o_ptr->sval == SV_LITE_LANTERN)
1232 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1234 info[i++] = "It provides light (radius 3) when fueled.";
1241 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1243 info[i++] = "It provides light (radius 2) when fueled.";
1250 if (o_ptr->sval == SV_LITE_FEANOR)
1253 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1255 info[i++] = "It provides light (radius 2) forever.";
1259 else if (o_ptr->sval == SV_LITE_LANTERN)
1262 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1264 info[i++] = "It provides light (radius 2) when fueled.";
1271 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
1273 info[i++] = "It provides light (radius 1) when fueled.";
1278 if (o_ptr->name2 == EGO_LITE_LONG)
1281 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
1283 info[i++] = "It provides light for much longer time.";
1289 /* And then describe it fully */
1291 if (have_flag(flgs, TR_RIDING))
1293 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
1295 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
1297 info[i++] = "It is made for use while riding.";
1302 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
1304 info[i++] = "It is suitable for use while riding.";
1306 /* This information is not important enough */
1310 if (have_flag(flgs, TR_STR))
1313 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1315 info[i++] = "It affects your strength.";
1319 if (have_flag(flgs, TR_INT))
1322 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1324 info[i++] = "It affects your intelligence.";
1328 if (have_flag(flgs, TR_WIS))
1331 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1333 info[i++] = "It affects your wisdom.";
1337 if (have_flag(flgs, TR_DEX))
1340 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1342 info[i++] = "It affects your dexterity.";
1346 if (have_flag(flgs, TR_CON))
1349 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1351 info[i++] = "It affects your constitution.";
1355 if (have_flag(flgs, TR_CHR))
1358 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1360 info[i++] = "It affects your charisma.";
1365 if (have_flag(flgs, TR_MAGIC_MASTERY))
1368 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1370 info[i++] = "It affects your ability to use magic devices.";
1374 if (have_flag(flgs, TR_STEALTH))
1377 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1379 info[i++] = "It affects your stealth.";
1383 if (have_flag(flgs, TR_SEARCH))
1386 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1388 info[i++] = "It affects your searching.";
1392 if (have_flag(flgs, TR_INFRA))
1395 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1397 info[i++] = "It affects your infravision.";
1401 if (have_flag(flgs, TR_TUNNEL))
1404 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1406 info[i++] = "It affects your ability to tunnel.";
1410 if (have_flag(flgs, TR_SPEED))
1413 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1415 info[i++] = "It affects your speed.";
1419 if (have_flag(flgs, TR_BLOWS))
1422 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1424 info[i++] = "It affects your attack speed.";
1429 if (have_flag(flgs, TR_BRAND_ACID))
1432 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1434 info[i++] = "It does extra damage from acid.";
1438 if (have_flag(flgs, TR_BRAND_ELEC))
1441 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1443 info[i++] = "It does extra damage from electricity.";
1447 if (have_flag(flgs, TR_BRAND_FIRE))
1450 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1452 info[i++] = "It does extra damage from fire.";
1456 if (have_flag(flgs, TR_BRAND_COLD))
1459 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1461 info[i++] = "It does extra damage from frost.";
1466 if (have_flag(flgs, TR_BRAND_POIS))
1469 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
1471 info[i++] = "It poisons your foes.";
1476 if (have_flag(flgs, TR_CHAOTIC))
1479 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
1481 info[i++] = "It produces chaotic effects.";
1486 if (have_flag(flgs, TR_VAMPIRIC))
1489 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
1491 info[i++] = "It drains life from your foes.";
1496 if (have_flag(flgs, TR_IMPACT))
1499 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
1501 info[i++] = "It can cause earthquakes.";
1506 if (have_flag(flgs, TR_VORPAL))
1509 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1511 info[i++] = "It is very sharp and can cut your foes.";
1516 if (have_flag(flgs, TR_KILL_DRAGON))
1519 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1521 info[i++] = "It is a great bane of dragons.";
1525 else if (have_flag(flgs, TR_SLAY_DRAGON))
1528 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1530 info[i++] = "It is especially deadly against dragons.";
1535 if (have_flag(flgs, TR_KILL_ORC))
1538 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1540 info[i++] = "It is a great bane of orcs.";
1544 if (have_flag(flgs, TR_SLAY_ORC))
1547 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1549 info[i++] = "It is especially deadly against orcs.";
1554 if (have_flag(flgs, TR_KILL_TROLL))
1557 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1559 info[i++] = "It is a great bane of trolls.";
1563 if (have_flag(flgs, TR_SLAY_TROLL))
1566 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1568 info[i++] = "It is especially deadly against trolls.";
1573 if (have_flag(flgs, TR_KILL_GIANT))
1576 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1578 info[i++] = "It is a great bane of giants.";
1581 else if (have_flag(flgs, TR_SLAY_GIANT))
1584 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1586 info[i++] = "It is especially deadly against giants.";
1591 if (have_flag(flgs, TR_KILL_DEMON))
1594 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1596 info[i++] = "It is a great bane of demons.";
1600 if (have_flag(flgs, TR_SLAY_DEMON))
1603 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1605 info[i++] = "It strikes at demons with holy wrath.";
1610 if (have_flag(flgs, TR_KILL_UNDEAD))
1613 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1615 info[i++] = "It is a great bane of undead.";
1619 if (have_flag(flgs, TR_SLAY_UNDEAD))
1622 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1624 info[i++] = "It strikes at undead with holy wrath.";
1629 if (have_flag(flgs, TR_KILL_EVIL))
1632 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1634 info[i++] = "It is a great bane of evil monsters.";
1638 if (have_flag(flgs, TR_SLAY_EVIL))
1641 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1643 info[i++] = "It fights against evil with holy fury.";
1648 if (have_flag(flgs, TR_KILL_ANIMAL))
1651 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1653 info[i++] = "It is a great bane of natural creatures.";
1657 if (have_flag(flgs, TR_SLAY_ANIMAL))
1660 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1662 info[i++] = "It is especially deadly against natural creatures.";
1667 if (have_flag(flgs, TR_KILL_HUMAN))
1670 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1672 info[i++] = "It is a great bane of humans.";
1676 if (have_flag(flgs, TR_SLAY_HUMAN))
1679 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1681 info[i++] = "It is especially deadly against humans.";
1686 if (have_flag(flgs, TR_FORCE_WEAPON))
1689 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
1691 info[i++] = "It powerfully strikes at a monster using your mana.";
1695 if (have_flag(flgs, TR_DEC_MANA))
1698 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
1700 info[i++] = "It decreases your mana consumption.";
1704 if (have_flag(flgs, TR_SUST_STR))
1707 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
1709 info[i++] = "It sustains your strength.";
1713 if (have_flag(flgs, TR_SUST_INT))
1716 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
1718 info[i++] = "It sustains your intelligence.";
1722 if (have_flag(flgs, TR_SUST_WIS))
1725 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
1727 info[i++] = "It sustains your wisdom.";
1731 if (have_flag(flgs, TR_SUST_DEX))
1734 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
1736 info[i++] = "It sustains your dexterity.";
1740 if (have_flag(flgs, TR_SUST_CON))
1743 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
1745 info[i++] = "It sustains your constitution.";
1749 if (have_flag(flgs, TR_SUST_CHR))
1752 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
1754 info[i++] = "It sustains your charisma.";
1759 if (have_flag(flgs, TR_IM_ACID))
1762 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1764 info[i++] = "It provides immunity to acid.";
1768 if (have_flag(flgs, TR_IM_ELEC))
1771 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1773 info[i++] = "It provides immunity to electricity.";
1777 if (have_flag(flgs, TR_IM_FIRE))
1780 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1782 info[i++] = "It provides immunity to fire.";
1786 if (have_flag(flgs, TR_IM_COLD))
1789 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1791 info[i++] = "It provides immunity to cold.";
1796 if (have_flag(flgs, TR_THROW))
1799 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1801 info[i++] = "It is perfectly balanced for throwing.";
1805 if (have_flag(flgs, TR_FREE_ACT))
1808 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1810 info[i++] = "It provides immunity to paralysis.";
1814 if (have_flag(flgs, TR_HOLD_LIFE))
1817 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
1819 info[i++] = "It provides resistance to life draining.";
1823 if (have_flag(flgs, TR_RES_FEAR))
1826 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1828 info[i++] = "It makes you completely fearless.";
1832 if (have_flag(flgs, TR_RES_ACID))
1835 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1837 info[i++] = "It provides resistance to acid.";
1841 if (have_flag(flgs, TR_RES_ELEC))
1844 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1846 info[i++] = "It provides resistance to electricity.";
1850 if (have_flag(flgs, TR_RES_FIRE))
1853 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1855 info[i++] = "It provides resistance to fire.";
1859 if (have_flag(flgs, TR_RES_COLD))
1862 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1864 info[i++] = "It provides resistance to cold.";
1868 if (have_flag(flgs, TR_RES_POIS))
1871 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1873 info[i++] = "It provides resistance to poison.";
1878 if (have_flag(flgs, TR_RES_LITE))
1881 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1883 info[i++] = "It provides resistance to light.";
1887 if (have_flag(flgs, TR_RES_DARK))
1890 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1892 info[i++] = "It provides resistance to dark.";
1897 if (have_flag(flgs, TR_RES_BLIND))
1900 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1902 info[i++] = "It provides resistance to blindness.";
1906 if (have_flag(flgs, TR_RES_CONF))
1909 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1911 info[i++] = "It provides resistance to confusion.";
1915 if (have_flag(flgs, TR_RES_SOUND))
1918 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1920 info[i++] = "It provides resistance to sound.";
1924 if (have_flag(flgs, TR_RES_SHARDS))
1927 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1929 info[i++] = "It provides resistance to shards.";
1934 if (have_flag(flgs, TR_RES_NETHER))
1937 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1939 info[i++] = "It provides resistance to nether.";
1943 if (have_flag(flgs, TR_RES_NEXUS))
1946 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1948 info[i++] = "It provides resistance to nexus.";
1952 if (have_flag(flgs, TR_RES_CHAOS))
1955 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1957 info[i++] = "It provides resistance to chaos.";
1961 if (have_flag(flgs, TR_RES_DISEN))
1964 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1966 info[i++] = "It provides resistance to disenchantment.";
1971 if (have_flag(flgs, TR_LEVITATION))
1974 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1976 info[i++] = "It allows you to levitate.";
1980 if (have_flag(flgs, TR_LITE))
1982 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
1984 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1986 info[i++] = "It decreases radius of your light source by 1.";
1990 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
1992 info[i++] = "It provides permanent light. (radius +1)";
1996 if (have_flag(flgs, TR_SEE_INVIS))
1999 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
2001 info[i++] = "It allows you to see invisible monsters.";
2005 if (have_flag(flgs, TR_TELEPATHY))
2008 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
2010 info[i++] = "It gives telepathic powers.";
2014 if (have_flag(flgs, TR_ESP_ANIMAL))
2017 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
2019 info[i++] = "It senses natural creatures.";
2023 if (have_flag(flgs, TR_ESP_UNDEAD))
2026 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
2028 info[i++] = "It senses undead.";
2032 if (have_flag(flgs, TR_ESP_DEMON))
2035 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò´¶ÃΤ¹¤ë¡£";
2037 info[i++] = "It senses demons.";
2041 if (have_flag(flgs, TR_ESP_ORC))
2044 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
2046 info[i++] = "It senses orcs.";
2050 if (have_flag(flgs, TR_ESP_TROLL))
2053 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
2055 info[i++] = "It senses trolls.";
2059 if (have_flag(flgs, TR_ESP_GIANT))
2062 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
2064 info[i++] = "It senses giants.";
2068 if (have_flag(flgs, TR_ESP_DRAGON))
2071 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
2073 info[i++] = "It senses dragons.";
2077 if (have_flag(flgs, TR_ESP_HUMAN))
2080 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
2082 info[i++] = "It senses humans.";
2086 if (have_flag(flgs, TR_ESP_EVIL))
2089 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
2091 info[i++] = "It senses evil creatures.";
2095 if (have_flag(flgs, TR_ESP_GOOD))
2098 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
2100 info[i++] = "It senses good creatures.";
2104 if (have_flag(flgs, TR_ESP_NONLIVING))
2107 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
2109 info[i++] = "It senses non-living creatures.";
2113 if (have_flag(flgs, TR_ESP_UNIQUE))
2116 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
2118 info[i++] = "It senses unique monsters.";
2122 if (have_flag(flgs, TR_SLOW_DIGEST))
2125 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
2127 info[i++] = "It slows your metabolism.";
2131 if (have_flag(flgs, TR_REGEN))
2134 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
2136 info[i++] = "It speeds your regenerative powers.";
2140 if (have_flag(flgs, TR_WARNING))
2143 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
2145 info[i++] = "It warns you of danger";
2149 if (have_flag(flgs, TR_REFLECT))
2152 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
2154 info[i++] = "It reflects bolts and arrows.";
2158 if (have_flag(flgs, TR_SH_FIRE))
2161 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2163 info[i++] = "It produces a fiery sheath.";
2167 if (have_flag(flgs, TR_SH_ELEC))
2170 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2172 info[i++] = "It produces an electric sheath.";
2176 if (have_flag(flgs, TR_SH_COLD))
2179 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2181 info[i++] = "It produces a sheath of coldness.";
2185 if (have_flag(flgs, TR_NO_MAGIC))
2188 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2190 info[i++] = "It produces an anti-magic shell.";
2194 if (have_flag(flgs, TR_NO_TELE))
2197 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
2199 info[i++] = "It prevents teleportation.";
2203 if (have_flag(flgs, TR_XTRA_MIGHT))
2206 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
2208 info[i++] = "It fires missiles with extra might.";
2212 if (have_flag(flgs, TR_XTRA_SHOTS))
2215 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
2217 info[i++] = "It fires missiles excessively fast.";
2222 if (have_flag(flgs, TR_BLESSED))
2225 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
2227 info[i++] = "It has been blessed by the gods.";
2232 if (object_is_cursed(o_ptr))
2234 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
2237 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
2239 info[i++] = "It is permanently cursed.";
2243 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
2246 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
2248 info[i++] = "It is heavily cursed.";
2255 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
2257 info[i++] = "It is cursed.";
2261 * It's a trivial infomation since there is
2262 * fake inscription {cursed}
2268 if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
2271 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
2273 info[i++] = "It carries an ancient foul curse.";
2277 if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
2280 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
2282 info[i++] = "It aggravates nearby creatures.";
2286 if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
2289 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
2291 info[i++] = "It drains experience.";
2295 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
2298 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
2300 info[i++] = "It slows your regenerative powers.";
2304 if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
2307 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
2309 info[i++] = "It adds weak curses.";
2313 if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
2316 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
2318 info[i++] = "It adds heavy curses.";
2322 if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
2325 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2327 info[i++] = "It attracts animals.";
2331 if (o_ptr->curse_flags & TRC_CALL_DEMON)
2334 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2336 info[i++] = "It attracts demons.";
2340 if (o_ptr->curse_flags & TRC_CALL_DRAGON)
2343 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2345 info[i++] = "It attracts dragons.";
2349 if (o_ptr->curse_flags & TRC_COWARDICE)
2352 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£";
2354 info[i++] = "It makes you subject to cowardice.";
2358 if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
2361 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£";
2363 info[i++] = "It induces random teleportation.";
2367 if (o_ptr->curse_flags & TRC_LOW_MELEE)
2370 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
2372 info[i++] = "It causes you to miss blows.";
2376 if (o_ptr->curse_flags & TRC_LOW_AC)
2379 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
2381 info[i++] = "It helps your enemies' blows.";
2385 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
2388 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
2390 info[i++] = "It encumbers you while spellcasting.";
2394 if (o_ptr->curse_flags & TRC_FAST_DIGEST)
2397 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
2399 info[i++] = "It speeds your metabolism.";
2403 if (o_ptr->curse_flags & TRC_DRAIN_HP)
2406 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
2408 info[i++] = "It drains you.";
2412 if (o_ptr->curse_flags & TRC_DRAIN_MANA)
2415 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
2417 info[i++] = "It drains your mana.";
2422 /* Describe about this kind of object instead of THIS fake object */
2423 if (mode & SCROBJ_FAKE_OBJECT)
2425 switch (o_ptr->tval)
2428 switch (o_ptr->sval)
2430 case SV_RING_LORDLY:
2432 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
2434 info[i++] = "It provides some random resistances.";
2437 case SV_RING_WARNING:
2439 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2441 info[i++] = "It may provide a low rank ESP.";
2448 switch (o_ptr->sval)
2450 case SV_AMULET_RESISTANCE:
2452 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2454 info[i++] = "It may provides resistance to poison.";
2457 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2459 info[i++] = "It may provide a random resistances.";
2462 case SV_AMULET_THE_MAGI:
2464 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
2466 info[i++] = "It provides up to three low rank ESPs.";
2474 if (have_flag(flgs, TR_IGNORE_ACID) &&
2475 have_flag(flgs, TR_IGNORE_ELEC) &&
2476 have_flag(flgs, TR_IGNORE_FIRE) &&
2477 have_flag(flgs, TR_IGNORE_COLD))
2480 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2482 info[i++] = "It cannot be harmed by the elements.";
2487 if (have_flag(flgs, TR_IGNORE_ACID))
2490 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2492 info[i++] = "It cannot be harmed by acid.";
2495 if (have_flag(flgs, TR_IGNORE_ELEC))
2498 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2500 info[i++] = "It cannot be harmed by electricity.";
2503 if (have_flag(flgs, TR_IGNORE_FIRE))
2506 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2508 info[i++] = "It cannot be harmed by fire.";
2511 if (have_flag(flgs, TR_IGNORE_COLD))
2514 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2516 info[i++] = "It cannot be harmed by cold.";
2521 if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
2523 /* No relevant informations */
2524 if (i <= trivial_info) return (FALSE);
2526 /* Save the screen */
2530 Term_get_size(&wid, &hgt);
2532 /* Display Item name */
2533 if (!(mode & SCROBJ_FAKE_OBJECT))
2534 object_desc(o_name, o_ptr, 0);
2536 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
2540 /* Erase the screen */
2541 for (k = 1; k < hgt; k++) prt("", k, 13);
2543 /* Label the information */
2544 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
2546 monster_race *r_ptr = &r_info[o_ptr->pval];
2547 int namelen = strlen(r_name + r_ptr->name);
2548 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
2549 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
2550 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
2554 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
2556 prt(" Item Attributes:", 1, 15);
2559 /* We will print on top of the map (column 13) */
2560 for (k = 2, j = 0; j < i; j++)
2563 prt(info[j], k++, 15);
2565 /* Every 20 entries (lines 2 to 21), start over */
2566 if ((k == hgt - 2) && (j+1 < i))
2569 prt("-- ³¤¯ --", k, 15);
2571 prt("-- more --", k, 15);
2574 for (; k > 2; k--) prt("", k, 15);
2580 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
2582 prt("[Press any key to continue]", k, 15);
2587 /* Restore the screen */
2590 /* Gave knowledge */
2597 * Convert an inventory index into a one character label
2598 * Note that the label does NOT distinguish inven/equip.
2600 char index_to_label(int i)
2602 /* Indexes for "inven" are easy */
2603 if (i < INVEN_RARM) return (I2A(i));
2605 /* Indexes for "equip" are offset */
2606 return (I2A(i - INVEN_RARM));
2611 * Convert a label into the index of an item in the "inven"
2612 * Return "-1" if the label does not indicate a real item
2614 s16b label_to_inven(int c)
2619 i = (islower(c) ? A2I(c) : -1);
2621 /* Verify the index */
2622 if ((i < 0) || (i > INVEN_PACK)) return (-1);
2624 /* Empty slots can never be chosen */
2625 if (!inventory[i].k_idx) return (-1);
2627 /* Return the index */
2633 extern bool select_ring_slot;
2636 static bool is_ring_slot(int i)
2638 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
2643 * Convert a label into the index of a item in the "equip"
2644 * Return "-1" if the label does not indicate a real item
2646 s16b label_to_equip(int c)
2651 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
2653 /* Verify the index */
2654 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
2656 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
2658 /* Empty slots can never be chosen */
2659 if (!inventory[i].k_idx) return (-1);
2661 /* Return the index */
2668 * Determine which equipment slot (if any) an item likes
2670 s16b wield_slot(object_type *o_ptr)
2672 /* Slot for equipment */
2673 switch (o_ptr->tval)
2680 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
2681 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
2682 return (INVEN_LARM);
2689 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
2690 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
2691 return (INVEN_RARM);
2701 /* Use the right hand first */
2702 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
2704 /* Use the left hand for swapping (by default) */
2705 return (INVEN_LEFT);
2711 return (INVEN_NECK);
2716 return (INVEN_LITE);
2723 return (INVEN_BODY);
2728 return (INVEN_OUTER);
2734 return (INVEN_HEAD);
2739 return (INVEN_HANDS);
2744 return (INVEN_FEET);
2748 /* No slot available */
2754 * Return a string mentioning how a given item is carried
2756 cptr mention_use(int i)
2760 /* Examine the location */
2764 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
2766 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
2770 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " ξ¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
2772 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
2776 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
2778 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
2782 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
2784 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
2788 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
2790 case INVEN_LEFT: p = (left_hander ? "On right hand" : "On left hand"); break;
2794 case INVEN_NECK: p = " ¼ó"; break;
2796 case INVEN_NECK: p = "Around neck"; break;
2800 case INVEN_LITE: p = " ¸÷¸»"; break;
2802 case INVEN_LITE: p = "Light source"; break;
2806 case INVEN_BODY: p = " ÂÎ"; break;
2808 case INVEN_BODY: p = "On body"; break;
2812 case INVEN_OUTER: p = "ÂΤξå"; break;
2814 case INVEN_OUTER: p = "About body"; break;
2818 case INVEN_HEAD: p = " Ƭ"; break;
2820 case INVEN_HEAD: p = "On head"; break;
2824 case INVEN_HANDS: p = " ¼ê"; break;
2826 case INVEN_HANDS: p = "On hands"; break;
2830 case INVEN_FEET: p = " "; break;
2832 case INVEN_FEET: p = "On feet"; break;
2836 default: p = "¥¶¥Ã¥¯"; break;
2838 default: p = "In pack"; break;
2842 /* Return the result */
2848 * Return a string describing how a given item is being worn.
2849 * Currently, only used for items in the equipment, not inventory.
2851 cptr describe_use(int i)
2858 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2860 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
2864 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2866 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
2870 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
2872 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
2876 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2878 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
2882 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2884 case INVEN_LEFT: p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
2888 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
2890 case INVEN_NECK: p = "wearing around your neck"; break;
2894 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
2896 case INVEN_LITE: p = "using to light the way"; break;
2900 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
2902 case INVEN_BODY: p = "wearing on your body"; break;
2906 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
2908 case INVEN_OUTER: p = "wearing on your back"; break;
2912 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
2914 case INVEN_HEAD: p = "wearing on your head"; break;
2918 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
2920 case INVEN_HANDS: p = "wearing on your hands"; break;
2924 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
2926 case INVEN_FEET: p = "wearing on your feet"; break;
2930 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
2932 default: p = "carrying in your pack"; break;
2936 /* Return the result */
2941 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
2943 bool check_book_realm(const byte book_tval, const byte book_sval)
2945 if (book_tval < TV_LIFE_BOOK) return FALSE;
2946 if (p_ptr->pclass == CLASS_SORCERER)
2948 return is_magic(tval2realm(book_tval));
2950 else if (p_ptr->pclass == CLASS_RED_MAGE)
2952 if (is_magic(tval2realm(book_tval)))
2953 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
2955 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
2960 * Check an item against the item tester info
2962 bool item_tester_okay(object_type *o_ptr)
2964 /* Hack -- allow listing empty slots */
2965 if (item_tester_full) return (TRUE);
2967 /* Require an item */
2968 if (!o_ptr->k_idx) return (FALSE);
2970 /* Hack -- ignore "gold" */
2971 if (o_ptr->tval == TV_GOLD)
2974 extern bool show_gold_on_floor;
2976 if (!show_gold_on_floor) return (FALSE);
2979 /* Check the tval */
2980 if (item_tester_tval)
2982 /* Is it a spellbook? If so, we need a hack -- TY */
2983 if ((item_tester_tval <= TV_DEATH_BOOK) &&
2984 (item_tester_tval >= TV_LIFE_BOOK))
2985 return check_book_realm(o_ptr->tval, o_ptr->sval);
2987 if (item_tester_tval != o_ptr->tval) return (FALSE);
2990 /* Check the hook */
2991 if (item_tester_hook)
2993 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
3004 * Choice window "shadow" of the "show_inven()" function
3006 void display_inven(void)
3008 register int i, n, z = 0;
3010 byte attr = TERM_WHITE;
3012 char o_name[MAX_NLEN];
3016 Term_get_size(&wid, &hgt);
3018 /* Find the "final" slot */
3019 for (i = 0; i < INVEN_PACK; i++)
3021 o_ptr = &inventory[i];
3023 /* Skip non-objects */
3024 if (!o_ptr->k_idx) continue;
3030 /* Display the pack */
3031 for (i = 0; i < z; i++)
3033 /* Examine the item */
3034 o_ptr = &inventory[i];
3036 /* Start with an empty "index" */
3037 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3039 /* Is this item "acceptable"? */
3040 if (item_tester_okay(o_ptr))
3042 /* Prepare an "index" */
3043 tmp_val[0] = index_to_label(i);
3045 /* Bracket the "index" --(-- */
3049 /* Display the index (or blank space) */
3050 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
3052 /* Obtain an item description */
3053 object_desc(o_name, o_ptr, 0);
3055 /* Obtain the length of the description */
3059 attr = tval_to_attr[o_ptr->tval % 128];
3061 /* Grey out charging items */
3067 /* Display the entry itself */
3068 Term_putstr(3, i, n, attr, o_name);
3070 /* Erase the rest of the line */
3071 Term_erase(3+n, i, 255);
3073 /* Display the weight if needed */
3076 int wgt = o_ptr->weight * o_ptr->number;
3078 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
3080 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3083 prt(tmp_val, i, wid - 9);
3087 /* Erase the rest of the window */
3088 for (i = z; i < hgt; i++)
3090 /* Erase the line */
3091 Term_erase(0, i, 255);
3098 * Choice window "shadow" of the "show_equip()" function
3100 void display_equip(void)
3104 byte attr = TERM_WHITE;
3106 char o_name[MAX_NLEN];
3110 Term_get_size(&wid, &hgt);
3112 /* Display the equipment */
3113 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3115 /* Examine the item */
3116 o_ptr = &inventory[i];
3118 /* Start with an empty "index" */
3119 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3121 /* Is this item "acceptable"? */
3122 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
3124 /* Prepare an "index" */
3125 tmp_val[0] = index_to_label(i);
3127 /* Bracket the "index" --(-- */
3131 /* Display the index (or blank space) */
3132 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
3134 /* Obtain an item description */
3135 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3138 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
3140 strcpy(o_name, "(wielding with two-hands)");
3146 object_desc(o_name, o_ptr, 0);
3147 attr = tval_to_attr[o_ptr->tval % 128];
3150 /* Obtain the length of the description */
3153 /* Grey out charging items */
3159 /* Display the entry itself */
3160 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
3162 /* Erase the rest of the line */
3163 Term_erase(3+n, i - INVEN_RARM, 255);
3165 /* Display the weight (if needed) */
3168 int wgt = o_ptr->weight * o_ptr->number;
3170 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3172 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3175 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
3178 /* Display the slot description (if needed) */
3181 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
3182 prt(mention_use(i), i - INVEN_RARM, wid - 15);
3186 /* Erase the rest of the window */
3187 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
3189 /* Clear that line */
3190 Term_erase(0, i, 255);
3196 * Find the "first" inventory object with the given "tag".
3198 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
3199 * inscription of an object. Alphabetical characters don't work as a
3202 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
3203 * and "x" is the "current" command_cmd code.
3205 static bool get_tag(int *cp, char tag, int mode)
3210 /* Extract index from mode */
3215 end = INVEN_TOTAL - 1;
3220 end = INVEN_PACK - 1;
3227 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
3229 /* Check every inventory object */
3230 for (i = start; i <= end; i++)
3232 object_type *o_ptr = &inventory[i];
3234 /* Skip non-objects */
3235 if (!o_ptr->k_idx) continue;
3237 /* Skip empty inscriptions */
3238 if (!o_ptr->inscription) continue;
3240 /* Skip non-choice */
3241 if (!item_tester_okay(o_ptr)) continue;
3244 s = my_strchr(quark_str(o_ptr->inscription), '@');
3246 /* Process all tags */
3249 /* Check the special tags */
3250 if ((s[1] == command_cmd) && (s[2] == tag))
3252 /* Save the actual inventory ID */
3259 /* Find another '@' */
3260 s = my_strchr(s + 1, '@');
3265 /**** Find a tag in the form of {@#} (allows only numerals) ***/
3267 /* Don't allow {@#} with '#' being alphabet */
3268 if (tag < '0' || '9' < tag)
3274 /* Check every object */
3275 for (i = start; i <= end; i++)
3277 object_type *o_ptr = &inventory[i];
3279 /* Skip non-objects */
3280 if (!o_ptr->k_idx) continue;
3282 /* Skip empty inscriptions */
3283 if (!o_ptr->inscription) continue;
3285 /* Skip non-choice */
3286 if (!item_tester_okay(o_ptr)) continue;
3289 s = my_strchr(quark_str(o_ptr->inscription), '@');
3291 /* Process all tags */
3294 /* Check the normal tags */
3297 /* Save the actual inventory ID */
3304 /* Find another '@' */
3305 s = my_strchr(s + 1, '@');
3315 * Find the "first" floor object with the given "tag".
3317 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
3318 * inscription of an object. Alphabetical characters don't work as a
3321 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
3322 * and "x" is the "current" command_cmd code.
3324 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
3329 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
3331 /* Check every object in the grid */
3332 for (i = 0; i < floor_num && i < 23; i++)
3334 object_type *o_ptr = &o_list[floor_list[i]];
3336 /* Skip empty inscriptions */
3337 if (!o_ptr->inscription) continue;
3340 s = my_strchr(quark_str(o_ptr->inscription), '@');
3342 /* Process all tags */
3345 /* Check the special tags */
3346 if ((s[1] == command_cmd) && (s[2] == tag))
3348 /* Save the actual floor object ID */
3355 /* Find another '@' */
3356 s = my_strchr(s + 1, '@');
3361 /**** Find a tag in the form of {@#} (allows only numerals) ***/
3363 /* Don't allow {@#} with '#' being alphabet */
3364 if (tag < '0' || '9' < tag)
3370 /* Check every object in the grid */
3371 for (i = 0; i < floor_num && i < 23; i++)
3373 object_type *o_ptr = &o_list[floor_list[i]];
3375 /* Skip empty inscriptions */
3376 if (!o_ptr->inscription) continue;
3379 s = my_strchr(quark_str(o_ptr->inscription), '@');
3381 /* Process all tags */
3384 /* Check the normal tags */
3387 /* Save the floor object ID */
3394 /* Find another '@' */
3395 s = my_strchr(s + 1, '@');
3405 * Move around label characters with correspond tags
3407 static void prepare_label_string(char *label, int mode)
3409 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
3410 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
3413 /* Prepare normal labels */
3414 strcpy(label, alphabet_chars);
3416 /* Move each label */
3417 for (i = 0; i < 52; i++)
3420 char c = alphabet_chars[i];
3422 /* Find a tag with this label */
3423 if (get_tag(&index, c, mode))
3425 /* Delete the overwritten label */
3426 if (label[i] == c) label[i] = ' ';
3428 /* Move the label to the place of corresponding tag */
3429 label[index - offset] = c;
3436 * Move around label characters with correspond tags (floor version)
3438 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
3440 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
3443 /* Prepare normal labels */
3444 strcpy(label, alphabet_chars);
3446 /* Move each label */
3447 for (i = 0; i < 52; i++)
3450 char c = alphabet_chars[i];
3452 /* Find a tag with this label */
3453 if (get_tag_floor(&index, c, floor_list, floor_num))
3455 /* Delete the overwritten label */
3456 if (label[i] == c) label[i] = ' ';
3458 /* Move the label to the place of corresponding tag */
3466 * Display the inventory.
3468 * Hack -- do not display "trailing" empty slots
3470 int show_inven(int target_item)
3472 int i, j, k, l, z = 0;
3473 int col, cur_col, len;
3475 char o_name[MAX_NLEN];
3479 char out_desc[23][MAX_NLEN];
3480 int target_item_label = 0;
3482 char inven_label[52 + 1];
3484 /* Starting column */
3488 Term_get_size(&wid, &hgt);
3490 /* Default "max-length" */
3491 len = wid - col - 1;
3494 /* Find the "final" slot */
3495 for (i = 0; i < INVEN_PACK; i++)
3497 o_ptr = &inventory[i];
3499 /* Skip non-objects */
3500 if (!o_ptr->k_idx) continue;
3506 prepare_label_string(inven_label, USE_INVEN);
3508 /* Display the inventory */
3509 for (k = 0, i = 0; i < z; i++)
3511 o_ptr = &inventory[i];
3513 /* Is this item acceptable? */
3514 if (!item_tester_okay(o_ptr)) continue;
3516 /* Describe the object */
3517 object_desc(o_name, o_ptr, 0);
3519 /* Save the object index, color, and description */
3521 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3523 /* Grey out charging items */
3526 out_color[k] = TERM_L_DARK;
3529 (void)strcpy(out_desc[k], o_name);
3531 /* Find the predicted "line length" */
3532 l = strlen(out_desc[k]) + 5;
3534 /* Be sure to account for the weight */
3535 if (show_weights) l += 9;
3537 /* Account for icon if displayed */
3538 if (show_item_graph)
3541 if (use_bigtile) l++;
3544 /* Maintain the maximum length */
3545 if (l > len) len = l;
3547 /* Advance to next "line" */
3551 /* Find the column to start in */
3552 col = (len > wid - 4) ? 0 : (wid - len - 1);
3554 /* Output each entry */
3555 for (j = 0; j < k; j++)
3561 o_ptr = &inventory[i];
3563 /* Clear the line */
3564 prt("", j + 1, col ? col - 2 : col);
3566 if (use_menu && target_item)
3568 if (j == (target_item-1))
3571 strcpy(tmp_val, "¡Õ");
3573 strcpy(tmp_val, "> ");
3575 target_item_label = i;
3577 else strcpy(tmp_val, " ");
3579 else if (i <= INVEN_PACK)
3581 /* Prepare an index --(-- */
3582 sprintf(tmp_val, "%c)", inven_label[i]);
3586 /* Prepare an index --(-- */
3587 sprintf(tmp_val, "%c)", index_to_label(i));
3590 /* Clear the line with the (possibly indented) index */
3591 put_str(tmp_val, j + 1, col);
3595 /* Display graphics for object, if desired */
3596 if (show_item_graph)
3598 byte a = object_attr(o_ptr);
3599 char c = object_char(o_ptr);
3602 if (a & 0x80) a |= 0x40;
3605 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3606 if (use_bigtile) cur_col++;
3612 /* Display the entry itself */
3613 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3615 /* Display the weight if needed */
3618 int wgt = o_ptr->weight * o_ptr->number;
3620 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3622 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3625 prt(tmp_val, j + 1, wid - 9);
3629 /* Make a "shadow" below the list (only if needed) */
3630 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3632 /* Save the new column */
3635 return target_item_label;
3641 * Display the equipment.
3643 int show_equip(int target_item)
3646 int col, cur_col, len;
3649 char o_name[MAX_NLEN];
3652 char out_desc[23][MAX_NLEN];
3653 int target_item_label = 0;
3655 char equip_label[52 + 1];
3657 /* Starting column */
3661 Term_get_size(&wid, &hgt);
3663 /* Maximal length */
3664 len = wid - col - 1;
3667 /* Scan the equipment list */
3668 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3670 o_ptr = &inventory[i];
3672 /* Is this item acceptable? */
3673 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
3674 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3675 item_tester_no_ryoute)) continue;
3678 object_desc(o_name, o_ptr, 0);
3680 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3683 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
3685 (void)strcpy(out_desc[k],"(wielding with two-hands)");
3687 out_color[k] = TERM_WHITE;
3691 (void)strcpy(out_desc[k], o_name);
3692 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3696 /* Grey out charging items */
3699 out_color[k] = TERM_L_DARK;
3702 /* Extract the maximal length (see below) */
3704 l = strlen(out_desc[k]) + (2 + 1);
3706 l = strlen(out_desc[k]) + (2 + 3);
3710 /* Increase length for labels (if needed) */
3712 if (show_labels) l += (7 + 2);
3714 if (show_labels) l += (14 + 2);
3718 /* Increase length for weight (if needed) */
3719 if (show_weights) l += 9;
3721 if (show_item_graph) l += 2;
3723 /* Maintain the max-length */
3724 if (l > len) len = l;
3726 /* Advance the entry */
3730 /* Hack -- Find a column to start in */
3732 col = (len > wid - 6) ? 0 : (wid - len - 1);
3734 col = (len > wid - 4) ? 0 : (wid - len - 1);
3737 prepare_label_string(equip_label, USE_EQUIP);
3739 /* Output each entry */
3740 for (j = 0; j < k; j++)
3746 o_ptr = &inventory[i];
3748 /* Clear the line */
3749 prt("", j + 1, col ? col - 2 : col);
3751 if (use_menu && target_item)
3753 if (j == (target_item-1))
3756 strcpy(tmp_val, "¡Õ");
3758 strcpy(tmp_val, "> ");
3760 target_item_label = i;
3762 else strcpy(tmp_val, " ");
3764 else if (i >= INVEN_RARM)
3766 /* Prepare an index --(-- */
3767 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3771 /* Prepare an index --(-- */
3772 sprintf(tmp_val, "%c)", index_to_label(i));
3775 /* Clear the line with the (possibly indented) index */
3776 put_str(tmp_val, j+1, col);
3780 /* Display graphics for object, if desired */
3781 if (show_item_graph)
3783 byte a = object_attr(o_ptr);
3784 char c = object_char(o_ptr);
3787 if (a & 0x80) a |= 0x40;
3790 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3791 if (use_bigtile) cur_col++;
3799 /* Mention the use */
3801 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
3803 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
3806 put_str(tmp_val, j+1, cur_col);
3808 /* Display the entry itself */
3810 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
3812 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
3819 /* Display the entry itself */
3820 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
3823 /* Display the weight if needed */
3826 int wgt = o_ptr->weight * o_ptr->number;
3828 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3830 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3833 prt(tmp_val, j + 1, wid - 9);
3837 /* Make a "shadow" below the list (only if needed) */
3838 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3840 /* Save the new column */
3843 return target_item_label;
3850 * Flip "inven" and "equip" in any sub-windows
3852 void toggle_inven_equip(void)
3857 for (j = 0; j < 8; j++)
3860 if (!angband_term[j]) continue;
3862 /* Flip inven to equip */
3863 if (window_flag[j] & (PW_INVEN))
3866 window_flag[j] &= ~(PW_INVEN);
3867 window_flag[j] |= (PW_EQUIP);
3870 p_ptr->window |= (PW_EQUIP);
3873 /* Flip inven to equip */
3874 else if (window_flag[j] & (PW_EQUIP))
3877 window_flag[j] &= ~(PW_EQUIP);
3878 window_flag[j] |= (PW_INVEN);
3881 p_ptr->window |= (PW_INVEN);
3889 * Verify the choice of an item.
3891 * The item can be negative to mean "item on floor".
3893 static bool verify(cptr prompt, int item)
3895 char o_name[MAX_NLEN];
3896 char out_val[MAX_NLEN+20];
3903 o_ptr = &inventory[item];
3909 o_ptr = &o_list[0 - item];
3913 object_desc(o_name, o_ptr, 0);
3917 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
3919 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
3924 return (get_check(out_val));
3929 * Hack -- allow user to "prevent" certain choices
3931 * The item can be negative to mean "item on floor".
3933 static bool get_item_allow(int item)
3939 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
3944 o_ptr = &inventory[item];
3950 o_ptr = &o_list[0 - item];
3953 /* No inscription */
3954 if (!o_ptr->inscription) return (TRUE);
3957 s = my_strchr(quark_str(o_ptr->inscription), '!');
3959 /* Process preventions */
3962 /* Check the "restriction" */
3963 if ((s[1] == command_cmd) || (s[1] == '*'))
3965 /* Verify the choice */
3967 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
3969 if (!verify("Really try", item)) return (FALSE);
3974 /* Find another '!' */
3975 s = my_strchr(s + 1, '!');
3985 * Auxiliary function for "get_item()" -- test an index
3987 static bool get_item_okay(int i)
3990 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
3992 if (select_ring_slot) return is_ring_slot(i);
3994 /* Verify the item */
3995 if (!item_tester_okay(&inventory[i])) return (FALSE);
4004 * Determine whether get_item() can get some item or not
4005 * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
4007 bool can_get_item(void)
4009 int j, floor_list[23], floor_num = 0;
4011 for (j = 0; j < INVEN_TOTAL; j++)
4012 if (item_tester_okay(&inventory[j]))
4015 floor_num = scan_floor(floor_list, py, px, 0x03);
4023 * Let the user select an item, save its "index"
4025 * Return TRUE only if an acceptable item was chosen by the user.
4027 * The selected item must satisfy the "item_tester_hook()" function,
4028 * if that hook is set, and the "item_tester_tval", if that value is set.
4030 * All "item_tester" restrictions are cleared before this function returns.
4032 * The user is allowed to choose acceptable items from the equipment,
4033 * inventory, or floor, respectively, if the proper flag was given,
4034 * and there are any acceptable items in that location.
4036 * The equipment or inventory are displayed (even if no acceptable
4037 * items are in that location) if the proper flag was given.
4039 * If there are no acceptable items available anywhere, and "str" is
4040 * not NULL, then it will be used as the text of a warning message
4041 * before the function returns.
4043 * Note that the user must press "-" to specify the item on the floor,
4044 * and there is no way to "examine" the item on the floor, while the
4045 * use of "capital" letters will "examine" an inventory/equipment item,
4046 * and prompt for its use.
4048 * If a legal item is selected from the inventory, we save it in "cp"
4049 * directly (0 to 35), and return TRUE.
4051 * If a legal item is selected from the floor, we save it in "cp" as
4052 * a negative (-1 to -511), and return TRUE.
4054 * If no item is available, we do nothing to "cp", and we display a
4055 * warning message, using "str" if available, and return FALSE.
4057 * If no item is selected, we do nothing to "cp", and return FALSE.
4059 * Global "p_ptr->command_new" is used when viewing the inventory or equipment
4060 * to allow the user to enter a command while viewing those screens, and
4061 * also to induce "auto-enter" of stores, and other such stuff.
4063 * Global "p_ptr->command_see" may be set before calling this function to start
4064 * out in "browse" mode. It is cleared before this function returns.
4066 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
4067 * If it is TRUE then we are viewing inventory, else equipment.
4069 * We always erase the prompt when we are done, leaving a blank line,
4070 * or a warning message, if appropriate, if no items are available.
4072 bool get_item(int *cp, cptr pmt, cptr str, int mode)
4074 s16b this_o_idx, next_o_idx = 0;
4078 int j, k, i1, i2, e1, e2;
4088 bool allow_floor = FALSE;
4090 bool toggle = FALSE;
4096 extern bool select_the_force;
4098 int menu_line = (use_menu ? 1 : 0);
4104 static char prev_tag = '\0';
4105 char cur_tag = '\0';
4107 #endif /* ALLOW_REPEAT */
4109 #ifdef ALLOW_EASY_FLOOR /* TNB */
4111 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
4113 #endif /* ALLOW_EASY_FLOOR -- TNB */
4116 if (mode & USE_EQUIP) equip = TRUE;
4117 if (mode & USE_INVEN) inven = TRUE;
4118 if (mode & USE_FLOOR) floor = TRUE;
4122 /* Get the item index */
4123 if (repeat_pull(cp))
4126 if (select_the_force && (*cp == INVEN_FORCE))
4128 item_tester_tval = 0;
4129 item_tester_hook = NULL;
4130 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4135 else if (floor && (*cp < 0))
4142 /* Acquire object */
4145 /* Validate the item */
4146 if (item_tester_okay(o_ptr))
4148 /* Forget restrictions */
4149 item_tester_tval = 0;
4150 item_tester_hook = NULL;
4151 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4158 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4159 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4161 if (prev_tag && command_cmd)
4163 /* Look up the tag and validate the item */
4164 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4165 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4166 else if (!get_item_okay(k)) /* Reject */;
4169 /* Accept that choice */
4172 /* Forget restrictions */
4173 item_tester_tval = 0;
4174 item_tester_hook = NULL;
4175 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4181 prev_tag = '\0'; /* prev_tag is no longer effective */
4184 /* Verify the item */
4185 else if (get_item_okay(*cp))
4187 /* Forget restrictions */
4188 item_tester_tval = 0;
4189 item_tester_hook = NULL;
4190 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4198 #endif /* ALLOW_REPEAT */
4201 /* Paranoia XXX XXX XXX */
4208 /* No item selected */
4212 /* Full inventory */
4214 i2 = INVEN_PACK - 1;
4216 /* Forbid inventory */
4217 if (!inven) i2 = -1;
4220 for (j = 0; j < INVEN_PACK; j++)
4221 if (item_tester_okay(&inventory[j])) max_inven++;
4224 /* Restrict inventory indexes */
4225 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4226 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4229 /* Full equipment */
4231 e2 = INVEN_TOTAL - 1;
4233 /* Forbid equipment */
4234 if (!equip) e2 = -1;
4237 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4238 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4239 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4242 /* Restrict equipment indexes */
4243 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4244 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4246 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4250 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4252 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4256 /* Restrict floor usage */
4259 /* Scan all objects in the grid */
4260 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4264 /* Acquire object */
4265 o_ptr = &o_list[this_o_idx];
4267 /* Acquire next object */
4268 next_o_idx = o_ptr->next_o_idx;
4270 /* Accept the item on the floor if legal */
4271 if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
4275 /* Require at least one legal choice */
4276 if (!allow_floor && (i1 > i2) && (e1 > e2))
4278 /* Cancel p_ptr->command_see */
4279 command_see = FALSE;
4287 if (select_the_force) {
4293 /* Analyze choices */
4296 /* Hack -- Start on equipment if requested */
4297 if (command_see && command_wrk && equip)
4302 /* Use inventory if allowed */
4305 command_wrk = FALSE;
4308 /* Use equipment if allowed */
4314 /* Use inventory for floor */
4317 command_wrk = FALSE;
4323 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4325 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4327 /* Hack -- start out in "display" mode */
4335 /* Repeat until done */
4338 int get_item_label = 0;
4345 for (j = 0; j < 8; j++)
4348 if (!angband_term[j]) continue;
4350 /* Count windows displaying inven */
4351 if (window_flag[j] & (PW_INVEN)) ni++;
4353 /* Count windows displaying equip */
4354 if (window_flag[j] & (PW_EQUIP)) ne++;
4357 /* Toggle if needed */
4358 if ((command_wrk && ni && !ne) ||
4359 (!command_wrk && !ni && ne))
4362 toggle_inven_equip();
4369 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4371 /* Redraw windows */
4375 /* Inventory screen */
4378 /* Redraw if needed */
4379 if (command_see) get_item_label = show_inven(menu_line);
4382 /* Equipment screen */
4385 /* Redraw if needed */
4386 if (command_see) get_item_label = show_equip(menu_line);
4389 /* Viewing inventory */
4392 /* Begin the prompt */
4394 sprintf(out_val, "»ý¤Áʪ:");
4396 sprintf(out_val, "Inven:");
4399 /* Some legal items */
4400 if ((i1 <= i2) && !use_menu)
4402 /* Build the prompt */
4404 sprintf(tmp_val, "%c-%c,'(',')',",
4406 sprintf(tmp_val, " %c-%c,'(',')',",
4408 index_to_label(i1), index_to_label(i2));
4411 strcat(out_val, tmp_val);
4414 /* Indicate ability to "view" */
4416 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4418 if (!command_see && !use_menu) strcat(out_val, " * to see,");
4423 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
4425 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
4429 /* Viewing equipment */
4432 /* Begin the prompt */
4434 sprintf(out_val, "ÁõÈ÷ÉÊ:");
4436 sprintf(out_val, "Equip:");
4439 /* Some legal items */
4440 if ((e1 <= e2) && !use_menu)
4442 /* Build the prompt */
4444 sprintf(tmp_val, "%c-%c,'(',')',",
4446 sprintf(tmp_val, " %c-%c,'(',')',",
4448 index_to_label(e1), index_to_label(e2));
4451 strcat(out_val, tmp_val);
4454 /* Indicate ability to "view" */
4456 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4458 if (!command_see) strcat(out_val, " * to see,");
4463 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
4465 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
4469 /* Indicate legality of the "floor" item */
4471 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
4472 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
4474 if (allow_floor) strcat(out_val, " - for floor,");
4475 if (select_the_force) strcat(out_val, " w for the Force,");
4478 /* Finish the prompt */
4479 strcat(out_val, " ESC");
4481 /* Build the prompt */
4482 sprintf(tmp_val, "(%s) %s", out_val, pmt);
4484 /* Show the prompt */
4492 int max_line = (command_wrk ? max_equip : max_inven);
4508 menu_line += (max_line - 1);
4527 /* Verify legality */
4528 if (!inven || !equip)
4534 /* Hack -- Fix screen */
4544 /* Switch inven/equip */
4545 command_wrk = !command_wrk;
4546 max_line = (command_wrk ? max_equip : max_inven);
4547 if (menu_line > max_line) menu_line = max_line;
4549 /* Need to redraw */
4558 if (command_wrk == USE_FLOOR)
4561 (*cp) = -get_item_label;
4565 /* Validate the item */
4566 if (!get_item_okay(get_item_label))
4572 /* Allow player to "refuse" certain actions */
4573 if (!get_item_allow(get_item_label))
4579 /* Accept that choice */
4580 (*cp) = get_item_label;
4589 if (select_the_force) {
4597 if (menu_line > max_line) menu_line -= max_line;
4618 command_see = FALSE;
4638 /* Verify legality */
4639 if (!inven || !equip)
4645 /* Hack -- Fix screen */
4655 /* Switch inven/equip */
4656 command_wrk = !command_wrk;
4658 /* Need to redraw */
4664 /* Use floor item */
4667 /* Scan all objects in the grid */
4668 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4672 /* Acquire object */
4673 o_ptr = &o_list[this_o_idx];
4675 /* Acquire next object */
4676 next_o_idx = o_ptr->next_o_idx;
4678 /* Validate the item */
4679 if (!item_tester_okay(o_ptr)) continue;
4684 /* Verify the item (if required) */
4686 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
4688 if (other_query_flag && !verify("Try", k)) continue;
4692 /* Allow player to "refuse" certain actions */
4693 if (!get_item_allow(k)) continue;
4695 /* Accept that choice */
4712 case '1': case '2': case '3':
4713 case '4': case '5': case '6':
4714 case '7': case '8': case '9':
4716 /* Look up the tag */
4717 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4723 /* Hack -- Validate the item */
4724 if ((k < INVEN_RARM) ? !inven : !equip)
4730 /* Validate the item */
4731 if (!get_item_okay(k))
4737 /* Allow player to "refuse" certain actions */
4738 if (!get_item_allow(k))
4744 /* Accept that choice */
4750 #endif /* ALLOW_REPEAT */
4758 /* Choose "default" inventory item */
4761 k = ((i1 == i2) ? i1 : -1);
4764 /* Choose "default" equipment item */
4767 k = ((e1 == e2) ? e1 : -1);
4770 /* Validate the item */
4771 if (!get_item_okay(k))
4777 /* Allow player to "refuse" certain actions */
4778 if (!get_item_allow(k))
4784 /* Accept that choice */
4794 if (select_the_force) {
4807 bool not_found = FALSE;
4809 /* Look up the alphabetical tag */
4810 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4815 /* Hack -- Validate the item */
4816 else if ((k < INVEN_RARM) ? !inven : !equip)
4821 /* Validate the item */
4822 else if (!get_item_okay(k))
4829 /* Accept that choice */
4835 #endif /* ALLOW_REPEAT */
4839 /* Extract "query" setting */
4840 ver = isupper(which);
4841 which = tolower(which);
4843 /* Convert letter to inventory index */
4846 if (which == '(') k = i1;
4847 else if (which == ')') k = i2;
4848 else k = label_to_inven(which);
4851 /* Convert letter to equipment index */
4854 if (which == '(') k = e1;
4855 else if (which == ')') k = e2;
4856 else k = label_to_equip(which);
4859 /* Validate the item */
4860 if (!get_item_okay(k))
4866 /* Verify the item */
4868 if (ver && !verify("ËÜÅö¤Ë", k))
4870 if (ver && !verify("Try", k))
4878 /* Allow player to "refuse" certain actions */
4879 if (!get_item_allow(k))
4885 /* Accept that choice */
4896 /* Fix the screen if necessary */
4902 /* Hack -- Cancel "display" */
4903 command_see = FALSE;
4907 /* Forget the item_tester_tval restriction */
4908 item_tester_tval = 0;
4910 item_tester_no_ryoute = FALSE;
4912 /* Forget the item_tester_hook restriction */
4913 item_tester_hook = NULL;
4916 /* Clean up 'show choices' */
4917 /* Toggle again if needed */
4918 if (toggle) toggle_inven_equip();
4921 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4927 /* Clear the prompt line */
4930 /* Warning if needed */
4931 if (oops && str) msg_print(str);
4937 if (command_cmd) prev_tag = cur_tag;
4938 #endif /* ALLOW_REPEAT */
4940 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4948 #ifdef ALLOW_EASY_FLOOR
4953 * Return a list of o_list[] indexes of items at the given cave
4954 * location. Valid flags are:
4956 * mode & 0x01 -- Item tester
4957 * mode & 0x02 -- Marked items only
4958 * mode & 0x04 -- Stop after first
4960 int scan_floor(int *items, int y, int x, int mode)
4962 int this_o_idx, next_o_idx;
4967 if (!in_bounds(y, x)) return 0;
4969 /* Scan all objects in the grid */
4970 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
4974 /* Acquire object */
4975 o_ptr = &o_list[this_o_idx];
4977 /* Acquire next object */
4978 next_o_idx = o_ptr->next_o_idx;
4981 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
4984 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
4986 /* Accept this item */
4987 /* XXX Hack -- Enforce limit */
4989 items[num] = this_o_idx;
4994 if (mode & 0x04) break;
5003 * Display a list of the items on the floor at the given location.
5005 int show_floor(int target_item, int y, int x, int *min_width)
5012 char o_name[MAX_NLEN];
5018 char out_desc[23][MAX_NLEN];
5019 int target_item_label = 0;
5021 int floor_list[23], floor_num;
5023 char floor_label[52 + 1];
5025 bool dont_need_to_show_weights = TRUE;
5028 Term_get_size(&wid, &hgt);
5030 /* Default length */
5031 len = MAX((*min_width), 20);
5034 /* Scan for objects in the grid, using item_tester_okay() */
5035 floor_num = scan_floor(floor_list, y, x, 0x03);
5037 /* Display the floor objects */
5038 for (k = 0, i = 0; i < floor_num && i < 23; i++)
5040 o_ptr = &o_list[floor_list[i]];
5042 /* Describe the object */
5043 object_desc(o_name, o_ptr, 0);
5045 /* Save the index */
5048 /* Acquire inventory color */
5049 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
5051 /* Save the object description */
5052 strcpy(out_desc[k], o_name);
5054 /* Find the predicted "line length" */
5055 l = strlen(out_desc[k]) + 5;
5057 /* Be sure to account for the weight */
5058 if (show_weights) l += 9;
5060 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
5062 /* Maintain the maximum length */
5063 if (l > len) len = l;
5065 /* Advance to next "line" */
5069 if (show_weights && dont_need_to_show_weights) len -= 9;
5074 /* Find the column to start in */
5075 col = (len > wid - 4) ? 0 : (wid - len - 1);
5077 prepare_label_string_floor(floor_label, floor_list, floor_num);
5079 /* Output each entry */
5080 for (j = 0; j < k; j++)
5083 i = floor_list[out_index[j]];
5088 /* Clear the line */
5089 prt("", j + 1, col ? col - 2 : col);
5091 if (use_menu && target_item)
5093 if (j == (target_item-1))
5096 strcpy(tmp_val, "¡Õ");
5098 strcpy(tmp_val, "> ");
5100 target_item_label = i;
5102 else strcpy(tmp_val, " ");
5106 /* Prepare an index --(-- */
5107 sprintf(tmp_val, "%c)", floor_label[j]);
5110 /* Clear the line with the (possibly indented) index */
5111 put_str(tmp_val, j + 1, col);
5113 /* Display the entry itself */
5114 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
5116 /* Display the weight if needed */
5117 if (show_weights && (o_ptr->tval != TV_GOLD))
5119 int wgt = o_ptr->weight * o_ptr->number;
5121 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
5123 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
5126 prt(tmp_val, j + 1, wid - 9);
5130 /* Make a "shadow" below the list (only if needed) */
5131 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
5133 return target_item_label;
5137 * This version of get_item() is called by get_item() when
5138 * the easy_floor is on.
5140 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
5142 char n1 = ' ', n2 = ' ', which = ' ';
5144 int j, k, i1, i2, e1, e2;
5151 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
5152 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
5153 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
5155 bool allow_equip = FALSE;
5156 bool allow_inven = FALSE;
5157 bool allow_floor = FALSE;
5159 bool toggle = FALSE;
5164 int floor_num, floor_list[23], floor_top = 0;
5167 extern bool select_the_force;
5169 int menu_line = (use_menu ? 1 : 0);
5175 static char prev_tag = '\0';
5176 char cur_tag = '\0';
5178 /* Get the item index */
5179 if (repeat_pull(cp))
5182 if (select_the_force && (*cp == INVEN_FORCE))
5184 item_tester_tval = 0;
5185 item_tester_hook = NULL;
5186 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5191 else if (floor && (*cp < 0))
5193 if (prev_tag && command_cmd)
5195 /* Scan all objects in the grid */
5196 floor_num = scan_floor(floor_list, py, px, 0x03);
5198 /* Look up the tag */
5199 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
5201 /* Accept that choice */
5202 (*cp) = 0 - floor_list[k];
5204 /* Forget restrictions */
5205 item_tester_tval = 0;
5206 item_tester_hook = NULL;
5207 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5213 prev_tag = '\0'; /* prev_tag is no longer effective */
5216 /* Validate the item */
5217 else if (item_tester_okay(&o_list[0 - (*cp)]))
5219 /* Forget restrictions */
5220 item_tester_tval = 0;
5221 item_tester_hook = NULL;
5222 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5229 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
5230 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
5232 if (prev_tag && command_cmd)
5234 /* Look up the tag and validate the item */
5235 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
5236 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
5237 else if (!get_item_okay(k)) /* Reject */;
5240 /* Accept that choice */
5243 /* Forget restrictions */
5244 item_tester_tval = 0;
5245 item_tester_hook = NULL;
5246 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5252 prev_tag = '\0'; /* prev_tag is no longer effective */
5255 /* Verify the item */
5256 else if (get_item_okay(*cp))
5258 /* Forget restrictions */
5259 item_tester_tval = 0;
5260 item_tester_hook = NULL;
5261 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5269 #endif /* ALLOW_REPEAT */
5272 /* Paranoia XXX XXX XXX */
5279 /* No item selected */
5283 /* Full inventory */
5285 i2 = INVEN_PACK - 1;
5287 /* Forbid inventory */
5288 if (!inven) i2 = -1;
5291 for (j = 0; j < INVEN_PACK; j++)
5292 if (item_tester_okay(&inventory[j])) max_inven++;
5295 /* Restrict inventory indexes */
5296 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
5297 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
5300 /* Full equipment */
5302 e2 = INVEN_TOTAL - 1;
5304 /* Forbid equipment */
5305 if (!equip) e2 = -1;
5308 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
5309 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
5310 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
5313 /* Restrict equipment indexes */
5314 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
5315 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
5317 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
5321 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
5323 else if (p_ptr->hidarite) e1 = INVEN_RARM;
5327 /* Count "okay" floor items */
5330 /* Restrict floor usage */
5333 /* Scan all objects in the grid */
5334 floor_num = scan_floor(floor_list, py, px, 0x03);
5337 /* Accept inventory */
5338 if (i1 <= i2) allow_inven = TRUE;
5340 /* Accept equipment */
5341 if (e1 <= e2) allow_equip = TRUE;
5344 if (floor_num) allow_floor = TRUE;
5346 /* Require at least one legal choice */
5347 if (!allow_inven && !allow_equip && !allow_floor)
5349 /* Cancel p_ptr->command_see */
5350 command_see = FALSE;
5358 if (select_the_force) {
5364 /* Analyze choices */
5367 /* Hack -- Start on equipment if requested */
5368 if (command_see && (command_wrk == (USE_EQUIP))
5371 command_wrk = (USE_EQUIP);
5374 /* Use inventory if allowed */
5375 else if (allow_inven)
5377 command_wrk = (USE_INVEN);
5380 /* Use equipment if allowed */
5381 else if (allow_equip)
5383 command_wrk = (USE_EQUIP);
5386 /* Use floor if allowed */
5387 else if (allow_floor)
5389 command_wrk = (USE_FLOOR);
5394 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
5396 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
5398 /* Hack -- start out in "display" mode */
5405 /* Repeat until done */
5408 int get_item_label = 0;
5415 for (j = 0; j < 8; j++)
5418 if (!angband_term[j]) continue;
5420 /* Count windows displaying inven */
5421 if (window_flag[j] & (PW_INVEN)) ni++;
5423 /* Count windows displaying equip */
5424 if (window_flag[j] & (PW_EQUIP)) ne++;
5427 /* Toggle if needed */
5428 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
5429 (command_wrk == (USE_INVEN) && !ni && ne))
5432 toggle_inven_equip();
5439 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5441 /* Redraw windows */
5444 /* Inventory screen */
5445 if (command_wrk == (USE_INVEN))
5447 /* Extract the legal requests */
5451 /* Redraw if needed */
5452 if (command_see) get_item_label = show_inven(menu_line);
5455 /* Equipment screen */
5456 else if (command_wrk == (USE_EQUIP))
5458 /* Extract the legal requests */
5459 n1 = I2A(e1 - INVEN_RARM);
5460 n2 = I2A(e2 - INVEN_RARM);
5462 /* Redraw if needed */
5463 if (command_see) get_item_label = show_equip(menu_line);
5467 else if (command_wrk == (USE_FLOOR))
5470 k = MIN(floor_top + 23, floor_num) - 1;
5472 /* Extract the legal requests */
5473 n1 = I2A(j - floor_top);
5474 n2 = I2A(k - floor_top);
5476 /* Redraw if needed */
5477 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
5480 /* Viewing inventory */
5481 if (command_wrk == (USE_INVEN))
5483 /* Begin the prompt */
5485 sprintf(out_val, "»ý¤Áʪ:");
5487 sprintf(out_val, "Inven:");
5492 /* Build the prompt */
5494 sprintf(tmp_val, "%c-%c,'(',')',",
5496 sprintf(tmp_val, " %c-%c,'(',')',",
5498 index_to_label(i1), index_to_label(i2));
5501 strcat(out_val, tmp_val);
5504 /* Indicate ability to "view" */
5506 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5508 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5516 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
5517 else if (allow_floor)
5518 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
5520 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5523 strcat(out_val, " / for Equip,");
5524 else if (allow_floor)
5525 strcat(out_val, " 6 for Equip,");
5527 strcat(out_val, " 4 or 6 for Equip,");
5536 strcat(out_val, " '-'¾²¾å,");
5537 else if (allow_equip)
5538 strcat(out_val, " '4' ¾²¾å,");
5540 strcat(out_val, " '4'or'6' ¾²¾å,");
5543 strcat(out_val, " - for floor,");
5544 else if (allow_equip)
5545 strcat(out_val, " 4 for floor,");
5547 strcat(out_val, " 4 or 6 for floor,");
5552 /* Viewing equipment */
5553 else if (command_wrk == (USE_EQUIP))
5555 /* Begin the prompt */
5557 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5559 sprintf(out_val, "Equip:");
5564 /* Build the prompt */
5566 sprintf(tmp_val, "%c-%c,'(',')',",
5568 sprintf(tmp_val, " %c-%c,'(',')',",
5570 index_to_label(e1), index_to_label(e2));
5573 strcat(out_val, tmp_val);
5576 /* Indicate ability to "view" */
5578 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5580 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5588 strcat(out_val, " '/' »ý¤Áʪ,");
5589 else if (allow_floor)
5590 strcat(out_val, " '4' »ý¤Áʪ,");
5592 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5595 strcat(out_val, " / for Inven,");
5596 else if (allow_floor)
5597 strcat(out_val, " 4 for Inven,");
5599 strcat(out_val, " 4 or 6 for Inven,");
5608 strcat(out_val, " '-'¾²¾å,");
5609 else if (allow_inven)
5610 strcat(out_val, " '6' ¾²¾å,");
5612 strcat(out_val, " '4'or'6' ¾²¾å,");
5615 strcat(out_val, " - for floor,");
5616 else if (allow_inven)
5617 strcat(out_val, " 6 for floor,");
5619 strcat(out_val, " 4 or 6 for floor,");
5625 else if (command_wrk == (USE_FLOOR))
5627 /* Begin the prompt */
5629 sprintf(out_val, "¾²¾å:");
5631 sprintf(out_val, "Floor:");
5636 /* Build the prompt */
5638 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5640 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5644 strcat(out_val, tmp_val);
5647 /* Indicate ability to "view" */
5649 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5651 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5656 if (allow_inven && allow_equip)
5659 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5661 strcat(out_val, " 4 for Equip, 6 for Inven,");
5664 else if (allow_inven)
5667 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5669 strcat(out_val, " 4 or 6 for Inven,");
5672 else if (allow_equip)
5675 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5677 strcat(out_val, " 4 or 6 for Equip,");
5682 else if (allow_inven)
5685 strcat(out_val, " '/' »ý¤Áʪ,");
5687 strcat(out_val, " / for Inven,");
5690 else if (allow_equip)
5693 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
5695 strcat(out_val, " / for Equip,");
5700 if (command_see && !use_menu)
5703 strcat(out_val, " Enter ¼¡,");
5705 strcat(out_val, " Enter for scroll down,");
5712 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
5714 if (select_the_force) strcat(out_val, " w for the Force,");
5717 /* Finish the prompt */
5718 strcat(out_val, " ESC");
5720 /* Build the prompt */
5721 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5723 /* Show the prompt */
5732 if (command_wrk == USE_INVEN) max_line = max_inven;
5733 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5734 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5750 menu_line += (max_line - 1);
5766 /* Verify legality */
5767 if (command_wrk == (USE_INVEN))
5769 if (allow_floor) command_wrk = USE_FLOOR;
5770 else if (allow_equip) command_wrk = USE_EQUIP;
5777 else if (command_wrk == (USE_EQUIP))
5779 if (allow_inven) command_wrk = USE_INVEN;
5780 else if (allow_floor) command_wrk = USE_FLOOR;
5787 else if (command_wrk == (USE_FLOOR))
5789 if (allow_equip) command_wrk = USE_EQUIP;
5790 else if (allow_inven) command_wrk = USE_INVEN;
5803 /* Hack -- Fix screen */
5813 /* Switch inven/equip */
5814 if (command_wrk == USE_INVEN) max_line = max_inven;
5815 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5816 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5817 if (menu_line > max_line) menu_line = max_line;
5819 /* Need to redraw */
5827 /* Verify legality */
5828 if (command_wrk == (USE_INVEN))
5830 if (allow_equip) command_wrk = USE_EQUIP;
5831 else if (allow_floor) command_wrk = USE_FLOOR;
5838 else if (command_wrk == (USE_EQUIP))
5840 if (allow_floor) command_wrk = USE_FLOOR;
5841 else if (allow_inven) command_wrk = USE_INVEN;
5848 else if (command_wrk == (USE_FLOOR))
5850 if (allow_inven) command_wrk = USE_INVEN;
5851 else if (allow_equip) command_wrk = USE_EQUIP;
5864 /* Hack -- Fix screen */
5874 /* Switch inven/equip */
5875 if (command_wrk == USE_INVEN) max_line = max_inven;
5876 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5877 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5878 if (menu_line > max_line) menu_line = max_line;
5880 /* Need to redraw */
5889 if (command_wrk == USE_FLOOR)
5892 (*cp) = -get_item_label;
5896 /* Validate the item */
5897 if (!get_item_okay(get_item_label))
5903 /* Allow player to "refuse" certain actions */
5904 if (!get_item_allow(get_item_label))
5910 /* Accept that choice */
5911 (*cp) = get_item_label;
5920 if (select_the_force) {
5928 if (menu_line > max_line) menu_line -= max_line;
5949 command_see = FALSE;
5972 cave_type *c_ptr = &cave[py][px];
5974 if (command_wrk != (USE_FLOOR)) break;
5976 /* Get the object being moved. */
5977 o_idx = c_ptr->o_idx;
5979 /* Only rotate a pile of two or more objects. */
5980 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
5982 /* Remove the first object from the list. */
5983 excise_object_idx(o_idx);
5985 /* Find end of the list. */
5987 while (o_list[i].next_o_idx)
5988 i = o_list[i].next_o_idx;
5990 /* Add after the last object. */
5991 o_list[i].next_o_idx = o_idx;
5993 /* Re-scan floor list */
5994 floor_num = scan_floor(floor_list, py, px, 0x03);
5996 /* Hack -- Fix screen */
6011 if (command_wrk == (USE_INVEN))
6018 command_wrk = (USE_EQUIP);
6020 else if (command_wrk == (USE_EQUIP))
6027 command_wrk = (USE_INVEN);
6029 else if (command_wrk == (USE_FLOOR))
6033 command_wrk = (USE_INVEN);
6035 else if (allow_equip)
6037 command_wrk = (USE_EQUIP);
6046 /* Hack -- Fix screen */
6056 /* Need to redraw */
6069 * If we are already examining the floor, and there
6070 * is only one item, we will always select it.
6071 * If we aren't examining the floor and there is only
6072 * one item, we will select it if floor_query_flag
6077 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
6080 k = 0 - floor_list[0];
6082 /* Allow player to "refuse" certain actions */
6083 if (!get_item_allow(k))
6089 /* Accept that choice */
6098 /* Hack -- Fix screen */
6108 command_wrk = (USE_FLOOR);
6114 case '1': case '2': case '3':
6115 case '4': case '5': case '6':
6116 case '7': case '8': case '9':
6118 if (command_wrk != USE_FLOOR)
6120 /* Look up the tag */
6121 if (!get_tag(&k, which, command_wrk))
6127 /* Hack -- Validate the item */
6128 if ((k < INVEN_RARM) ? !inven : !equip)
6134 /* Validate the item */
6135 if (!get_item_okay(k))
6143 /* Look up the alphabetical tag */
6144 if (get_tag_floor(&k, which, floor_list, floor_num))
6147 k = 0 - floor_list[k];
6156 /* Allow player to "refuse" certain actions */
6157 if (!get_item_allow(k))
6163 /* Accept that choice */
6169 #endif /* ALLOW_REPEAT */
6177 /* Choose "default" inventory item */
6178 if (command_wrk == (USE_INVEN))
6180 k = ((i1 == i2) ? i1 : -1);
6183 /* Choose "default" equipment item */
6184 else if (command_wrk == (USE_EQUIP))
6186 k = ((e1 == e2) ? e1 : -1);
6189 /* Choose "default" floor item */
6190 else if (command_wrk == (USE_FLOOR))
6195 k = 0 - floor_list[0];
6197 /* Allow player to "refuse" certain actions */
6198 if (!get_item_allow(k))
6204 /* Accept that choice */
6212 /* Validate the item */
6213 if (!get_item_okay(k))
6219 /* Allow player to "refuse" certain actions */
6220 if (!get_item_allow(k))
6226 /* Accept that choice */
6236 if (select_the_force) {
6250 if (command_wrk != USE_FLOOR)
6252 bool not_found = FALSE;
6254 /* Look up the alphabetical tag */
6255 if (!get_tag(&k, which, command_wrk))
6260 /* Hack -- Validate the item */
6261 else if ((k < INVEN_RARM) ? !inven : !equip)
6266 /* Validate the item */
6267 else if (!get_item_okay(k))
6274 /* Accept that choice */
6280 #endif /* ALLOW_REPEAT */
6286 /* Look up the alphabetical tag */
6287 if (get_tag_floor(&k, which, floor_list, floor_num))
6290 k = 0 - floor_list[k];
6292 /* Accept that choice */
6298 #endif /* ALLOW_REPEAT */
6303 /* Extract "query" setting */
6304 ver = isupper(which);
6305 which = tolower(which);
6307 /* Convert letter to inventory index */
6308 if (command_wrk == (USE_INVEN))
6310 if (which == '(') k = i1;
6311 else if (which == ')') k = i2;
6312 else k = label_to_inven(which);
6315 /* Convert letter to equipment index */
6316 else if (command_wrk == (USE_EQUIP))
6318 if (which == '(') k = e1;
6319 else if (which == ')') k = e2;
6320 else k = label_to_equip(which);
6323 /* Convert letter to floor index */
6324 else if (command_wrk == USE_FLOOR)
6326 if (which == '(') k = 0;
6327 else if (which == ')') k = floor_num - 1;
6328 else k = islower(which) ? A2I(which) : -1;
6329 if (k < 0 || k >= floor_num || k >= 23)
6336 k = 0 - floor_list[k];
6339 /* Validate the item */
6340 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
6346 /* Verify the item */
6348 if (ver && !verify("ËÜÅö¤Ë", k))
6350 if (ver && !verify("Try", k))
6358 /* Allow player to "refuse" certain actions */
6359 if (!get_item_allow(k))
6365 /* Accept that choice */
6375 /* Fix the screen if necessary */
6381 /* Hack -- Cancel "display" */
6382 command_see = FALSE;
6386 /* Forget the item_tester_tval restriction */
6387 item_tester_tval = 0;
6389 /* Forget the item_tester_hook restriction */
6390 item_tester_hook = NULL;
6393 /* Clean up 'show choices' */
6394 /* Toggle again if needed */
6395 if (toggle) toggle_inven_equip();
6398 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6404 /* Clear the prompt line */
6407 /* Warning if needed */
6408 if (oops && str) msg_print(str);
6414 if (command_cmd) prev_tag = cur_tag;
6415 #endif /* ALLOW_REPEAT */
6417 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
6425 static bool py_pickup_floor_aux(void)
6433 /* Restrict the choices */
6434 item_tester_hook = inven_carry_okay;
6438 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
6439 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
6441 q = "Get which item? ";
6442 s = "You no longer have any room for the objects on the floor.";
6445 if (get_item(&item, q, s, (USE_FLOOR)))
6447 this_o_idx = 0 - item;
6454 /* Pick up the object */
6455 py_pickup_aux(this_o_idx);
6462 * Make the player carry everything in a grid
6464 * If "pickup" is FALSE then only gold will be picked up
6466 * This is called by py_pickup() when easy_floor is TRUE.
6468 void py_pickup_floor(bool pickup)
6470 s16b this_o_idx, next_o_idx = 0;
6472 char o_name[MAX_NLEN];
6475 int floor_num = 0, floor_list[23], floor_o_idx = 0;
6479 /* Scan the pile of objects */
6480 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
6484 /* Access the object */
6485 o_ptr = &o_list[this_o_idx];
6487 /* Describe the object */
6488 object_desc(o_name, o_ptr, 0);
6490 /* Access the next object */
6491 next_o_idx = o_ptr->next_o_idx;
6493 /* Hack -- disturb */
6497 if (o_ptr->tval == TV_GOLD)
6501 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
6502 (long)o_ptr->pval, o_name);
6504 msg_format("You have found %ld gold pieces worth of %s.",
6505 (long) o_ptr->pval, o_name);
6509 /* Collect the gold */
6510 p_ptr->au += o_ptr->pval;
6513 p_ptr->redraw |= (PR_GOLD);
6516 p_ptr->window |= (PW_PLAYER);
6518 /* Delete the gold */
6519 delete_object_idx(this_o_idx);
6521 /* Check the next object */
6524 else if (o_ptr->marked & OM_NOMSG)
6526 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
6527 * ignored. Otherwise, they are included in the prompt. */
6528 o_ptr->marked &= ~(OM_NOMSG);
6532 /* Count non-gold objects that can be picked up. */
6533 if (inven_carry_okay(o_ptr))
6538 /* Remember this object index */
6540 floor_list[floor_num] = this_o_idx;
6542 /* Count non-gold objects */
6545 /* Remember this index */
6546 floor_o_idx = this_o_idx;
6549 /* There are no non-gold objects */
6553 /* Mention the number of objects */
6559 /* Access the object */
6560 o_ptr = &o_list[floor_o_idx];
6562 #ifdef ALLOW_EASY_SENSE
6564 /* Option: Make object sensing easy */
6567 /* Sense the object */
6568 (void) sense_object(o_ptr);
6571 #endif /* ALLOW_EASY_SENSE */
6573 /* Describe the object */
6574 object_desc(o_name, o_ptr, 0);
6578 msg_format("%s¤¬¤¢¤ë¡£", o_name);
6580 msg_format("You see %s.", o_name);
6585 /* Multiple objects */
6590 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
6592 msg_format("You see a pile of %d items.", floor_num);
6601 /* The player has no room for anything on the floor. */
6607 /* Access the object */
6608 o_ptr = &o_list[floor_o_idx];
6610 #ifdef ALLOW_EASY_SENSE
6612 /* Option: Make object sensing easy */
6615 /* Sense the object */
6616 (void) sense_object(o_ptr);
6619 #endif /* ALLOW_EASY_SENSE */
6621 /* Describe the object */
6622 object_desc(o_name, o_ptr, 0);
6626 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6628 msg_format("You have no room for %s.", o_name);
6633 /* Multiple objects */
6638 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6640 msg_print("You have no room for any of the objects on the floor.");
6652 /* Hack -- query every object */
6653 if (carry_query_flag)
6655 char out_val[MAX_NLEN+20];
6657 /* Access the object */
6658 o_ptr = &o_list[floor_o_idx];
6660 #ifdef ALLOW_EASY_SENSE
6662 /* Option: Make object sensing easy */
6665 /* Sense the object */
6666 (void) sense_object(o_ptr);
6669 #endif /* ALLOW_EASY_SENSE */
6671 /* Describe the object */
6672 object_desc(o_name, o_ptr, 0);
6674 /* Build a prompt */
6676 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
6678 (void) sprintf(out_val, "Pick up %s? ", o_name);
6682 /* Ask the user to confirm */
6683 if (!get_check(out_val))
6690 /* Access the object */
6691 o_ptr = &o_list[floor_o_idx];
6693 #ifdef ALLOW_EASY_SENSE
6695 /* Option: Make object sensing easy */
6698 /* Sense the object */
6699 (void) sense_object(o_ptr);
6702 #endif /* ALLOW_EASY_SENSE */
6704 /* Pick up the object */
6705 py_pickup_aux(floor_o_idx);
6708 /* Allow the user to choose an object */
6711 while (can_pickup--)
6713 if (!py_pickup_floor_aux()) break;
6718 #endif /* ALLOW_EASY_FLOOR */