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 static 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)", ""));
357 static cptr item_activation_aux(object_type *o_ptr)
359 static char activation_detail[256];
363 const activation_type* const act_ptr = find_activation_info(o_ptr);
365 if (!act_ptr) return _("̤ÄêµÁ", "something undefined");
367 desc = act_ptr->desc;
369 /* Overwrite description if it is special */
370 switch (act_ptr->index) {
372 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
373 desc = _("²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ", "breath of fire (200) and resist fire");
376 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
377 desc = _("Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ", "breath of cold (200) and resist cold");
380 desc = item_activation_dragon_breath(o_ptr);
383 if (o_ptr->name1 == ART_HYOUSIGI)
384 desc = _("Çï»ÒÌÚ¤òÂǤÁ¤Ê¤é¤¹", "beat wooden clappers");
386 case ACT_RESIST_ACID:
387 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID)) || (o_ptr->name2 == EGO_BRAND_ACID))
388 desc = _("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ", "ball of acid (100) and resist acid");
390 case ACT_RESIST_FIRE:
391 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) || (o_ptr->name2 == EGO_BRAND_FIRE))
392 desc = _("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ", "ball of fire (100) and resist fire");
394 case ACT_RESIST_COLD:
395 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) || (o_ptr->name2 == EGO_BRAND_COLD))
396 desc = _("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ", "ball of cold (100) and resist cold");
398 case ACT_RESIST_ELEC:
399 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC)) || (o_ptr->name2 == EGO_BRAND_ELEC))
400 desc = _("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ", "ball of elec (100) and resist elec");
402 case ACT_RESIST_POIS:
403 if (o_ptr->name2 == EGO_BRAND_POIS)
404 desc = _("°½±À (100) ¤ÈÆǤؤÎÂÑÀ", "ball of poison (100) and resist elec");
408 /* Timeout description */
409 constant = act_ptr->timeout.constant;
410 dice = act_ptr->timeout.dice;
411 if (constant == 0 && dice == 0) {
412 /* We can activate it every turn */
413 strcpy(timeout, _("¤¤¤Ä¤Ç¤â", "every turn"));
414 } else if (constant < 0) {
415 /* Activations that have special timeout */
416 switch (act_ptr->index) {
418 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
419 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250);
422 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
423 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250);
426 strcpy(timeout, _("3*(¥ì¥Ù¥ë+10) ¥¿¡¼¥óËè", "every 3 * (level+10) turns"));
429 strcpy(timeout, _("³ÎΨ50%¤Ç²õ¤ì¤ë", "(destroyed 50%)"));
432 strcpy(timeout, "undefined");
436 /* Normal timeout activations */
437 char constant_str[16], dice_str[16];
438 sprintf(constant_str, "%d", constant);
439 sprintf(dice_str, "d%d", dice);
440 sprintf(timeout, _("%s%s%s ¥¿¡¼¥óËè", "every %s%s%s turns"),
441 (constant > 0) ? constant_str : "",
442 (constant > 0 && dice > 0) ? "+" : "",
443 (dice > 0) ? dice_str : "");
446 /* Build detail activate description */
447 sprintf(activation_detail, _("%s : %s", "%s %s"), desc, timeout);
449 return activation_detail;
453 * Determine the "Activation" (if any) for an artifact
454 * Return a string, or NULL for "no activation"
456 cptr item_activation(object_type *o_ptr)
458 u32b flgs[TR_FLAG_SIZE];
460 /* Extract the flags */
461 object_flags(o_ptr, flgs);
463 /* Require activation ability */
465 if (!(have_flag(flgs, TR_ACTIVATE))) return ("¤Ê¤·");
467 if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
470 /* Get an explain of an activation */
471 if (activation_index(o_ptr))
473 return item_activation_aux(o_ptr);
477 if (o_ptr->tval == TV_WHISTLE)
480 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
482 return "call pet every 100+d100 turns";
486 if (o_ptr->tval == TV_CAPTURE)
489 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
491 return "captures or releases a monster.";
497 return "²¿¤âµ¯¤¤Ê¤¤";
505 * Describe a "fully identified" item
507 bool screen_object(object_type *o_ptr, u32b mode)
511 u32b flgs[TR_FLAG_SIZE];
515 char o_name[MAX_NLEN];
518 int trivial_info = 0;
520 /* Extract the flags */
521 object_flags(o_ptr, flgs);
523 /* Extract the description */
525 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
526 (k_text + k_info[o_ptr->k_idx].text),
527 77 - 15, temp, sizeof(temp));
528 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
529 { info[i] = &temp[j]; i++;}
532 if (object_is_equipment(o_ptr))
534 /* Descriptions of a basic equipment is just a flavor */
538 /* Mega-Hack -- describe activation */
539 if (have_flag(flgs, TR_ACTIVATE))
542 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
544 info[i++] = "It can be activated for...";
547 info[i++] = item_activation(o_ptr);
549 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
551 info[i++] = "...if it is being worn.";
556 /* Figurines, a hack */
557 if (o_ptr->tval == TV_FIGURINE)
560 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
562 info[i++] = "It will transform into a pet when thrown.";
567 /* Figurines, a hack */
568 if (o_ptr->name1 == ART_STONEMASK)
571 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
573 info[i++] = "It makes you turn into a vampire permanently.";
578 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
581 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
583 info[i++] = "It will attempt to kill a monster instantly.";
588 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
591 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
593 info[i++] = "It causes you to strike yourself sometimes.";
597 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
599 info[i++] = "It always penetrates invulnerability barriers.";
603 if (o_ptr->name2 == EGO_2WEAPON)
606 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
608 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
613 if (have_flag(flgs, TR_EASY_SPELL))
616 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
618 info[i++] = "It affects your ability to cast spells.";
622 if (o_ptr->name2 == EGO_AMU_FOOL)
625 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
627 info[i++] = "It interferes with casting spells.";
631 if (o_ptr->name2 == EGO_RING_THROW)
634 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
636 info[i++] = "It provides great strength when you throw an item.";
640 if (o_ptr->name2 == EGO_AMU_NAIVETY)
643 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
645 info[i++] = "It decreases your magic resistance.";
649 if (o_ptr->tval == TV_STATUE)
651 monster_race *r_ptr = &r_info[o_ptr->pval];
653 if (o_ptr->pval == MON_BULLGATES)
655 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
657 info[i++] = "It is shameful.";
659 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
661 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
663 info[i++] = "It is fearful.";
667 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
669 info[i++] = "It is cheerful.";
673 /* Hack -- describe lite's */
674 if (o_ptr->tval == TV_LITE)
676 if (o_ptr->name2 == EGO_LITE_DARKNESS)
679 info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
681 info[i++] = "It provides no light.";
684 if (o_ptr->sval == SV_LITE_FEANOR)
687 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
689 info[i++] = "It decreases radius of light source by 3.";
692 else if (o_ptr->sval == SV_LITE_LANTERN)
695 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
697 info[i++] = "It decreases radius of light source by 2.";
703 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
705 info[i++] = "It decreases radius of light source by 1.";
709 else if (object_is_fixed_artifact(o_ptr))
712 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
714 info[i++] = "It provides light (radius 3) forever.";
718 else if (o_ptr->name2 == EGO_LITE_SHINE)
720 if (o_ptr->sval == SV_LITE_FEANOR)
723 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
725 info[i++] = "It provides light (radius 3) forever.";
729 else if (o_ptr->sval == SV_LITE_LANTERN)
732 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
734 info[i++] = "It provides light (radius 3) when fueled.";
741 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
743 info[i++] = "It provides light (radius 2) when fueled.";
750 if (o_ptr->sval == SV_LITE_FEANOR)
753 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
755 info[i++] = "It provides light (radius 2) forever.";
759 else if (o_ptr->sval == SV_LITE_LANTERN)
762 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
764 info[i++] = "It provides light (radius 2) when fueled.";
771 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
773 info[i++] = "It provides light (radius 1) when fueled.";
778 if (o_ptr->name2 == EGO_LITE_LONG)
781 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
783 info[i++] = "It provides light for much longer time.";
789 /* And then describe it fully */
791 if (have_flag(flgs, TR_RIDING))
793 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
795 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
797 info[i++] = "It is made for use while riding.";
802 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
804 info[i++] = "It is suitable for use while riding.";
806 /* This information is not important enough */
810 if (have_flag(flgs, TR_STR))
813 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
815 info[i++] = "It affects your strength.";
819 if (have_flag(flgs, TR_INT))
822 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
824 info[i++] = "It affects your intelligence.";
828 if (have_flag(flgs, TR_WIS))
831 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
833 info[i++] = "It affects your wisdom.";
837 if (have_flag(flgs, TR_DEX))
840 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
842 info[i++] = "It affects your dexterity.";
846 if (have_flag(flgs, TR_CON))
849 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
851 info[i++] = "It affects your constitution.";
855 if (have_flag(flgs, TR_CHR))
858 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
860 info[i++] = "It affects your charisma.";
865 if (have_flag(flgs, TR_MAGIC_MASTERY))
868 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
870 info[i++] = "It affects your ability to use magic devices.";
874 if (have_flag(flgs, TR_STEALTH))
877 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
879 info[i++] = "It affects your stealth.";
883 if (have_flag(flgs, TR_SEARCH))
886 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
888 info[i++] = "It affects your searching.";
892 if (have_flag(flgs, TR_INFRA))
895 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
897 info[i++] = "It affects your infravision.";
901 if (have_flag(flgs, TR_TUNNEL))
904 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
906 info[i++] = "It affects your ability to tunnel.";
910 if (have_flag(flgs, TR_SPEED))
913 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
915 info[i++] = "It affects your speed.";
919 if (have_flag(flgs, TR_BLOWS))
922 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
924 info[i++] = "It affects your attack speed.";
929 if (have_flag(flgs, TR_BRAND_ACID))
932 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
934 info[i++] = "It does extra damage from acid.";
938 if (have_flag(flgs, TR_BRAND_ELEC))
941 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
943 info[i++] = "It does extra damage from electricity.";
947 if (have_flag(flgs, TR_BRAND_FIRE))
950 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
952 info[i++] = "It does extra damage from fire.";
956 if (have_flag(flgs, TR_BRAND_COLD))
959 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
961 info[i++] = "It does extra damage from frost.";
966 if (have_flag(flgs, TR_BRAND_POIS))
969 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
971 info[i++] = "It poisons your foes.";
976 if (have_flag(flgs, TR_CHAOTIC))
979 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
981 info[i++] = "It produces chaotic effects.";
986 if (have_flag(flgs, TR_VAMPIRIC))
989 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
991 info[i++] = "It drains life from your foes.";
996 if (have_flag(flgs, TR_IMPACT))
999 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
1001 info[i++] = "It can cause earthquakes.";
1006 if (have_flag(flgs, TR_VORPAL))
1009 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1011 info[i++] = "It is very sharp and can cut your foes.";
1016 if (have_flag(flgs, TR_KILL_DRAGON))
1019 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1021 info[i++] = "It is a great bane of dragons.";
1025 else if (have_flag(flgs, TR_SLAY_DRAGON))
1028 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1030 info[i++] = "It is especially deadly against dragons.";
1035 if (have_flag(flgs, TR_KILL_ORC))
1038 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1040 info[i++] = "It is a great bane of orcs.";
1044 if (have_flag(flgs, TR_SLAY_ORC))
1047 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1049 info[i++] = "It is especially deadly against orcs.";
1054 if (have_flag(flgs, TR_KILL_TROLL))
1057 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1059 info[i++] = "It is a great bane of trolls.";
1063 if (have_flag(flgs, TR_SLAY_TROLL))
1066 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1068 info[i++] = "It is especially deadly against trolls.";
1073 if (have_flag(flgs, TR_KILL_GIANT))
1076 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1078 info[i++] = "It is a great bane of giants.";
1081 else if (have_flag(flgs, TR_SLAY_GIANT))
1084 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1086 info[i++] = "It is especially deadly against giants.";
1091 if (have_flag(flgs, TR_KILL_DEMON))
1094 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1096 info[i++] = "It is a great bane of demons.";
1100 if (have_flag(flgs, TR_SLAY_DEMON))
1103 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1105 info[i++] = "It strikes at demons with holy wrath.";
1110 if (have_flag(flgs, TR_KILL_UNDEAD))
1113 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1115 info[i++] = "It is a great bane of undead.";
1119 if (have_flag(flgs, TR_SLAY_UNDEAD))
1122 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1124 info[i++] = "It strikes at undead with holy wrath.";
1129 if (have_flag(flgs, TR_KILL_EVIL))
1132 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1134 info[i++] = "It is a great bane of evil monsters.";
1138 if (have_flag(flgs, TR_SLAY_EVIL))
1141 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1143 info[i++] = "It fights against evil with holy fury.";
1148 if (have_flag(flgs, TR_KILL_ANIMAL))
1151 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1153 info[i++] = "It is a great bane of natural creatures.";
1157 if (have_flag(flgs, TR_SLAY_ANIMAL))
1160 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1162 info[i++] = "It is especially deadly against natural creatures.";
1167 if (have_flag(flgs, TR_KILL_HUMAN))
1170 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1172 info[i++] = "It is a great bane of humans.";
1176 if (have_flag(flgs, TR_SLAY_HUMAN))
1179 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1181 info[i++] = "It is especially deadly against humans.";
1186 if (have_flag(flgs, TR_FORCE_WEAPON))
1189 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
1191 info[i++] = "It powerfully strikes at a monster using your mana.";
1195 if (have_flag(flgs, TR_DEC_MANA))
1198 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
1200 info[i++] = "It decreases your mana consumption.";
1204 if (have_flag(flgs, TR_SUST_STR))
1207 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
1209 info[i++] = "It sustains your strength.";
1213 if (have_flag(flgs, TR_SUST_INT))
1216 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
1218 info[i++] = "It sustains your intelligence.";
1222 if (have_flag(flgs, TR_SUST_WIS))
1225 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
1227 info[i++] = "It sustains your wisdom.";
1231 if (have_flag(flgs, TR_SUST_DEX))
1234 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
1236 info[i++] = "It sustains your dexterity.";
1240 if (have_flag(flgs, TR_SUST_CON))
1243 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
1245 info[i++] = "It sustains your constitution.";
1249 if (have_flag(flgs, TR_SUST_CHR))
1252 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
1254 info[i++] = "It sustains your charisma.";
1259 if (have_flag(flgs, TR_IM_ACID))
1262 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1264 info[i++] = "It provides immunity to acid.";
1268 if (have_flag(flgs, TR_IM_ELEC))
1271 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1273 info[i++] = "It provides immunity to electricity.";
1277 if (have_flag(flgs, TR_IM_FIRE))
1280 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1282 info[i++] = "It provides immunity to fire.";
1286 if (have_flag(flgs, TR_IM_COLD))
1289 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1291 info[i++] = "It provides immunity to cold.";
1296 if (have_flag(flgs, TR_THROW))
1299 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1301 info[i++] = "It is perfectly balanced for throwing.";
1305 if (have_flag(flgs, TR_FREE_ACT))
1308 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1310 info[i++] = "It provides immunity to paralysis.";
1314 if (have_flag(flgs, TR_HOLD_LIFE))
1317 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
1319 info[i++] = "It provides resistance to life draining.";
1323 if (have_flag(flgs, TR_RES_FEAR))
1326 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1328 info[i++] = "It makes you completely fearless.";
1332 if (have_flag(flgs, TR_RES_ACID))
1335 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1337 info[i++] = "It provides resistance to acid.";
1341 if (have_flag(flgs, TR_RES_ELEC))
1344 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1346 info[i++] = "It provides resistance to electricity.";
1350 if (have_flag(flgs, TR_RES_FIRE))
1353 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1355 info[i++] = "It provides resistance to fire.";
1359 if (have_flag(flgs, TR_RES_COLD))
1362 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1364 info[i++] = "It provides resistance to cold.";
1368 if (have_flag(flgs, TR_RES_POIS))
1371 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1373 info[i++] = "It provides resistance to poison.";
1378 if (have_flag(flgs, TR_RES_LITE))
1381 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1383 info[i++] = "It provides resistance to light.";
1387 if (have_flag(flgs, TR_RES_DARK))
1390 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1392 info[i++] = "It provides resistance to dark.";
1397 if (have_flag(flgs, TR_RES_BLIND))
1400 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1402 info[i++] = "It provides resistance to blindness.";
1406 if (have_flag(flgs, TR_RES_CONF))
1409 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1411 info[i++] = "It provides resistance to confusion.";
1415 if (have_flag(flgs, TR_RES_SOUND))
1418 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1420 info[i++] = "It provides resistance to sound.";
1424 if (have_flag(flgs, TR_RES_SHARDS))
1427 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1429 info[i++] = "It provides resistance to shards.";
1434 if (have_flag(flgs, TR_RES_NETHER))
1437 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1439 info[i++] = "It provides resistance to nether.";
1443 if (have_flag(flgs, TR_RES_NEXUS))
1446 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1448 info[i++] = "It provides resistance to nexus.";
1452 if (have_flag(flgs, TR_RES_CHAOS))
1455 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1457 info[i++] = "It provides resistance to chaos.";
1461 if (have_flag(flgs, TR_RES_DISEN))
1464 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1466 info[i++] = "It provides resistance to disenchantment.";
1471 if (have_flag(flgs, TR_LEVITATION))
1474 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1476 info[i++] = "It allows you to levitate.";
1480 if (have_flag(flgs, TR_LITE))
1482 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
1484 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1486 info[i++] = "It decreases radius of your light source by 1.";
1490 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
1492 info[i++] = "It provides permanent light. (radius +1)";
1496 if (have_flag(flgs, TR_SEE_INVIS))
1499 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1501 info[i++] = "It allows you to see invisible monsters.";
1505 if (have_flag(flgs, TR_TELEPATHY))
1508 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
1510 info[i++] = "It gives telepathic powers.";
1514 if (have_flag(flgs, TR_ESP_ANIMAL))
1517 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
1519 info[i++] = "It senses natural creatures.";
1523 if (have_flag(flgs, TR_ESP_UNDEAD))
1526 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
1528 info[i++] = "It senses undead.";
1532 if (have_flag(flgs, TR_ESP_DEMON))
1535 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò´¶ÃΤ¹¤ë¡£";
1537 info[i++] = "It senses demons.";
1541 if (have_flag(flgs, TR_ESP_ORC))
1544 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
1546 info[i++] = "It senses orcs.";
1550 if (have_flag(flgs, TR_ESP_TROLL))
1553 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
1555 info[i++] = "It senses trolls.";
1559 if (have_flag(flgs, TR_ESP_GIANT))
1562 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
1564 info[i++] = "It senses giants.";
1568 if (have_flag(flgs, TR_ESP_DRAGON))
1571 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
1573 info[i++] = "It senses dragons.";
1577 if (have_flag(flgs, TR_ESP_HUMAN))
1580 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
1582 info[i++] = "It senses humans.";
1586 if (have_flag(flgs, TR_ESP_EVIL))
1589 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
1591 info[i++] = "It senses evil creatures.";
1595 if (have_flag(flgs, TR_ESP_GOOD))
1598 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
1600 info[i++] = "It senses good creatures.";
1604 if (have_flag(flgs, TR_ESP_NONLIVING))
1607 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
1609 info[i++] = "It senses non-living creatures.";
1613 if (have_flag(flgs, TR_ESP_UNIQUE))
1616 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
1618 info[i++] = "It senses unique monsters.";
1622 if (have_flag(flgs, TR_SLOW_DIGEST))
1625 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
1627 info[i++] = "It slows your metabolism.";
1631 if (have_flag(flgs, TR_REGEN))
1634 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
1636 info[i++] = "It speeds your regenerative powers.";
1640 if (have_flag(flgs, TR_WARNING))
1643 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
1645 info[i++] = "It warns you of danger";
1649 if (have_flag(flgs, TR_REFLECT))
1652 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
1654 info[i++] = "It reflects bolts and arrows.";
1658 if (have_flag(flgs, TR_SH_FIRE))
1661 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1663 info[i++] = "It produces a fiery sheath.";
1667 if (have_flag(flgs, TR_SH_ELEC))
1670 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1672 info[i++] = "It produces an electric sheath.";
1676 if (have_flag(flgs, TR_SH_COLD))
1679 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1681 info[i++] = "It produces a sheath of coldness.";
1685 if (have_flag(flgs, TR_NO_MAGIC))
1688 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1690 info[i++] = "It produces an anti-magic shell.";
1694 if (have_flag(flgs, TR_NO_TELE))
1697 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
1699 info[i++] = "It prevents teleportation.";
1703 if (have_flag(flgs, TR_XTRA_MIGHT))
1706 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1708 info[i++] = "It fires missiles with extra might.";
1712 if (have_flag(flgs, TR_XTRA_SHOTS))
1715 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1717 info[i++] = "It fires missiles excessively fast.";
1722 if (have_flag(flgs, TR_BLESSED))
1725 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
1727 info[i++] = "It has been blessed by the gods.";
1732 if (object_is_cursed(o_ptr))
1734 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
1737 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1739 info[i++] = "It is permanently cursed.";
1743 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
1746 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1748 info[i++] = "It is heavily cursed.";
1755 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
1757 info[i++] = "It is cursed.";
1761 * It's a trivial infomation since there is
1762 * fake inscription {cursed}
1768 if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
1770 info[i++] = _("¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£", "It carries an ancient foul curse.");
1772 if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
1774 info[i++] = _("¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£", "It aggravates nearby creatures.");
1776 if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
1778 info[i++] = _("¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£", "It drains experience.");
1780 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
1782 info[i++] = _("¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£", "It slows your regenerative powers.");
1784 if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
1786 info[i++] = _("¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£","It adds weak curses.");
1788 if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
1790 info[i++] = _("¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£","It adds heavy curses.");
1792 if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
1794 info[i++] = _("¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts animals.");
1796 if (o_ptr->curse_flags & TRC_CALL_DEMON)
1798 info[i++] = _("¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts demons.");
1800 if (o_ptr->curse_flags & TRC_CALL_DRAGON)
1802 info[i++] = _("¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts dragons.");
1804 if (o_ptr->curse_flags & TRC_COWARDICE)
1806 info[i++] = _("¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£", "It makes you subject to cowardice.");
1808 if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
1810 info[i++] = _("¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£", "It induces random teleportation.");
1812 if (o_ptr->curse_flags & TRC_LOW_MELEE)
1814 info[i++] = _("¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£", "It causes you to miss blows.");
1816 if (o_ptr->curse_flags & TRC_LOW_AC)
1818 info[i++] = _("¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£", "It helps your enemies' blows.");
1820 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
1822 info[i++] = _("¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£", "It encumbers you while spellcasting.");
1824 if (o_ptr->curse_flags & TRC_FAST_DIGEST)
1826 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£", "It speeds your metabolism.");
1828 if ((have_flag(flgs, TR_DRAIN_HP)) || (o_ptr->curse_flags & TRC_DRAIN_HP))
1830 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£", "It drains you.");
1832 if ((have_flag(flgs, TR_DRAIN_MANA)) || (o_ptr->curse_flags & TRC_DRAIN_MANA))
1834 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£", "It drains your mana.");
1837 /* Describe about this kind of object instead of THIS fake object */
1838 if (mode & SCROBJ_FAKE_OBJECT)
1840 switch (o_ptr->tval)
1843 switch (o_ptr->sval)
1845 case SV_RING_LORDLY:
1847 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1849 info[i++] = "It provides some random resistances.";
1852 case SV_RING_WARNING:
1854 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1856 info[i++] = "It may provide a low rank ESP.";
1863 switch (o_ptr->sval)
1865 case SV_AMULET_RESISTANCE:
1867 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1869 info[i++] = "It may provides resistance to poison.";
1872 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1874 info[i++] = "It may provide a random resistances.";
1877 case SV_AMULET_THE_MAGI:
1879 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
1881 info[i++] = "It provides up to three low rank ESPs.";
1889 if (have_flag(flgs, TR_IGNORE_ACID) &&
1890 have_flag(flgs, TR_IGNORE_ELEC) &&
1891 have_flag(flgs, TR_IGNORE_FIRE) &&
1892 have_flag(flgs, TR_IGNORE_COLD))
1895 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1897 info[i++] = "It cannot be harmed by the elements.";
1902 if (have_flag(flgs, TR_IGNORE_ACID))
1905 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1907 info[i++] = "It cannot be harmed by acid.";
1910 if (have_flag(flgs, TR_IGNORE_ELEC))
1913 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1915 info[i++] = "It cannot be harmed by electricity.";
1918 if (have_flag(flgs, TR_IGNORE_FIRE))
1921 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1923 info[i++] = "It cannot be harmed by fire.";
1926 if (have_flag(flgs, TR_IGNORE_COLD))
1929 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1931 info[i++] = "It cannot be harmed by cold.";
1936 if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
1938 /* No relevant informations */
1939 if (i <= trivial_info) return (FALSE);
1941 /* Save the screen */
1945 Term_get_size(&wid, &hgt);
1947 /* Display Item name */
1948 if (!(mode & SCROBJ_FAKE_OBJECT))
1949 object_desc(o_name, o_ptr, 0);
1951 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
1955 /* Erase the screen */
1956 for (k = 1; k < hgt; k++) prt("", k, 13);
1958 /* Label the information */
1959 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
1961 monster_race *r_ptr = &r_info[o_ptr->pval];
1962 int namelen = strlen(r_name + r_ptr->name);
1963 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
1964 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
1965 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
1969 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
1971 prt(" Item Attributes:", 1, 15);
1974 /* We will print on top of the map (column 13) */
1975 for (k = 2, j = 0; j < i; j++)
1978 prt(info[j], k++, 15);
1980 /* Every 20 entries (lines 2 to 21), start over */
1981 if ((k == hgt - 2) && (j+1 < i))
1984 prt("-- ³¤¯ --", k, 15);
1986 prt("-- more --", k, 15);
1989 for (; k > 2; k--) prt("", k, 15);
1995 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
1997 prt("[Press any key to continue]", k, 15);
2002 /* Restore the screen */
2005 /* Gave knowledge */
2012 * Convert an inventory index into a one character label
2013 * Note that the label does NOT distinguish inven/equip.
2015 char index_to_label(int i)
2017 /* Indexes for "inven" are easy */
2018 if (i < INVEN_RARM) return (I2A(i));
2020 /* Indexes for "equip" are offset */
2021 return (I2A(i - INVEN_RARM));
2026 * Convert a label into the index of an item in the "inven"
2027 * Return "-1" if the label does not indicate a real item
2029 s16b label_to_inven(int c)
2034 i = (islower(c) ? A2I(c) : -1);
2036 /* Verify the index */
2037 if ((i < 0) || (i > INVEN_PACK)) return (-1);
2039 /* Empty slots can never be chosen */
2040 if (!inventory[i].k_idx) return (-1);
2042 /* Return the index */
2048 extern bool select_ring_slot;
2051 static bool is_ring_slot(int i)
2053 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
2058 * Convert a label into the index of a item in the "equip"
2059 * Return "-1" if the label does not indicate a real item
2061 s16b label_to_equip(int c)
2066 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
2068 /* Verify the index */
2069 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
2071 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
2073 /* Empty slots can never be chosen */
2074 if (!inventory[i].k_idx) return (-1);
2076 /* Return the index */
2083 * Determine which equipment slot (if any) an item likes
2085 s16b wield_slot(object_type *o_ptr)
2087 /* Slot for equipment */
2088 switch (o_ptr->tval)
2095 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
2096 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
2097 return (INVEN_LARM);
2104 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
2105 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
2106 return (INVEN_RARM);
2116 /* Use the right hand first */
2117 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
2119 /* Use the left hand for swapping (by default) */
2120 return (INVEN_LEFT);
2126 return (INVEN_NECK);
2131 return (INVEN_LITE);
2138 return (INVEN_BODY);
2143 return (INVEN_OUTER);
2149 return (INVEN_HEAD);
2154 return (INVEN_HANDS);
2159 return (INVEN_FEET);
2163 /* No slot available */
2169 * Return a string mentioning how a given item is carried
2171 cptr mention_use(int i)
2175 /* Examine the location */
2179 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
2181 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
2185 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " ξ¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
2187 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
2191 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
2193 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
2197 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
2199 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
2203 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
2205 case INVEN_LEFT: p = (left_hander ? "On right hand" : "On left hand"); break;
2209 case INVEN_NECK: p = " ¼ó"; break;
2211 case INVEN_NECK: p = "Around neck"; break;
2215 case INVEN_LITE: p = " ¸÷¸»"; break;
2217 case INVEN_LITE: p = "Light source"; break;
2221 case INVEN_BODY: p = " ÂÎ"; break;
2223 case INVEN_BODY: p = "On body"; break;
2227 case INVEN_OUTER: p = "ÂΤξå"; break;
2229 case INVEN_OUTER: p = "About body"; break;
2233 case INVEN_HEAD: p = " Ƭ"; break;
2235 case INVEN_HEAD: p = "On head"; break;
2239 case INVEN_HANDS: p = " ¼ê"; break;
2241 case INVEN_HANDS: p = "On hands"; break;
2245 case INVEN_FEET: p = " "; break;
2247 case INVEN_FEET: p = "On feet"; break;
2251 default: p = "¥¶¥Ã¥¯"; break;
2253 default: p = "In pack"; break;
2257 /* Return the result */
2263 * Return a string describing how a given item is being worn.
2264 * Currently, only used for items in the equipment, not inventory.
2266 cptr describe_use(int i)
2273 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2275 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
2279 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2281 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
2285 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
2287 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
2291 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2293 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
2297 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2299 case INVEN_LEFT: p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
2303 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
2305 case INVEN_NECK: p = "wearing around your neck"; break;
2309 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
2311 case INVEN_LITE: p = "using to light the way"; break;
2315 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
2317 case INVEN_BODY: p = "wearing on your body"; break;
2321 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
2323 case INVEN_OUTER: p = "wearing on your back"; break;
2327 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
2329 case INVEN_HEAD: p = "wearing on your head"; break;
2333 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
2335 case INVEN_HANDS: p = "wearing on your hands"; break;
2339 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
2341 case INVEN_FEET: p = "wearing on your feet"; break;
2345 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
2347 default: p = "carrying in your pack"; break;
2351 /* Return the result */
2356 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
2358 bool check_book_realm(const byte book_tval, const byte book_sval)
2360 if (book_tval < TV_LIFE_BOOK) return FALSE;
2361 if (p_ptr->pclass == CLASS_SORCERER)
2363 return is_magic(tval2realm(book_tval));
2365 else if (p_ptr->pclass == CLASS_RED_MAGE)
2367 if (is_magic(tval2realm(book_tval)))
2368 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
2370 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
2375 * Check an item against the item tester info
2377 bool item_tester_okay(object_type *o_ptr)
2379 /* Hack -- allow listing empty slots */
2380 if (item_tester_full) return (TRUE);
2382 /* Require an item */
2383 if (!o_ptr->k_idx) return (FALSE);
2385 /* Hack -- ignore "gold" */
2386 if (o_ptr->tval == TV_GOLD)
2389 extern bool show_gold_on_floor;
2391 if (!show_gold_on_floor) return (FALSE);
2394 /* Check the tval */
2395 if (item_tester_tval)
2397 /* Is it a spellbook? If so, we need a hack -- TY */
2398 if ((item_tester_tval <= TV_DEATH_BOOK) &&
2399 (item_tester_tval >= TV_LIFE_BOOK))
2400 return check_book_realm(o_ptr->tval, o_ptr->sval);
2402 if (item_tester_tval != o_ptr->tval) return (FALSE);
2405 /* Check the hook */
2406 if (item_tester_hook)
2408 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
2419 * Choice window "shadow" of the "show_inven()" function
2421 void display_inven(void)
2423 register int i, n, z = 0;
2425 byte attr = TERM_WHITE;
2427 char o_name[MAX_NLEN];
2431 Term_get_size(&wid, &hgt);
2433 /* Find the "final" slot */
2434 for (i = 0; i < INVEN_PACK; i++)
2436 o_ptr = &inventory[i];
2438 /* Skip non-objects */
2439 if (!o_ptr->k_idx) continue;
2445 /* Display the pack */
2446 for (i = 0; i < z; i++)
2448 /* Examine the item */
2449 o_ptr = &inventory[i];
2451 /* Start with an empty "index" */
2452 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2454 /* Is this item "acceptable"? */
2455 if (item_tester_okay(o_ptr))
2457 /* Prepare an "index" */
2458 tmp_val[0] = index_to_label(i);
2460 /* Bracket the "index" --(-- */
2464 /* Display the index (or blank space) */
2465 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
2467 /* Obtain an item description */
2468 object_desc(o_name, o_ptr, 0);
2470 /* Obtain the length of the description */
2474 attr = tval_to_attr[o_ptr->tval % 128];
2476 /* Grey out charging items */
2482 /* Display the entry itself */
2483 Term_putstr(3, i, n, attr, o_name);
2485 /* Erase the rest of the line */
2486 Term_erase(3+n, i, 255);
2488 /* Display the weight if needed */
2491 int wgt = o_ptr->weight * o_ptr->number;
2493 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
2495 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2498 prt(tmp_val, i, wid - 9);
2502 /* Erase the rest of the window */
2503 for (i = z; i < hgt; i++)
2505 /* Erase the line */
2506 Term_erase(0, i, 255);
2513 * Choice window "shadow" of the "show_equip()" function
2515 void display_equip(void)
2519 byte attr = TERM_WHITE;
2521 char o_name[MAX_NLEN];
2525 Term_get_size(&wid, &hgt);
2527 /* Display the equipment */
2528 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2530 /* Examine the item */
2531 o_ptr = &inventory[i];
2533 /* Start with an empty "index" */
2534 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2536 /* Is this item "acceptable"? */
2537 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
2539 /* Prepare an "index" */
2540 tmp_val[0] = index_to_label(i);
2542 /* Bracket the "index" --(-- */
2546 /* Display the index (or blank space) */
2547 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
2549 /* Obtain an item description */
2550 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
2553 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
2555 strcpy(o_name, "(wielding with two-hands)");
2561 object_desc(o_name, o_ptr, 0);
2562 attr = tval_to_attr[o_ptr->tval % 128];
2565 /* Obtain the length of the description */
2568 /* Grey out charging items */
2574 /* Display the entry itself */
2575 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
2577 /* Erase the rest of the line */
2578 Term_erase(3+n, i - INVEN_RARM, 255);
2580 /* Display the weight (if needed) */
2583 int wgt = o_ptr->weight * o_ptr->number;
2585 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
2587 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2590 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
2593 /* Display the slot description (if needed) */
2596 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
2597 prt(mention_use(i), i - INVEN_RARM, wid - 15);
2601 /* Erase the rest of the window */
2602 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
2604 /* Clear that line */
2605 Term_erase(0, i, 255);
2611 * Find the "first" inventory object with the given "tag".
2613 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2614 * inscription of an object. Alphabetical characters don't work as a
2617 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2618 * and "x" is the "current" command_cmd code.
2620 static bool get_tag(int *cp, char tag, int mode)
2625 /* Extract index from mode */
2630 end = INVEN_TOTAL - 1;
2635 end = INVEN_PACK - 1;
2642 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2644 /* Check every inventory object */
2645 for (i = start; i <= end; i++)
2647 object_type *o_ptr = &inventory[i];
2649 /* Skip non-objects */
2650 if (!o_ptr->k_idx) continue;
2652 /* Skip empty inscriptions */
2653 if (!o_ptr->inscription) continue;
2655 /* Skip non-choice */
2656 if (!item_tester_okay(o_ptr)) continue;
2659 s = my_strchr(quark_str(o_ptr->inscription), '@');
2661 /* Process all tags */
2664 /* Check the special tags */
2665 if ((s[1] == command_cmd) && (s[2] == tag))
2667 /* Save the actual inventory ID */
2674 /* Find another '@' */
2675 s = my_strchr(s + 1, '@');
2680 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2682 /* Don't allow {@#} with '#' being alphabet */
2683 if (tag < '0' || '9' < tag)
2689 /* Check every object */
2690 for (i = start; i <= end; i++)
2692 object_type *o_ptr = &inventory[i];
2694 /* Skip non-objects */
2695 if (!o_ptr->k_idx) continue;
2697 /* Skip empty inscriptions */
2698 if (!o_ptr->inscription) continue;
2700 /* Skip non-choice */
2701 if (!item_tester_okay(o_ptr)) continue;
2704 s = my_strchr(quark_str(o_ptr->inscription), '@');
2706 /* Process all tags */
2709 /* Check the normal tags */
2712 /* Save the actual inventory ID */
2719 /* Find another '@' */
2720 s = my_strchr(s + 1, '@');
2730 * Find the "first" floor object with the given "tag".
2732 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2733 * inscription of an object. Alphabetical characters don't work as a
2736 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2737 * and "x" is the "current" command_cmd code.
2739 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
2744 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2746 /* Check every object in the grid */
2747 for (i = 0; i < floor_num && i < 23; i++)
2749 object_type *o_ptr = &o_list[floor_list[i]];
2751 /* Skip empty inscriptions */
2752 if (!o_ptr->inscription) continue;
2755 s = my_strchr(quark_str(o_ptr->inscription), '@');
2757 /* Process all tags */
2760 /* Check the special tags */
2761 if ((s[1] == command_cmd) && (s[2] == tag))
2763 /* Save the actual floor object ID */
2770 /* Find another '@' */
2771 s = my_strchr(s + 1, '@');
2776 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2778 /* Don't allow {@#} with '#' being alphabet */
2779 if (tag < '0' || '9' < tag)
2785 /* Check every object in the grid */
2786 for (i = 0; i < floor_num && i < 23; i++)
2788 object_type *o_ptr = &o_list[floor_list[i]];
2790 /* Skip empty inscriptions */
2791 if (!o_ptr->inscription) continue;
2794 s = my_strchr(quark_str(o_ptr->inscription), '@');
2796 /* Process all tags */
2799 /* Check the normal tags */
2802 /* Save the floor object ID */
2809 /* Find another '@' */
2810 s = my_strchr(s + 1, '@');
2820 * Move around label characters with correspond tags
2822 static void prepare_label_string(char *label, int mode)
2824 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2825 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
2828 /* Prepare normal labels */
2829 strcpy(label, alphabet_chars);
2831 /* Move each label */
2832 for (i = 0; i < 52; i++)
2835 char c = alphabet_chars[i];
2837 /* Find a tag with this label */
2838 if (get_tag(&index, c, mode))
2840 /* Delete the overwritten label */
2841 if (label[i] == c) label[i] = ' ';
2843 /* Move the label to the place of corresponding tag */
2844 label[index - offset] = c;
2851 * Move around label characters with correspond tags (floor version)
2853 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
2855 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2858 /* Prepare normal labels */
2859 strcpy(label, alphabet_chars);
2861 /* Move each label */
2862 for (i = 0; i < 52; i++)
2865 char c = alphabet_chars[i];
2867 /* Find a tag with this label */
2868 if (get_tag_floor(&index, c, floor_list, floor_num))
2870 /* Delete the overwritten label */
2871 if (label[i] == c) label[i] = ' ';
2873 /* Move the label to the place of corresponding tag */
2881 * Display the inventory.
2883 * Hack -- do not display "trailing" empty slots
2885 int show_inven(int target_item)
2887 int i, j, k, l, z = 0;
2888 int col, cur_col, len;
2890 char o_name[MAX_NLEN];
2894 char out_desc[23][MAX_NLEN];
2895 int target_item_label = 0;
2897 char inven_label[52 + 1];
2899 /* Starting column */
2903 Term_get_size(&wid, &hgt);
2905 /* Default "max-length" */
2906 len = wid - col - 1;
2909 /* Find the "final" slot */
2910 for (i = 0; i < INVEN_PACK; i++)
2912 o_ptr = &inventory[i];
2914 /* Skip non-objects */
2915 if (!o_ptr->k_idx) continue;
2921 prepare_label_string(inven_label, USE_INVEN);
2923 /* Display the inventory */
2924 for (k = 0, i = 0; i < z; i++)
2926 o_ptr = &inventory[i];
2928 /* Is this item acceptable? */
2929 if (!item_tester_okay(o_ptr)) continue;
2931 /* Describe the object */
2932 object_desc(o_name, o_ptr, 0);
2934 /* Save the object index, color, and description */
2936 out_color[k] = tval_to_attr[o_ptr->tval % 128];
2938 /* Grey out charging items */
2941 out_color[k] = TERM_L_DARK;
2944 (void)strcpy(out_desc[k], o_name);
2946 /* Find the predicted "line length" */
2947 l = strlen(out_desc[k]) + 5;
2949 /* Be sure to account for the weight */
2950 if (show_weights) l += 9;
2952 /* Account for icon if displayed */
2953 if (show_item_graph)
2956 if (use_bigtile) l++;
2959 /* Maintain the maximum length */
2960 if (l > len) len = l;
2962 /* Advance to next "line" */
2966 /* Find the column to start in */
2967 col = (len > wid - 4) ? 0 : (wid - len - 1);
2969 /* Output each entry */
2970 for (j = 0; j < k; j++)
2976 o_ptr = &inventory[i];
2978 /* Clear the line */
2979 prt("", j + 1, col ? col - 2 : col);
2981 if (use_menu && target_item)
2983 if (j == (target_item-1))
2986 strcpy(tmp_val, "¡Õ");
2988 strcpy(tmp_val, "> ");
2990 target_item_label = i;
2992 else strcpy(tmp_val, " ");
2994 else if (i <= INVEN_PACK)
2996 /* Prepare an index --(-- */
2997 sprintf(tmp_val, "%c)", inven_label[i]);
3001 /* Prepare an index --(-- */
3002 sprintf(tmp_val, "%c)", index_to_label(i));
3005 /* Clear the line with the (possibly indented) index */
3006 put_str(tmp_val, j + 1, col);
3010 /* Display graphics for object, if desired */
3011 if (show_item_graph)
3013 byte a = object_attr(o_ptr);
3014 char c = object_char(o_ptr);
3017 if (a & 0x80) a |= 0x40;
3020 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3021 if (use_bigtile) cur_col++;
3027 /* Display the entry itself */
3028 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3030 /* Display the weight if needed */
3033 int wgt = o_ptr->weight * o_ptr->number;
3035 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3037 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3040 prt(tmp_val, j + 1, wid - 9);
3044 /* Make a "shadow" below the list (only if needed) */
3045 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3047 /* Save the new column */
3050 return target_item_label;
3056 * Display the equipment.
3058 int show_equip(int target_item)
3061 int col, cur_col, len;
3064 char o_name[MAX_NLEN];
3067 char out_desc[23][MAX_NLEN];
3068 int target_item_label = 0;
3070 char equip_label[52 + 1];
3072 /* Starting column */
3076 Term_get_size(&wid, &hgt);
3078 /* Maximal length */
3079 len = wid - col - 1;
3082 /* Scan the equipment list */
3083 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3085 o_ptr = &inventory[i];
3087 /* Is this item acceptable? */
3088 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
3089 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3090 item_tester_no_ryoute)) continue;
3093 object_desc(o_name, o_ptr, 0);
3095 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3098 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
3100 (void)strcpy(out_desc[k],"(wielding with two-hands)");
3102 out_color[k] = TERM_WHITE;
3106 (void)strcpy(out_desc[k], o_name);
3107 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3111 /* Grey out charging items */
3114 out_color[k] = TERM_L_DARK;
3117 /* Extract the maximal length (see below) */
3119 l = strlen(out_desc[k]) + (2 + 1);
3121 l = strlen(out_desc[k]) + (2 + 3);
3125 /* Increase length for labels (if needed) */
3127 if (show_labels) l += (7 + 2);
3129 if (show_labels) l += (14 + 2);
3133 /* Increase length for weight (if needed) */
3134 if (show_weights) l += 9;
3136 if (show_item_graph) l += 2;
3138 /* Maintain the max-length */
3139 if (l > len) len = l;
3141 /* Advance the entry */
3145 /* Hack -- Find a column to start in */
3147 col = (len > wid - 6) ? 0 : (wid - len - 1);
3149 col = (len > wid - 4) ? 0 : (wid - len - 1);
3152 prepare_label_string(equip_label, USE_EQUIP);
3154 /* Output each entry */
3155 for (j = 0; j < k; j++)
3161 o_ptr = &inventory[i];
3163 /* Clear the line */
3164 prt("", j + 1, col ? col - 2 : col);
3166 if (use_menu && target_item)
3168 if (j == (target_item-1))
3171 strcpy(tmp_val, "¡Õ");
3173 strcpy(tmp_val, "> ");
3175 target_item_label = i;
3177 else strcpy(tmp_val, " ");
3179 else if (i >= INVEN_RARM)
3181 /* Prepare an index --(-- */
3182 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3186 /* Prepare an index --(-- */
3187 sprintf(tmp_val, "%c)", index_to_label(i));
3190 /* Clear the line with the (possibly indented) index */
3191 put_str(tmp_val, j+1, col);
3195 /* Display graphics for object, if desired */
3196 if (show_item_graph)
3198 byte a = object_attr(o_ptr);
3199 char c = object_char(o_ptr);
3202 if (a & 0x80) a |= 0x40;
3205 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3206 if (use_bigtile) cur_col++;
3214 /* Mention the use */
3216 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
3218 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
3221 put_str(tmp_val, j+1, cur_col);
3223 /* Display the entry itself */
3225 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
3227 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
3234 /* Display the entry itself */
3235 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
3238 /* Display the weight if needed */
3241 int wgt = o_ptr->weight * o_ptr->number;
3243 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3245 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3248 prt(tmp_val, j + 1, wid - 9);
3252 /* Make a "shadow" below the list (only if needed) */
3253 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3255 /* Save the new column */
3258 return target_item_label;
3265 * Flip "inven" and "equip" in any sub-windows
3267 void toggle_inven_equip(void)
3272 for (j = 0; j < 8; j++)
3275 if (!angband_term[j]) continue;
3277 /* Flip inven to equip */
3278 if (window_flag[j] & (PW_INVEN))
3281 window_flag[j] &= ~(PW_INVEN);
3282 window_flag[j] |= (PW_EQUIP);
3285 p_ptr->window |= (PW_EQUIP);
3288 /* Flip inven to equip */
3289 else if (window_flag[j] & (PW_EQUIP))
3292 window_flag[j] &= ~(PW_EQUIP);
3293 window_flag[j] |= (PW_INVEN);
3296 p_ptr->window |= (PW_INVEN);
3304 * Verify the choice of an item.
3306 * The item can be negative to mean "item on floor".
3308 static bool verify(cptr prompt, int item)
3310 char o_name[MAX_NLEN];
3311 char out_val[MAX_NLEN+20];
3318 o_ptr = &inventory[item];
3324 o_ptr = &o_list[0 - item];
3328 object_desc(o_name, o_ptr, 0);
3332 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
3334 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
3339 return (get_check(out_val));
3344 * Hack -- allow user to "prevent" certain choices
3346 * The item can be negative to mean "item on floor".
3348 static bool get_item_allow(int item)
3354 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
3359 o_ptr = &inventory[item];
3365 o_ptr = &o_list[0 - item];
3368 /* No inscription */
3369 if (!o_ptr->inscription) return (TRUE);
3372 s = my_strchr(quark_str(o_ptr->inscription), '!');
3374 /* Process preventions */
3377 /* Check the "restriction" */
3378 if ((s[1] == command_cmd) || (s[1] == '*'))
3380 /* Verify the choice */
3382 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
3384 if (!verify("Really try", item)) return (FALSE);
3389 /* Find another '!' */
3390 s = my_strchr(s + 1, '!');
3400 * Auxiliary function for "get_item()" -- test an index
3402 static bool get_item_okay(int i)
3405 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
3407 if (select_ring_slot) return is_ring_slot(i);
3409 /* Verify the item */
3410 if (!item_tester_okay(&inventory[i])) return (FALSE);
3419 * Determine whether get_item() can get some item or not
3420 * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
3422 bool can_get_item(void)
3424 int j, floor_list[23], floor_num = 0;
3426 for (j = 0; j < INVEN_TOTAL; j++)
3427 if (item_tester_okay(&inventory[j]))
3430 floor_num = scan_floor(floor_list, py, px, 0x03);
3438 * Let the user select an item, save its "index"
3440 * Return TRUE only if an acceptable item was chosen by the user.
3442 * The selected item must satisfy the "item_tester_hook()" function,
3443 * if that hook is set, and the "item_tester_tval", if that value is set.
3445 * All "item_tester" restrictions are cleared before this function returns.
3447 * The user is allowed to choose acceptable items from the equipment,
3448 * inventory, or floor, respectively, if the proper flag was given,
3449 * and there are any acceptable items in that location.
3451 * The equipment or inventory are displayed (even if no acceptable
3452 * items are in that location) if the proper flag was given.
3454 * If there are no acceptable items available anywhere, and "str" is
3455 * not NULL, then it will be used as the text of a warning message
3456 * before the function returns.
3458 * Note that the user must press "-" to specify the item on the floor,
3459 * and there is no way to "examine" the item on the floor, while the
3460 * use of "capital" letters will "examine" an inventory/equipment item,
3461 * and prompt for its use.
3463 * If a legal item is selected from the inventory, we save it in "cp"
3464 * directly (0 to 35), and return TRUE.
3466 * If a legal item is selected from the floor, we save it in "cp" as
3467 * a negative (-1 to -511), and return TRUE.
3469 * If no item is available, we do nothing to "cp", and we display a
3470 * warning message, using "str" if available, and return FALSE.
3472 * If no item is selected, we do nothing to "cp", and return FALSE.
3474 * Global "p_ptr->command_new" is used when viewing the inventory or equipment
3475 * to allow the user to enter a command while viewing those screens, and
3476 * also to induce "auto-enter" of stores, and other such stuff.
3478 * Global "p_ptr->command_see" may be set before calling this function to start
3479 * out in "browse" mode. It is cleared before this function returns.
3481 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
3482 * If it is TRUE then we are viewing inventory, else equipment.
3484 * We always erase the prompt when we are done, leaving a blank line,
3485 * or a warning message, if appropriate, if no items are available.
3487 bool get_item(int *cp, cptr pmt, cptr str, int mode)
3489 s16b this_o_idx, next_o_idx = 0;
3493 int j, k, i1, i2, e1, e2;
3503 bool allow_floor = FALSE;
3505 bool toggle = FALSE;
3511 extern bool select_the_force;
3513 int menu_line = (use_menu ? 1 : 0);
3519 static char prev_tag = '\0';
3520 char cur_tag = '\0';
3522 #endif /* ALLOW_REPEAT */
3524 #ifdef ALLOW_EASY_FLOOR /* TNB */
3526 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
3528 #endif /* ALLOW_EASY_FLOOR -- TNB */
3531 if (mode & USE_EQUIP) equip = TRUE;
3532 if (mode & USE_INVEN) inven = TRUE;
3533 if (mode & USE_FLOOR) floor = TRUE;
3537 /* Get the item index */
3538 if (repeat_pull(cp))
3541 if (select_the_force && (*cp == INVEN_FORCE))
3543 item_tester_tval = 0;
3544 item_tester_hook = NULL;
3545 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3550 else if (floor && (*cp < 0))
3557 /* Acquire object */
3560 /* Validate the item */
3561 if (item_tester_okay(o_ptr))
3563 /* Forget restrictions */
3564 item_tester_tval = 0;
3565 item_tester_hook = NULL;
3566 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3573 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
3574 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
3576 if (prev_tag && command_cmd)
3578 /* Look up the tag and validate the item */
3579 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
3580 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
3581 else if (!get_item_okay(k)) /* Reject */;
3584 /* Accept that choice */
3587 /* Forget restrictions */
3588 item_tester_tval = 0;
3589 item_tester_hook = NULL;
3590 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3596 prev_tag = '\0'; /* prev_tag is no longer effective */
3599 /* Verify the item */
3600 else if (get_item_okay(*cp))
3602 /* Forget restrictions */
3603 item_tester_tval = 0;
3604 item_tester_hook = NULL;
3605 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3613 #endif /* ALLOW_REPEAT */
3616 /* Paranoia XXX XXX XXX */
3623 /* No item selected */
3627 /* Full inventory */
3629 i2 = INVEN_PACK - 1;
3631 /* Forbid inventory */
3632 if (!inven) i2 = -1;
3635 for (j = 0; j < INVEN_PACK; j++)
3636 if (item_tester_okay(&inventory[j])) max_inven++;
3639 /* Restrict inventory indexes */
3640 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
3641 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
3644 /* Full equipment */
3646 e2 = INVEN_TOTAL - 1;
3648 /* Forbid equipment */
3649 if (!equip) e2 = -1;
3652 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
3653 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
3654 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
3657 /* Restrict equipment indexes */
3658 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
3659 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
3661 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
3665 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
3667 else if (p_ptr->hidarite) e1 = INVEN_RARM;
3671 /* Restrict floor usage */
3674 /* Scan all objects in the grid */
3675 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
3679 /* Acquire object */
3680 o_ptr = &o_list[this_o_idx];
3682 /* Acquire next object */
3683 next_o_idx = o_ptr->next_o_idx;
3685 /* Accept the item on the floor if legal */
3686 if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
3690 /* Require at least one legal choice */
3691 if (!allow_floor && (i1 > i2) && (e1 > e2))
3693 /* Cancel p_ptr->command_see */
3694 command_see = FALSE;
3702 if (select_the_force) {
3708 /* Analyze choices */
3711 /* Hack -- Start on equipment if requested */
3712 if (command_see && command_wrk && equip)
3717 /* Use inventory if allowed */
3720 command_wrk = FALSE;
3723 /* Use equipment if allowed */
3729 /* Use inventory for floor */
3732 command_wrk = FALSE;
3738 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
3740 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
3742 /* Hack -- start out in "display" mode */
3750 /* Repeat until done */
3753 int get_item_label = 0;
3760 for (j = 0; j < 8; j++)
3763 if (!angband_term[j]) continue;
3765 /* Count windows displaying inven */
3766 if (window_flag[j] & (PW_INVEN)) ni++;
3768 /* Count windows displaying equip */
3769 if (window_flag[j] & (PW_EQUIP)) ne++;
3772 /* Toggle if needed */
3773 if ((command_wrk && ni && !ne) ||
3774 (!command_wrk && !ni && ne))
3777 toggle_inven_equip();
3784 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3786 /* Redraw windows */
3790 /* Inventory screen */
3793 /* Redraw if needed */
3794 if (command_see) get_item_label = show_inven(menu_line);
3797 /* Equipment screen */
3800 /* Redraw if needed */
3801 if (command_see) get_item_label = show_equip(menu_line);
3804 /* Viewing inventory */
3807 /* Begin the prompt */
3809 sprintf(out_val, "»ý¤Áʪ:");
3811 sprintf(out_val, "Inven:");
3814 /* Some legal items */
3815 if ((i1 <= i2) && !use_menu)
3817 /* Build the prompt */
3819 sprintf(tmp_val, "%c-%c,'(',')',",
3821 sprintf(tmp_val, " %c-%c,'(',')',",
3823 index_to_label(i1), index_to_label(i2));
3826 strcat(out_val, tmp_val);
3829 /* Indicate ability to "view" */
3831 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3833 if (!command_see && !use_menu) strcat(out_val, " * to see,");
3838 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
3840 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
3844 /* Viewing equipment */
3847 /* Begin the prompt */
3849 sprintf(out_val, "ÁõÈ÷ÉÊ:");
3851 sprintf(out_val, "Equip:");
3854 /* Some legal items */
3855 if ((e1 <= e2) && !use_menu)
3857 /* Build the prompt */
3859 sprintf(tmp_val, "%c-%c,'(',')',",
3861 sprintf(tmp_val, " %c-%c,'(',')',",
3863 index_to_label(e1), index_to_label(e2));
3866 strcat(out_val, tmp_val);
3869 /* Indicate ability to "view" */
3871 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3873 if (!command_see) strcat(out_val, " * to see,");
3878 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
3880 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
3884 /* Indicate legality of the "floor" item */
3886 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
3887 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
3889 if (allow_floor) strcat(out_val, " - for floor,");
3890 if (select_the_force) strcat(out_val, " w for the Force,");
3893 /* Finish the prompt */
3894 strcat(out_val, " ESC");
3896 /* Build the prompt */
3897 sprintf(tmp_val, "(%s) %s", out_val, pmt);
3899 /* Show the prompt */
3907 int max_line = (command_wrk ? max_equip : max_inven);
3923 menu_line += (max_line - 1);
3942 /* Verify legality */
3943 if (!inven || !equip)
3949 /* Hack -- Fix screen */
3959 /* Switch inven/equip */
3960 command_wrk = !command_wrk;
3961 max_line = (command_wrk ? max_equip : max_inven);
3962 if (menu_line > max_line) menu_line = max_line;
3964 /* Need to redraw */
3973 if (command_wrk == USE_FLOOR)
3976 (*cp) = -get_item_label;
3980 /* Validate the item */
3981 if (!get_item_okay(get_item_label))
3987 /* Allow player to "refuse" certain actions */
3988 if (!get_item_allow(get_item_label))
3994 /* Accept that choice */
3995 (*cp) = get_item_label;
4004 if (select_the_force) {
4012 if (menu_line > max_line) menu_line -= max_line;
4033 command_see = FALSE;
4053 /* Verify legality */
4054 if (!inven || !equip)
4060 /* Hack -- Fix screen */
4070 /* Switch inven/equip */
4071 command_wrk = !command_wrk;
4073 /* Need to redraw */
4079 /* Use floor item */
4082 /* Scan all objects in the grid */
4083 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4087 /* Acquire object */
4088 o_ptr = &o_list[this_o_idx];
4090 /* Acquire next object */
4091 next_o_idx = o_ptr->next_o_idx;
4093 /* Validate the item */
4094 if (!item_tester_okay(o_ptr)) continue;
4099 /* Verify the item (if required) */
4101 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
4103 if (other_query_flag && !verify("Try", k)) continue;
4107 /* Allow player to "refuse" certain actions */
4108 if (!get_item_allow(k)) continue;
4110 /* Accept that choice */
4127 case '1': case '2': case '3':
4128 case '4': case '5': case '6':
4129 case '7': case '8': case '9':
4131 /* Look up the tag */
4132 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4138 /* Hack -- Validate the item */
4139 if ((k < INVEN_RARM) ? !inven : !equip)
4145 /* Validate the item */
4146 if (!get_item_okay(k))
4152 /* Allow player to "refuse" certain actions */
4153 if (!get_item_allow(k))
4159 /* Accept that choice */
4165 #endif /* ALLOW_REPEAT */
4173 /* Choose "default" inventory item */
4176 k = ((i1 == i2) ? i1 : -1);
4179 /* Choose "default" equipment item */
4182 k = ((e1 == e2) ? e1 : -1);
4185 /* Validate the item */
4186 if (!get_item_okay(k))
4192 /* Allow player to "refuse" certain actions */
4193 if (!get_item_allow(k))
4199 /* Accept that choice */
4209 if (select_the_force) {
4222 bool not_found = FALSE;
4224 /* Look up the alphabetical tag */
4225 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4230 /* Hack -- Validate the item */
4231 else if ((k < INVEN_RARM) ? !inven : !equip)
4236 /* Validate the item */
4237 else if (!get_item_okay(k))
4244 /* Accept that choice */
4250 #endif /* ALLOW_REPEAT */
4254 /* Extract "query" setting */
4255 ver = isupper(which);
4256 which = tolower(which);
4258 /* Convert letter to inventory index */
4261 if (which == '(') k = i1;
4262 else if (which == ')') k = i2;
4263 else k = label_to_inven(which);
4266 /* Convert letter to equipment index */
4269 if (which == '(') k = e1;
4270 else if (which == ')') k = e2;
4271 else k = label_to_equip(which);
4274 /* Validate the item */
4275 if (!get_item_okay(k))
4281 /* Verify the item */
4283 if (ver && !verify("ËÜÅö¤Ë", k))
4285 if (ver && !verify("Try", k))
4293 /* Allow player to "refuse" certain actions */
4294 if (!get_item_allow(k))
4300 /* Accept that choice */
4311 /* Fix the screen if necessary */
4317 /* Hack -- Cancel "display" */
4318 command_see = FALSE;
4322 /* Forget the item_tester_tval restriction */
4323 item_tester_tval = 0;
4325 item_tester_no_ryoute = FALSE;
4327 /* Forget the item_tester_hook restriction */
4328 item_tester_hook = NULL;
4331 /* Clean up 'show choices' */
4332 /* Toggle again if needed */
4333 if (toggle) toggle_inven_equip();
4336 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4342 /* Clear the prompt line */
4345 /* Warning if needed */
4346 if (oops && str) msg_print(str);
4352 if (command_cmd) prev_tag = cur_tag;
4353 #endif /* ALLOW_REPEAT */
4355 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4363 #ifdef ALLOW_EASY_FLOOR
4368 * Return a list of o_list[] indexes of items at the given cave
4369 * location. Valid flags are:
4371 * mode & 0x01 -- Item tester
4372 * mode & 0x02 -- Marked items only
4373 * mode & 0x04 -- Stop after first
4375 int scan_floor(int *items, int y, int x, int mode)
4377 int this_o_idx, next_o_idx;
4382 if (!in_bounds(y, x)) return 0;
4384 /* Scan all objects in the grid */
4385 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
4389 /* Acquire object */
4390 o_ptr = &o_list[this_o_idx];
4392 /* Acquire next object */
4393 next_o_idx = o_ptr->next_o_idx;
4396 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
4399 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
4401 /* Accept this item */
4402 /* XXX Hack -- Enforce limit */
4404 items[num] = this_o_idx;
4409 if (mode & 0x04) break;
4418 * Display a list of the items on the floor at the given location.
4420 int show_floor(int target_item, int y, int x, int *min_width)
4427 char o_name[MAX_NLEN];
4433 char out_desc[23][MAX_NLEN];
4434 int target_item_label = 0;
4436 int floor_list[23], floor_num;
4438 char floor_label[52 + 1];
4440 bool dont_need_to_show_weights = TRUE;
4443 Term_get_size(&wid, &hgt);
4445 /* Default length */
4446 len = MAX((*min_width), 20);
4449 /* Scan for objects in the grid, using item_tester_okay() */
4450 floor_num = scan_floor(floor_list, y, x, 0x03);
4452 /* Display the floor objects */
4453 for (k = 0, i = 0; i < floor_num && i < 23; i++)
4455 o_ptr = &o_list[floor_list[i]];
4457 /* Describe the object */
4458 object_desc(o_name, o_ptr, 0);
4460 /* Save the index */
4463 /* Acquire inventory color */
4464 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
4466 /* Save the object description */
4467 strcpy(out_desc[k], o_name);
4469 /* Find the predicted "line length" */
4470 l = strlen(out_desc[k]) + 5;
4472 /* Be sure to account for the weight */
4473 if (show_weights) l += 9;
4475 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
4477 /* Maintain the maximum length */
4478 if (l > len) len = l;
4480 /* Advance to next "line" */
4484 if (show_weights && dont_need_to_show_weights) len -= 9;
4489 /* Find the column to start in */
4490 col = (len > wid - 4) ? 0 : (wid - len - 1);
4492 prepare_label_string_floor(floor_label, floor_list, floor_num);
4494 /* Output each entry */
4495 for (j = 0; j < k; j++)
4498 i = floor_list[out_index[j]];
4503 /* Clear the line */
4504 prt("", j + 1, col ? col - 2 : col);
4506 if (use_menu && target_item)
4508 if (j == (target_item-1))
4511 strcpy(tmp_val, "¡Õ");
4513 strcpy(tmp_val, "> ");
4515 target_item_label = i;
4517 else strcpy(tmp_val, " ");
4521 /* Prepare an index --(-- */
4522 sprintf(tmp_val, "%c)", floor_label[j]);
4525 /* Clear the line with the (possibly indented) index */
4526 put_str(tmp_val, j + 1, col);
4528 /* Display the entry itself */
4529 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
4531 /* Display the weight if needed */
4532 if (show_weights && (o_ptr->tval != TV_GOLD))
4534 int wgt = o_ptr->weight * o_ptr->number;
4536 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4538 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4541 prt(tmp_val, j + 1, wid - 9);
4545 /* Make a "shadow" below the list (only if needed) */
4546 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4548 return target_item_label;
4552 * This version of get_item() is called by get_item() when
4553 * the easy_floor is on.
4555 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
4557 char n1 = ' ', n2 = ' ', which = ' ';
4559 int j, k, i1, i2, e1, e2;
4566 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
4567 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
4568 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
4570 bool allow_equip = FALSE;
4571 bool allow_inven = FALSE;
4572 bool allow_floor = FALSE;
4574 bool toggle = FALSE;
4579 int floor_num, floor_list[23], floor_top = 0;
4582 extern bool select_the_force;
4584 int menu_line = (use_menu ? 1 : 0);
4590 static char prev_tag = '\0';
4591 char cur_tag = '\0';
4593 /* Get the item index */
4594 if (repeat_pull(cp))
4597 if (select_the_force && (*cp == INVEN_FORCE))
4599 item_tester_tval = 0;
4600 item_tester_hook = NULL;
4601 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4606 else if (floor && (*cp < 0))
4608 if (prev_tag && command_cmd)
4610 /* Scan all objects in the grid */
4611 floor_num = scan_floor(floor_list, py, px, 0x03);
4613 /* Look up the tag */
4614 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
4616 /* Accept that choice */
4617 (*cp) = 0 - floor_list[k];
4619 /* Forget restrictions */
4620 item_tester_tval = 0;
4621 item_tester_hook = NULL;
4622 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4628 prev_tag = '\0'; /* prev_tag is no longer effective */
4631 /* Validate the item */
4632 else if (item_tester_okay(&o_list[0 - (*cp)]))
4634 /* Forget restrictions */
4635 item_tester_tval = 0;
4636 item_tester_hook = NULL;
4637 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4644 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4645 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4647 if (prev_tag && command_cmd)
4649 /* Look up the tag and validate the item */
4650 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4651 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4652 else if (!get_item_okay(k)) /* Reject */;
4655 /* Accept that choice */
4658 /* Forget restrictions */
4659 item_tester_tval = 0;
4660 item_tester_hook = NULL;
4661 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4667 prev_tag = '\0'; /* prev_tag is no longer effective */
4670 /* Verify the item */
4671 else if (get_item_okay(*cp))
4673 /* Forget restrictions */
4674 item_tester_tval = 0;
4675 item_tester_hook = NULL;
4676 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4684 #endif /* ALLOW_REPEAT */
4687 /* Paranoia XXX XXX XXX */
4694 /* No item selected */
4698 /* Full inventory */
4700 i2 = INVEN_PACK - 1;
4702 /* Forbid inventory */
4703 if (!inven) i2 = -1;
4706 for (j = 0; j < INVEN_PACK; j++)
4707 if (item_tester_okay(&inventory[j])) max_inven++;
4710 /* Restrict inventory indexes */
4711 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4712 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4715 /* Full equipment */
4717 e2 = INVEN_TOTAL - 1;
4719 /* Forbid equipment */
4720 if (!equip) e2 = -1;
4723 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4724 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4725 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4728 /* Restrict equipment indexes */
4729 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4730 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4732 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4736 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4738 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4742 /* Count "okay" floor items */
4745 /* Restrict floor usage */
4748 /* Scan all objects in the grid */
4749 floor_num = scan_floor(floor_list, py, px, 0x03);
4752 /* Accept inventory */
4753 if (i1 <= i2) allow_inven = TRUE;
4755 /* Accept equipment */
4756 if (e1 <= e2) allow_equip = TRUE;
4759 if (floor_num) allow_floor = TRUE;
4761 /* Require at least one legal choice */
4762 if (!allow_inven && !allow_equip && !allow_floor)
4764 /* Cancel p_ptr->command_see */
4765 command_see = FALSE;
4773 if (select_the_force) {
4779 /* Analyze choices */
4782 /* Hack -- Start on equipment if requested */
4783 if (command_see && (command_wrk == (USE_EQUIP))
4786 command_wrk = (USE_EQUIP);
4789 /* Use inventory if allowed */
4790 else if (allow_inven)
4792 command_wrk = (USE_INVEN);
4795 /* Use equipment if allowed */
4796 else if (allow_equip)
4798 command_wrk = (USE_EQUIP);
4801 /* Use floor if allowed */
4802 else if (allow_floor)
4804 command_wrk = (USE_FLOOR);
4809 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4811 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4813 /* Hack -- start out in "display" mode */
4820 /* Repeat until done */
4823 int get_item_label = 0;
4830 for (j = 0; j < 8; j++)
4833 if (!angband_term[j]) continue;
4835 /* Count windows displaying inven */
4836 if (window_flag[j] & (PW_INVEN)) ni++;
4838 /* Count windows displaying equip */
4839 if (window_flag[j] & (PW_EQUIP)) ne++;
4842 /* Toggle if needed */
4843 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
4844 (command_wrk == (USE_INVEN) && !ni && ne))
4847 toggle_inven_equip();
4854 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4856 /* Redraw windows */
4859 /* Inventory screen */
4860 if (command_wrk == (USE_INVEN))
4862 /* Extract the legal requests */
4866 /* Redraw if needed */
4867 if (command_see) get_item_label = show_inven(menu_line);
4870 /* Equipment screen */
4871 else if (command_wrk == (USE_EQUIP))
4873 /* Extract the legal requests */
4874 n1 = I2A(e1 - INVEN_RARM);
4875 n2 = I2A(e2 - INVEN_RARM);
4877 /* Redraw if needed */
4878 if (command_see) get_item_label = show_equip(menu_line);
4882 else if (command_wrk == (USE_FLOOR))
4885 k = MIN(floor_top + 23, floor_num) - 1;
4887 /* Extract the legal requests */
4888 n1 = I2A(j - floor_top);
4889 n2 = I2A(k - floor_top);
4891 /* Redraw if needed */
4892 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
4895 /* Viewing inventory */
4896 if (command_wrk == (USE_INVEN))
4898 /* Begin the prompt */
4900 sprintf(out_val, "»ý¤Áʪ:");
4902 sprintf(out_val, "Inven:");
4907 /* Build the prompt */
4909 sprintf(tmp_val, "%c-%c,'(',')',",
4911 sprintf(tmp_val, " %c-%c,'(',')',",
4913 index_to_label(i1), index_to_label(i2));
4916 strcat(out_val, tmp_val);
4919 /* Indicate ability to "view" */
4921 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4923 if (!command_see && !use_menu) strcat(out_val, " * to see,");
4931 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
4932 else if (allow_floor)
4933 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
4935 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
4938 strcat(out_val, " / for Equip,");
4939 else if (allow_floor)
4940 strcat(out_val, " 6 for Equip,");
4942 strcat(out_val, " 4 or 6 for Equip,");
4951 strcat(out_val, " '-'¾²¾å,");
4952 else if (allow_equip)
4953 strcat(out_val, " '4' ¾²¾å,");
4955 strcat(out_val, " '4'or'6' ¾²¾å,");
4958 strcat(out_val, " - for floor,");
4959 else if (allow_equip)
4960 strcat(out_val, " 4 for floor,");
4962 strcat(out_val, " 4 or 6 for floor,");
4967 /* Viewing equipment */
4968 else if (command_wrk == (USE_EQUIP))
4970 /* Begin the prompt */
4972 sprintf(out_val, "ÁõÈ÷ÉÊ:");
4974 sprintf(out_val, "Equip:");
4979 /* Build the prompt */
4981 sprintf(tmp_val, "%c-%c,'(',')',",
4983 sprintf(tmp_val, " %c-%c,'(',')',",
4985 index_to_label(e1), index_to_label(e2));
4988 strcat(out_val, tmp_val);
4991 /* Indicate ability to "view" */
4993 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4995 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5003 strcat(out_val, " '/' »ý¤Áʪ,");
5004 else if (allow_floor)
5005 strcat(out_val, " '4' »ý¤Áʪ,");
5007 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5010 strcat(out_val, " / for Inven,");
5011 else if (allow_floor)
5012 strcat(out_val, " 4 for Inven,");
5014 strcat(out_val, " 4 or 6 for Inven,");
5023 strcat(out_val, " '-'¾²¾å,");
5024 else if (allow_inven)
5025 strcat(out_val, " '6' ¾²¾å,");
5027 strcat(out_val, " '4'or'6' ¾²¾å,");
5030 strcat(out_val, " - for floor,");
5031 else if (allow_inven)
5032 strcat(out_val, " 6 for floor,");
5034 strcat(out_val, " 4 or 6 for floor,");
5040 else if (command_wrk == (USE_FLOOR))
5042 /* Begin the prompt */
5044 sprintf(out_val, "¾²¾å:");
5046 sprintf(out_val, "Floor:");
5051 /* Build the prompt */
5053 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5055 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5059 strcat(out_val, tmp_val);
5062 /* Indicate ability to "view" */
5064 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5066 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5071 if (allow_inven && allow_equip)
5074 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5076 strcat(out_val, " 4 for Equip, 6 for Inven,");
5079 else if (allow_inven)
5082 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5084 strcat(out_val, " 4 or 6 for Inven,");
5087 else if (allow_equip)
5090 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5092 strcat(out_val, " 4 or 6 for Equip,");
5097 else if (allow_inven)
5100 strcat(out_val, " '/' »ý¤Áʪ,");
5102 strcat(out_val, " / for Inven,");
5105 else if (allow_equip)
5108 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
5110 strcat(out_val, " / for Equip,");
5115 if (command_see && !use_menu)
5118 strcat(out_val, " Enter ¼¡,");
5120 strcat(out_val, " Enter for scroll down,");
5127 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
5129 if (select_the_force) strcat(out_val, " w for the Force,");
5132 /* Finish the prompt */
5133 strcat(out_val, " ESC");
5135 /* Build the prompt */
5136 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5138 /* Show the prompt */
5147 if (command_wrk == USE_INVEN) max_line = max_inven;
5148 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5149 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5165 menu_line += (max_line - 1);
5181 /* Verify legality */
5182 if (command_wrk == (USE_INVEN))
5184 if (allow_floor) command_wrk = USE_FLOOR;
5185 else if (allow_equip) command_wrk = USE_EQUIP;
5192 else if (command_wrk == (USE_EQUIP))
5194 if (allow_inven) command_wrk = USE_INVEN;
5195 else if (allow_floor) command_wrk = USE_FLOOR;
5202 else if (command_wrk == (USE_FLOOR))
5204 if (allow_equip) command_wrk = USE_EQUIP;
5205 else if (allow_inven) command_wrk = USE_INVEN;
5218 /* Hack -- Fix screen */
5228 /* Switch inven/equip */
5229 if (command_wrk == USE_INVEN) max_line = max_inven;
5230 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5231 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5232 if (menu_line > max_line) menu_line = max_line;
5234 /* Need to redraw */
5242 /* Verify legality */
5243 if (command_wrk == (USE_INVEN))
5245 if (allow_equip) command_wrk = USE_EQUIP;
5246 else if (allow_floor) command_wrk = USE_FLOOR;
5253 else if (command_wrk == (USE_EQUIP))
5255 if (allow_floor) command_wrk = USE_FLOOR;
5256 else if (allow_inven) command_wrk = USE_INVEN;
5263 else if (command_wrk == (USE_FLOOR))
5265 if (allow_inven) command_wrk = USE_INVEN;
5266 else if (allow_equip) command_wrk = USE_EQUIP;
5279 /* Hack -- Fix screen */
5289 /* Switch inven/equip */
5290 if (command_wrk == USE_INVEN) max_line = max_inven;
5291 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5292 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5293 if (menu_line > max_line) menu_line = max_line;
5295 /* Need to redraw */
5304 if (command_wrk == USE_FLOOR)
5307 (*cp) = -get_item_label;
5311 /* Validate the item */
5312 if (!get_item_okay(get_item_label))
5318 /* Allow player to "refuse" certain actions */
5319 if (!get_item_allow(get_item_label))
5325 /* Accept that choice */
5326 (*cp) = get_item_label;
5335 if (select_the_force) {
5343 if (menu_line > max_line) menu_line -= max_line;
5364 command_see = FALSE;
5387 cave_type *c_ptr = &cave[py][px];
5389 if (command_wrk != (USE_FLOOR)) break;
5391 /* Get the object being moved. */
5392 o_idx = c_ptr->o_idx;
5394 /* Only rotate a pile of two or more objects. */
5395 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
5397 /* Remove the first object from the list. */
5398 excise_object_idx(o_idx);
5400 /* Find end of the list. */
5402 while (o_list[i].next_o_idx)
5403 i = o_list[i].next_o_idx;
5405 /* Add after the last object. */
5406 o_list[i].next_o_idx = o_idx;
5408 /* Re-scan floor list */
5409 floor_num = scan_floor(floor_list, py, px, 0x03);
5411 /* Hack -- Fix screen */
5426 if (command_wrk == (USE_INVEN))
5433 command_wrk = (USE_EQUIP);
5435 else if (command_wrk == (USE_EQUIP))
5442 command_wrk = (USE_INVEN);
5444 else if (command_wrk == (USE_FLOOR))
5448 command_wrk = (USE_INVEN);
5450 else if (allow_equip)
5452 command_wrk = (USE_EQUIP);
5461 /* Hack -- Fix screen */
5471 /* Need to redraw */
5484 * If we are already examining the floor, and there
5485 * is only one item, we will always select it.
5486 * If we aren't examining the floor and there is only
5487 * one item, we will select it if floor_query_flag
5492 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
5495 k = 0 - floor_list[0];
5497 /* Allow player to "refuse" certain actions */
5498 if (!get_item_allow(k))
5504 /* Accept that choice */
5513 /* Hack -- Fix screen */
5523 command_wrk = (USE_FLOOR);
5529 case '1': case '2': case '3':
5530 case '4': case '5': case '6':
5531 case '7': case '8': case '9':
5533 if (command_wrk != USE_FLOOR)
5535 /* Look up the tag */
5536 if (!get_tag(&k, which, command_wrk))
5542 /* Hack -- Validate the item */
5543 if ((k < INVEN_RARM) ? !inven : !equip)
5549 /* Validate the item */
5550 if (!get_item_okay(k))
5558 /* Look up the alphabetical tag */
5559 if (get_tag_floor(&k, which, floor_list, floor_num))
5562 k = 0 - floor_list[k];
5571 /* Allow player to "refuse" certain actions */
5572 if (!get_item_allow(k))
5578 /* Accept that choice */
5584 #endif /* ALLOW_REPEAT */
5592 /* Choose "default" inventory item */
5593 if (command_wrk == (USE_INVEN))
5595 k = ((i1 == i2) ? i1 : -1);
5598 /* Choose "default" equipment item */
5599 else if (command_wrk == (USE_EQUIP))
5601 k = ((e1 == e2) ? e1 : -1);
5604 /* Choose "default" floor item */
5605 else if (command_wrk == (USE_FLOOR))
5610 k = 0 - floor_list[0];
5612 /* Allow player to "refuse" certain actions */
5613 if (!get_item_allow(k))
5619 /* Accept that choice */
5627 /* Validate the item */
5628 if (!get_item_okay(k))
5634 /* Allow player to "refuse" certain actions */
5635 if (!get_item_allow(k))
5641 /* Accept that choice */
5651 if (select_the_force) {
5665 if (command_wrk != USE_FLOOR)
5667 bool not_found = FALSE;
5669 /* Look up the alphabetical tag */
5670 if (!get_tag(&k, which, command_wrk))
5675 /* Hack -- Validate the item */
5676 else if ((k < INVEN_RARM) ? !inven : !equip)
5681 /* Validate the item */
5682 else if (!get_item_okay(k))
5689 /* Accept that choice */
5695 #endif /* ALLOW_REPEAT */
5701 /* Look up the alphabetical tag */
5702 if (get_tag_floor(&k, which, floor_list, floor_num))
5705 k = 0 - floor_list[k];
5707 /* Accept that choice */
5713 #endif /* ALLOW_REPEAT */
5718 /* Extract "query" setting */
5719 ver = isupper(which);
5720 which = tolower(which);
5722 /* Convert letter to inventory index */
5723 if (command_wrk == (USE_INVEN))
5725 if (which == '(') k = i1;
5726 else if (which == ')') k = i2;
5727 else k = label_to_inven(which);
5730 /* Convert letter to equipment index */
5731 else if (command_wrk == (USE_EQUIP))
5733 if (which == '(') k = e1;
5734 else if (which == ')') k = e2;
5735 else k = label_to_equip(which);
5738 /* Convert letter to floor index */
5739 else if (command_wrk == USE_FLOOR)
5741 if (which == '(') k = 0;
5742 else if (which == ')') k = floor_num - 1;
5743 else k = islower(which) ? A2I(which) : -1;
5744 if (k < 0 || k >= floor_num || k >= 23)
5751 k = 0 - floor_list[k];
5754 /* Validate the item */
5755 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
5761 /* Verify the item */
5763 if (ver && !verify("ËÜÅö¤Ë", k))
5765 if (ver && !verify("Try", k))
5773 /* Allow player to "refuse" certain actions */
5774 if (!get_item_allow(k))
5780 /* Accept that choice */
5790 /* Fix the screen if necessary */
5796 /* Hack -- Cancel "display" */
5797 command_see = FALSE;
5801 /* Forget the item_tester_tval restriction */
5802 item_tester_tval = 0;
5804 /* Forget the item_tester_hook restriction */
5805 item_tester_hook = NULL;
5808 /* Clean up 'show choices' */
5809 /* Toggle again if needed */
5810 if (toggle) toggle_inven_equip();
5813 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5819 /* Clear the prompt line */
5822 /* Warning if needed */
5823 if (oops && str) msg_print(str);
5829 if (command_cmd) prev_tag = cur_tag;
5830 #endif /* ALLOW_REPEAT */
5832 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5840 static bool py_pickup_floor_aux(void)
5848 /* Restrict the choices */
5849 item_tester_hook = inven_carry_okay;
5853 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
5854 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
5856 q = "Get which item? ";
5857 s = "You no longer have any room for the objects on the floor.";
5860 if (get_item(&item, q, s, (USE_FLOOR)))
5862 this_o_idx = 0 - item;
5869 /* Pick up the object */
5870 py_pickup_aux(this_o_idx);
5877 * Make the player carry everything in a grid
5879 * If "pickup" is FALSE then only gold will be picked up
5881 * This is called by py_pickup() when easy_floor is TRUE.
5883 void py_pickup_floor(bool pickup)
5885 s16b this_o_idx, next_o_idx = 0;
5887 char o_name[MAX_NLEN];
5890 int floor_num = 0, floor_o_idx = 0;
5894 /* Scan the pile of objects */
5895 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5899 /* Access the object */
5900 o_ptr = &o_list[this_o_idx];
5902 /* Describe the object */
5903 object_desc(o_name, o_ptr, 0);
5905 /* Access the next object */
5906 next_o_idx = o_ptr->next_o_idx;
5908 /* Hack -- disturb */
5912 if (o_ptr->tval == TV_GOLD)
5916 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
5917 (long)o_ptr->pval, o_name);
5919 msg_format("You have found %ld gold pieces worth of %s.",
5920 (long) o_ptr->pval, o_name);
5924 /* Collect the gold */
5925 p_ptr->au += o_ptr->pval;
5928 p_ptr->redraw |= (PR_GOLD);
5931 p_ptr->window |= (PW_PLAYER);
5933 /* Delete the gold */
5934 delete_object_idx(this_o_idx);
5936 /* Check the next object */
5939 else if (o_ptr->marked & OM_NOMSG)
5941 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
5942 * ignored. Otherwise, they are included in the prompt. */
5943 o_ptr->marked &= ~(OM_NOMSG);
5947 /* Count non-gold objects that can be picked up. */
5948 if (inven_carry_okay(o_ptr))
5953 /* Count non-gold objects */
5956 /* Remember this index */
5957 floor_o_idx = this_o_idx;
5960 /* There are no non-gold objects */
5964 /* Mention the number of objects */
5970 /* Access the object */
5971 o_ptr = &o_list[floor_o_idx];
5973 #ifdef ALLOW_EASY_SENSE
5975 /* Option: Make object sensing easy */
5978 /* Sense the object */
5979 (void) sense_object(o_ptr);
5982 #endif /* ALLOW_EASY_SENSE */
5984 /* Describe the object */
5985 object_desc(o_name, o_ptr, 0);
5989 msg_format("%s¤¬¤¢¤ë¡£", o_name);
5991 msg_format("You see %s.", o_name);
5996 /* Multiple objects */
6001 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
6003 msg_format("You see a pile of %d items.", floor_num);
6012 /* The player has no room for anything on the floor. */
6018 /* Access the object */
6019 o_ptr = &o_list[floor_o_idx];
6021 #ifdef ALLOW_EASY_SENSE
6023 /* Option: Make object sensing easy */
6026 /* Sense the object */
6027 (void) sense_object(o_ptr);
6030 #endif /* ALLOW_EASY_SENSE */
6032 /* Describe the object */
6033 object_desc(o_name, o_ptr, 0);
6037 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6039 msg_format("You have no room for %s.", o_name);
6044 /* Multiple objects */
6049 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6051 msg_print("You have no room for any of the objects on the floor.");
6063 /* Hack -- query every object */
6064 if (carry_query_flag)
6066 char out_val[MAX_NLEN+20];
6068 /* Access the object */
6069 o_ptr = &o_list[floor_o_idx];
6071 #ifdef ALLOW_EASY_SENSE
6073 /* Option: Make object sensing easy */
6076 /* Sense the object */
6077 (void) sense_object(o_ptr);
6080 #endif /* ALLOW_EASY_SENSE */
6082 /* Describe the object */
6083 object_desc(o_name, o_ptr, 0);
6085 /* Build a prompt */
6087 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
6089 (void) sprintf(out_val, "Pick up %s? ", o_name);
6093 /* Ask the user to confirm */
6094 if (!get_check(out_val))
6101 /* Access the object */
6102 o_ptr = &o_list[floor_o_idx];
6104 #ifdef ALLOW_EASY_SENSE
6106 /* Option: Make object sensing easy */
6109 /* Sense the object */
6110 (void) sense_object(o_ptr);
6113 #endif /* ALLOW_EASY_SENSE */
6115 /* Pick up the object */
6116 py_pickup_aux(floor_o_idx);
6119 /* Allow the user to choose an object */
6122 while (can_pickup--)
6124 if (!py_pickup_floor_aux()) break;
6129 #endif /* ALLOW_EASY_FLOOR */