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");
466 /* Get an explain of an activation */
467 if (activation_index(o_ptr))
469 return item_activation_aux(o_ptr);
473 if (o_ptr->tval == TV_WHISTLE)
476 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
478 return "call pet every 100+d100 turns";
482 if (o_ptr->tval == TV_CAPTURE)
485 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
487 return "captures or releases a monster.";
493 return "²¿¤âµ¯¤¤Ê¤¤";
501 * Describe a "fully identified" item
503 bool screen_object(object_type *o_ptr, u32b mode)
507 u32b flgs[TR_FLAG_SIZE];
511 char o_name[MAX_NLEN];
514 int trivial_info = 0;
516 /* Extract the flags */
517 object_flags(o_ptr, flgs);
519 /* Extract the description */
521 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
522 (k_text + k_info[o_ptr->k_idx].text),
523 77 - 15, temp, sizeof(temp));
524 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
525 { info[i] = &temp[j]; i++;}
528 if (object_is_equipment(o_ptr))
530 /* Descriptions of a basic equipment is just a flavor */
534 /* Mega-Hack -- describe activation */
535 if (have_flag(flgs, TR_ACTIVATE))
538 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
540 info[i++] = "It can be activated for...";
543 info[i++] = item_activation(o_ptr);
545 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
547 info[i++] = "...if it is being worn.";
552 /* Figurines, a hack */
553 if (o_ptr->tval == TV_FIGURINE)
556 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
558 info[i++] = "It will transform into a pet when thrown.";
563 /* Figurines, a hack */
564 if (o_ptr->name1 == ART_STONEMASK)
567 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
569 info[i++] = "It makes you turn into a vampire permanently.";
574 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
577 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
579 info[i++] = "It will attempt to kill a monster instantly.";
584 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
587 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
589 info[i++] = "It causes you to strike yourself sometimes.";
593 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
595 info[i++] = "It always penetrates invulnerability barriers.";
599 if (o_ptr->name2 == EGO_2WEAPON)
602 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
604 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
609 if (have_flag(flgs, TR_EASY_SPELL))
612 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
614 info[i++] = "It affects your ability to cast spells.";
618 if (o_ptr->name2 == EGO_AMU_FOOL)
621 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
623 info[i++] = "It interferes with casting spells.";
627 if (o_ptr->name2 == EGO_RING_THROW)
630 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
632 info[i++] = "It provides great strength when you throw an item.";
636 if (o_ptr->name2 == EGO_AMU_NAIVETY)
639 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
641 info[i++] = "It decreases your magic resistance.";
645 if (o_ptr->tval == TV_STATUE)
647 monster_race *r_ptr = &r_info[o_ptr->pval];
649 if (o_ptr->pval == MON_BULLGATES)
651 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
653 info[i++] = "It is shameful.";
655 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
657 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
659 info[i++] = "It is fearful.";
663 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
665 info[i++] = "It is cheerful.";
669 /* Hack -- describe lite's */
670 if (o_ptr->tval == TV_LITE)
672 if (o_ptr->name2 == EGO_LITE_DARKNESS)
675 info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
677 info[i++] = "It provides no light.";
680 if (o_ptr->sval == SV_LITE_FEANOR)
683 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
685 info[i++] = "It decreases radius of light source by 3.";
688 else if (o_ptr->sval == SV_LITE_LANTERN)
691 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
693 info[i++] = "It decreases radius of light source by 2.";
699 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
701 info[i++] = "It decreases radius of light source by 1.";
705 else if (object_is_fixed_artifact(o_ptr))
708 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
710 info[i++] = "It provides light (radius 3) forever.";
714 else if (o_ptr->name2 == EGO_LITE_SHINE)
716 if (o_ptr->sval == SV_LITE_FEANOR)
719 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
721 info[i++] = "It provides light (radius 3) forever.";
725 else if (o_ptr->sval == SV_LITE_LANTERN)
728 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
730 info[i++] = "It provides light (radius 3) when fueled.";
737 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
739 info[i++] = "It provides light (radius 2) when fueled.";
746 if (o_ptr->sval == SV_LITE_FEANOR)
749 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
751 info[i++] = "It provides light (radius 2) forever.";
755 else if (o_ptr->sval == SV_LITE_LANTERN)
758 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
760 info[i++] = "It provides light (radius 2) when fueled.";
767 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
769 info[i++] = "It provides light (radius 1) when fueled.";
774 if (o_ptr->name2 == EGO_LITE_LONG)
777 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
779 info[i++] = "It provides light for much longer time.";
785 /* And then describe it fully */
787 if (have_flag(flgs, TR_RIDING))
789 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
791 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
793 info[i++] = "It is made for use while riding.";
798 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
800 info[i++] = "It is suitable for use while riding.";
802 /* This information is not important enough */
806 if (have_flag(flgs, TR_STR))
809 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
811 info[i++] = "It affects your strength.";
815 if (have_flag(flgs, TR_INT))
818 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
820 info[i++] = "It affects your intelligence.";
824 if (have_flag(flgs, TR_WIS))
827 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
829 info[i++] = "It affects your wisdom.";
833 if (have_flag(flgs, TR_DEX))
836 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
838 info[i++] = "It affects your dexterity.";
842 if (have_flag(flgs, TR_CON))
845 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
847 info[i++] = "It affects your constitution.";
851 if (have_flag(flgs, TR_CHR))
854 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
856 info[i++] = "It affects your charisma.";
861 if (have_flag(flgs, TR_MAGIC_MASTERY))
864 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
866 info[i++] = "It affects your ability to use magic devices.";
870 if (have_flag(flgs, TR_STEALTH))
873 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
875 info[i++] = "It affects your stealth.";
879 if (have_flag(flgs, TR_SEARCH))
882 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
884 info[i++] = "It affects your searching.";
888 if (have_flag(flgs, TR_INFRA))
891 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
893 info[i++] = "It affects your infravision.";
897 if (have_flag(flgs, TR_TUNNEL))
900 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
902 info[i++] = "It affects your ability to tunnel.";
906 if (have_flag(flgs, TR_SPEED))
909 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
911 info[i++] = "It affects your speed.";
915 if (have_flag(flgs, TR_BLOWS))
918 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
920 info[i++] = "It affects your attack speed.";
925 if (have_flag(flgs, TR_BRAND_ACID))
928 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
930 info[i++] = "It does extra damage from acid.";
934 if (have_flag(flgs, TR_BRAND_ELEC))
937 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
939 info[i++] = "It does extra damage from electricity.";
943 if (have_flag(flgs, TR_BRAND_FIRE))
946 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
948 info[i++] = "It does extra damage from fire.";
952 if (have_flag(flgs, TR_BRAND_COLD))
955 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
957 info[i++] = "It does extra damage from frost.";
962 if (have_flag(flgs, TR_BRAND_POIS))
965 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
967 info[i++] = "It poisons your foes.";
972 if (have_flag(flgs, TR_CHAOTIC))
975 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
977 info[i++] = "It produces chaotic effects.";
982 if (have_flag(flgs, TR_VAMPIRIC))
985 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
987 info[i++] = "It drains life from your foes.";
992 if (have_flag(flgs, TR_IMPACT))
995 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
997 info[i++] = "It can cause earthquakes.";
1002 if (have_flag(flgs, TR_VORPAL))
1005 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1007 info[i++] = "It is very sharp and can cut your foes.";
1012 if (have_flag(flgs, TR_KILL_DRAGON))
1015 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1017 info[i++] = "It is a great bane of dragons.";
1021 else if (have_flag(flgs, TR_SLAY_DRAGON))
1024 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1026 info[i++] = "It is especially deadly against dragons.";
1031 if (have_flag(flgs, TR_KILL_ORC))
1034 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1036 info[i++] = "It is a great bane of orcs.";
1040 if (have_flag(flgs, TR_SLAY_ORC))
1043 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1045 info[i++] = "It is especially deadly against orcs.";
1050 if (have_flag(flgs, TR_KILL_TROLL))
1053 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1055 info[i++] = "It is a great bane of trolls.";
1059 if (have_flag(flgs, TR_SLAY_TROLL))
1062 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1064 info[i++] = "It is especially deadly against trolls.";
1069 if (have_flag(flgs, TR_KILL_GIANT))
1072 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1074 info[i++] = "It is a great bane of giants.";
1077 else if (have_flag(flgs, TR_SLAY_GIANT))
1080 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1082 info[i++] = "It is especially deadly against giants.";
1087 if (have_flag(flgs, TR_KILL_DEMON))
1090 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1092 info[i++] = "It is a great bane of demons.";
1096 if (have_flag(flgs, TR_SLAY_DEMON))
1099 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1101 info[i++] = "It strikes at demons with holy wrath.";
1106 if (have_flag(flgs, TR_KILL_UNDEAD))
1109 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1111 info[i++] = "It is a great bane of undead.";
1115 if (have_flag(flgs, TR_SLAY_UNDEAD))
1118 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1120 info[i++] = "It strikes at undead with holy wrath.";
1125 if (have_flag(flgs, TR_KILL_EVIL))
1128 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1130 info[i++] = "It is a great bane of evil monsters.";
1134 if (have_flag(flgs, TR_SLAY_EVIL))
1137 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1139 info[i++] = "It fights against evil with holy fury.";
1144 if (have_flag(flgs, TR_KILL_ANIMAL))
1147 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1149 info[i++] = "It is a great bane of natural creatures.";
1153 if (have_flag(flgs, TR_SLAY_ANIMAL))
1156 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1158 info[i++] = "It is especially deadly against natural creatures.";
1163 if (have_flag(flgs, TR_KILL_HUMAN))
1166 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1168 info[i++] = "It is a great bane of humans.";
1172 if (have_flag(flgs, TR_SLAY_HUMAN))
1175 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1177 info[i++] = "It is especially deadly against humans.";
1182 if (have_flag(flgs, TR_FORCE_WEAPON))
1185 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
1187 info[i++] = "It powerfully strikes at a monster using your mana.";
1191 if (have_flag(flgs, TR_DEC_MANA))
1194 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
1196 info[i++] = "It decreases your mana consumption.";
1200 if (have_flag(flgs, TR_SUST_STR))
1203 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
1205 info[i++] = "It sustains your strength.";
1209 if (have_flag(flgs, TR_SUST_INT))
1212 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
1214 info[i++] = "It sustains your intelligence.";
1218 if (have_flag(flgs, TR_SUST_WIS))
1221 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
1223 info[i++] = "It sustains your wisdom.";
1227 if (have_flag(flgs, TR_SUST_DEX))
1230 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
1232 info[i++] = "It sustains your dexterity.";
1236 if (have_flag(flgs, TR_SUST_CON))
1239 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
1241 info[i++] = "It sustains your constitution.";
1245 if (have_flag(flgs, TR_SUST_CHR))
1248 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
1250 info[i++] = "It sustains your charisma.";
1255 if (have_flag(flgs, TR_IM_ACID))
1258 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1260 info[i++] = "It provides immunity to acid.";
1264 if (have_flag(flgs, TR_IM_ELEC))
1267 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1269 info[i++] = "It provides immunity to electricity.";
1273 if (have_flag(flgs, TR_IM_FIRE))
1276 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1278 info[i++] = "It provides immunity to fire.";
1282 if (have_flag(flgs, TR_IM_COLD))
1285 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1287 info[i++] = "It provides immunity to cold.";
1292 if (have_flag(flgs, TR_THROW))
1295 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1297 info[i++] = "It is perfectly balanced for throwing.";
1301 if (have_flag(flgs, TR_FREE_ACT))
1304 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1306 info[i++] = "It provides immunity to paralysis.";
1310 if (have_flag(flgs, TR_HOLD_LIFE))
1313 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
1315 info[i++] = "It provides resistance to life draining.";
1319 if (have_flag(flgs, TR_RES_FEAR))
1322 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1324 info[i++] = "It makes you completely fearless.";
1328 if (have_flag(flgs, TR_RES_ACID))
1331 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1333 info[i++] = "It provides resistance to acid.";
1337 if (have_flag(flgs, TR_RES_ELEC))
1340 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1342 info[i++] = "It provides resistance to electricity.";
1346 if (have_flag(flgs, TR_RES_FIRE))
1349 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1351 info[i++] = "It provides resistance to fire.";
1355 if (have_flag(flgs, TR_RES_COLD))
1358 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1360 info[i++] = "It provides resistance to cold.";
1364 if (have_flag(flgs, TR_RES_POIS))
1367 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1369 info[i++] = "It provides resistance to poison.";
1374 if (have_flag(flgs, TR_RES_LITE))
1377 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1379 info[i++] = "It provides resistance to light.";
1383 if (have_flag(flgs, TR_RES_DARK))
1386 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1388 info[i++] = "It provides resistance to dark.";
1393 if (have_flag(flgs, TR_RES_BLIND))
1396 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1398 info[i++] = "It provides resistance to blindness.";
1402 if (have_flag(flgs, TR_RES_CONF))
1405 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1407 info[i++] = "It provides resistance to confusion.";
1411 if (have_flag(flgs, TR_RES_SOUND))
1414 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1416 info[i++] = "It provides resistance to sound.";
1420 if (have_flag(flgs, TR_RES_SHARDS))
1423 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1425 info[i++] = "It provides resistance to shards.";
1430 if (have_flag(flgs, TR_RES_NETHER))
1433 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1435 info[i++] = "It provides resistance to nether.";
1439 if (have_flag(flgs, TR_RES_NEXUS))
1442 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1444 info[i++] = "It provides resistance to nexus.";
1448 if (have_flag(flgs, TR_RES_CHAOS))
1451 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1453 info[i++] = "It provides resistance to chaos.";
1457 if (have_flag(flgs, TR_RES_DISEN))
1460 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1462 info[i++] = "It provides resistance to disenchantment.";
1467 if (have_flag(flgs, TR_LEVITATION))
1470 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1472 info[i++] = "It allows you to levitate.";
1476 if (have_flag(flgs, TR_LITE))
1478 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
1480 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1482 info[i++] = "It decreases radius of your light source by 1.";
1486 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
1488 info[i++] = "It provides permanent light. (radius +1)";
1492 if (have_flag(flgs, TR_SEE_INVIS))
1495 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1497 info[i++] = "It allows you to see invisible monsters.";
1501 if (have_flag(flgs, TR_TELEPATHY))
1504 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
1506 info[i++] = "It gives telepathic powers.";
1510 if (have_flag(flgs, TR_ESP_ANIMAL))
1513 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
1515 info[i++] = "It senses natural creatures.";
1519 if (have_flag(flgs, TR_ESP_UNDEAD))
1522 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
1524 info[i++] = "It senses undead.";
1528 if (have_flag(flgs, TR_ESP_DEMON))
1531 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò´¶ÃΤ¹¤ë¡£";
1533 info[i++] = "It senses demons.";
1537 if (have_flag(flgs, TR_ESP_ORC))
1540 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
1542 info[i++] = "It senses orcs.";
1546 if (have_flag(flgs, TR_ESP_TROLL))
1549 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
1551 info[i++] = "It senses trolls.";
1555 if (have_flag(flgs, TR_ESP_GIANT))
1558 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
1560 info[i++] = "It senses giants.";
1564 if (have_flag(flgs, TR_ESP_DRAGON))
1567 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
1569 info[i++] = "It senses dragons.";
1573 if (have_flag(flgs, TR_ESP_HUMAN))
1576 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
1578 info[i++] = "It senses humans.";
1582 if (have_flag(flgs, TR_ESP_EVIL))
1585 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
1587 info[i++] = "It senses evil creatures.";
1591 if (have_flag(flgs, TR_ESP_GOOD))
1594 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
1596 info[i++] = "It senses good creatures.";
1600 if (have_flag(flgs, TR_ESP_NONLIVING))
1603 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
1605 info[i++] = "It senses non-living creatures.";
1609 if (have_flag(flgs, TR_ESP_UNIQUE))
1612 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
1614 info[i++] = "It senses unique monsters.";
1618 if (have_flag(flgs, TR_SLOW_DIGEST))
1621 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
1623 info[i++] = "It slows your metabolism.";
1627 if (have_flag(flgs, TR_REGEN))
1630 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
1632 info[i++] = "It speeds your regenerative powers.";
1636 if (have_flag(flgs, TR_WARNING))
1639 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
1641 info[i++] = "It warns you of danger";
1645 if (have_flag(flgs, TR_REFLECT))
1648 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
1650 info[i++] = "It reflects bolts and arrows.";
1654 if (have_flag(flgs, TR_SH_FIRE))
1657 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1659 info[i++] = "It produces a fiery sheath.";
1663 if (have_flag(flgs, TR_SH_ELEC))
1666 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1668 info[i++] = "It produces an electric sheath.";
1672 if (have_flag(flgs, TR_SH_COLD))
1675 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1677 info[i++] = "It produces a sheath of coldness.";
1681 if (have_flag(flgs, TR_NO_MAGIC))
1684 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1686 info[i++] = "It produces an anti-magic shell.";
1690 if (have_flag(flgs, TR_NO_TELE))
1693 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
1695 info[i++] = "It prevents teleportation.";
1699 if (have_flag(flgs, TR_XTRA_MIGHT))
1702 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1704 info[i++] = "It fires missiles with extra might.";
1708 if (have_flag(flgs, TR_XTRA_SHOTS))
1711 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1713 info[i++] = "It fires missiles excessively fast.";
1718 if (have_flag(flgs, TR_BLESSED))
1721 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
1723 info[i++] = "It has been blessed by the gods.";
1728 if (object_is_cursed(o_ptr))
1730 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
1733 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1735 info[i++] = "It is permanently cursed.";
1739 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
1742 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1744 info[i++] = "It is heavily cursed.";
1751 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
1753 info[i++] = "It is cursed.";
1757 * It's a trivial infomation since there is
1758 * fake inscription {cursed}
1764 if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
1767 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
1769 info[i++] = "It carries an ancient foul curse.";
1773 if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
1776 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
1778 info[i++] = "It aggravates nearby creatures.";
1782 if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
1785 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
1787 info[i++] = "It drains experience.";
1791 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
1794 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
1796 info[i++] = "It slows your regenerative powers.";
1800 if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
1803 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
1805 info[i++] = "It adds weak curses.";
1809 if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
1812 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
1814 info[i++] = "It adds heavy curses.";
1818 if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
1821 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1823 info[i++] = "It attracts animals.";
1827 if (o_ptr->curse_flags & TRC_CALL_DEMON)
1830 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1832 info[i++] = "It attracts demons.";
1836 if (o_ptr->curse_flags & TRC_CALL_DRAGON)
1839 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
1841 info[i++] = "It attracts dragons.";
1845 if (o_ptr->curse_flags & TRC_COWARDICE)
1848 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£";
1850 info[i++] = "It makes you subject to cowardice.";
1854 if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
1857 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£";
1859 info[i++] = "It induces random teleportation.";
1863 if (o_ptr->curse_flags & TRC_LOW_MELEE)
1866 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
1868 info[i++] = "It causes you to miss blows.";
1872 if (o_ptr->curse_flags & TRC_LOW_AC)
1875 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
1877 info[i++] = "It helps your enemies' blows.";
1881 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
1884 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
1886 info[i++] = "It encumbers you while spellcasting.";
1890 if (o_ptr->curse_flags & TRC_FAST_DIGEST)
1893 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
1895 info[i++] = "It speeds your metabolism.";
1899 if (o_ptr->curse_flags & TRC_DRAIN_HP)
1902 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
1904 info[i++] = "It drains you.";
1908 if (o_ptr->curse_flags & TRC_DRAIN_MANA)
1911 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
1913 info[i++] = "It drains your mana.";
1918 /* Describe about this kind of object instead of THIS fake object */
1919 if (mode & SCROBJ_FAKE_OBJECT)
1921 switch (o_ptr->tval)
1924 switch (o_ptr->sval)
1926 case SV_RING_LORDLY:
1928 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1930 info[i++] = "It provides some random resistances.";
1933 case SV_RING_WARNING:
1935 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1937 info[i++] = "It may provide a low rank ESP.";
1944 switch (o_ptr->sval)
1946 case SV_AMULET_RESISTANCE:
1948 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1950 info[i++] = "It may provides resistance to poison.";
1953 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1955 info[i++] = "It may provide a random resistances.";
1958 case SV_AMULET_THE_MAGI:
1960 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
1962 info[i++] = "It provides up to three low rank ESPs.";
1970 if (have_flag(flgs, TR_IGNORE_ACID) &&
1971 have_flag(flgs, TR_IGNORE_ELEC) &&
1972 have_flag(flgs, TR_IGNORE_FIRE) &&
1973 have_flag(flgs, TR_IGNORE_COLD))
1976 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1978 info[i++] = "It cannot be harmed by the elements.";
1983 if (have_flag(flgs, TR_IGNORE_ACID))
1986 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1988 info[i++] = "It cannot be harmed by acid.";
1991 if (have_flag(flgs, TR_IGNORE_ELEC))
1994 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1996 info[i++] = "It cannot be harmed by electricity.";
1999 if (have_flag(flgs, TR_IGNORE_FIRE))
2002 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2004 info[i++] = "It cannot be harmed by fire.";
2007 if (have_flag(flgs, TR_IGNORE_COLD))
2010 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2012 info[i++] = "It cannot be harmed by cold.";
2017 if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
2019 /* No relevant informations */
2020 if (i <= trivial_info) return (FALSE);
2022 /* Save the screen */
2026 Term_get_size(&wid, &hgt);
2028 /* Display Item name */
2029 if (!(mode & SCROBJ_FAKE_OBJECT))
2030 object_desc(o_name, o_ptr, 0);
2032 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
2036 /* Erase the screen */
2037 for (k = 1; k < hgt; k++) prt("", k, 13);
2039 /* Label the information */
2040 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
2042 monster_race *r_ptr = &r_info[o_ptr->pval];
2043 int namelen = strlen(r_name + r_ptr->name);
2044 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
2045 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
2046 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
2050 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
2052 prt(" Item Attributes:", 1, 15);
2055 /* We will print on top of the map (column 13) */
2056 for (k = 2, j = 0; j < i; j++)
2059 prt(info[j], k++, 15);
2061 /* Every 20 entries (lines 2 to 21), start over */
2062 if ((k == hgt - 2) && (j+1 < i))
2065 prt("-- ³¤¯ --", k, 15);
2067 prt("-- more --", k, 15);
2070 for (; k > 2; k--) prt("", k, 15);
2076 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
2078 prt("[Press any key to continue]", k, 15);
2083 /* Restore the screen */
2086 /* Gave knowledge */
2093 * Convert an inventory index into a one character label
2094 * Note that the label does NOT distinguish inven/equip.
2096 char index_to_label(int i)
2098 /* Indexes for "inven" are easy */
2099 if (i < INVEN_RARM) return (I2A(i));
2101 /* Indexes for "equip" are offset */
2102 return (I2A(i - INVEN_RARM));
2107 * Convert a label into the index of an item in the "inven"
2108 * Return "-1" if the label does not indicate a real item
2110 s16b label_to_inven(int c)
2115 i = (islower(c) ? A2I(c) : -1);
2117 /* Verify the index */
2118 if ((i < 0) || (i > INVEN_PACK)) return (-1);
2120 /* Empty slots can never be chosen */
2121 if (!inventory[i].k_idx) return (-1);
2123 /* Return the index */
2129 extern bool select_ring_slot;
2132 static bool is_ring_slot(int i)
2134 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
2139 * Convert a label into the index of a item in the "equip"
2140 * Return "-1" if the label does not indicate a real item
2142 s16b label_to_equip(int c)
2147 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
2149 /* Verify the index */
2150 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
2152 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
2154 /* Empty slots can never be chosen */
2155 if (!inventory[i].k_idx) return (-1);
2157 /* Return the index */
2164 * Determine which equipment slot (if any) an item likes
2166 s16b wield_slot(object_type *o_ptr)
2168 /* Slot for equipment */
2169 switch (o_ptr->tval)
2176 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
2177 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
2178 return (INVEN_LARM);
2185 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
2186 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
2187 return (INVEN_RARM);
2197 /* Use the right hand first */
2198 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
2200 /* Use the left hand for swapping (by default) */
2201 return (INVEN_LEFT);
2207 return (INVEN_NECK);
2212 return (INVEN_LITE);
2219 return (INVEN_BODY);
2224 return (INVEN_OUTER);
2230 return (INVEN_HEAD);
2235 return (INVEN_HANDS);
2240 return (INVEN_FEET);
2244 /* No slot available */
2250 * Return a string mentioning how a given item is carried
2252 cptr mention_use(int i)
2256 /* Examine the location */
2260 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
2262 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
2266 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " ξ¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
2268 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
2272 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
2274 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
2278 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
2280 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
2284 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
2286 case INVEN_LEFT: p = (left_hander ? "On right hand" : "On left hand"); break;
2290 case INVEN_NECK: p = " ¼ó"; break;
2292 case INVEN_NECK: p = "Around neck"; break;
2296 case INVEN_LITE: p = " ¸÷¸»"; break;
2298 case INVEN_LITE: p = "Light source"; break;
2302 case INVEN_BODY: p = " ÂÎ"; break;
2304 case INVEN_BODY: p = "On body"; break;
2308 case INVEN_OUTER: p = "ÂΤξå"; break;
2310 case INVEN_OUTER: p = "About body"; break;
2314 case INVEN_HEAD: p = " Ƭ"; break;
2316 case INVEN_HEAD: p = "On head"; break;
2320 case INVEN_HANDS: p = " ¼ê"; break;
2322 case INVEN_HANDS: p = "On hands"; break;
2326 case INVEN_FEET: p = " "; break;
2328 case INVEN_FEET: p = "On feet"; break;
2332 default: p = "¥¶¥Ã¥¯"; break;
2334 default: p = "In pack"; break;
2338 /* Return the result */
2344 * Return a string describing how a given item is being worn.
2345 * Currently, only used for items in the equipment, not inventory.
2347 cptr describe_use(int i)
2354 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2356 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
2360 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2362 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
2366 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
2368 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
2372 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2374 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
2378 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2380 case INVEN_LEFT: p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
2384 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
2386 case INVEN_NECK: p = "wearing around your neck"; break;
2390 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
2392 case INVEN_LITE: p = "using to light the way"; break;
2396 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
2398 case INVEN_BODY: p = "wearing on your body"; break;
2402 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
2404 case INVEN_OUTER: p = "wearing on your back"; break;
2408 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
2410 case INVEN_HEAD: p = "wearing on your head"; break;
2414 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
2416 case INVEN_HANDS: p = "wearing on your hands"; break;
2420 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
2422 case INVEN_FEET: p = "wearing on your feet"; break;
2426 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
2428 default: p = "carrying in your pack"; break;
2432 /* Return the result */
2437 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
2439 bool check_book_realm(const byte book_tval, const byte book_sval)
2441 if (book_tval < TV_LIFE_BOOK) return FALSE;
2442 if (p_ptr->pclass == CLASS_SORCERER)
2444 return is_magic(tval2realm(book_tval));
2446 else if (p_ptr->pclass == CLASS_RED_MAGE)
2448 if (is_magic(tval2realm(book_tval)))
2449 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
2451 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
2456 * Check an item against the item tester info
2458 bool item_tester_okay(object_type *o_ptr)
2460 /* Hack -- allow listing empty slots */
2461 if (item_tester_full) return (TRUE);
2463 /* Require an item */
2464 if (!o_ptr->k_idx) return (FALSE);
2466 /* Hack -- ignore "gold" */
2467 if (o_ptr->tval == TV_GOLD)
2470 extern bool show_gold_on_floor;
2472 if (!show_gold_on_floor) return (FALSE);
2475 /* Check the tval */
2476 if (item_tester_tval)
2478 /* Is it a spellbook? If so, we need a hack -- TY */
2479 if ((item_tester_tval <= TV_DEATH_BOOK) &&
2480 (item_tester_tval >= TV_LIFE_BOOK))
2481 return check_book_realm(o_ptr->tval, o_ptr->sval);
2483 if (item_tester_tval != o_ptr->tval) return (FALSE);
2486 /* Check the hook */
2487 if (item_tester_hook)
2489 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
2500 * Choice window "shadow" of the "show_inven()" function
2502 void display_inven(void)
2504 register int i, n, z = 0;
2506 byte attr = TERM_WHITE;
2508 char o_name[MAX_NLEN];
2512 Term_get_size(&wid, &hgt);
2514 /* Find the "final" slot */
2515 for (i = 0; i < INVEN_PACK; i++)
2517 o_ptr = &inventory[i];
2519 /* Skip non-objects */
2520 if (!o_ptr->k_idx) continue;
2526 /* Display the pack */
2527 for (i = 0; i < z; i++)
2529 /* Examine the item */
2530 o_ptr = &inventory[i];
2532 /* Start with an empty "index" */
2533 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2535 /* Is this item "acceptable"? */
2536 if (item_tester_okay(o_ptr))
2538 /* Prepare an "index" */
2539 tmp_val[0] = index_to_label(i);
2541 /* Bracket the "index" --(-- */
2545 /* Display the index (or blank space) */
2546 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
2548 /* Obtain an item description */
2549 object_desc(o_name, o_ptr, 0);
2551 /* Obtain the length of the description */
2555 attr = tval_to_attr[o_ptr->tval % 128];
2557 /* Grey out charging items */
2563 /* Display the entry itself */
2564 Term_putstr(3, i, n, attr, o_name);
2566 /* Erase the rest of the line */
2567 Term_erase(3+n, i, 255);
2569 /* Display the weight if needed */
2572 int wgt = o_ptr->weight * o_ptr->number;
2574 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
2576 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2579 prt(tmp_val, i, wid - 9);
2583 /* Erase the rest of the window */
2584 for (i = z; i < hgt; i++)
2586 /* Erase the line */
2587 Term_erase(0, i, 255);
2594 * Choice window "shadow" of the "show_equip()" function
2596 void display_equip(void)
2600 byte attr = TERM_WHITE;
2602 char o_name[MAX_NLEN];
2606 Term_get_size(&wid, &hgt);
2608 /* Display the equipment */
2609 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2611 /* Examine the item */
2612 o_ptr = &inventory[i];
2614 /* Start with an empty "index" */
2615 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2617 /* Is this item "acceptable"? */
2618 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
2620 /* Prepare an "index" */
2621 tmp_val[0] = index_to_label(i);
2623 /* Bracket the "index" --(-- */
2627 /* Display the index (or blank space) */
2628 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
2630 /* Obtain an item description */
2631 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
2634 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
2636 strcpy(o_name, "(wielding with two-hands)");
2642 object_desc(o_name, o_ptr, 0);
2643 attr = tval_to_attr[o_ptr->tval % 128];
2646 /* Obtain the length of the description */
2649 /* Grey out charging items */
2655 /* Display the entry itself */
2656 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
2658 /* Erase the rest of the line */
2659 Term_erase(3+n, i - INVEN_RARM, 255);
2661 /* Display the weight (if needed) */
2664 int wgt = o_ptr->weight * o_ptr->number;
2666 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
2668 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2671 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
2674 /* Display the slot description (if needed) */
2677 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
2678 prt(mention_use(i), i - INVEN_RARM, wid - 15);
2682 /* Erase the rest of the window */
2683 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
2685 /* Clear that line */
2686 Term_erase(0, i, 255);
2692 * Find the "first" inventory object with the given "tag".
2694 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2695 * inscription of an object. Alphabetical characters don't work as a
2698 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2699 * and "x" is the "current" command_cmd code.
2701 static bool get_tag(int *cp, char tag, int mode)
2706 /* Extract index from mode */
2711 end = INVEN_TOTAL - 1;
2716 end = INVEN_PACK - 1;
2723 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2725 /* Check every inventory object */
2726 for (i = start; i <= end; i++)
2728 object_type *o_ptr = &inventory[i];
2730 /* Skip non-objects */
2731 if (!o_ptr->k_idx) continue;
2733 /* Skip empty inscriptions */
2734 if (!o_ptr->inscription) continue;
2736 /* Skip non-choice */
2737 if (!item_tester_okay(o_ptr)) continue;
2740 s = my_strchr(quark_str(o_ptr->inscription), '@');
2742 /* Process all tags */
2745 /* Check the special tags */
2746 if ((s[1] == command_cmd) && (s[2] == tag))
2748 /* Save the actual inventory ID */
2755 /* Find another '@' */
2756 s = my_strchr(s + 1, '@');
2761 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2763 /* Don't allow {@#} with '#' being alphabet */
2764 if (tag < '0' || '9' < tag)
2770 /* Check every 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 normal tags */
2793 /* Save the actual inventory ID */
2800 /* Find another '@' */
2801 s = my_strchr(s + 1, '@');
2811 * Find the "first" floor object with the given "tag".
2813 * A "tag" is a numeral "n" appearing as "@n" anywhere in the
2814 * inscription of an object. Alphabetical characters don't work as a
2817 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
2818 * and "x" is the "current" command_cmd code.
2820 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
2825 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2827 /* Check every object in the grid */
2828 for (i = 0; i < floor_num && i < 23; i++)
2830 object_type *o_ptr = &o_list[floor_list[i]];
2832 /* Skip empty inscriptions */
2833 if (!o_ptr->inscription) continue;
2836 s = my_strchr(quark_str(o_ptr->inscription), '@');
2838 /* Process all tags */
2841 /* Check the special tags */
2842 if ((s[1] == command_cmd) && (s[2] == tag))
2844 /* Save the actual floor object ID */
2851 /* Find another '@' */
2852 s = my_strchr(s + 1, '@');
2857 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2859 /* Don't allow {@#} with '#' being alphabet */
2860 if (tag < '0' || '9' < tag)
2866 /* Check every object in the grid */
2867 for (i = 0; i < floor_num && i < 23; i++)
2869 object_type *o_ptr = &o_list[floor_list[i]];
2871 /* Skip empty inscriptions */
2872 if (!o_ptr->inscription) continue;
2875 s = my_strchr(quark_str(o_ptr->inscription), '@');
2877 /* Process all tags */
2880 /* Check the normal tags */
2883 /* Save the floor object ID */
2890 /* Find another '@' */
2891 s = my_strchr(s + 1, '@');
2901 * Move around label characters with correspond tags
2903 static void prepare_label_string(char *label, int mode)
2905 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2906 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
2909 /* Prepare normal labels */
2910 strcpy(label, alphabet_chars);
2912 /* Move each label */
2913 for (i = 0; i < 52; i++)
2916 char c = alphabet_chars[i];
2918 /* Find a tag with this label */
2919 if (get_tag(&index, c, mode))
2921 /* Delete the overwritten label */
2922 if (label[i] == c) label[i] = ' ';
2924 /* Move the label to the place of corresponding tag */
2925 label[index - offset] = c;
2932 * Move around label characters with correspond tags (floor version)
2934 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
2936 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2939 /* Prepare normal labels */
2940 strcpy(label, alphabet_chars);
2942 /* Move each label */
2943 for (i = 0; i < 52; i++)
2946 char c = alphabet_chars[i];
2948 /* Find a tag with this label */
2949 if (get_tag_floor(&index, c, floor_list, floor_num))
2951 /* Delete the overwritten label */
2952 if (label[i] == c) label[i] = ' ';
2954 /* Move the label to the place of corresponding tag */
2962 * Display the inventory.
2964 * Hack -- do not display "trailing" empty slots
2966 int show_inven(int target_item)
2968 int i, j, k, l, z = 0;
2969 int col, cur_col, len;
2971 char o_name[MAX_NLEN];
2975 char out_desc[23][MAX_NLEN];
2976 int target_item_label = 0;
2978 char inven_label[52 + 1];
2980 /* Starting column */
2984 Term_get_size(&wid, &hgt);
2986 /* Default "max-length" */
2987 len = wid - col - 1;
2990 /* Find the "final" slot */
2991 for (i = 0; i < INVEN_PACK; i++)
2993 o_ptr = &inventory[i];
2995 /* Skip non-objects */
2996 if (!o_ptr->k_idx) continue;
3002 prepare_label_string(inven_label, USE_INVEN);
3004 /* Display the inventory */
3005 for (k = 0, i = 0; i < z; i++)
3007 o_ptr = &inventory[i];
3009 /* Is this item acceptable? */
3010 if (!item_tester_okay(o_ptr)) continue;
3012 /* Describe the object */
3013 object_desc(o_name, o_ptr, 0);
3015 /* Save the object index, color, and description */
3017 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3019 /* Grey out charging items */
3022 out_color[k] = TERM_L_DARK;
3025 (void)strcpy(out_desc[k], o_name);
3027 /* Find the predicted "line length" */
3028 l = strlen(out_desc[k]) + 5;
3030 /* Be sure to account for the weight */
3031 if (show_weights) l += 9;
3033 /* Account for icon if displayed */
3034 if (show_item_graph)
3037 if (use_bigtile) l++;
3040 /* Maintain the maximum length */
3041 if (l > len) len = l;
3043 /* Advance to next "line" */
3047 /* Find the column to start in */
3048 col = (len > wid - 4) ? 0 : (wid - len - 1);
3050 /* Output each entry */
3051 for (j = 0; j < k; j++)
3057 o_ptr = &inventory[i];
3059 /* Clear the line */
3060 prt("", j + 1, col ? col - 2 : col);
3062 if (use_menu && target_item)
3064 if (j == (target_item-1))
3067 strcpy(tmp_val, "¡Õ");
3069 strcpy(tmp_val, "> ");
3071 target_item_label = i;
3073 else strcpy(tmp_val, " ");
3075 else if (i <= INVEN_PACK)
3077 /* Prepare an index --(-- */
3078 sprintf(tmp_val, "%c)", inven_label[i]);
3082 /* Prepare an index --(-- */
3083 sprintf(tmp_val, "%c)", index_to_label(i));
3086 /* Clear the line with the (possibly indented) index */
3087 put_str(tmp_val, j + 1, col);
3091 /* Display graphics for object, if desired */
3092 if (show_item_graph)
3094 byte a = object_attr(o_ptr);
3095 char c = object_char(o_ptr);
3098 if (a & 0x80) a |= 0x40;
3101 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3102 if (use_bigtile) cur_col++;
3108 /* Display the entry itself */
3109 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3111 /* Display the weight if needed */
3114 int wgt = o_ptr->weight * o_ptr->number;
3116 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3118 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3121 prt(tmp_val, j + 1, wid - 9);
3125 /* Make a "shadow" below the list (only if needed) */
3126 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3128 /* Save the new column */
3131 return target_item_label;
3137 * Display the equipment.
3139 int show_equip(int target_item)
3142 int col, cur_col, len;
3145 char o_name[MAX_NLEN];
3148 char out_desc[23][MAX_NLEN];
3149 int target_item_label = 0;
3151 char equip_label[52 + 1];
3153 /* Starting column */
3157 Term_get_size(&wid, &hgt);
3159 /* Maximal length */
3160 len = wid - col - 1;
3163 /* Scan the equipment list */
3164 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3166 o_ptr = &inventory[i];
3168 /* Is this item acceptable? */
3169 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
3170 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3171 item_tester_no_ryoute)) continue;
3174 object_desc(o_name, o_ptr, 0);
3176 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3179 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
3181 (void)strcpy(out_desc[k],"(wielding with two-hands)");
3183 out_color[k] = TERM_WHITE;
3187 (void)strcpy(out_desc[k], o_name);
3188 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3192 /* Grey out charging items */
3195 out_color[k] = TERM_L_DARK;
3198 /* Extract the maximal length (see below) */
3200 l = strlen(out_desc[k]) + (2 + 1);
3202 l = strlen(out_desc[k]) + (2 + 3);
3206 /* Increase length for labels (if needed) */
3208 if (show_labels) l += (7 + 2);
3210 if (show_labels) l += (14 + 2);
3214 /* Increase length for weight (if needed) */
3215 if (show_weights) l += 9;
3217 if (show_item_graph) l += 2;
3219 /* Maintain the max-length */
3220 if (l > len) len = l;
3222 /* Advance the entry */
3226 /* Hack -- Find a column to start in */
3228 col = (len > wid - 6) ? 0 : (wid - len - 1);
3230 col = (len > wid - 4) ? 0 : (wid - len - 1);
3233 prepare_label_string(equip_label, USE_EQUIP);
3235 /* Output each entry */
3236 for (j = 0; j < k; j++)
3242 o_ptr = &inventory[i];
3244 /* Clear the line */
3245 prt("", j + 1, col ? col - 2 : col);
3247 if (use_menu && target_item)
3249 if (j == (target_item-1))
3252 strcpy(tmp_val, "¡Õ");
3254 strcpy(tmp_val, "> ");
3256 target_item_label = i;
3258 else strcpy(tmp_val, " ");
3260 else if (i >= INVEN_RARM)
3262 /* Prepare an index --(-- */
3263 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3267 /* Prepare an index --(-- */
3268 sprintf(tmp_val, "%c)", index_to_label(i));
3271 /* Clear the line with the (possibly indented) index */
3272 put_str(tmp_val, j+1, col);
3276 /* Display graphics for object, if desired */
3277 if (show_item_graph)
3279 byte a = object_attr(o_ptr);
3280 char c = object_char(o_ptr);
3283 if (a & 0x80) a |= 0x40;
3286 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3287 if (use_bigtile) cur_col++;
3295 /* Mention the use */
3297 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
3299 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
3302 put_str(tmp_val, j+1, cur_col);
3304 /* Display the entry itself */
3306 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
3308 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
3315 /* Display the entry itself */
3316 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
3319 /* Display the weight if needed */
3322 int wgt = o_ptr->weight * o_ptr->number;
3324 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3326 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3329 prt(tmp_val, j + 1, wid - 9);
3333 /* Make a "shadow" below the list (only if needed) */
3334 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3336 /* Save the new column */
3339 return target_item_label;
3346 * Flip "inven" and "equip" in any sub-windows
3348 void toggle_inven_equip(void)
3353 for (j = 0; j < 8; j++)
3356 if (!angband_term[j]) continue;
3358 /* Flip inven to equip */
3359 if (window_flag[j] & (PW_INVEN))
3362 window_flag[j] &= ~(PW_INVEN);
3363 window_flag[j] |= (PW_EQUIP);
3366 p_ptr->window |= (PW_EQUIP);
3369 /* Flip inven to equip */
3370 else if (window_flag[j] & (PW_EQUIP))
3373 window_flag[j] &= ~(PW_EQUIP);
3374 window_flag[j] |= (PW_INVEN);
3377 p_ptr->window |= (PW_INVEN);
3385 * Verify the choice of an item.
3387 * The item can be negative to mean "item on floor".
3389 static bool verify(cptr prompt, int item)
3391 char o_name[MAX_NLEN];
3392 char out_val[MAX_NLEN+20];
3399 o_ptr = &inventory[item];
3405 o_ptr = &o_list[0 - item];
3409 object_desc(o_name, o_ptr, 0);
3413 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
3415 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
3420 return (get_check(out_val));
3425 * Hack -- allow user to "prevent" certain choices
3427 * The item can be negative to mean "item on floor".
3429 static bool get_item_allow(int item)
3435 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
3440 o_ptr = &inventory[item];
3446 o_ptr = &o_list[0 - item];
3449 /* No inscription */
3450 if (!o_ptr->inscription) return (TRUE);
3453 s = my_strchr(quark_str(o_ptr->inscription), '!');
3455 /* Process preventions */
3458 /* Check the "restriction" */
3459 if ((s[1] == command_cmd) || (s[1] == '*'))
3461 /* Verify the choice */
3463 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
3465 if (!verify("Really try", item)) return (FALSE);
3470 /* Find another '!' */
3471 s = my_strchr(s + 1, '!');
3481 * Auxiliary function for "get_item()" -- test an index
3483 static bool get_item_okay(int i)
3486 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
3488 if (select_ring_slot) return is_ring_slot(i);
3490 /* Verify the item */
3491 if (!item_tester_okay(&inventory[i])) return (FALSE);
3500 * Determine whether get_item() can get some item or not
3501 * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
3503 bool can_get_item(void)
3505 int j, floor_list[23], floor_num = 0;
3507 for (j = 0; j < INVEN_TOTAL; j++)
3508 if (item_tester_okay(&inventory[j]))
3511 floor_num = scan_floor(floor_list, py, px, 0x03);
3519 * Let the user select an item, save its "index"
3521 * Return TRUE only if an acceptable item was chosen by the user.
3523 * The selected item must satisfy the "item_tester_hook()" function,
3524 * if that hook is set, and the "item_tester_tval", if that value is set.
3526 * All "item_tester" restrictions are cleared before this function returns.
3528 * The user is allowed to choose acceptable items from the equipment,
3529 * inventory, or floor, respectively, if the proper flag was given,
3530 * and there are any acceptable items in that location.
3532 * The equipment or inventory are displayed (even if no acceptable
3533 * items are in that location) if the proper flag was given.
3535 * If there are no acceptable items available anywhere, and "str" is
3536 * not NULL, then it will be used as the text of a warning message
3537 * before the function returns.
3539 * Note that the user must press "-" to specify the item on the floor,
3540 * and there is no way to "examine" the item on the floor, while the
3541 * use of "capital" letters will "examine" an inventory/equipment item,
3542 * and prompt for its use.
3544 * If a legal item is selected from the inventory, we save it in "cp"
3545 * directly (0 to 35), and return TRUE.
3547 * If a legal item is selected from the floor, we save it in "cp" as
3548 * a negative (-1 to -511), and return TRUE.
3550 * If no item is available, we do nothing to "cp", and we display a
3551 * warning message, using "str" if available, and return FALSE.
3553 * If no item is selected, we do nothing to "cp", and return FALSE.
3555 * Global "p_ptr->command_new" is used when viewing the inventory or equipment
3556 * to allow the user to enter a command while viewing those screens, and
3557 * also to induce "auto-enter" of stores, and other such stuff.
3559 * Global "p_ptr->command_see" may be set before calling this function to start
3560 * out in "browse" mode. It is cleared before this function returns.
3562 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
3563 * If it is TRUE then we are viewing inventory, else equipment.
3565 * We always erase the prompt when we are done, leaving a blank line,
3566 * or a warning message, if appropriate, if no items are available.
3568 bool get_item(int *cp, cptr pmt, cptr str, int mode)
3570 s16b this_o_idx, next_o_idx = 0;
3574 int j, k, i1, i2, e1, e2;
3584 bool allow_floor = FALSE;
3586 bool toggle = FALSE;
3592 extern bool select_the_force;
3594 int menu_line = (use_menu ? 1 : 0);
3600 static char prev_tag = '\0';
3601 char cur_tag = '\0';
3603 #endif /* ALLOW_REPEAT */
3605 #ifdef ALLOW_EASY_FLOOR /* TNB */
3607 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
3609 #endif /* ALLOW_EASY_FLOOR -- TNB */
3612 if (mode & USE_EQUIP) equip = TRUE;
3613 if (mode & USE_INVEN) inven = TRUE;
3614 if (mode & USE_FLOOR) floor = TRUE;
3618 /* Get the item index */
3619 if (repeat_pull(cp))
3622 if (select_the_force && (*cp == INVEN_FORCE))
3624 item_tester_tval = 0;
3625 item_tester_hook = NULL;
3626 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3631 else if (floor && (*cp < 0))
3638 /* Acquire object */
3641 /* Validate the item */
3642 if (item_tester_okay(o_ptr))
3644 /* Forget restrictions */
3645 item_tester_tval = 0;
3646 item_tester_hook = NULL;
3647 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3654 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
3655 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
3657 if (prev_tag && command_cmd)
3659 /* Look up the tag and validate the item */
3660 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
3661 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
3662 else if (!get_item_okay(k)) /* Reject */;
3665 /* Accept that choice */
3668 /* Forget restrictions */
3669 item_tester_tval = 0;
3670 item_tester_hook = NULL;
3671 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3677 prev_tag = '\0'; /* prev_tag is no longer effective */
3680 /* Verify the item */
3681 else if (get_item_okay(*cp))
3683 /* Forget restrictions */
3684 item_tester_tval = 0;
3685 item_tester_hook = NULL;
3686 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3694 #endif /* ALLOW_REPEAT */
3697 /* Paranoia XXX XXX XXX */
3704 /* No item selected */
3708 /* Full inventory */
3710 i2 = INVEN_PACK - 1;
3712 /* Forbid inventory */
3713 if (!inven) i2 = -1;
3716 for (j = 0; j < INVEN_PACK; j++)
3717 if (item_tester_okay(&inventory[j])) max_inven++;
3720 /* Restrict inventory indexes */
3721 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
3722 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
3725 /* Full equipment */
3727 e2 = INVEN_TOTAL - 1;
3729 /* Forbid equipment */
3730 if (!equip) e2 = -1;
3733 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
3734 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
3735 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
3738 /* Restrict equipment indexes */
3739 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
3740 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
3742 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
3746 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
3748 else if (p_ptr->hidarite) e1 = INVEN_RARM;
3752 /* Restrict floor usage */
3755 /* Scan all objects in the grid */
3756 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
3760 /* Acquire object */
3761 o_ptr = &o_list[this_o_idx];
3763 /* Acquire next object */
3764 next_o_idx = o_ptr->next_o_idx;
3766 /* Accept the item on the floor if legal */
3767 if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
3771 /* Require at least one legal choice */
3772 if (!allow_floor && (i1 > i2) && (e1 > e2))
3774 /* Cancel p_ptr->command_see */
3775 command_see = FALSE;
3783 if (select_the_force) {
3789 /* Analyze choices */
3792 /* Hack -- Start on equipment if requested */
3793 if (command_see && command_wrk && equip)
3798 /* Use inventory if allowed */
3801 command_wrk = FALSE;
3804 /* Use equipment if allowed */
3810 /* Use inventory for floor */
3813 command_wrk = FALSE;
3819 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
3821 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
3823 /* Hack -- start out in "display" mode */
3831 /* Repeat until done */
3834 int get_item_label = 0;
3841 for (j = 0; j < 8; j++)
3844 if (!angband_term[j]) continue;
3846 /* Count windows displaying inven */
3847 if (window_flag[j] & (PW_INVEN)) ni++;
3849 /* Count windows displaying equip */
3850 if (window_flag[j] & (PW_EQUIP)) ne++;
3853 /* Toggle if needed */
3854 if ((command_wrk && ni && !ne) ||
3855 (!command_wrk && !ni && ne))
3858 toggle_inven_equip();
3865 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3867 /* Redraw windows */
3871 /* Inventory screen */
3874 /* Redraw if needed */
3875 if (command_see) get_item_label = show_inven(menu_line);
3878 /* Equipment screen */
3881 /* Redraw if needed */
3882 if (command_see) get_item_label = show_equip(menu_line);
3885 /* Viewing inventory */
3888 /* Begin the prompt */
3890 sprintf(out_val, "»ý¤Áʪ:");
3892 sprintf(out_val, "Inven:");
3895 /* Some legal items */
3896 if ((i1 <= i2) && !use_menu)
3898 /* Build the prompt */
3900 sprintf(tmp_val, "%c-%c,'(',')',",
3902 sprintf(tmp_val, " %c-%c,'(',')',",
3904 index_to_label(i1), index_to_label(i2));
3907 strcat(out_val, tmp_val);
3910 /* Indicate ability to "view" */
3912 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3914 if (!command_see && !use_menu) strcat(out_val, " * to see,");
3919 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
3921 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
3925 /* Viewing equipment */
3928 /* Begin the prompt */
3930 sprintf(out_val, "ÁõÈ÷ÉÊ:");
3932 sprintf(out_val, "Equip:");
3935 /* Some legal items */
3936 if ((e1 <= e2) && !use_menu)
3938 /* Build the prompt */
3940 sprintf(tmp_val, "%c-%c,'(',')',",
3942 sprintf(tmp_val, " %c-%c,'(',')',",
3944 index_to_label(e1), index_to_label(e2));
3947 strcat(out_val, tmp_val);
3950 /* Indicate ability to "view" */
3952 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3954 if (!command_see) strcat(out_val, " * to see,");
3959 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
3961 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
3965 /* Indicate legality of the "floor" item */
3967 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
3968 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
3970 if (allow_floor) strcat(out_val, " - for floor,");
3971 if (select_the_force) strcat(out_val, " w for the Force,");
3974 /* Finish the prompt */
3975 strcat(out_val, " ESC");
3977 /* Build the prompt */
3978 sprintf(tmp_val, "(%s) %s", out_val, pmt);
3980 /* Show the prompt */
3988 int max_line = (command_wrk ? max_equip : max_inven);
4004 menu_line += (max_line - 1);
4023 /* Verify legality */
4024 if (!inven || !equip)
4030 /* Hack -- Fix screen */
4040 /* Switch inven/equip */
4041 command_wrk = !command_wrk;
4042 max_line = (command_wrk ? max_equip : max_inven);
4043 if (menu_line > max_line) menu_line = max_line;
4045 /* Need to redraw */
4054 if (command_wrk == USE_FLOOR)
4057 (*cp) = -get_item_label;
4061 /* Validate the item */
4062 if (!get_item_okay(get_item_label))
4068 /* Allow player to "refuse" certain actions */
4069 if (!get_item_allow(get_item_label))
4075 /* Accept that choice */
4076 (*cp) = get_item_label;
4085 if (select_the_force) {
4093 if (menu_line > max_line) menu_line -= max_line;
4114 command_see = FALSE;
4134 /* Verify legality */
4135 if (!inven || !equip)
4141 /* Hack -- Fix screen */
4151 /* Switch inven/equip */
4152 command_wrk = !command_wrk;
4154 /* Need to redraw */
4160 /* Use floor item */
4163 /* Scan all objects in the grid */
4164 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4168 /* Acquire object */
4169 o_ptr = &o_list[this_o_idx];
4171 /* Acquire next object */
4172 next_o_idx = o_ptr->next_o_idx;
4174 /* Validate the item */
4175 if (!item_tester_okay(o_ptr)) continue;
4180 /* Verify the item (if required) */
4182 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
4184 if (other_query_flag && !verify("Try", k)) continue;
4188 /* Allow player to "refuse" certain actions */
4189 if (!get_item_allow(k)) continue;
4191 /* Accept that choice */
4208 case '1': case '2': case '3':
4209 case '4': case '5': case '6':
4210 case '7': case '8': case '9':
4212 /* Look up the tag */
4213 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4219 /* Hack -- Validate the item */
4220 if ((k < INVEN_RARM) ? !inven : !equip)
4226 /* Validate the item */
4227 if (!get_item_okay(k))
4233 /* Allow player to "refuse" certain actions */
4234 if (!get_item_allow(k))
4240 /* Accept that choice */
4246 #endif /* ALLOW_REPEAT */
4254 /* Choose "default" inventory item */
4257 k = ((i1 == i2) ? i1 : -1);
4260 /* Choose "default" equipment item */
4263 k = ((e1 == e2) ? e1 : -1);
4266 /* Validate the item */
4267 if (!get_item_okay(k))
4273 /* Allow player to "refuse" certain actions */
4274 if (!get_item_allow(k))
4280 /* Accept that choice */
4290 if (select_the_force) {
4303 bool not_found = FALSE;
4305 /* Look up the alphabetical tag */
4306 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4311 /* Hack -- Validate the item */
4312 else if ((k < INVEN_RARM) ? !inven : !equip)
4317 /* Validate the item */
4318 else if (!get_item_okay(k))
4325 /* Accept that choice */
4331 #endif /* ALLOW_REPEAT */
4335 /* Extract "query" setting */
4336 ver = isupper(which);
4337 which = tolower(which);
4339 /* Convert letter to inventory index */
4342 if (which == '(') k = i1;
4343 else if (which == ')') k = i2;
4344 else k = label_to_inven(which);
4347 /* Convert letter to equipment index */
4350 if (which == '(') k = e1;
4351 else if (which == ')') k = e2;
4352 else k = label_to_equip(which);
4355 /* Validate the item */
4356 if (!get_item_okay(k))
4362 /* Verify the item */
4364 if (ver && !verify("ËÜÅö¤Ë", k))
4366 if (ver && !verify("Try", k))
4374 /* Allow player to "refuse" certain actions */
4375 if (!get_item_allow(k))
4381 /* Accept that choice */
4392 /* Fix the screen if necessary */
4398 /* Hack -- Cancel "display" */
4399 command_see = FALSE;
4403 /* Forget the item_tester_tval restriction */
4404 item_tester_tval = 0;
4406 item_tester_no_ryoute = FALSE;
4408 /* Forget the item_tester_hook restriction */
4409 item_tester_hook = NULL;
4412 /* Clean up 'show choices' */
4413 /* Toggle again if needed */
4414 if (toggle) toggle_inven_equip();
4417 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4423 /* Clear the prompt line */
4426 /* Warning if needed */
4427 if (oops && str) msg_print(str);
4433 if (command_cmd) prev_tag = cur_tag;
4434 #endif /* ALLOW_REPEAT */
4436 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4444 #ifdef ALLOW_EASY_FLOOR
4449 * Return a list of o_list[] indexes of items at the given cave
4450 * location. Valid flags are:
4452 * mode & 0x01 -- Item tester
4453 * mode & 0x02 -- Marked items only
4454 * mode & 0x04 -- Stop after first
4456 int scan_floor(int *items, int y, int x, int mode)
4458 int this_o_idx, next_o_idx;
4463 if (!in_bounds(y, x)) return 0;
4465 /* Scan all objects in the grid */
4466 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
4470 /* Acquire object */
4471 o_ptr = &o_list[this_o_idx];
4473 /* Acquire next object */
4474 next_o_idx = o_ptr->next_o_idx;
4477 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
4480 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
4482 /* Accept this item */
4483 /* XXX Hack -- Enforce limit */
4485 items[num] = this_o_idx;
4490 if (mode & 0x04) break;
4499 * Display a list of the items on the floor at the given location.
4501 int show_floor(int target_item, int y, int x, int *min_width)
4508 char o_name[MAX_NLEN];
4514 char out_desc[23][MAX_NLEN];
4515 int target_item_label = 0;
4517 int floor_list[23], floor_num;
4519 char floor_label[52 + 1];
4521 bool dont_need_to_show_weights = TRUE;
4524 Term_get_size(&wid, &hgt);
4526 /* Default length */
4527 len = MAX((*min_width), 20);
4530 /* Scan for objects in the grid, using item_tester_okay() */
4531 floor_num = scan_floor(floor_list, y, x, 0x03);
4533 /* Display the floor objects */
4534 for (k = 0, i = 0; i < floor_num && i < 23; i++)
4536 o_ptr = &o_list[floor_list[i]];
4538 /* Describe the object */
4539 object_desc(o_name, o_ptr, 0);
4541 /* Save the index */
4544 /* Acquire inventory color */
4545 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
4547 /* Save the object description */
4548 strcpy(out_desc[k], o_name);
4550 /* Find the predicted "line length" */
4551 l = strlen(out_desc[k]) + 5;
4553 /* Be sure to account for the weight */
4554 if (show_weights) l += 9;
4556 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
4558 /* Maintain the maximum length */
4559 if (l > len) len = l;
4561 /* Advance to next "line" */
4565 if (show_weights && dont_need_to_show_weights) len -= 9;
4570 /* Find the column to start in */
4571 col = (len > wid - 4) ? 0 : (wid - len - 1);
4573 prepare_label_string_floor(floor_label, floor_list, floor_num);
4575 /* Output each entry */
4576 for (j = 0; j < k; j++)
4579 i = floor_list[out_index[j]];
4584 /* Clear the line */
4585 prt("", j + 1, col ? col - 2 : col);
4587 if (use_menu && target_item)
4589 if (j == (target_item-1))
4592 strcpy(tmp_val, "¡Õ");
4594 strcpy(tmp_val, "> ");
4596 target_item_label = i;
4598 else strcpy(tmp_val, " ");
4602 /* Prepare an index --(-- */
4603 sprintf(tmp_val, "%c)", floor_label[j]);
4606 /* Clear the line with the (possibly indented) index */
4607 put_str(tmp_val, j + 1, col);
4609 /* Display the entry itself */
4610 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
4612 /* Display the weight if needed */
4613 if (show_weights && (o_ptr->tval != TV_GOLD))
4615 int wgt = o_ptr->weight * o_ptr->number;
4617 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4619 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4622 prt(tmp_val, j + 1, wid - 9);
4626 /* Make a "shadow" below the list (only if needed) */
4627 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4629 return target_item_label;
4633 * This version of get_item() is called by get_item() when
4634 * the easy_floor is on.
4636 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
4638 char n1 = ' ', n2 = ' ', which = ' ';
4640 int j, k, i1, i2, e1, e2;
4647 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
4648 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
4649 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
4651 bool allow_equip = FALSE;
4652 bool allow_inven = FALSE;
4653 bool allow_floor = FALSE;
4655 bool toggle = FALSE;
4660 int floor_num, floor_list[23], floor_top = 0;
4663 extern bool select_the_force;
4665 int menu_line = (use_menu ? 1 : 0);
4671 static char prev_tag = '\0';
4672 char cur_tag = '\0';
4674 /* Get the item index */
4675 if (repeat_pull(cp))
4678 if (select_the_force && (*cp == INVEN_FORCE))
4680 item_tester_tval = 0;
4681 item_tester_hook = NULL;
4682 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4687 else if (floor && (*cp < 0))
4689 if (prev_tag && command_cmd)
4691 /* Scan all objects in the grid */
4692 floor_num = scan_floor(floor_list, py, px, 0x03);
4694 /* Look up the tag */
4695 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
4697 /* Accept that choice */
4698 (*cp) = 0 - floor_list[k];
4700 /* Forget restrictions */
4701 item_tester_tval = 0;
4702 item_tester_hook = NULL;
4703 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4709 prev_tag = '\0'; /* prev_tag is no longer effective */
4712 /* Validate the item */
4713 else if (item_tester_okay(&o_list[0 - (*cp)]))
4715 /* Forget restrictions */
4716 item_tester_tval = 0;
4717 item_tester_hook = NULL;
4718 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4725 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4726 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4728 if (prev_tag && command_cmd)
4730 /* Look up the tag and validate the item */
4731 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4732 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4733 else if (!get_item_okay(k)) /* Reject */;
4736 /* Accept that choice */
4739 /* Forget restrictions */
4740 item_tester_tval = 0;
4741 item_tester_hook = NULL;
4742 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4748 prev_tag = '\0'; /* prev_tag is no longer effective */
4751 /* Verify the item */
4752 else if (get_item_okay(*cp))
4754 /* Forget restrictions */
4755 item_tester_tval = 0;
4756 item_tester_hook = NULL;
4757 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4765 #endif /* ALLOW_REPEAT */
4768 /* Paranoia XXX XXX XXX */
4775 /* No item selected */
4779 /* Full inventory */
4781 i2 = INVEN_PACK - 1;
4783 /* Forbid inventory */
4784 if (!inven) i2 = -1;
4787 for (j = 0; j < INVEN_PACK; j++)
4788 if (item_tester_okay(&inventory[j])) max_inven++;
4791 /* Restrict inventory indexes */
4792 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4793 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4796 /* Full equipment */
4798 e2 = INVEN_TOTAL - 1;
4800 /* Forbid equipment */
4801 if (!equip) e2 = -1;
4804 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4805 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4806 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4809 /* Restrict equipment indexes */
4810 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4811 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4813 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4817 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4819 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4823 /* Count "okay" floor items */
4826 /* Restrict floor usage */
4829 /* Scan all objects in the grid */
4830 floor_num = scan_floor(floor_list, py, px, 0x03);
4833 /* Accept inventory */
4834 if (i1 <= i2) allow_inven = TRUE;
4836 /* Accept equipment */
4837 if (e1 <= e2) allow_equip = TRUE;
4840 if (floor_num) allow_floor = TRUE;
4842 /* Require at least one legal choice */
4843 if (!allow_inven && !allow_equip && !allow_floor)
4845 /* Cancel p_ptr->command_see */
4846 command_see = FALSE;
4854 if (select_the_force) {
4860 /* Analyze choices */
4863 /* Hack -- Start on equipment if requested */
4864 if (command_see && (command_wrk == (USE_EQUIP))
4867 command_wrk = (USE_EQUIP);
4870 /* Use inventory if allowed */
4871 else if (allow_inven)
4873 command_wrk = (USE_INVEN);
4876 /* Use equipment if allowed */
4877 else if (allow_equip)
4879 command_wrk = (USE_EQUIP);
4882 /* Use floor if allowed */
4883 else if (allow_floor)
4885 command_wrk = (USE_FLOOR);
4890 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4892 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4894 /* Hack -- start out in "display" mode */
4901 /* Repeat until done */
4904 int get_item_label = 0;
4911 for (j = 0; j < 8; j++)
4914 if (!angband_term[j]) continue;
4916 /* Count windows displaying inven */
4917 if (window_flag[j] & (PW_INVEN)) ni++;
4919 /* Count windows displaying equip */
4920 if (window_flag[j] & (PW_EQUIP)) ne++;
4923 /* Toggle if needed */
4924 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
4925 (command_wrk == (USE_INVEN) && !ni && ne))
4928 toggle_inven_equip();
4935 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4937 /* Redraw windows */
4940 /* Inventory screen */
4941 if (command_wrk == (USE_INVEN))
4943 /* Extract the legal requests */
4947 /* Redraw if needed */
4948 if (command_see) get_item_label = show_inven(menu_line);
4951 /* Equipment screen */
4952 else if (command_wrk == (USE_EQUIP))
4954 /* Extract the legal requests */
4955 n1 = I2A(e1 - INVEN_RARM);
4956 n2 = I2A(e2 - INVEN_RARM);
4958 /* Redraw if needed */
4959 if (command_see) get_item_label = show_equip(menu_line);
4963 else if (command_wrk == (USE_FLOOR))
4966 k = MIN(floor_top + 23, floor_num) - 1;
4968 /* Extract the legal requests */
4969 n1 = I2A(j - floor_top);
4970 n2 = I2A(k - floor_top);
4972 /* Redraw if needed */
4973 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
4976 /* Viewing inventory */
4977 if (command_wrk == (USE_INVEN))
4979 /* Begin the prompt */
4981 sprintf(out_val, "»ý¤Áʪ:");
4983 sprintf(out_val, "Inven:");
4988 /* Build the prompt */
4990 sprintf(tmp_val, "%c-%c,'(',')',",
4992 sprintf(tmp_val, " %c-%c,'(',')',",
4994 index_to_label(i1), index_to_label(i2));
4997 strcat(out_val, tmp_val);
5000 /* Indicate ability to "view" */
5002 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5004 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5012 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
5013 else if (allow_floor)
5014 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
5016 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5019 strcat(out_val, " / for Equip,");
5020 else if (allow_floor)
5021 strcat(out_val, " 6 for Equip,");
5023 strcat(out_val, " 4 or 6 for Equip,");
5032 strcat(out_val, " '-'¾²¾å,");
5033 else if (allow_equip)
5034 strcat(out_val, " '4' ¾²¾å,");
5036 strcat(out_val, " '4'or'6' ¾²¾å,");
5039 strcat(out_val, " - for floor,");
5040 else if (allow_equip)
5041 strcat(out_val, " 4 for floor,");
5043 strcat(out_val, " 4 or 6 for floor,");
5048 /* Viewing equipment */
5049 else if (command_wrk == (USE_EQUIP))
5051 /* Begin the prompt */
5053 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5055 sprintf(out_val, "Equip:");
5060 /* Build the prompt */
5062 sprintf(tmp_val, "%c-%c,'(',')',",
5064 sprintf(tmp_val, " %c-%c,'(',')',",
5066 index_to_label(e1), index_to_label(e2));
5069 strcat(out_val, tmp_val);
5072 /* Indicate ability to "view" */
5074 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5076 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5084 strcat(out_val, " '/' »ý¤Áʪ,");
5085 else if (allow_floor)
5086 strcat(out_val, " '4' »ý¤Áʪ,");
5088 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5091 strcat(out_val, " / for Inven,");
5092 else if (allow_floor)
5093 strcat(out_val, " 4 for Inven,");
5095 strcat(out_val, " 4 or 6 for Inven,");
5104 strcat(out_val, " '-'¾²¾å,");
5105 else if (allow_inven)
5106 strcat(out_val, " '6' ¾²¾å,");
5108 strcat(out_val, " '4'or'6' ¾²¾å,");
5111 strcat(out_val, " - for floor,");
5112 else if (allow_inven)
5113 strcat(out_val, " 6 for floor,");
5115 strcat(out_val, " 4 or 6 for floor,");
5121 else if (command_wrk == (USE_FLOOR))
5123 /* Begin the prompt */
5125 sprintf(out_val, "¾²¾å:");
5127 sprintf(out_val, "Floor:");
5132 /* Build the prompt */
5134 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5136 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5140 strcat(out_val, tmp_val);
5143 /* Indicate ability to "view" */
5145 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5147 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5152 if (allow_inven && allow_equip)
5155 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5157 strcat(out_val, " 4 for Equip, 6 for Inven,");
5160 else if (allow_inven)
5163 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5165 strcat(out_val, " 4 or 6 for Inven,");
5168 else if (allow_equip)
5171 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5173 strcat(out_val, " 4 or 6 for Equip,");
5178 else if (allow_inven)
5181 strcat(out_val, " '/' »ý¤Áʪ,");
5183 strcat(out_val, " / for Inven,");
5186 else if (allow_equip)
5189 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
5191 strcat(out_val, " / for Equip,");
5196 if (command_see && !use_menu)
5199 strcat(out_val, " Enter ¼¡,");
5201 strcat(out_val, " Enter for scroll down,");
5208 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
5210 if (select_the_force) strcat(out_val, " w for the Force,");
5213 /* Finish the prompt */
5214 strcat(out_val, " ESC");
5216 /* Build the prompt */
5217 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5219 /* Show the prompt */
5228 if (command_wrk == USE_INVEN) max_line = max_inven;
5229 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5230 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5246 menu_line += (max_line - 1);
5262 /* Verify legality */
5263 if (command_wrk == (USE_INVEN))
5265 if (allow_floor) command_wrk = USE_FLOOR;
5266 else if (allow_equip) command_wrk = USE_EQUIP;
5273 else if (command_wrk == (USE_EQUIP))
5275 if (allow_inven) command_wrk = USE_INVEN;
5276 else if (allow_floor) command_wrk = USE_FLOOR;
5283 else if (command_wrk == (USE_FLOOR))
5285 if (allow_equip) command_wrk = USE_EQUIP;
5286 else if (allow_inven) command_wrk = USE_INVEN;
5299 /* Hack -- Fix screen */
5309 /* Switch inven/equip */
5310 if (command_wrk == USE_INVEN) max_line = max_inven;
5311 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5312 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5313 if (menu_line > max_line) menu_line = max_line;
5315 /* Need to redraw */
5323 /* Verify legality */
5324 if (command_wrk == (USE_INVEN))
5326 if (allow_equip) command_wrk = USE_EQUIP;
5327 else if (allow_floor) command_wrk = USE_FLOOR;
5334 else if (command_wrk == (USE_EQUIP))
5336 if (allow_floor) command_wrk = USE_FLOOR;
5337 else if (allow_inven) command_wrk = USE_INVEN;
5344 else if (command_wrk == (USE_FLOOR))
5346 if (allow_inven) command_wrk = USE_INVEN;
5347 else if (allow_equip) command_wrk = USE_EQUIP;
5360 /* Hack -- Fix screen */
5370 /* Switch inven/equip */
5371 if (command_wrk == USE_INVEN) max_line = max_inven;
5372 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5373 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5374 if (menu_line > max_line) menu_line = max_line;
5376 /* Need to redraw */
5385 if (command_wrk == USE_FLOOR)
5388 (*cp) = -get_item_label;
5392 /* Validate the item */
5393 if (!get_item_okay(get_item_label))
5399 /* Allow player to "refuse" certain actions */
5400 if (!get_item_allow(get_item_label))
5406 /* Accept that choice */
5407 (*cp) = get_item_label;
5416 if (select_the_force) {
5424 if (menu_line > max_line) menu_line -= max_line;
5445 command_see = FALSE;
5468 cave_type *c_ptr = &cave[py][px];
5470 if (command_wrk != (USE_FLOOR)) break;
5472 /* Get the object being moved. */
5473 o_idx = c_ptr->o_idx;
5475 /* Only rotate a pile of two or more objects. */
5476 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
5478 /* Remove the first object from the list. */
5479 excise_object_idx(o_idx);
5481 /* Find end of the list. */
5483 while (o_list[i].next_o_idx)
5484 i = o_list[i].next_o_idx;
5486 /* Add after the last object. */
5487 o_list[i].next_o_idx = o_idx;
5489 /* Re-scan floor list */
5490 floor_num = scan_floor(floor_list, py, px, 0x03);
5492 /* Hack -- Fix screen */
5507 if (command_wrk == (USE_INVEN))
5514 command_wrk = (USE_EQUIP);
5516 else if (command_wrk == (USE_EQUIP))
5523 command_wrk = (USE_INVEN);
5525 else if (command_wrk == (USE_FLOOR))
5529 command_wrk = (USE_INVEN);
5531 else if (allow_equip)
5533 command_wrk = (USE_EQUIP);
5542 /* Hack -- Fix screen */
5552 /* Need to redraw */
5565 * If we are already examining the floor, and there
5566 * is only one item, we will always select it.
5567 * If we aren't examining the floor and there is only
5568 * one item, we will select it if floor_query_flag
5573 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
5576 k = 0 - floor_list[0];
5578 /* Allow player to "refuse" certain actions */
5579 if (!get_item_allow(k))
5585 /* Accept that choice */
5594 /* Hack -- Fix screen */
5604 command_wrk = (USE_FLOOR);
5610 case '1': case '2': case '3':
5611 case '4': case '5': case '6':
5612 case '7': case '8': case '9':
5614 if (command_wrk != USE_FLOOR)
5616 /* Look up the tag */
5617 if (!get_tag(&k, which, command_wrk))
5623 /* Hack -- Validate the item */
5624 if ((k < INVEN_RARM) ? !inven : !equip)
5630 /* Validate the item */
5631 if (!get_item_okay(k))
5639 /* Look up the alphabetical tag */
5640 if (get_tag_floor(&k, which, floor_list, floor_num))
5643 k = 0 - floor_list[k];
5652 /* Allow player to "refuse" certain actions */
5653 if (!get_item_allow(k))
5659 /* Accept that choice */
5665 #endif /* ALLOW_REPEAT */
5673 /* Choose "default" inventory item */
5674 if (command_wrk == (USE_INVEN))
5676 k = ((i1 == i2) ? i1 : -1);
5679 /* Choose "default" equipment item */
5680 else if (command_wrk == (USE_EQUIP))
5682 k = ((e1 == e2) ? e1 : -1);
5685 /* Choose "default" floor item */
5686 else if (command_wrk == (USE_FLOOR))
5691 k = 0 - floor_list[0];
5693 /* Allow player to "refuse" certain actions */
5694 if (!get_item_allow(k))
5700 /* Accept that choice */
5708 /* Validate the item */
5709 if (!get_item_okay(k))
5715 /* Allow player to "refuse" certain actions */
5716 if (!get_item_allow(k))
5722 /* Accept that choice */
5732 if (select_the_force) {
5746 if (command_wrk != USE_FLOOR)
5748 bool not_found = FALSE;
5750 /* Look up the alphabetical tag */
5751 if (!get_tag(&k, which, command_wrk))
5756 /* Hack -- Validate the item */
5757 else if ((k < INVEN_RARM) ? !inven : !equip)
5762 /* Validate the item */
5763 else if (!get_item_okay(k))
5770 /* Accept that choice */
5776 #endif /* ALLOW_REPEAT */
5782 /* Look up the alphabetical tag */
5783 if (get_tag_floor(&k, which, floor_list, floor_num))
5786 k = 0 - floor_list[k];
5788 /* Accept that choice */
5794 #endif /* ALLOW_REPEAT */
5799 /* Extract "query" setting */
5800 ver = isupper(which);
5801 which = tolower(which);
5803 /* Convert letter to inventory index */
5804 if (command_wrk == (USE_INVEN))
5806 if (which == '(') k = i1;
5807 else if (which == ')') k = i2;
5808 else k = label_to_inven(which);
5811 /* Convert letter to equipment index */
5812 else if (command_wrk == (USE_EQUIP))
5814 if (which == '(') k = e1;
5815 else if (which == ')') k = e2;
5816 else k = label_to_equip(which);
5819 /* Convert letter to floor index */
5820 else if (command_wrk == USE_FLOOR)
5822 if (which == '(') k = 0;
5823 else if (which == ')') k = floor_num - 1;
5824 else k = islower(which) ? A2I(which) : -1;
5825 if (k < 0 || k >= floor_num || k >= 23)
5832 k = 0 - floor_list[k];
5835 /* Validate the item */
5836 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
5842 /* Verify the item */
5844 if (ver && !verify("ËÜÅö¤Ë", k))
5846 if (ver && !verify("Try", k))
5854 /* Allow player to "refuse" certain actions */
5855 if (!get_item_allow(k))
5861 /* Accept that choice */
5871 /* Fix the screen if necessary */
5877 /* Hack -- Cancel "display" */
5878 command_see = FALSE;
5882 /* Forget the item_tester_tval restriction */
5883 item_tester_tval = 0;
5885 /* Forget the item_tester_hook restriction */
5886 item_tester_hook = NULL;
5889 /* Clean up 'show choices' */
5890 /* Toggle again if needed */
5891 if (toggle) toggle_inven_equip();
5894 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5900 /* Clear the prompt line */
5903 /* Warning if needed */
5904 if (oops && str) msg_print(str);
5910 if (command_cmd) prev_tag = cur_tag;
5911 #endif /* ALLOW_REPEAT */
5913 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5921 static bool py_pickup_floor_aux(void)
5929 /* Restrict the choices */
5930 item_tester_hook = inven_carry_okay;
5934 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
5935 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
5937 q = "Get which item? ";
5938 s = "You no longer have any room for the objects on the floor.";
5941 if (get_item(&item, q, s, (USE_FLOOR)))
5943 this_o_idx = 0 - item;
5950 /* Pick up the object */
5951 py_pickup_aux(this_o_idx);
5958 * Make the player carry everything in a grid
5960 * If "pickup" is FALSE then only gold will be picked up
5962 * This is called by py_pickup() when easy_floor is TRUE.
5964 void py_pickup_floor(bool pickup)
5966 s16b this_o_idx, next_o_idx = 0;
5968 char o_name[MAX_NLEN];
5971 int floor_num = 0, floor_o_idx = 0;
5975 /* Scan the pile of objects */
5976 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5980 /* Access the object */
5981 o_ptr = &o_list[this_o_idx];
5983 /* Describe the object */
5984 object_desc(o_name, o_ptr, 0);
5986 /* Access the next object */
5987 next_o_idx = o_ptr->next_o_idx;
5989 /* Hack -- disturb */
5993 if (o_ptr->tval == TV_GOLD)
5997 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
5998 (long)o_ptr->pval, o_name);
6000 msg_format("You have found %ld gold pieces worth of %s.",
6001 (long) o_ptr->pval, o_name);
6005 /* Collect the gold */
6006 p_ptr->au += o_ptr->pval;
6009 p_ptr->redraw |= (PR_GOLD);
6012 p_ptr->window |= (PW_PLAYER);
6014 /* Delete the gold */
6015 delete_object_idx(this_o_idx);
6017 /* Check the next object */
6020 else if (o_ptr->marked & OM_NOMSG)
6022 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
6023 * ignored. Otherwise, they are included in the prompt. */
6024 o_ptr->marked &= ~(OM_NOMSG);
6028 /* Count non-gold objects that can be picked up. */
6029 if (inven_carry_okay(o_ptr))
6034 /* Count non-gold objects */
6037 /* Remember this index */
6038 floor_o_idx = this_o_idx;
6041 /* There are no non-gold objects */
6045 /* Mention the number of objects */
6051 /* Access the object */
6052 o_ptr = &o_list[floor_o_idx];
6054 #ifdef ALLOW_EASY_SENSE
6056 /* Option: Make object sensing easy */
6059 /* Sense the object */
6060 (void) sense_object(o_ptr);
6063 #endif /* ALLOW_EASY_SENSE */
6065 /* Describe the object */
6066 object_desc(o_name, o_ptr, 0);
6070 msg_format("%s¤¬¤¢¤ë¡£", o_name);
6072 msg_format("You see %s.", o_name);
6077 /* Multiple objects */
6082 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
6084 msg_format("You see a pile of %d items.", floor_num);
6093 /* The player has no room for anything on the floor. */
6099 /* Access the object */
6100 o_ptr = &o_list[floor_o_idx];
6102 #ifdef ALLOW_EASY_SENSE
6104 /* Option: Make object sensing easy */
6107 /* Sense the object */
6108 (void) sense_object(o_ptr);
6111 #endif /* ALLOW_EASY_SENSE */
6113 /* Describe the object */
6114 object_desc(o_name, o_ptr, 0);
6118 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6120 msg_format("You have no room for %s.", o_name);
6125 /* Multiple objects */
6130 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6132 msg_print("You have no room for any of the objects on the floor.");
6144 /* Hack -- query every object */
6145 if (carry_query_flag)
6147 char out_val[MAX_NLEN+20];
6149 /* Access the object */
6150 o_ptr = &o_list[floor_o_idx];
6152 #ifdef ALLOW_EASY_SENSE
6154 /* Option: Make object sensing easy */
6157 /* Sense the object */
6158 (void) sense_object(o_ptr);
6161 #endif /* ALLOW_EASY_SENSE */
6163 /* Describe the object */
6164 object_desc(o_name, o_ptr, 0);
6166 /* Build a prompt */
6168 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
6170 (void) sprintf(out_val, "Pick up %s? ", o_name);
6174 /* Ask the user to confirm */
6175 if (!get_check(out_val))
6182 /* Access the object */
6183 o_ptr = &o_list[floor_o_idx];
6185 #ifdef ALLOW_EASY_SENSE
6187 /* Option: Make object sensing easy */
6190 /* Sense the object */
6191 (void) sense_object(o_ptr);
6194 #endif /* ALLOW_EASY_SENSE */
6196 /* Pick up the object */
6197 py_pickup_aux(floor_o_idx);
6200 /* Allow the user to choose an object */
6203 while (can_pickup--)
6205 if (!py_pickup_floor_aux()) break;
6210 #endif /* ALLOW_EASY_FLOOR */