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))
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))
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))
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))
400 desc = _("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ", "ball of elec (100) and resist elec");
404 /* Timeout description */
405 constant = act_ptr->timeout.constant;
406 dice = act_ptr->timeout.dice;
407 if (constant == 0 && dice == 0) {
408 /* We can activate it every turn */
409 strcpy(timeout, _("¤¤¤Ä¤Ç¤â", "every turn"));
410 } else if (constant < 0) {
411 /* Activations that have special timeout */
412 switch (act_ptr->index) {
414 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
415 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250);
418 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
419 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250);
422 strcpy(timeout, _("3*(¥ì¥Ù¥ë+10) ¥¿¡¼¥óËè", "every 3 * (level+10) turns"));
425 strcpy(timeout, _("³ÎΨ50%¤Ç²õ¤ì¤ë", "(destroyed 50%)"));
428 strcpy(timeout, "undefined");
432 /* Normal timeout activations */
433 char constant_str[16], dice_str[16];
434 sprintf(constant_str, "%d", constant);
435 sprintf(dice_str, "d%d", dice);
436 sprintf(timeout, _("%s%s%s ¥¿¡¼¥óËè", "every %s%s%s turns"),
437 (constant > 0) ? constant_str : "",
438 (constant > 0 && dice > 0) ? "+" : "",
439 (dice > 0) ? dice_str : "");
442 /* Build detail activate description */
443 sprintf(activation_detail, _("%s : %s", "%s %s"), desc, timeout);
445 return activation_detail;
449 * Determine the "Activation" (if any) for an artifact
450 * Return a string, or NULL for "no activation"
452 cptr item_activation(object_type *o_ptr)
454 u32b flgs[TR_FLAG_SIZE];
456 /* Extract the flags */
457 object_flags(o_ptr, flgs);
459 /* Require activation ability */
461 if (!(have_flag(flgs, TR_ACTIVATE))) return ("¤Ê¤·");
463 if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
467 * We need to deduce somehow that it is a random artifact -- one
468 * problem: It could be a random artifact which has NOT YET received
469 * a name. Thus we eliminate other possibilities instead of checking
473 /* Give priority to weaponsmith's essential activations */
474 if (object_is_smith(o_ptr))
476 switch (o_ptr->xtra3 - 1)
478 case ESSENCE_TMP_RES_ACID:
480 return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
482 return "resist acid every 50+d50 turns";
484 case ESSENCE_TMP_RES_ELEC:
486 return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
488 return "resist elec every 50+d50 turns";
490 case ESSENCE_TMP_RES_FIRE:
492 return "²Ð¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
494 return "resist fire every 50+d50 turns";
496 case ESSENCE_TMP_RES_COLD:
498 return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
500 return "resist cold every 50+d50 turns";
504 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
506 return "earthquake every 100+d100 turns";
511 /* Get an explain of an activation */
512 if (activation_index(o_ptr))
514 return item_activation_aux(o_ptr);
518 if (o_ptr->tval == TV_WHISTLE)
521 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
523 return "call pet every 100+d100 turns";
527 if (o_ptr->tval == TV_CAPTURE)
530 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
532 return "captures or releases a monster.";
538 return "²¿¤âµ¯¤¤Ê¤¤";
546 * Describe a "fully identified" item
548 bool screen_object(object_type *o_ptr, u32b mode)
552 u32b flgs[TR_FLAG_SIZE];
556 char o_name[MAX_NLEN];
559 int trivial_info = 0;
561 /* Extract the flags */
562 object_flags(o_ptr, flgs);
564 /* Extract the description */
566 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
567 (k_text + k_info[o_ptr->k_idx].text),
568 77 - 15, temp, sizeof(temp));
569 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
570 { info[i] = &temp[j]; i++;}
573 if (object_is_equipment(o_ptr))
575 /* Descriptions of a basic equipment is just a flavor */
579 /* Mega-Hack -- describe activation */
580 if (have_flag(flgs, TR_ACTIVATE))
583 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
585 info[i++] = "It can be activated for...";
588 info[i++] = item_activation(o_ptr);
590 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
592 info[i++] = "...if it is being worn.";
597 /* Figurines, a hack */
598 if (o_ptr->tval == TV_FIGURINE)
601 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
603 info[i++] = "It will transform into a pet when thrown.";
608 /* Figurines, a hack */
609 if (o_ptr->name1 == ART_STONEMASK)
612 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
614 info[i++] = "It makes you turn into a vampire permanently.";
619 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
622 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
624 info[i++] = "It will attempt to kill a monster instantly.";
629 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
632 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
634 info[i++] = "It causes you to strike yourself sometimes.";
638 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
640 info[i++] = "It always penetrates invulnerability barriers.";
644 if (o_ptr->name2 == EGO_2WEAPON)
647 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
649 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
654 if (have_flag(flgs, TR_EASY_SPELL))
657 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
659 info[i++] = "It affects your ability to cast spells.";
663 if (o_ptr->name2 == EGO_AMU_FOOL)
666 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
668 info[i++] = "It interferes with casting spells.";
672 if (o_ptr->name2 == EGO_RING_THROW)
675 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
677 info[i++] = "It provides great strength when you throw an item.";
681 if (o_ptr->name2 == EGO_AMU_NAIVETY)
684 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
686 info[i++] = "It decreases your magic resistance.";
690 if (o_ptr->tval == TV_STATUE)
692 monster_race *r_ptr = &r_info[o_ptr->pval];
694 if (o_ptr->pval == MON_BULLGATES)
696 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
698 info[i++] = "It is shameful.";
700 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
702 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
704 info[i++] = "It is fearful.";
708 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
710 info[i++] = "It is cheerful.";
714 /* Hack -- describe lite's */
715 if (o_ptr->tval == TV_LITE)
717 if (o_ptr->name2 == EGO_LITE_DARKNESS)
720 info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
722 info[i++] = "It provides no light.";
725 if (o_ptr->sval == SV_LITE_FEANOR)
728 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
730 info[i++] = "It decreases radius of light source by 3.";
733 else if (o_ptr->sval == SV_LITE_LANTERN)
736 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
738 info[i++] = "It decreases radius of light source by 2.";
744 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
746 info[i++] = "It decreases radius of light source by 1.";
750 else if (object_is_fixed_artifact(o_ptr))
753 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
755 info[i++] = "It provides light (radius 3) forever.";
759 else if (o_ptr->name2 == EGO_LITE_SHINE)
761 if (o_ptr->sval == SV_LITE_FEANOR)
764 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
766 info[i++] = "It provides light (radius 3) forever.";
770 else if (o_ptr->sval == SV_LITE_LANTERN)
773 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
775 info[i++] = "It provides light (radius 3) when fueled.";
782 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
784 info[i++] = "It provides light (radius 2) when fueled.";
791 if (o_ptr->sval == SV_LITE_FEANOR)
794 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
796 info[i++] = "It provides light (radius 2) forever.";
800 else if (o_ptr->sval == SV_LITE_LANTERN)
803 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
805 info[i++] = "It provides light (radius 2) when fueled.";
812 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
814 info[i++] = "It provides light (radius 1) when fueled.";
819 if (o_ptr->name2 == EGO_LITE_LONG)
822 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
824 info[i++] = "It provides light for much longer time.";
830 /* And then describe it fully */
832 if (have_flag(flgs, TR_RIDING))
834 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
836 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
838 info[i++] = "It is made for use while riding.";
843 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
845 info[i++] = "It is suitable for use while riding.";
847 /* This information is not important enough */
851 if (have_flag(flgs, TR_STR))
854 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
856 info[i++] = "It affects your strength.";
860 if (have_flag(flgs, TR_INT))
863 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
865 info[i++] = "It affects your intelligence.";
869 if (have_flag(flgs, TR_WIS))
872 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
874 info[i++] = "It affects your wisdom.";
878 if (have_flag(flgs, TR_DEX))
881 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
883 info[i++] = "It affects your dexterity.";
887 if (have_flag(flgs, TR_CON))
890 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
892 info[i++] = "It affects your constitution.";
896 if (have_flag(flgs, TR_CHR))
899 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
901 info[i++] = "It affects your charisma.";
906 if (have_flag(flgs, TR_MAGIC_MASTERY))
909 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
911 info[i++] = "It affects your ability to use magic devices.";
915 if (have_flag(flgs, TR_STEALTH))
918 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
920 info[i++] = "It affects your stealth.";
924 if (have_flag(flgs, TR_SEARCH))
927 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
929 info[i++] = "It affects your searching.";
933 if (have_flag(flgs, TR_INFRA))
936 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
938 info[i++] = "It affects your infravision.";
942 if (have_flag(flgs, TR_TUNNEL))
945 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
947 info[i++] = "It affects your ability to tunnel.";
951 if (have_flag(flgs, TR_SPEED))
954 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
956 info[i++] = "It affects your speed.";
960 if (have_flag(flgs, TR_BLOWS))
963 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
965 info[i++] = "It affects your attack speed.";
970 if (have_flag(flgs, TR_BRAND_ACID))
973 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
975 info[i++] = "It does extra damage from acid.";
979 if (have_flag(flgs, TR_BRAND_ELEC))
982 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
984 info[i++] = "It does extra damage from electricity.";
988 if (have_flag(flgs, TR_BRAND_FIRE))
991 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
993 info[i++] = "It does extra damage from fire.";
997 if (have_flag(flgs, TR_BRAND_COLD))
1000 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1002 info[i++] = "It does extra damage from frost.";
1007 if (have_flag(flgs, TR_BRAND_POIS))
1010 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
1012 info[i++] = "It poisons your foes.";
1017 if (have_flag(flgs, TR_CHAOTIC))
1020 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
1022 info[i++] = "It produces chaotic effects.";
1027 if (have_flag(flgs, TR_VAMPIRIC))
1030 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
1032 info[i++] = "It drains life from your foes.";
1037 if (have_flag(flgs, TR_IMPACT))
1040 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
1042 info[i++] = "It can cause earthquakes.";
1047 if (have_flag(flgs, TR_VORPAL))
1050 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1052 info[i++] = "It is very sharp and can cut your foes.";
1057 if (have_flag(flgs, TR_KILL_DRAGON))
1060 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1062 info[i++] = "It is a great bane of dragons.";
1066 else if (have_flag(flgs, TR_SLAY_DRAGON))
1069 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1071 info[i++] = "It is especially deadly against dragons.";
1076 if (have_flag(flgs, TR_KILL_ORC))
1079 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1081 info[i++] = "It is a great bane of orcs.";
1085 if (have_flag(flgs, TR_SLAY_ORC))
1088 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1090 info[i++] = "It is especially deadly against orcs.";
1095 if (have_flag(flgs, TR_KILL_TROLL))
1098 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1100 info[i++] = "It is a great bane of trolls.";
1104 if (have_flag(flgs, TR_SLAY_TROLL))
1107 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1109 info[i++] = "It is especially deadly against trolls.";
1114 if (have_flag(flgs, TR_KILL_GIANT))
1117 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1119 info[i++] = "It is a great bane of giants.";
1122 else if (have_flag(flgs, TR_SLAY_GIANT))
1125 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1127 info[i++] = "It is especially deadly against giants.";
1132 if (have_flag(flgs, TR_KILL_DEMON))
1135 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1137 info[i++] = "It is a great bane of demons.";
1141 if (have_flag(flgs, TR_SLAY_DEMON))
1144 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1146 info[i++] = "It strikes at demons with holy wrath.";
1151 if (have_flag(flgs, TR_KILL_UNDEAD))
1154 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1156 info[i++] = "It is a great bane of undead.";
1160 if (have_flag(flgs, TR_SLAY_UNDEAD))
1163 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1165 info[i++] = "It strikes at undead with holy wrath.";
1170 if (have_flag(flgs, TR_KILL_EVIL))
1173 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1175 info[i++] = "It is a great bane of evil monsters.";
1179 if (have_flag(flgs, TR_SLAY_EVIL))
1182 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1184 info[i++] = "It fights against evil with holy fury.";
1189 if (have_flag(flgs, TR_KILL_ANIMAL))
1192 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1194 info[i++] = "It is a great bane of natural creatures.";
1198 if (have_flag(flgs, TR_SLAY_ANIMAL))
1201 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1203 info[i++] = "It is especially deadly against natural creatures.";
1208 if (have_flag(flgs, TR_KILL_HUMAN))
1211 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1213 info[i++] = "It is a great bane of humans.";
1217 if (have_flag(flgs, TR_SLAY_HUMAN))
1220 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1222 info[i++] = "It is especially deadly against humans.";
1227 if (have_flag(flgs, TR_FORCE_WEAPON))
1230 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
1232 info[i++] = "It powerfully strikes at a monster using your mana.";
1236 if (have_flag(flgs, TR_DEC_MANA))
1239 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
1241 info[i++] = "It decreases your mana consumption.";
1245 if (have_flag(flgs, TR_SUST_STR))
1248 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
1250 info[i++] = "It sustains your strength.";
1254 if (have_flag(flgs, TR_SUST_INT))
1257 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
1259 info[i++] = "It sustains your intelligence.";
1263 if (have_flag(flgs, TR_SUST_WIS))
1266 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
1268 info[i++] = "It sustains your wisdom.";
1272 if (have_flag(flgs, TR_SUST_DEX))
1275 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
1277 info[i++] = "It sustains your dexterity.";
1281 if (have_flag(flgs, TR_SUST_CON))
1284 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
1286 info[i++] = "It sustains your constitution.";
1290 if (have_flag(flgs, TR_SUST_CHR))
1293 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
1295 info[i++] = "It sustains your charisma.";
1300 if (have_flag(flgs, TR_IM_ACID))
1303 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1305 info[i++] = "It provides immunity to acid.";
1309 if (have_flag(flgs, TR_IM_ELEC))
1312 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1314 info[i++] = "It provides immunity to electricity.";
1318 if (have_flag(flgs, TR_IM_FIRE))
1321 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1323 info[i++] = "It provides immunity to fire.";
1327 if (have_flag(flgs, TR_IM_COLD))
1330 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1332 info[i++] = "It provides immunity to cold.";
1337 if (have_flag(flgs, TR_THROW))
1340 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1342 info[i++] = "It is perfectly balanced for throwing.";
1346 if (have_flag(flgs, TR_FREE_ACT))
1349 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1351 info[i++] = "It provides immunity to paralysis.";
1355 if (have_flag(flgs, TR_HOLD_LIFE))
1358 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
1360 info[i++] = "It provides resistance to life draining.";
1364 if (have_flag(flgs, TR_RES_FEAR))
1367 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1369 info[i++] = "It makes you completely fearless.";
1373 if (have_flag(flgs, TR_RES_ACID))
1376 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1378 info[i++] = "It provides resistance to acid.";
1382 if (have_flag(flgs, TR_RES_ELEC))
1385 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1387 info[i++] = "It provides resistance to electricity.";
1391 if (have_flag(flgs, TR_RES_FIRE))
1394 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1396 info[i++] = "It provides resistance to fire.";
1400 if (have_flag(flgs, TR_RES_COLD))
1403 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1405 info[i++] = "It provides resistance to cold.";
1409 if (have_flag(flgs, TR_RES_POIS))
1412 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1414 info[i++] = "It provides resistance to poison.";
1419 if (have_flag(flgs, TR_RES_LITE))
1422 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1424 info[i++] = "It provides resistance to light.";
1428 if (have_flag(flgs, TR_RES_DARK))
1431 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1433 info[i++] = "It provides resistance to dark.";
1438 if (have_flag(flgs, TR_RES_BLIND))
1441 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1443 info[i++] = "It provides resistance to blindness.";
1447 if (have_flag(flgs, TR_RES_CONF))
1450 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1452 info[i++] = "It provides resistance to confusion.";
1456 if (have_flag(flgs, TR_RES_SOUND))
1459 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1461 info[i++] = "It provides resistance to sound.";
1465 if (have_flag(flgs, TR_RES_SHARDS))
1468 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1470 info[i++] = "It provides resistance to shards.";
1475 if (have_flag(flgs, TR_RES_NETHER))
1478 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1480 info[i++] = "It provides resistance to nether.";
1484 if (have_flag(flgs, TR_RES_NEXUS))
1487 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1489 info[i++] = "It provides resistance to nexus.";
1493 if (have_flag(flgs, TR_RES_CHAOS))
1496 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1498 info[i++] = "It provides resistance to chaos.";
1502 if (have_flag(flgs, TR_RES_DISEN))
1505 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1507 info[i++] = "It provides resistance to disenchantment.";
1512 if (have_flag(flgs, TR_LEVITATION))
1515 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1517 info[i++] = "It allows you to levitate.";
1521 if (have_flag(flgs, TR_LITE))
1523 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
1525 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1527 info[i++] = "It decreases radius of your light source by 1.";
1531 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
1533 info[i++] = "It provides permanent light. (radius +1)";
1537 if (have_flag(flgs, TR_SEE_INVIS))
1540 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1542 info[i++] = "It allows you to see invisible monsters.";
1546 if (have_flag(flgs, TR_TELEPATHY))
1549 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
1551 info[i++] = "It gives telepathic powers.";
1555 if (have_flag(flgs, TR_ESP_ANIMAL))
1558 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
1560 info[i++] = "It senses natural creatures.";
1564 if (have_flag(flgs, TR_ESP_UNDEAD))
1567 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
1569 info[i++] = "It senses undead.";
1573 if (have_flag(flgs, TR_ESP_DEMON))
1576 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò´¶ÃΤ¹¤ë¡£";
1578 info[i++] = "It senses demons.";
1582 if (have_flag(flgs, TR_ESP_ORC))
1585 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
1587 info[i++] = "It senses orcs.";
1591 if (have_flag(flgs, TR_ESP_TROLL))
1594 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
1596 info[i++] = "It senses trolls.";
1600 if (have_flag(flgs, TR_ESP_GIANT))
1603 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
1605 info[i++] = "It senses giants.";
1609 if (have_flag(flgs, TR_ESP_DRAGON))
1612 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
1614 info[i++] = "It senses dragons.";
1618 if (have_flag(flgs, TR_ESP_HUMAN))
1621 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
1623 info[i++] = "It senses humans.";
1627 if (have_flag(flgs, TR_ESP_EVIL))
1630 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
1632 info[i++] = "It senses evil creatures.";
1636 if (have_flag(flgs, TR_ESP_GOOD))
1639 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
1641 info[i++] = "It senses good creatures.";
1645 if (have_flag(flgs, TR_ESP_NONLIVING))
1648 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
1650 info[i++] = "It senses non-living creatures.";
1654 if (have_flag(flgs, TR_ESP_UNIQUE))
1657 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
1659 info[i++] = "It senses unique monsters.";
1663 if (have_flag(flgs, TR_SLOW_DIGEST))
1666 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
1668 info[i++] = "It slows your metabolism.";
1672 if (have_flag(flgs, TR_REGEN))
1675 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
1677 info[i++] = "It speeds your regenerative powers.";
1681 if (have_flag(flgs, TR_WARNING))
1684 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
1686 info[i++] = "It warns you of danger";
1690 if (have_flag(flgs, TR_REFLECT))
1693 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
1695 info[i++] = "It reflects bolts and arrows.";
1699 if (have_flag(flgs, TR_SH_FIRE))
1702 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1704 info[i++] = "It produces a fiery sheath.";
1708 if (have_flag(flgs, TR_SH_ELEC))
1711 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1713 info[i++] = "It produces an electric sheath.";
1717 if (have_flag(flgs, TR_SH_COLD))
1720 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1722 info[i++] = "It produces a sheath of coldness.";
1726 if (have_flag(flgs, TR_NO_MAGIC))
1729 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1731 info[i++] = "It produces an anti-magic shell.";
1735 if (have_flag(flgs, TR_NO_TELE))
1738 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
1740 info[i++] = "It prevents teleportation.";
1744 if (have_flag(flgs, TR_XTRA_MIGHT))
1747 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1749 info[i++] = "It fires missiles with extra might.";
1753 if (have_flag(flgs, TR_XTRA_SHOTS))
1756 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1758 info[i++] = "It fires missiles excessively fast.";
1763 if (have_flag(flgs, TR_BLESSED))
1766 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
1768 info[i++] = "It has been blessed by the gods.";
1773 if (object_is_cursed(o_ptr))
1775 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
1778 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1780 info[i++] = "It is permanently cursed.";
1784 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
1787 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1789 info[i++] = "It is heavily cursed.";
1796 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
1798 info[i++] = "It is cursed.";
1802 * It's a trivial infomation since there is
1803 * fake inscription {cursed}
1809 if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
1812 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
1814 info[i++] = "It carries an ancient foul curse.";
1818 if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
1821 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
1823 info[i++] = "It aggravates nearby creatures.";
1827 if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
1830 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
1832 info[i++] = "It drains experience.";
1836 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
1839 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
1841 info[i++] = "It slows your regenerative powers.";
1845 if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
1848 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
1850 info[i++] = "It adds weak curses.";
1854 if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
1857 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
1859 info[i++] = "It adds heavy curses.";
1863 if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
1866 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1868 info[i++] = "It attracts animals.";
1872 if (o_ptr->curse_flags & TRC_CALL_DEMON)
1875 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1877 info[i++] = "It attracts demons.";
1881 if (o_ptr->curse_flags & TRC_CALL_DRAGON)
1884 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1886 info[i++] = "It attracts dragons.";
1890 if (o_ptr->curse_flags & TRC_COWARDICE)
1893 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£";
1895 info[i++] = "It makes you subject to cowardice.";
1899 if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
1902 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£";
1904 info[i++] = "It induces random teleportation.";
1908 if (o_ptr->curse_flags & TRC_LOW_MELEE)
1911 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
1913 info[i++] = "It causes you to miss blows.";
1917 if (o_ptr->curse_flags & TRC_LOW_AC)
1920 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
1922 info[i++] = "It helps your enemies' blows.";
1926 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
1929 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
1931 info[i++] = "It encumbers you while spellcasting.";
1935 if (o_ptr->curse_flags & TRC_FAST_DIGEST)
1938 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
1940 info[i++] = "It speeds your metabolism.";
1944 if (o_ptr->curse_flags & TRC_DRAIN_HP)
1947 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
1949 info[i++] = "It drains you.";
1953 if (o_ptr->curse_flags & TRC_DRAIN_MANA)
1956 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
1958 info[i++] = "It drains your mana.";
1963 /* Describe about this kind of object instead of THIS fake object */
1964 if (mode & SCROBJ_FAKE_OBJECT)
1966 switch (o_ptr->tval)
1969 switch (o_ptr->sval)
1971 case SV_RING_LORDLY:
1973 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1975 info[i++] = "It provides some random resistances.";
1978 case SV_RING_WARNING:
1980 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1982 info[i++] = "It may provide a low rank ESP.";
1989 switch (o_ptr->sval)
1991 case SV_AMULET_RESISTANCE:
1993 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1995 info[i++] = "It may provides resistance to poison.";
1998 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2000 info[i++] = "It may provide a random resistances.";
2003 case SV_AMULET_THE_MAGI:
2005 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
2007 info[i++] = "It provides up to three low rank ESPs.";
2015 if (have_flag(flgs, TR_IGNORE_ACID) &&
2016 have_flag(flgs, TR_IGNORE_ELEC) &&
2017 have_flag(flgs, TR_IGNORE_FIRE) &&
2018 have_flag(flgs, TR_IGNORE_COLD))
2021 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2023 info[i++] = "It cannot be harmed by the elements.";
2028 if (have_flag(flgs, TR_IGNORE_ACID))
2031 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2033 info[i++] = "It cannot be harmed by acid.";
2036 if (have_flag(flgs, TR_IGNORE_ELEC))
2039 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2041 info[i++] = "It cannot be harmed by electricity.";
2044 if (have_flag(flgs, TR_IGNORE_FIRE))
2047 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2049 info[i++] = "It cannot be harmed by fire.";
2052 if (have_flag(flgs, TR_IGNORE_COLD))
2055 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2057 info[i++] = "It cannot be harmed by cold.";
2062 if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
2064 /* No relevant informations */
2065 if (i <= trivial_info) return (FALSE);
2067 /* Save the screen */
2071 Term_get_size(&wid, &hgt);
2073 /* Display Item name */
2074 if (!(mode & SCROBJ_FAKE_OBJECT))
2075 object_desc(o_name, o_ptr, 0);
2077 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
2081 /* Erase the screen */
2082 for (k = 1; k < hgt; k++) prt("", k, 13);
2084 /* Label the information */
2085 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
2087 monster_race *r_ptr = &r_info[o_ptr->pval];
2088 int namelen = strlen(r_name + r_ptr->name);
2089 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
2090 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
2091 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
2095 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
2097 prt(" Item Attributes:", 1, 15);
2100 /* We will print on top of the map (column 13) */
2101 for (k = 2, j = 0; j < i; j++)
2104 prt(info[j], k++, 15);
2106 /* Every 20 entries (lines 2 to 21), start over */
2107 if ((k == hgt - 2) && (j+1 < i))
2110 prt("-- ³¤¯ --", k, 15);
2112 prt("-- more --", k, 15);
2115 for (; k > 2; k--) prt("", k, 15);
2121 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
2123 prt("[Press any key to continue]", k, 15);
2128 /* Restore the screen */
2131 /* Gave knowledge */
2138 * Convert an inventory index into a one character label
2139 * Note that the label does NOT distinguish inven/equip.
2141 char index_to_label(int i)
2143 /* Indexes for "inven" are easy */
2144 if (i < INVEN_RARM) return (I2A(i));
2146 /* Indexes for "equip" are offset */
2147 return (I2A(i - INVEN_RARM));
2152 * Convert a label into the index of an item in the "inven"
2153 * Return "-1" if the label does not indicate a real item
2155 s16b label_to_inven(int c)
2160 i = (islower(c) ? A2I(c) : -1);
2162 /* Verify the index */
2163 if ((i < 0) || (i > INVEN_PACK)) return (-1);
2165 /* Empty slots can never be chosen */
2166 if (!inventory[i].k_idx) return (-1);
2168 /* Return the index */
2174 extern bool select_ring_slot;
2177 static bool is_ring_slot(int i)
2179 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
2184 * Convert a label into the index of a item in the "equip"
2185 * Return "-1" if the label does not indicate a real item
2187 s16b label_to_equip(int c)
2192 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
2194 /* Verify the index */
2195 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
2197 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
2199 /* Empty slots can never be chosen */
2200 if (!inventory[i].k_idx) return (-1);
2202 /* Return the index */
2209 * Determine which equipment slot (if any) an item likes
2211 s16b wield_slot(object_type *o_ptr)
2213 /* Slot for equipment */
2214 switch (o_ptr->tval)
2221 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
2222 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
2223 return (INVEN_LARM);
2230 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
2231 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
2232 return (INVEN_RARM);
2242 /* Use the right hand first */
2243 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
2245 /* Use the left hand for swapping (by default) */
2246 return (INVEN_LEFT);
2252 return (INVEN_NECK);
2257 return (INVEN_LITE);
2264 return (INVEN_BODY);
2269 return (INVEN_OUTER);
2275 return (INVEN_HEAD);
2280 return (INVEN_HANDS);
2285 return (INVEN_FEET);
2289 /* No slot available */
2295 * Return a string mentioning how a given item is carried
2297 cptr mention_use(int i)
2301 /* Examine the location */
2305 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
2307 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
2311 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " ξ¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
2313 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
2317 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
2319 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
2323 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
2325 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
2329 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
2331 case INVEN_LEFT: p = (left_hander ? "On right hand" : "On left hand"); break;
2335 case INVEN_NECK: p = " ¼ó"; break;
2337 case INVEN_NECK: p = "Around neck"; break;
2341 case INVEN_LITE: p = " ¸÷¸»"; break;
2343 case INVEN_LITE: p = "Light source"; break;
2347 case INVEN_BODY: p = " ÂÎ"; break;
2349 case INVEN_BODY: p = "On body"; break;
2353 case INVEN_OUTER: p = "ÂΤξå"; break;
2355 case INVEN_OUTER: p = "About body"; break;
2359 case INVEN_HEAD: p = " Ƭ"; break;
2361 case INVEN_HEAD: p = "On head"; break;
2365 case INVEN_HANDS: p = " ¼ê"; break;
2367 case INVEN_HANDS: p = "On hands"; break;
2371 case INVEN_FEET: p = " "; break;
2373 case INVEN_FEET: p = "On feet"; break;
2377 default: p = "¥¶¥Ã¥¯"; break;
2379 default: p = "In pack"; break;
2383 /* Return the result */
2389 * Return a string describing how a given item is being worn.
2390 * Currently, only used for items in the equipment, not inventory.
2392 cptr describe_use(int i)
2399 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2401 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
2405 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2407 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
2411 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
2413 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
2417 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2419 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
2423 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2425 case INVEN_LEFT: p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
2429 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
2431 case INVEN_NECK: p = "wearing around your neck"; break;
2435 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
2437 case INVEN_LITE: p = "using to light the way"; break;
2441 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
2443 case INVEN_BODY: p = "wearing on your body"; break;
2447 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
2449 case INVEN_OUTER: p = "wearing on your back"; break;
2453 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
2455 case INVEN_HEAD: p = "wearing on your head"; break;
2459 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
2461 case INVEN_HANDS: p = "wearing on your hands"; break;
2465 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
2467 case INVEN_FEET: p = "wearing on your feet"; break;
2471 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
2473 default: p = "carrying in your pack"; break;
2477 /* Return the result */
2482 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
2484 bool check_book_realm(const byte book_tval, const byte book_sval)
2486 if (book_tval < TV_LIFE_BOOK) return FALSE;
2487 if (p_ptr->pclass == CLASS_SORCERER)
2489 return is_magic(tval2realm(book_tval));
2491 else if (p_ptr->pclass == CLASS_RED_MAGE)
2493 if (is_magic(tval2realm(book_tval)))
2494 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
2496 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
2501 * Check an item against the item tester info
2503 bool item_tester_okay(object_type *o_ptr)
2505 /* Hack -- allow listing empty slots */
2506 if (item_tester_full) return (TRUE);
2508 /* Require an item */
2509 if (!o_ptr->k_idx) return (FALSE);
2511 /* Hack -- ignore "gold" */
2512 if (o_ptr->tval == TV_GOLD)
2515 extern bool show_gold_on_floor;
2517 if (!show_gold_on_floor) return (FALSE);
2520 /* Check the tval */
2521 if (item_tester_tval)
2523 /* Is it a spellbook? If so, we need a hack -- TY */
2524 if ((item_tester_tval <= TV_DEATH_BOOK) &&
2525 (item_tester_tval >= TV_LIFE_BOOK))
2526 return check_book_realm(o_ptr->tval, o_ptr->sval);
2528 if (item_tester_tval != o_ptr->tval) return (FALSE);
2531 /* Check the hook */
2532 if (item_tester_hook)
2534 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
2545 * Choice window "shadow" of the "show_inven()" function
2547 void display_inven(void)
2549 register int i, n, z = 0;
2551 byte attr = TERM_WHITE;
2553 char o_name[MAX_NLEN];
2557 Term_get_size(&wid, &hgt);
2559 /* Find the "final" slot */
2560 for (i = 0; i < INVEN_PACK; i++)
2562 o_ptr = &inventory[i];
2564 /* Skip non-objects */
2565 if (!o_ptr->k_idx) continue;
2571 /* Display the pack */
2572 for (i = 0; i < z; i++)
2574 /* Examine the item */
2575 o_ptr = &inventory[i];
2577 /* Start with an empty "index" */
2578 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2580 /* Is this item "acceptable"? */
2581 if (item_tester_okay(o_ptr))
2583 /* Prepare an "index" */
2584 tmp_val[0] = index_to_label(i);
2586 /* Bracket the "index" --(-- */
2590 /* Display the index (or blank space) */
2591 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
2593 /* Obtain an item description */
2594 object_desc(o_name, o_ptr, 0);
2596 /* Obtain the length of the description */
2600 attr = tval_to_attr[o_ptr->tval % 128];
2602 /* Grey out charging items */
2608 /* Display the entry itself */
2609 Term_putstr(3, i, n, attr, o_name);
2611 /* Erase the rest of the line */
2612 Term_erase(3+n, i, 255);
2614 /* Display the weight if needed */
2617 int wgt = o_ptr->weight * o_ptr->number;
2619 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
2621 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2624 prt(tmp_val, i, wid - 9);
2628 /* Erase the rest of the window */
2629 for (i = z; i < hgt; i++)
2631 /* Erase the line */
2632 Term_erase(0, i, 255);
2639 * Choice window "shadow" of the "show_equip()" function
2641 void display_equip(void)
2645 byte attr = TERM_WHITE;
2647 char o_name[MAX_NLEN];
2651 Term_get_size(&wid, &hgt);
2653 /* Display the equipment */
2654 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2656 /* Examine the item */
2657 o_ptr = &inventory[i];
2659 /* Start with an empty "index" */
2660 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2662 /* Is this item "acceptable"? */
2663 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
2665 /* Prepare an "index" */
2666 tmp_val[0] = index_to_label(i);
2668 /* Bracket the "index" --(-- */
2672 /* Display the index (or blank space) */
2673 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
2675 /* Obtain an item description */
2676 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
2679 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
2681 strcpy(o_name, "(wielding with two-hands)");
2687 object_desc(o_name, o_ptr, 0);
2688 attr = tval_to_attr[o_ptr->tval % 128];
2691 /* Obtain the length of the description */
2694 /* Grey out charging items */
2700 /* Display the entry itself */
2701 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
2703 /* Erase the rest of the line */
2704 Term_erase(3+n, i - INVEN_RARM, 255);
2706 /* Display the weight (if needed) */
2709 int wgt = o_ptr->weight * o_ptr->number;
2711 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
2713 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2716 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
2719 /* Display the slot description (if needed) */
2722 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
2723 prt(mention_use(i), i - INVEN_RARM, wid - 15);
2727 /* Erase the rest of the window */
2728 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
2730 /* Clear that line */
2731 Term_erase(0, i, 255);
2737 * Find the "first" inventory object with the given "tag".
2739 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2740 * inscription of an object. Alphabetical characters don't work as a
2743 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2744 * and "x" is the "current" command_cmd code.
2746 static bool get_tag(int *cp, char tag, int mode)
2751 /* Extract index from mode */
2756 end = INVEN_TOTAL - 1;
2761 end = INVEN_PACK - 1;
2768 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2770 /* Check every inventory object */
2771 for (i = start; i <= end; i++)
2773 object_type *o_ptr = &inventory[i];
2775 /* Skip non-objects */
2776 if (!o_ptr->k_idx) continue;
2778 /* Skip empty inscriptions */
2779 if (!o_ptr->inscription) continue;
2781 /* Skip non-choice */
2782 if (!item_tester_okay(o_ptr)) continue;
2785 s = my_strchr(quark_str(o_ptr->inscription), '@');
2787 /* Process all tags */
2790 /* Check the special tags */
2791 if ((s[1] == command_cmd) && (s[2] == tag))
2793 /* Save the actual inventory ID */
2800 /* Find another '@' */
2801 s = my_strchr(s + 1, '@');
2806 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2808 /* Don't allow {@#} with '#' being alphabet */
2809 if (tag < '0' || '9' < tag)
2815 /* Check every object */
2816 for (i = start; i <= end; i++)
2818 object_type *o_ptr = &inventory[i];
2820 /* Skip non-objects */
2821 if (!o_ptr->k_idx) continue;
2823 /* Skip empty inscriptions */
2824 if (!o_ptr->inscription) continue;
2826 /* Skip non-choice */
2827 if (!item_tester_okay(o_ptr)) continue;
2830 s = my_strchr(quark_str(o_ptr->inscription), '@');
2832 /* Process all tags */
2835 /* Check the normal tags */
2838 /* Save the actual inventory ID */
2845 /* Find another '@' */
2846 s = my_strchr(s + 1, '@');
2856 * Find the "first" floor object with the given "tag".
2858 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2859 * inscription of an object. Alphabetical characters don't work as a
2862 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2863 * and "x" is the "current" command_cmd code.
2865 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
2870 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2872 /* Check every object in the grid */
2873 for (i = 0; i < floor_num && i < 23; i++)
2875 object_type *o_ptr = &o_list[floor_list[i]];
2877 /* Skip empty inscriptions */
2878 if (!o_ptr->inscription) continue;
2881 s = my_strchr(quark_str(o_ptr->inscription), '@');
2883 /* Process all tags */
2886 /* Check the special tags */
2887 if ((s[1] == command_cmd) && (s[2] == tag))
2889 /* Save the actual floor object ID */
2896 /* Find another '@' */
2897 s = my_strchr(s + 1, '@');
2902 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2904 /* Don't allow {@#} with '#' being alphabet */
2905 if (tag < '0' || '9' < tag)
2911 /* Check every object in the grid */
2912 for (i = 0; i < floor_num && i < 23; i++)
2914 object_type *o_ptr = &o_list[floor_list[i]];
2916 /* Skip empty inscriptions */
2917 if (!o_ptr->inscription) continue;
2920 s = my_strchr(quark_str(o_ptr->inscription), '@');
2922 /* Process all tags */
2925 /* Check the normal tags */
2928 /* Save the floor object ID */
2935 /* Find another '@' */
2936 s = my_strchr(s + 1, '@');
2946 * Move around label characters with correspond tags
2948 static void prepare_label_string(char *label, int mode)
2950 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2951 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
2954 /* Prepare normal labels */
2955 strcpy(label, alphabet_chars);
2957 /* Move each label */
2958 for (i = 0; i < 52; i++)
2961 char c = alphabet_chars[i];
2963 /* Find a tag with this label */
2964 if (get_tag(&index, c, mode))
2966 /* Delete the overwritten label */
2967 if (label[i] == c) label[i] = ' ';
2969 /* Move the label to the place of corresponding tag */
2970 label[index - offset] = c;
2977 * Move around label characters with correspond tags (floor version)
2979 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
2981 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2984 /* Prepare normal labels */
2985 strcpy(label, alphabet_chars);
2987 /* Move each label */
2988 for (i = 0; i < 52; i++)
2991 char c = alphabet_chars[i];
2993 /* Find a tag with this label */
2994 if (get_tag_floor(&index, c, floor_list, floor_num))
2996 /* Delete the overwritten label */
2997 if (label[i] == c) label[i] = ' ';
2999 /* Move the label to the place of corresponding tag */
3007 * Display the inventory.
3009 * Hack -- do not display "trailing" empty slots
3011 int show_inven(int target_item)
3013 int i, j, k, l, z = 0;
3014 int col, cur_col, len;
3016 char o_name[MAX_NLEN];
3020 char out_desc[23][MAX_NLEN];
3021 int target_item_label = 0;
3023 char inven_label[52 + 1];
3025 /* Starting column */
3029 Term_get_size(&wid, &hgt);
3031 /* Default "max-length" */
3032 len = wid - col - 1;
3035 /* Find the "final" slot */
3036 for (i = 0; i < INVEN_PACK; i++)
3038 o_ptr = &inventory[i];
3040 /* Skip non-objects */
3041 if (!o_ptr->k_idx) continue;
3047 prepare_label_string(inven_label, USE_INVEN);
3049 /* Display the inventory */
3050 for (k = 0, i = 0; i < z; i++)
3052 o_ptr = &inventory[i];
3054 /* Is this item acceptable? */
3055 if (!item_tester_okay(o_ptr)) continue;
3057 /* Describe the object */
3058 object_desc(o_name, o_ptr, 0);
3060 /* Save the object index, color, and description */
3062 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3064 /* Grey out charging items */
3067 out_color[k] = TERM_L_DARK;
3070 (void)strcpy(out_desc[k], o_name);
3072 /* Find the predicted "line length" */
3073 l = strlen(out_desc[k]) + 5;
3075 /* Be sure to account for the weight */
3076 if (show_weights) l += 9;
3078 /* Account for icon if displayed */
3079 if (show_item_graph)
3082 if (use_bigtile) l++;
3085 /* Maintain the maximum length */
3086 if (l > len) len = l;
3088 /* Advance to next "line" */
3092 /* Find the column to start in */
3093 col = (len > wid - 4) ? 0 : (wid - len - 1);
3095 /* Output each entry */
3096 for (j = 0; j < k; j++)
3102 o_ptr = &inventory[i];
3104 /* Clear the line */
3105 prt("", j + 1, col ? col - 2 : col);
3107 if (use_menu && target_item)
3109 if (j == (target_item-1))
3112 strcpy(tmp_val, "¡Õ");
3114 strcpy(tmp_val, "> ");
3116 target_item_label = i;
3118 else strcpy(tmp_val, " ");
3120 else if (i <= INVEN_PACK)
3122 /* Prepare an index --(-- */
3123 sprintf(tmp_val, "%c)", inven_label[i]);
3127 /* Prepare an index --(-- */
3128 sprintf(tmp_val, "%c)", index_to_label(i));
3131 /* Clear the line with the (possibly indented) index */
3132 put_str(tmp_val, j + 1, col);
3136 /* Display graphics for object, if desired */
3137 if (show_item_graph)
3139 byte a = object_attr(o_ptr);
3140 char c = object_char(o_ptr);
3143 if (a & 0x80) a |= 0x40;
3146 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3147 if (use_bigtile) cur_col++;
3153 /* Display the entry itself */
3154 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3156 /* Display the weight if needed */
3159 int wgt = o_ptr->weight * o_ptr->number;
3161 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3163 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3166 prt(tmp_val, j + 1, wid - 9);
3170 /* Make a "shadow" below the list (only if needed) */
3171 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3173 /* Save the new column */
3176 return target_item_label;
3182 * Display the equipment.
3184 int show_equip(int target_item)
3187 int col, cur_col, len;
3190 char o_name[MAX_NLEN];
3193 char out_desc[23][MAX_NLEN];
3194 int target_item_label = 0;
3196 char equip_label[52 + 1];
3198 /* Starting column */
3202 Term_get_size(&wid, &hgt);
3204 /* Maximal length */
3205 len = wid - col - 1;
3208 /* Scan the equipment list */
3209 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3211 o_ptr = &inventory[i];
3213 /* Is this item acceptable? */
3214 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
3215 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3216 item_tester_no_ryoute)) continue;
3219 object_desc(o_name, o_ptr, 0);
3221 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3224 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
3226 (void)strcpy(out_desc[k],"(wielding with two-hands)");
3228 out_color[k] = TERM_WHITE;
3232 (void)strcpy(out_desc[k], o_name);
3233 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3237 /* Grey out charging items */
3240 out_color[k] = TERM_L_DARK;
3243 /* Extract the maximal length (see below) */
3245 l = strlen(out_desc[k]) + (2 + 1);
3247 l = strlen(out_desc[k]) + (2 + 3);
3251 /* Increase length for labels (if needed) */
3253 if (show_labels) l += (7 + 2);
3255 if (show_labels) l += (14 + 2);
3259 /* Increase length for weight (if needed) */
3260 if (show_weights) l += 9;
3262 if (show_item_graph) l += 2;
3264 /* Maintain the max-length */
3265 if (l > len) len = l;
3267 /* Advance the entry */
3271 /* Hack -- Find a column to start in */
3273 col = (len > wid - 6) ? 0 : (wid - len - 1);
3275 col = (len > wid - 4) ? 0 : (wid - len - 1);
3278 prepare_label_string(equip_label, USE_EQUIP);
3280 /* Output each entry */
3281 for (j = 0; j < k; j++)
3287 o_ptr = &inventory[i];
3289 /* Clear the line */
3290 prt("", j + 1, col ? col - 2 : col);
3292 if (use_menu && target_item)
3294 if (j == (target_item-1))
3297 strcpy(tmp_val, "¡Õ");
3299 strcpy(tmp_val, "> ");
3301 target_item_label = i;
3303 else strcpy(tmp_val, " ");
3305 else if (i >= INVEN_RARM)
3307 /* Prepare an index --(-- */
3308 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3312 /* Prepare an index --(-- */
3313 sprintf(tmp_val, "%c)", index_to_label(i));
3316 /* Clear the line with the (possibly indented) index */
3317 put_str(tmp_val, j+1, col);
3321 /* Display graphics for object, if desired */
3322 if (show_item_graph)
3324 byte a = object_attr(o_ptr);
3325 char c = object_char(o_ptr);
3328 if (a & 0x80) a |= 0x40;
3331 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3332 if (use_bigtile) cur_col++;
3340 /* Mention the use */
3342 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
3344 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
3347 put_str(tmp_val, j+1, cur_col);
3349 /* Display the entry itself */
3351 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
3353 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
3360 /* Display the entry itself */
3361 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
3364 /* Display the weight if needed */
3367 int wgt = o_ptr->weight * o_ptr->number;
3369 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3371 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3374 prt(tmp_val, j + 1, wid - 9);
3378 /* Make a "shadow" below the list (only if needed) */
3379 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3381 /* Save the new column */
3384 return target_item_label;
3391 * Flip "inven" and "equip" in any sub-windows
3393 void toggle_inven_equip(void)
3398 for (j = 0; j < 8; j++)
3401 if (!angband_term[j]) continue;
3403 /* Flip inven to equip */
3404 if (window_flag[j] & (PW_INVEN))
3407 window_flag[j] &= ~(PW_INVEN);
3408 window_flag[j] |= (PW_EQUIP);
3411 p_ptr->window |= (PW_EQUIP);
3414 /* Flip inven to equip */
3415 else if (window_flag[j] & (PW_EQUIP))
3418 window_flag[j] &= ~(PW_EQUIP);
3419 window_flag[j] |= (PW_INVEN);
3422 p_ptr->window |= (PW_INVEN);
3430 * Verify the choice of an item.
3432 * The item can be negative to mean "item on floor".
3434 static bool verify(cptr prompt, int item)
3436 char o_name[MAX_NLEN];
3437 char out_val[MAX_NLEN+20];
3444 o_ptr = &inventory[item];
3450 o_ptr = &o_list[0 - item];
3454 object_desc(o_name, o_ptr, 0);
3458 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
3460 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
3465 return (get_check(out_val));
3470 * Hack -- allow user to "prevent" certain choices
3472 * The item can be negative to mean "item on floor".
3474 static bool get_item_allow(int item)
3480 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
3485 o_ptr = &inventory[item];
3491 o_ptr = &o_list[0 - item];
3494 /* No inscription */
3495 if (!o_ptr->inscription) return (TRUE);
3498 s = my_strchr(quark_str(o_ptr->inscription), '!');
3500 /* Process preventions */
3503 /* Check the "restriction" */
3504 if ((s[1] == command_cmd) || (s[1] == '*'))
3506 /* Verify the choice */
3508 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
3510 if (!verify("Really try", item)) return (FALSE);
3515 /* Find another '!' */
3516 s = my_strchr(s + 1, '!');
3526 * Auxiliary function for "get_item()" -- test an index
3528 static bool get_item_okay(int i)
3531 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
3533 if (select_ring_slot) return is_ring_slot(i);
3535 /* Verify the item */
3536 if (!item_tester_okay(&inventory[i])) return (FALSE);
3545 * Determine whether get_item() can get some item or not
3546 * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
3548 bool can_get_item(void)
3550 int j, floor_list[23], floor_num = 0;
3552 for (j = 0; j < INVEN_TOTAL; j++)
3553 if (item_tester_okay(&inventory[j]))
3556 floor_num = scan_floor(floor_list, py, px, 0x03);
3564 * Let the user select an item, save its "index"
3566 * Return TRUE only if an acceptable item was chosen by the user.
3568 * The selected item must satisfy the "item_tester_hook()" function,
3569 * if that hook is set, and the "item_tester_tval", if that value is set.
3571 * All "item_tester" restrictions are cleared before this function returns.
3573 * The user is allowed to choose acceptable items from the equipment,
3574 * inventory, or floor, respectively, if the proper flag was given,
3575 * and there are any acceptable items in that location.
3577 * The equipment or inventory are displayed (even if no acceptable
3578 * items are in that location) if the proper flag was given.
3580 * If there are no acceptable items available anywhere, and "str" is
3581 * not NULL, then it will be used as the text of a warning message
3582 * before the function returns.
3584 * Note that the user must press "-" to specify the item on the floor,
3585 * and there is no way to "examine" the item on the floor, while the
3586 * use of "capital" letters will "examine" an inventory/equipment item,
3587 * and prompt for its use.
3589 * If a legal item is selected from the inventory, we save it in "cp"
3590 * directly (0 to 35), and return TRUE.
3592 * If a legal item is selected from the floor, we save it in "cp" as
3593 * a negative (-1 to -511), and return TRUE.
3595 * If no item is available, we do nothing to "cp", and we display a
3596 * warning message, using "str" if available, and return FALSE.
3598 * If no item is selected, we do nothing to "cp", and return FALSE.
3600 * Global "p_ptr->command_new" is used when viewing the inventory or equipment
3601 * to allow the user to enter a command while viewing those screens, and
3602 * also to induce "auto-enter" of stores, and other such stuff.
3604 * Global "p_ptr->command_see" may be set before calling this function to start
3605 * out in "browse" mode. It is cleared before this function returns.
3607 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
3608 * If it is TRUE then we are viewing inventory, else equipment.
3610 * We always erase the prompt when we are done, leaving a blank line,
3611 * or a warning message, if appropriate, if no items are available.
3613 bool get_item(int *cp, cptr pmt, cptr str, int mode)
3615 s16b this_o_idx, next_o_idx = 0;
3619 int j, k, i1, i2, e1, e2;
3629 bool allow_floor = FALSE;
3631 bool toggle = FALSE;
3637 extern bool select_the_force;
3639 int menu_line = (use_menu ? 1 : 0);
3645 static char prev_tag = '\0';
3646 char cur_tag = '\0';
3648 #endif /* ALLOW_REPEAT */
3650 #ifdef ALLOW_EASY_FLOOR /* TNB */
3652 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
3654 #endif /* ALLOW_EASY_FLOOR -- TNB */
3657 if (mode & USE_EQUIP) equip = TRUE;
3658 if (mode & USE_INVEN) inven = TRUE;
3659 if (mode & USE_FLOOR) floor = TRUE;
3663 /* Get the item index */
3664 if (repeat_pull(cp))
3667 if (select_the_force && (*cp == INVEN_FORCE))
3669 item_tester_tval = 0;
3670 item_tester_hook = NULL;
3671 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3676 else if (floor && (*cp < 0))
3683 /* Acquire object */
3686 /* Validate the item */
3687 if (item_tester_okay(o_ptr))
3689 /* Forget restrictions */
3690 item_tester_tval = 0;
3691 item_tester_hook = NULL;
3692 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3699 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
3700 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
3702 if (prev_tag && command_cmd)
3704 /* Look up the tag and validate the item */
3705 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
3706 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
3707 else if (!get_item_okay(k)) /* Reject */;
3710 /* Accept that choice */
3713 /* Forget restrictions */
3714 item_tester_tval = 0;
3715 item_tester_hook = NULL;
3716 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3722 prev_tag = '\0'; /* prev_tag is no longer effective */
3725 /* Verify the item */
3726 else if (get_item_okay(*cp))
3728 /* Forget restrictions */
3729 item_tester_tval = 0;
3730 item_tester_hook = NULL;
3731 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3739 #endif /* ALLOW_REPEAT */
3742 /* Paranoia XXX XXX XXX */
3749 /* No item selected */
3753 /* Full inventory */
3755 i2 = INVEN_PACK - 1;
3757 /* Forbid inventory */
3758 if (!inven) i2 = -1;
3761 for (j = 0; j < INVEN_PACK; j++)
3762 if (item_tester_okay(&inventory[j])) max_inven++;
3765 /* Restrict inventory indexes */
3766 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
3767 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
3770 /* Full equipment */
3772 e2 = INVEN_TOTAL - 1;
3774 /* Forbid equipment */
3775 if (!equip) e2 = -1;
3778 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
3779 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
3780 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
3783 /* Restrict equipment indexes */
3784 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
3785 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
3787 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
3791 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
3793 else if (p_ptr->hidarite) e1 = INVEN_RARM;
3797 /* Restrict floor usage */
3800 /* Scan all objects in the grid */
3801 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
3805 /* Acquire object */
3806 o_ptr = &o_list[this_o_idx];
3808 /* Acquire next object */
3809 next_o_idx = o_ptr->next_o_idx;
3811 /* Accept the item on the floor if legal */
3812 if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
3816 /* Require at least one legal choice */
3817 if (!allow_floor && (i1 > i2) && (e1 > e2))
3819 /* Cancel p_ptr->command_see */
3820 command_see = FALSE;
3828 if (select_the_force) {
3834 /* Analyze choices */
3837 /* Hack -- Start on equipment if requested */
3838 if (command_see && command_wrk && equip)
3843 /* Use inventory if allowed */
3846 command_wrk = FALSE;
3849 /* Use equipment if allowed */
3855 /* Use inventory for floor */
3858 command_wrk = FALSE;
3864 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
3866 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
3868 /* Hack -- start out in "display" mode */
3876 /* Repeat until done */
3879 int get_item_label = 0;
3886 for (j = 0; j < 8; j++)
3889 if (!angband_term[j]) continue;
3891 /* Count windows displaying inven */
3892 if (window_flag[j] & (PW_INVEN)) ni++;
3894 /* Count windows displaying equip */
3895 if (window_flag[j] & (PW_EQUIP)) ne++;
3898 /* Toggle if needed */
3899 if ((command_wrk && ni && !ne) ||
3900 (!command_wrk && !ni && ne))
3903 toggle_inven_equip();
3910 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3912 /* Redraw windows */
3916 /* Inventory screen */
3919 /* Redraw if needed */
3920 if (command_see) get_item_label = show_inven(menu_line);
3923 /* Equipment screen */
3926 /* Redraw if needed */
3927 if (command_see) get_item_label = show_equip(menu_line);
3930 /* Viewing inventory */
3933 /* Begin the prompt */
3935 sprintf(out_val, "»ý¤Áʪ:");
3937 sprintf(out_val, "Inven:");
3940 /* Some legal items */
3941 if ((i1 <= i2) && !use_menu)
3943 /* Build the prompt */
3945 sprintf(tmp_val, "%c-%c,'(',')',",
3947 sprintf(tmp_val, " %c-%c,'(',')',",
3949 index_to_label(i1), index_to_label(i2));
3952 strcat(out_val, tmp_val);
3955 /* Indicate ability to "view" */
3957 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3959 if (!command_see && !use_menu) strcat(out_val, " * to see,");
3964 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
3966 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
3970 /* Viewing equipment */
3973 /* Begin the prompt */
3975 sprintf(out_val, "ÁõÈ÷ÉÊ:");
3977 sprintf(out_val, "Equip:");
3980 /* Some legal items */
3981 if ((e1 <= e2) && !use_menu)
3983 /* Build the prompt */
3985 sprintf(tmp_val, "%c-%c,'(',')',",
3987 sprintf(tmp_val, " %c-%c,'(',')',",
3989 index_to_label(e1), index_to_label(e2));
3992 strcat(out_val, tmp_val);
3995 /* Indicate ability to "view" */
3997 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3999 if (!command_see) strcat(out_val, " * to see,");
4004 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
4006 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
4010 /* Indicate legality of the "floor" item */
4012 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
4013 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
4015 if (allow_floor) strcat(out_val, " - for floor,");
4016 if (select_the_force) strcat(out_val, " w for the Force,");
4019 /* Finish the prompt */
4020 strcat(out_val, " ESC");
4022 /* Build the prompt */
4023 sprintf(tmp_val, "(%s) %s", out_val, pmt);
4025 /* Show the prompt */
4033 int max_line = (command_wrk ? max_equip : max_inven);
4049 menu_line += (max_line - 1);
4068 /* Verify legality */
4069 if (!inven || !equip)
4075 /* Hack -- Fix screen */
4085 /* Switch inven/equip */
4086 command_wrk = !command_wrk;
4087 max_line = (command_wrk ? max_equip : max_inven);
4088 if (menu_line > max_line) menu_line = max_line;
4090 /* Need to redraw */
4099 if (command_wrk == USE_FLOOR)
4102 (*cp) = -get_item_label;
4106 /* Validate the item */
4107 if (!get_item_okay(get_item_label))
4113 /* Allow player to "refuse" certain actions */
4114 if (!get_item_allow(get_item_label))
4120 /* Accept that choice */
4121 (*cp) = get_item_label;
4130 if (select_the_force) {
4138 if (menu_line > max_line) menu_line -= max_line;
4159 command_see = FALSE;
4179 /* Verify legality */
4180 if (!inven || !equip)
4186 /* Hack -- Fix screen */
4196 /* Switch inven/equip */
4197 command_wrk = !command_wrk;
4199 /* Need to redraw */
4205 /* Use floor item */
4208 /* Scan all objects in the grid */
4209 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4213 /* Acquire object */
4214 o_ptr = &o_list[this_o_idx];
4216 /* Acquire next object */
4217 next_o_idx = o_ptr->next_o_idx;
4219 /* Validate the item */
4220 if (!item_tester_okay(o_ptr)) continue;
4225 /* Verify the item (if required) */
4227 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
4229 if (other_query_flag && !verify("Try", k)) continue;
4233 /* Allow player to "refuse" certain actions */
4234 if (!get_item_allow(k)) continue;
4236 /* Accept that choice */
4253 case '1': case '2': case '3':
4254 case '4': case '5': case '6':
4255 case '7': case '8': case '9':
4257 /* Look up the tag */
4258 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4264 /* Hack -- Validate the item */
4265 if ((k < INVEN_RARM) ? !inven : !equip)
4271 /* Validate the item */
4272 if (!get_item_okay(k))
4278 /* Allow player to "refuse" certain actions */
4279 if (!get_item_allow(k))
4285 /* Accept that choice */
4291 #endif /* ALLOW_REPEAT */
4299 /* Choose "default" inventory item */
4302 k = ((i1 == i2) ? i1 : -1);
4305 /* Choose "default" equipment item */
4308 k = ((e1 == e2) ? e1 : -1);
4311 /* Validate the item */
4312 if (!get_item_okay(k))
4318 /* Allow player to "refuse" certain actions */
4319 if (!get_item_allow(k))
4325 /* Accept that choice */
4335 if (select_the_force) {
4348 bool not_found = FALSE;
4350 /* Look up the alphabetical tag */
4351 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4356 /* Hack -- Validate the item */
4357 else if ((k < INVEN_RARM) ? !inven : !equip)
4362 /* Validate the item */
4363 else if (!get_item_okay(k))
4370 /* Accept that choice */
4376 #endif /* ALLOW_REPEAT */
4380 /* Extract "query" setting */
4381 ver = isupper(which);
4382 which = tolower(which);
4384 /* Convert letter to inventory index */
4387 if (which == '(') k = i1;
4388 else if (which == ')') k = i2;
4389 else k = label_to_inven(which);
4392 /* Convert letter to equipment index */
4395 if (which == '(') k = e1;
4396 else if (which == ')') k = e2;
4397 else k = label_to_equip(which);
4400 /* Validate the item */
4401 if (!get_item_okay(k))
4407 /* Verify the item */
4409 if (ver && !verify("ËÜÅö¤Ë", k))
4411 if (ver && !verify("Try", k))
4419 /* Allow player to "refuse" certain actions */
4420 if (!get_item_allow(k))
4426 /* Accept that choice */
4437 /* Fix the screen if necessary */
4443 /* Hack -- Cancel "display" */
4444 command_see = FALSE;
4448 /* Forget the item_tester_tval restriction */
4449 item_tester_tval = 0;
4451 item_tester_no_ryoute = FALSE;
4453 /* Forget the item_tester_hook restriction */
4454 item_tester_hook = NULL;
4457 /* Clean up 'show choices' */
4458 /* Toggle again if needed */
4459 if (toggle) toggle_inven_equip();
4462 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4468 /* Clear the prompt line */
4471 /* Warning if needed */
4472 if (oops && str) msg_print(str);
4478 if (command_cmd) prev_tag = cur_tag;
4479 #endif /* ALLOW_REPEAT */
4481 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4489 #ifdef ALLOW_EASY_FLOOR
4494 * Return a list of o_list[] indexes of items at the given cave
4495 * location. Valid flags are:
4497 * mode & 0x01 -- Item tester
4498 * mode & 0x02 -- Marked items only
4499 * mode & 0x04 -- Stop after first
4501 int scan_floor(int *items, int y, int x, int mode)
4503 int this_o_idx, next_o_idx;
4508 if (!in_bounds(y, x)) return 0;
4510 /* Scan all objects in the grid */
4511 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
4515 /* Acquire object */
4516 o_ptr = &o_list[this_o_idx];
4518 /* Acquire next object */
4519 next_o_idx = o_ptr->next_o_idx;
4522 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
4525 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
4527 /* Accept this item */
4528 /* XXX Hack -- Enforce limit */
4530 items[num] = this_o_idx;
4535 if (mode & 0x04) break;
4544 * Display a list of the items on the floor at the given location.
4546 int show_floor(int target_item, int y, int x, int *min_width)
4553 char o_name[MAX_NLEN];
4559 char out_desc[23][MAX_NLEN];
4560 int target_item_label = 0;
4562 int floor_list[23], floor_num;
4564 char floor_label[52 + 1];
4566 bool dont_need_to_show_weights = TRUE;
4569 Term_get_size(&wid, &hgt);
4571 /* Default length */
4572 len = MAX((*min_width), 20);
4575 /* Scan for objects in the grid, using item_tester_okay() */
4576 floor_num = scan_floor(floor_list, y, x, 0x03);
4578 /* Display the floor objects */
4579 for (k = 0, i = 0; i < floor_num && i < 23; i++)
4581 o_ptr = &o_list[floor_list[i]];
4583 /* Describe the object */
4584 object_desc(o_name, o_ptr, 0);
4586 /* Save the index */
4589 /* Acquire inventory color */
4590 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
4592 /* Save the object description */
4593 strcpy(out_desc[k], o_name);
4595 /* Find the predicted "line length" */
4596 l = strlen(out_desc[k]) + 5;
4598 /* Be sure to account for the weight */
4599 if (show_weights) l += 9;
4601 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
4603 /* Maintain the maximum length */
4604 if (l > len) len = l;
4606 /* Advance to next "line" */
4610 if (show_weights && dont_need_to_show_weights) len -= 9;
4615 /* Find the column to start in */
4616 col = (len > wid - 4) ? 0 : (wid - len - 1);
4618 prepare_label_string_floor(floor_label, floor_list, floor_num);
4620 /* Output each entry */
4621 for (j = 0; j < k; j++)
4624 i = floor_list[out_index[j]];
4629 /* Clear the line */
4630 prt("", j + 1, col ? col - 2 : col);
4632 if (use_menu && target_item)
4634 if (j == (target_item-1))
4637 strcpy(tmp_val, "¡Õ");
4639 strcpy(tmp_val, "> ");
4641 target_item_label = i;
4643 else strcpy(tmp_val, " ");
4647 /* Prepare an index --(-- */
4648 sprintf(tmp_val, "%c)", floor_label[j]);
4651 /* Clear the line with the (possibly indented) index */
4652 put_str(tmp_val, j + 1, col);
4654 /* Display the entry itself */
4655 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
4657 /* Display the weight if needed */
4658 if (show_weights && (o_ptr->tval != TV_GOLD))
4660 int wgt = o_ptr->weight * o_ptr->number;
4662 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4664 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4667 prt(tmp_val, j + 1, wid - 9);
4671 /* Make a "shadow" below the list (only if needed) */
4672 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4674 return target_item_label;
4678 * This version of get_item() is called by get_item() when
4679 * the easy_floor is on.
4681 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
4683 char n1 = ' ', n2 = ' ', which = ' ';
4685 int j, k, i1, i2, e1, e2;
4692 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
4693 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
4694 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
4696 bool allow_equip = FALSE;
4697 bool allow_inven = FALSE;
4698 bool allow_floor = FALSE;
4700 bool toggle = FALSE;
4705 int floor_num, floor_list[23], floor_top = 0;
4708 extern bool select_the_force;
4710 int menu_line = (use_menu ? 1 : 0);
4716 static char prev_tag = '\0';
4717 char cur_tag = '\0';
4719 /* Get the item index */
4720 if (repeat_pull(cp))
4723 if (select_the_force && (*cp == INVEN_FORCE))
4725 item_tester_tval = 0;
4726 item_tester_hook = NULL;
4727 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4732 else if (floor && (*cp < 0))
4734 if (prev_tag && command_cmd)
4736 /* Scan all objects in the grid */
4737 floor_num = scan_floor(floor_list, py, px, 0x03);
4739 /* Look up the tag */
4740 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
4742 /* Accept that choice */
4743 (*cp) = 0 - floor_list[k];
4745 /* Forget restrictions */
4746 item_tester_tval = 0;
4747 item_tester_hook = NULL;
4748 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4754 prev_tag = '\0'; /* prev_tag is no longer effective */
4757 /* Validate the item */
4758 else if (item_tester_okay(&o_list[0 - (*cp)]))
4760 /* Forget restrictions */
4761 item_tester_tval = 0;
4762 item_tester_hook = NULL;
4763 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4770 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4771 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4773 if (prev_tag && command_cmd)
4775 /* Look up the tag and validate the item */
4776 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4777 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4778 else if (!get_item_okay(k)) /* Reject */;
4781 /* Accept that choice */
4784 /* Forget restrictions */
4785 item_tester_tval = 0;
4786 item_tester_hook = NULL;
4787 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4793 prev_tag = '\0'; /* prev_tag is no longer effective */
4796 /* Verify the item */
4797 else if (get_item_okay(*cp))
4799 /* Forget restrictions */
4800 item_tester_tval = 0;
4801 item_tester_hook = NULL;
4802 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4810 #endif /* ALLOW_REPEAT */
4813 /* Paranoia XXX XXX XXX */
4820 /* No item selected */
4824 /* Full inventory */
4826 i2 = INVEN_PACK - 1;
4828 /* Forbid inventory */
4829 if (!inven) i2 = -1;
4832 for (j = 0; j < INVEN_PACK; j++)
4833 if (item_tester_okay(&inventory[j])) max_inven++;
4836 /* Restrict inventory indexes */
4837 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4838 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4841 /* Full equipment */
4843 e2 = INVEN_TOTAL - 1;
4845 /* Forbid equipment */
4846 if (!equip) e2 = -1;
4849 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4850 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4851 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4854 /* Restrict equipment indexes */
4855 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4856 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4858 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4862 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4864 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4868 /* Count "okay" floor items */
4871 /* Restrict floor usage */
4874 /* Scan all objects in the grid */
4875 floor_num = scan_floor(floor_list, py, px, 0x03);
4878 /* Accept inventory */
4879 if (i1 <= i2) allow_inven = TRUE;
4881 /* Accept equipment */
4882 if (e1 <= e2) allow_equip = TRUE;
4885 if (floor_num) allow_floor = TRUE;
4887 /* Require at least one legal choice */
4888 if (!allow_inven && !allow_equip && !allow_floor)
4890 /* Cancel p_ptr->command_see */
4891 command_see = FALSE;
4899 if (select_the_force) {
4905 /* Analyze choices */
4908 /* Hack -- Start on equipment if requested */
4909 if (command_see && (command_wrk == (USE_EQUIP))
4912 command_wrk = (USE_EQUIP);
4915 /* Use inventory if allowed */
4916 else if (allow_inven)
4918 command_wrk = (USE_INVEN);
4921 /* Use equipment if allowed */
4922 else if (allow_equip)
4924 command_wrk = (USE_EQUIP);
4927 /* Use floor if allowed */
4928 else if (allow_floor)
4930 command_wrk = (USE_FLOOR);
4935 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4937 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4939 /* Hack -- start out in "display" mode */
4946 /* Repeat until done */
4949 int get_item_label = 0;
4956 for (j = 0; j < 8; j++)
4959 if (!angband_term[j]) continue;
4961 /* Count windows displaying inven */
4962 if (window_flag[j] & (PW_INVEN)) ni++;
4964 /* Count windows displaying equip */
4965 if (window_flag[j] & (PW_EQUIP)) ne++;
4968 /* Toggle if needed */
4969 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
4970 (command_wrk == (USE_INVEN) && !ni && ne))
4973 toggle_inven_equip();
4980 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4982 /* Redraw windows */
4985 /* Inventory screen */
4986 if (command_wrk == (USE_INVEN))
4988 /* Extract the legal requests */
4992 /* Redraw if needed */
4993 if (command_see) get_item_label = show_inven(menu_line);
4996 /* Equipment screen */
4997 else if (command_wrk == (USE_EQUIP))
4999 /* Extract the legal requests */
5000 n1 = I2A(e1 - INVEN_RARM);
5001 n2 = I2A(e2 - INVEN_RARM);
5003 /* Redraw if needed */
5004 if (command_see) get_item_label = show_equip(menu_line);
5008 else if (command_wrk == (USE_FLOOR))
5011 k = MIN(floor_top + 23, floor_num) - 1;
5013 /* Extract the legal requests */
5014 n1 = I2A(j - floor_top);
5015 n2 = I2A(k - floor_top);
5017 /* Redraw if needed */
5018 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
5021 /* Viewing inventory */
5022 if (command_wrk == (USE_INVEN))
5024 /* Begin the prompt */
5026 sprintf(out_val, "»ý¤Áʪ:");
5028 sprintf(out_val, "Inven:");
5033 /* Build the prompt */
5035 sprintf(tmp_val, "%c-%c,'(',')',",
5037 sprintf(tmp_val, " %c-%c,'(',')',",
5039 index_to_label(i1), index_to_label(i2));
5042 strcat(out_val, tmp_val);
5045 /* Indicate ability to "view" */
5047 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5049 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5057 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
5058 else if (allow_floor)
5059 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
5061 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5064 strcat(out_val, " / for Equip,");
5065 else if (allow_floor)
5066 strcat(out_val, " 6 for Equip,");
5068 strcat(out_val, " 4 or 6 for Equip,");
5077 strcat(out_val, " '-'¾²¾å,");
5078 else if (allow_equip)
5079 strcat(out_val, " '4' ¾²¾å,");
5081 strcat(out_val, " '4'or'6' ¾²¾å,");
5084 strcat(out_val, " - for floor,");
5085 else if (allow_equip)
5086 strcat(out_val, " 4 for floor,");
5088 strcat(out_val, " 4 or 6 for floor,");
5093 /* Viewing equipment */
5094 else if (command_wrk == (USE_EQUIP))
5096 /* Begin the prompt */
5098 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5100 sprintf(out_val, "Equip:");
5105 /* Build the prompt */
5107 sprintf(tmp_val, "%c-%c,'(',')',",
5109 sprintf(tmp_val, " %c-%c,'(',')',",
5111 index_to_label(e1), index_to_label(e2));
5114 strcat(out_val, tmp_val);
5117 /* Indicate ability to "view" */
5119 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5121 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5129 strcat(out_val, " '/' »ý¤Áʪ,");
5130 else if (allow_floor)
5131 strcat(out_val, " '4' »ý¤Áʪ,");
5133 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5136 strcat(out_val, " / for Inven,");
5137 else if (allow_floor)
5138 strcat(out_val, " 4 for Inven,");
5140 strcat(out_val, " 4 or 6 for Inven,");
5149 strcat(out_val, " '-'¾²¾å,");
5150 else if (allow_inven)
5151 strcat(out_val, " '6' ¾²¾å,");
5153 strcat(out_val, " '4'or'6' ¾²¾å,");
5156 strcat(out_val, " - for floor,");
5157 else if (allow_inven)
5158 strcat(out_val, " 6 for floor,");
5160 strcat(out_val, " 4 or 6 for floor,");
5166 else if (command_wrk == (USE_FLOOR))
5168 /* Begin the prompt */
5170 sprintf(out_val, "¾²¾å:");
5172 sprintf(out_val, "Floor:");
5177 /* Build the prompt */
5179 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5181 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5185 strcat(out_val, tmp_val);
5188 /* Indicate ability to "view" */
5190 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5192 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5197 if (allow_inven && allow_equip)
5200 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5202 strcat(out_val, " 4 for Equip, 6 for Inven,");
5205 else if (allow_inven)
5208 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5210 strcat(out_val, " 4 or 6 for Inven,");
5213 else if (allow_equip)
5216 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5218 strcat(out_val, " 4 or 6 for Equip,");
5223 else if (allow_inven)
5226 strcat(out_val, " '/' »ý¤Áʪ,");
5228 strcat(out_val, " / for Inven,");
5231 else if (allow_equip)
5234 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
5236 strcat(out_val, " / for Equip,");
5241 if (command_see && !use_menu)
5244 strcat(out_val, " Enter ¼¡,");
5246 strcat(out_val, " Enter for scroll down,");
5253 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
5255 if (select_the_force) strcat(out_val, " w for the Force,");
5258 /* Finish the prompt */
5259 strcat(out_val, " ESC");
5261 /* Build the prompt */
5262 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5264 /* Show the prompt */
5273 if (command_wrk == USE_INVEN) max_line = max_inven;
5274 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5275 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5291 menu_line += (max_line - 1);
5307 /* Verify legality */
5308 if (command_wrk == (USE_INVEN))
5310 if (allow_floor) command_wrk = USE_FLOOR;
5311 else if (allow_equip) command_wrk = USE_EQUIP;
5318 else if (command_wrk == (USE_EQUIP))
5320 if (allow_inven) command_wrk = USE_INVEN;
5321 else if (allow_floor) command_wrk = USE_FLOOR;
5328 else if (command_wrk == (USE_FLOOR))
5330 if (allow_equip) command_wrk = USE_EQUIP;
5331 else if (allow_inven) command_wrk = USE_INVEN;
5344 /* Hack -- Fix screen */
5354 /* Switch inven/equip */
5355 if (command_wrk == USE_INVEN) max_line = max_inven;
5356 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5357 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5358 if (menu_line > max_line) menu_line = max_line;
5360 /* Need to redraw */
5368 /* Verify legality */
5369 if (command_wrk == (USE_INVEN))
5371 if (allow_equip) command_wrk = USE_EQUIP;
5372 else if (allow_floor) command_wrk = USE_FLOOR;
5379 else if (command_wrk == (USE_EQUIP))
5381 if (allow_floor) command_wrk = USE_FLOOR;
5382 else if (allow_inven) command_wrk = USE_INVEN;
5389 else if (command_wrk == (USE_FLOOR))
5391 if (allow_inven) command_wrk = USE_INVEN;
5392 else if (allow_equip) command_wrk = USE_EQUIP;
5405 /* Hack -- Fix screen */
5415 /* Switch inven/equip */
5416 if (command_wrk == USE_INVEN) max_line = max_inven;
5417 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5418 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5419 if (menu_line > max_line) menu_line = max_line;
5421 /* Need to redraw */
5430 if (command_wrk == USE_FLOOR)
5433 (*cp) = -get_item_label;
5437 /* Validate the item */
5438 if (!get_item_okay(get_item_label))
5444 /* Allow player to "refuse" certain actions */
5445 if (!get_item_allow(get_item_label))
5451 /* Accept that choice */
5452 (*cp) = get_item_label;
5461 if (select_the_force) {
5469 if (menu_line > max_line) menu_line -= max_line;
5490 command_see = FALSE;
5513 cave_type *c_ptr = &cave[py][px];
5515 if (command_wrk != (USE_FLOOR)) break;
5517 /* Get the object being moved. */
5518 o_idx = c_ptr->o_idx;
5520 /* Only rotate a pile of two or more objects. */
5521 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
5523 /* Remove the first object from the list. */
5524 excise_object_idx(o_idx);
5526 /* Find end of the list. */
5528 while (o_list[i].next_o_idx)
5529 i = o_list[i].next_o_idx;
5531 /* Add after the last object. */
5532 o_list[i].next_o_idx = o_idx;
5534 /* Re-scan floor list */
5535 floor_num = scan_floor(floor_list, py, px, 0x03);
5537 /* Hack -- Fix screen */
5552 if (command_wrk == (USE_INVEN))
5559 command_wrk = (USE_EQUIP);
5561 else if (command_wrk == (USE_EQUIP))
5568 command_wrk = (USE_INVEN);
5570 else if (command_wrk == (USE_FLOOR))
5574 command_wrk = (USE_INVEN);
5576 else if (allow_equip)
5578 command_wrk = (USE_EQUIP);
5587 /* Hack -- Fix screen */
5597 /* Need to redraw */
5610 * If we are already examining the floor, and there
5611 * is only one item, we will always select it.
5612 * If we aren't examining the floor and there is only
5613 * one item, we will select it if floor_query_flag
5618 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
5621 k = 0 - floor_list[0];
5623 /* Allow player to "refuse" certain actions */
5624 if (!get_item_allow(k))
5630 /* Accept that choice */
5639 /* Hack -- Fix screen */
5649 command_wrk = (USE_FLOOR);
5655 case '1': case '2': case '3':
5656 case '4': case '5': case '6':
5657 case '7': case '8': case '9':
5659 if (command_wrk != USE_FLOOR)
5661 /* Look up the tag */
5662 if (!get_tag(&k, which, command_wrk))
5668 /* Hack -- Validate the item */
5669 if ((k < INVEN_RARM) ? !inven : !equip)
5675 /* Validate the item */
5676 if (!get_item_okay(k))
5684 /* Look up the alphabetical tag */
5685 if (get_tag_floor(&k, which, floor_list, floor_num))
5688 k = 0 - floor_list[k];
5697 /* Allow player to "refuse" certain actions */
5698 if (!get_item_allow(k))
5704 /* Accept that choice */
5710 #endif /* ALLOW_REPEAT */
5718 /* Choose "default" inventory item */
5719 if (command_wrk == (USE_INVEN))
5721 k = ((i1 == i2) ? i1 : -1);
5724 /* Choose "default" equipment item */
5725 else if (command_wrk == (USE_EQUIP))
5727 k = ((e1 == e2) ? e1 : -1);
5730 /* Choose "default" floor item */
5731 else if (command_wrk == (USE_FLOOR))
5736 k = 0 - floor_list[0];
5738 /* Allow player to "refuse" certain actions */
5739 if (!get_item_allow(k))
5745 /* Accept that choice */
5753 /* Validate the item */
5754 if (!get_item_okay(k))
5760 /* Allow player to "refuse" certain actions */
5761 if (!get_item_allow(k))
5767 /* Accept that choice */
5777 if (select_the_force) {
5791 if (command_wrk != USE_FLOOR)
5793 bool not_found = FALSE;
5795 /* Look up the alphabetical tag */
5796 if (!get_tag(&k, which, command_wrk))
5801 /* Hack -- Validate the item */
5802 else if ((k < INVEN_RARM) ? !inven : !equip)
5807 /* Validate the item */
5808 else if (!get_item_okay(k))
5815 /* Accept that choice */
5821 #endif /* ALLOW_REPEAT */
5827 /* Look up the alphabetical tag */
5828 if (get_tag_floor(&k, which, floor_list, floor_num))
5831 k = 0 - floor_list[k];
5833 /* Accept that choice */
5839 #endif /* ALLOW_REPEAT */
5844 /* Extract "query" setting */
5845 ver = isupper(which);
5846 which = tolower(which);
5848 /* Convert letter to inventory index */
5849 if (command_wrk == (USE_INVEN))
5851 if (which == '(') k = i1;
5852 else if (which == ')') k = i2;
5853 else k = label_to_inven(which);
5856 /* Convert letter to equipment index */
5857 else if (command_wrk == (USE_EQUIP))
5859 if (which == '(') k = e1;
5860 else if (which == ')') k = e2;
5861 else k = label_to_equip(which);
5864 /* Convert letter to floor index */
5865 else if (command_wrk == USE_FLOOR)
5867 if (which == '(') k = 0;
5868 else if (which == ')') k = floor_num - 1;
5869 else k = islower(which) ? A2I(which) : -1;
5870 if (k < 0 || k >= floor_num || k >= 23)
5877 k = 0 - floor_list[k];
5880 /* Validate the item */
5881 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
5887 /* Verify the item */
5889 if (ver && !verify("ËÜÅö¤Ë", k))
5891 if (ver && !verify("Try", k))
5899 /* Allow player to "refuse" certain actions */
5900 if (!get_item_allow(k))
5906 /* Accept that choice */
5916 /* Fix the screen if necessary */
5922 /* Hack -- Cancel "display" */
5923 command_see = FALSE;
5927 /* Forget the item_tester_tval restriction */
5928 item_tester_tval = 0;
5930 /* Forget the item_tester_hook restriction */
5931 item_tester_hook = NULL;
5934 /* Clean up 'show choices' */
5935 /* Toggle again if needed */
5936 if (toggle) toggle_inven_equip();
5939 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5945 /* Clear the prompt line */
5948 /* Warning if needed */
5949 if (oops && str) msg_print(str);
5955 if (command_cmd) prev_tag = cur_tag;
5956 #endif /* ALLOW_REPEAT */
5958 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5966 static bool py_pickup_floor_aux(void)
5974 /* Restrict the choices */
5975 item_tester_hook = inven_carry_okay;
5979 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
5980 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
5982 q = "Get which item? ";
5983 s = "You no longer have any room for the objects on the floor.";
5986 if (get_item(&item, q, s, (USE_FLOOR)))
5988 this_o_idx = 0 - item;
5995 /* Pick up the object */
5996 py_pickup_aux(this_o_idx);
6003 * Make the player carry everything in a grid
6005 * If "pickup" is FALSE then only gold will be picked up
6007 * This is called by py_pickup() when easy_floor is TRUE.
6009 void py_pickup_floor(bool pickup)
6011 s16b this_o_idx, next_o_idx = 0;
6013 char o_name[MAX_NLEN];
6016 int floor_num = 0, floor_list[23], floor_o_idx = 0;
6020 /* Scan the pile of objects */
6021 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
6025 /* Access the object */
6026 o_ptr = &o_list[this_o_idx];
6028 /* Describe the object */
6029 object_desc(o_name, o_ptr, 0);
6031 /* Access the next object */
6032 next_o_idx = o_ptr->next_o_idx;
6034 /* Hack -- disturb */
6038 if (o_ptr->tval == TV_GOLD)
6042 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
6043 (long)o_ptr->pval, o_name);
6045 msg_format("You have found %ld gold pieces worth of %s.",
6046 (long) o_ptr->pval, o_name);
6050 /* Collect the gold */
6051 p_ptr->au += o_ptr->pval;
6054 p_ptr->redraw |= (PR_GOLD);
6057 p_ptr->window |= (PW_PLAYER);
6059 /* Delete the gold */
6060 delete_object_idx(this_o_idx);
6062 /* Check the next object */
6065 else if (o_ptr->marked & OM_NOMSG)
6067 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
6068 * ignored. Otherwise, they are included in the prompt. */
6069 o_ptr->marked &= ~(OM_NOMSG);
6073 /* Count non-gold objects that can be picked up. */
6074 if (inven_carry_okay(o_ptr))
6079 /* Remember this object index */
6081 floor_list[floor_num] = this_o_idx;
6083 /* Count non-gold objects */
6086 /* Remember this index */
6087 floor_o_idx = this_o_idx;
6090 /* There are no non-gold objects */
6094 /* Mention the number of objects */
6100 /* Access the object */
6101 o_ptr = &o_list[floor_o_idx];
6103 #ifdef ALLOW_EASY_SENSE
6105 /* Option: Make object sensing easy */
6108 /* Sense the object */
6109 (void) sense_object(o_ptr);
6112 #endif /* ALLOW_EASY_SENSE */
6114 /* Describe the object */
6115 object_desc(o_name, o_ptr, 0);
6119 msg_format("%s¤¬¤¢¤ë¡£", o_name);
6121 msg_format("You see %s.", o_name);
6126 /* Multiple objects */
6131 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
6133 msg_format("You see a pile of %d items.", floor_num);
6142 /* The player has no room for anything on the floor. */
6148 /* Access the object */
6149 o_ptr = &o_list[floor_o_idx];
6151 #ifdef ALLOW_EASY_SENSE
6153 /* Option: Make object sensing easy */
6156 /* Sense the object */
6157 (void) sense_object(o_ptr);
6160 #endif /* ALLOW_EASY_SENSE */
6162 /* Describe the object */
6163 object_desc(o_name, o_ptr, 0);
6167 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6169 msg_format("You have no room for %s.", o_name);
6174 /* Multiple objects */
6179 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6181 msg_print("You have no room for any of the objects on the floor.");
6193 /* Hack -- query every object */
6194 if (carry_query_flag)
6196 char out_val[MAX_NLEN+20];
6198 /* Access the object */
6199 o_ptr = &o_list[floor_o_idx];
6201 #ifdef ALLOW_EASY_SENSE
6203 /* Option: Make object sensing easy */
6206 /* Sense the object */
6207 (void) sense_object(o_ptr);
6210 #endif /* ALLOW_EASY_SENSE */
6212 /* Describe the object */
6213 object_desc(o_name, o_ptr, 0);
6215 /* Build a prompt */
6217 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
6219 (void) sprintf(out_val, "Pick up %s? ", o_name);
6223 /* Ask the user to confirm */
6224 if (!get_check(out_val))
6231 /* Access the object */
6232 o_ptr = &o_list[floor_o_idx];
6234 #ifdef ALLOW_EASY_SENSE
6236 /* Option: Make object sensing easy */
6239 /* Sense the object */
6240 (void) sense_object(o_ptr);
6243 #endif /* ALLOW_EASY_SENSE */
6245 /* Pick up the object */
6246 py_pickup_aux(floor_o_idx);
6249 /* Allow the user to choose an object */
6252 while (can_pickup--)
6254 if (!py_pickup_floor_aux()) break;
6259 #endif /* ALLOW_EASY_FLOOR */