3 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Î¼ÂÁõ / Object code, part 1
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
11 * 2014 Deskull rearranged comment for Doxygen.\n
16 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
23 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¡¢ÃÏ·Á¤Îɽ¼¨¥·¥ó¥Ü¥ë¤Ê¤É½é´ü²½¤¹¤ë / Reset the "visual" lists
25 * This involves resetting various things to their "default" state.\n
27 * If the "prefs" flag is TRUE, then we will also load the appropriate\n
28 * "user pref file" based on the current setting of the "use_graphics"\n
29 * flag. This is useful for switching "graphics" on/off.\n
31 * The features, objects, and monsters, should all be encoded in the\n
32 * relevant "font.pref" and/or "graf.prf" files. XXX XXX XXX\n
34 * The "prefs" parameter is no longer meaningful. XXX XXX XXX\n
36 void reset_visuals(void)
40 /* Extract some info about terrain features */
41 for (i = 0; i < max_f_idx; i++)
43 feature_type *f_ptr = &f_info[i];
45 /* Assume we will use the underlying values */
46 for (j = 0; j < F_LIT_MAX; j++)
48 f_ptr->x_attr[j] = f_ptr->d_attr[j];
49 f_ptr->x_char[j] = f_ptr->d_char[j];
53 /* Extract default attr/char code for objects */
54 for (i = 0; i < max_k_idx; i++)
56 object_kind *k_ptr = &k_info[i];
58 /* Default attr/char */
59 k_ptr->x_attr = k_ptr->d_attr;
60 k_ptr->x_char = k_ptr->d_char;
63 /* Extract default attr/char code for monsters */
64 for (i = 0; i < max_r_idx; i++)
66 monster_race *r_ptr = &r_info[i];
68 /* Default attr/char */
69 r_ptr->x_attr = r_ptr->d_attr;
70 r_ptr->x_char = r_ptr->d_char;
77 /* Process "graf.prf" */
78 process_pref_file("graf.prf");
80 /* Access the "character" pref file */
81 sprintf(buf, "graf-%s.prf", player_base);
83 /* Process "graf-<playername>.prf" */
84 process_pref_file(buf);
92 /* Process "font.prf" */
93 process_pref_file("font.prf");
95 /* Access the "character" pref file */
96 sprintf(buf, "font-%s.prf", player_base);
98 /* Process "font-<playername>.prf" */
99 process_pref_file(buf);
104 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Õ¥é¥°Îà¤òÇÛÎó¤ËÍ¿¤¨¤ë
105 * Obtain the "flags" for an item
106 * @param o_ptr ¥Õ¥é¥°¼èÆÀ¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
107 * @param flgs ¥Õ¥é¥°¾ðÊó¤ò¼õ¤±¼è¤ëÇÛÎó
110 void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
112 object_kind *k_ptr = &k_info[o_ptr->k_idx];
116 for (i = 0; i < TR_FLAG_SIZE; i++)
117 flgs[i] = k_ptr->flags[i];
120 if (object_is_fixed_artifact(o_ptr))
122 artifact_type *a_ptr = &a_info[o_ptr->name1];
124 for (i = 0; i < TR_FLAG_SIZE; i++)
125 flgs[i] = a_ptr->flags[i];
129 if (object_is_ego(o_ptr))
131 ego_item_type *e_ptr = &e_info[o_ptr->name2];
133 for (i = 0; i < TR_FLAG_SIZE; i++)
134 flgs[i] |= e_ptr->flags[i];
136 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
138 remove_flag(flgs, TR_SH_FIRE);
140 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
142 remove_flag(flgs, TR_INFRA);
144 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
146 remove_flag(flgs, TR_RES_BLIND);
147 remove_flag(flgs, TR_SEE_INVIS);
151 /* Random artifact ! */
152 for (i = 0; i < TR_FLAG_SIZE; i++)
153 flgs[i] |= o_ptr->art_flags[i];
155 if (object_is_smith(o_ptr))
157 int add = o_ptr->xtra3 - 1;
159 if (add < TR_FLAG_MAX)
163 else if (add == ESSENCE_TMP_RES_ACID)
165 add_flag(flgs, TR_RES_ACID);
166 add_flag(flgs, TR_ACTIVATE);
168 else if (add == ESSENCE_TMP_RES_ELEC)
170 add_flag(flgs, TR_RES_ELEC);
171 add_flag(flgs, TR_ACTIVATE);
173 else if (add == ESSENCE_TMP_RES_FIRE)
175 add_flag(flgs, TR_RES_FIRE);
176 add_flag(flgs, TR_ACTIVATE);
178 else if (add == ESSENCE_TMP_RES_COLD)
180 add_flag(flgs, TR_RES_COLD);
181 add_flag(flgs, TR_ACTIVATE);
183 else if (add == ESSENCE_SH_FIRE)
185 add_flag(flgs, TR_RES_FIRE);
186 add_flag(flgs, TR_SH_FIRE);
188 else if (add == ESSENCE_SH_ELEC)
190 add_flag(flgs, TR_RES_ELEC);
191 add_flag(flgs, TR_SH_ELEC);
193 else if (add == ESSENCE_SH_COLD)
195 add_flag(flgs, TR_RES_COLD);
196 add_flag(flgs, TR_SH_COLD);
198 else if (add == ESSENCE_RESISTANCE)
200 add_flag(flgs, TR_RES_ACID);
201 add_flag(flgs, TR_RES_ELEC);
202 add_flag(flgs, TR_RES_FIRE);
203 add_flag(flgs, TR_RES_COLD);
205 else if (add == TR_IMPACT)
207 add_flag(flgs, TR_ACTIVATE);
213 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÌÀ¼¨¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°Îà¤ò¼èÆÀ¤¹¤ë
214 * Obtain the "flags" for an item which are known to the player
215 * @param o_ptr ¥Õ¥é¥°¼èÆÀ¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
216 * @param flgs ¥Õ¥é¥°¾ðÊó¤ò¼õ¤±¼è¤ëÇÛÎó
219 void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
224 object_kind *k_ptr = &k_info[o_ptr->k_idx];
227 for (i = 0; i < TR_FLAG_SIZE; i++)
230 if (!object_is_aware(o_ptr)) return;
233 for (i = 0; i < TR_FLAG_SIZE; i++)
234 flgs[i] = k_ptr->flags[i];
236 /* Must be identified */
237 if (!object_is_known(o_ptr)) return;
239 /* Ego-item (known basic flags) */
240 if (object_is_ego(o_ptr))
242 ego_item_type *e_ptr = &e_info[o_ptr->name2];
244 for (i = 0; i < TR_FLAG_SIZE; i++)
245 flgs[i] |= e_ptr->flags[i];
247 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
249 remove_flag(flgs, TR_SH_FIRE);
251 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
253 remove_flag(flgs, TR_INFRA);
255 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
257 remove_flag(flgs, TR_RES_BLIND);
258 remove_flag(flgs, TR_SEE_INVIS);
263 #ifdef SPOIL_ARTIFACTS
264 /* Full knowledge for some artifacts */
265 if (object_is_artifact(o_ptr)) spoil = TRUE;
266 #endif /* SPOIL_ARTIFACTS */
268 #ifdef SPOIL_EGO_ITEMS
269 /* Full knowledge for some ego-items */
270 if (object_is_ego(o_ptr)) spoil = TRUE;
271 #endif /* SPOIL_EGO_ITEMS */
273 /* Need full knowledge or spoilers */
274 if (spoil || (o_ptr->ident & IDENT_MENTAL))
277 if (object_is_fixed_artifact(o_ptr))
279 artifact_type *a_ptr = &a_info[o_ptr->name1];
281 for (i = 0; i < TR_FLAG_SIZE; i++)
282 flgs[i] = a_ptr->flags[i];
285 /* Random artifact ! */
286 for (i = 0; i < TR_FLAG_SIZE; i++)
287 flgs[i] |= o_ptr->art_flags[i];
290 if (object_is_smith(o_ptr))
292 int add = o_ptr->xtra3 - 1;
294 if (add < TR_FLAG_MAX)
298 else if (add == ESSENCE_TMP_RES_ACID)
300 add_flag(flgs, TR_RES_ACID);
302 else if (add == ESSENCE_TMP_RES_ELEC)
304 add_flag(flgs, TR_RES_ELEC);
306 else if (add == ESSENCE_TMP_RES_FIRE)
308 add_flag(flgs, TR_RES_FIRE);
310 else if (add == ESSENCE_TMP_RES_COLD)
312 add_flag(flgs, TR_RES_COLD);
314 else if (add == ESSENCE_SH_FIRE)
316 add_flag(flgs, TR_RES_FIRE);
317 add_flag(flgs, TR_SH_FIRE);
319 else if (add == ESSENCE_SH_ELEC)
321 add_flag(flgs, TR_RES_ELEC);
322 add_flag(flgs, TR_SH_ELEC);
324 else if (add == ESSENCE_SH_COLD)
326 add_flag(flgs, TR_RES_COLD);
327 add_flag(flgs, TR_SH_COLD);
329 else if (add == ESSENCE_RESISTANCE)
331 add_flag(flgs, TR_RES_ACID);
332 add_flag(flgs, TR_RES_ELEC);
333 add_flag(flgs, TR_RES_FIRE);
334 add_flag(flgs, TR_RES_COLD);
340 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Îȯư¸ú²Ì̾¾Î¤òÊÖ¤¹¡Ê¥µ¥Ö¥ë¡¼¥Á¥ó/¥Ö¥ì¥¹¡Ë
341 * @param o_ptr ̾¾Î¤ò¼èÆÀ¤¹¤ë¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
342 * @return cptr ȯư̾¾Î¤òÊÖ¤¹Ê¸»úÎó¥Ý¥¤¥ó¥¿
344 static cptr item_activation_dragon_breath(object_type *o_ptr)
346 static char desc[256];
347 u32b flgs[TR_FLAG_SIZE]; /* for resistance flags */
350 object_flags(o_ptr, flgs);
351 strcpy(desc, _("", "breath "));
353 for (i = 0; dragonbreath_info[i].flag != 0; i++)
355 if (have_flag(flgs, dragonbreath_info[i].flag))
357 if (n > 0) strcat(desc, _("¡¢", ", "));
358 strcat(desc, dragonbreath_info[i].name);
363 strcat(desc, _("¤Î¥Ö¥ì¥¹(250)", ""));
369 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Îȯư¸ú²Ì̾¾Î¤òÊÖ¤¹¡Ê¥µ¥Ö¥ë¡¼¥Á¥ó/ÈÆÍÑ¡Ë
370 * @param o_ptr ̾¾Î¤ò¼èÆÀ¤¹¤ë¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
371 * @return cptr ȯư̾¾Î¤òÊÖ¤¹Ê¸»úÎó¥Ý¥¤¥ó¥¿
373 static cptr item_activation_aux(object_type *o_ptr)
375 static char activation_detail[256];
379 const activation_type* const act_ptr = find_activation_info(o_ptr);
381 if (!act_ptr) return _("̤ÄêµÁ", "something undefined");
383 desc = act_ptr->desc;
385 /* Overwrite description if it is special */
386 switch (act_ptr->index) {
388 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
389 desc = _("²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ", "breath of fire (200) and resist fire");
392 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
393 desc = _("Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ", "breath of cold (200) and resist cold");
396 desc = item_activation_dragon_breath(o_ptr);
399 if (o_ptr->name1 == ART_HYOUSIGI)
400 desc = _("Çï»ÒÌÚ¤òÂǤÁ¤Ê¤é¤¹", "beat wooden clappers");
402 case ACT_RESIST_ACID:
403 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID)) || (o_ptr->name2 == EGO_BRAND_ACID))
404 desc = _("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ", "ball of acid (100) and resist acid");
406 case ACT_RESIST_FIRE:
407 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) || (o_ptr->name2 == EGO_BRAND_FIRE))
408 desc = _("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ", "ball of fire (100) and resist fire");
410 case ACT_RESIST_COLD:
411 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) || (o_ptr->name2 == EGO_BRAND_COLD))
412 desc = _("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ", "ball of cold (100) and resist cold");
414 case ACT_RESIST_ELEC:
415 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC)) || (o_ptr->name2 == EGO_BRAND_ELEC))
416 desc = _("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ", "ball of elec (100) and resist elec");
418 case ACT_RESIST_POIS:
419 if (o_ptr->name2 == EGO_BRAND_POIS)
420 desc = _("°½±À (100) ¤ÈÆǤؤÎÂÑÀ", "ball of poison (100) and resist elec");
424 /* Timeout description */
425 constant = act_ptr->timeout.constant;
426 dice = act_ptr->timeout.dice;
427 if (constant == 0 && dice == 0) {
428 /* We can activate it every turn */
429 strcpy(timeout, _("¤¤¤Ä¤Ç¤â", "every turn"));
430 } else if (constant < 0) {
431 /* Activations that have special timeout */
432 switch (act_ptr->index) {
434 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
435 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250);
438 sprintf(timeout, _("%d ¥¿¡¼¥óËè", "every %d turns"),
439 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250);
442 strcpy(timeout, _("3*(¥ì¥Ù¥ë+10) ¥¿¡¼¥óËè", "every 3 * (level+10) turns"));
445 strcpy(timeout, _("³ÎΨ50%¤Ç²õ¤ì¤ë", "(destroyed 50%)"));
448 strcpy(timeout, "undefined");
452 /* Normal timeout activations */
453 char constant_str[16], dice_str[16];
454 sprintf(constant_str, "%d", constant);
455 sprintf(dice_str, "d%d", dice);
456 sprintf(timeout, _("%s%s%s ¥¿¡¼¥óËè", "every %s%s%s turns"),
457 (constant > 0) ? constant_str : "",
458 (constant > 0 && dice > 0) ? "+" : "",
459 (dice > 0) ? dice_str : "");
462 /* Build detail activate description */
463 sprintf(activation_detail, _("%s : %s", "%s %s"), desc, timeout);
465 return activation_detail;
469 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Îȯư¸ú²Ì̾¾Î¤òÊÖ¤¹¡Ê¥á¥¤¥ó¥ë¡¼¥Á¥ó¡Ë /
470 * Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation"
471 * @param o_ptr ̾¾Î¤ò¼èÆÀ¤¹¤ë¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
472 * @return cptr ȯư̾¾Î¤òÊÖ¤¹Ê¸»úÎó¥Ý¥¤¥ó¥¿
474 cptr item_activation(object_type *o_ptr)
476 u32b flgs[TR_FLAG_SIZE];
478 /* Extract the flags */
479 object_flags(o_ptr, flgs);
481 /* Require activation ability */
483 if (!(have_flag(flgs, TR_ACTIVATE))) return ("¤Ê¤·");
485 if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
488 /* Get an explain of an activation */
489 if (activation_index(o_ptr))
491 return item_activation_aux(o_ptr);
495 if (o_ptr->tval == TV_WHISTLE)
498 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
500 return "call pet every 100+d100 turns";
504 if (o_ptr->tval == TV_CAPTURE)
507 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
509 return "captures or releases a monster.";
515 return "²¿¤âµ¯¤¤Ê¤¤";
523 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Î*´ÕÄê*ÆâÍƤò¾Ü½Ò¤·¤Æɽ¼¨¤¹¤ë /
524 * Describe a "fully identified" item
525 * @param o_ptr *´ÕÄê*¾ðÊó¤ò¼èÆÀ¤¹¤ë¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
526 * @param mode ɽ¼¨¥ª¥×¥·¥ç¥ó
527 * @return ÆÃÉ®¤¹¤Ù¤¾ðÊ󤬰ì¤Ä¤Ç¤â¤¢¤Ã¤¿¾ì¹çTRUE¡¢°ì¤Ä¤â¤Ê¤¯É½¼¨¤¬¥¥ã¥ó¥»¥ë¤µ¤ì¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
529 bool screen_object(object_type *o_ptr, u32b mode)
533 u32b flgs[TR_FLAG_SIZE];
537 char o_name[MAX_NLEN];
542 int trivial_info = 0;
544 /* Extract the flags */
545 object_flags(o_ptr, flgs);
547 /* Extract the description */
549 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
550 (k_text + k_info[o_ptr->k_idx].text),
551 77 - 15, temp, sizeof(temp));
552 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
553 { info[i] = &temp[j]; i++;}
556 if (object_is_equipment(o_ptr))
558 /* Descriptions of a basic equipment is just a flavor */
562 /* Mega-Hack -- describe activation */
563 if (have_flag(flgs, TR_ACTIVATE))
566 info[i++] = "»ÏÆ°¤·¤¿¤È¤¤Î¸ú²Ì...";
568 info[i++] = "It can be activated for...";
571 info[i++] = item_activation(o_ptr);
573 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
575 info[i++] = "...if it is being worn.";
580 /* Figurines, a hack */
581 if (o_ptr->tval == TV_FIGURINE)
584 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
586 info[i++] = "It will transform into a pet when thrown.";
591 /* Figurines, a hack */
592 if (o_ptr->name1 == ART_STONEMASK)
595 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
597 info[i++] = "It makes you turn into a vampire permanently.";
602 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
605 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
607 info[i++] = "It will attempt to kill a monster instantly.";
612 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
615 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
617 info[i++] = "It causes you to strike yourself sometimes.";
621 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
623 info[i++] = "It always penetrates invulnerability barriers.";
627 if (o_ptr->name2 == EGO_2WEAPON)
630 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
632 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
637 if (have_flag(flgs, TR_EASY_SPELL))
640 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
642 info[i++] = "It affects your ability to cast spells.";
646 if (o_ptr->name2 == EGO_AMU_FOOL)
649 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
651 info[i++] = "It interferes with casting spells.";
655 if (o_ptr->name2 == EGO_RING_THROW)
658 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
660 info[i++] = "It provides great strength when you throw an item.";
664 if (o_ptr->name2 == EGO_AMU_NAIVETY)
667 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
669 info[i++] = "It decreases your magic resistance.";
673 if (o_ptr->tval == TV_STATUE)
675 monster_race *r_ptr = &r_info[o_ptr->pval];
677 if (o_ptr->pval == MON_BULLGATES)
679 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
681 info[i++] = "It is shameful.";
683 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
685 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
687 info[i++] = "It is fearful.";
691 info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
693 info[i++] = "It is cheerful.";
697 /* Hack -- describe lite's */
699 if (o_ptr->name2 == EGO_LITE_DARKNESS) info[i++] = _("¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£", "It provides no light.");
702 if (have_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 1;
703 if (have_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 2;
704 if (have_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 3;
705 if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
706 if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
707 if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
709 if(o_ptr->name2 == EGO_LITE_SHINE) rad++;
711 if (have_flag(flgs, TR_LITE_FUEL) && o_ptr->name2 != EGO_LITE_DARKNESS)
713 if(rad > 0) sprintf(desc, _("¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â %d)¤ò¼ø¤±¤ë¡£", "It provides light (radius %d) when fueled."), rad);
717 if(rad > 0) sprintf(desc, _("¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â %d)¤ò¼ø¤±¤ë¡£", "It provides light (radius %d) forever."), rad);
718 if(rad < 0) sprintf(desc, _("¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-%d)¡£", "It decreases radius of light source by %d."), -rad);
721 if(rad != 0) info[i++] = desc;
724 if (o_ptr->name2 == EGO_LITE_LONG)
726 info[i++] = _("¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£", "It provides light for much longer time.");
729 /* And then describe it fully */
731 if (have_flag(flgs, TR_RIDING))
733 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
735 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
737 info[i++] = "It is made for use while riding.";
742 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
744 info[i++] = "It is suitable for use while riding.";
746 /* This information is not important enough */
750 if (have_flag(flgs, TR_STR))
753 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
755 info[i++] = "It affects your strength.";
759 if (have_flag(flgs, TR_INT))
762 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
764 info[i++] = "It affects your intelligence.";
768 if (have_flag(flgs, TR_WIS))
771 info[i++] = "¤½¤ì¤Ï¸¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
773 info[i++] = "It affects your wisdom.";
777 if (have_flag(flgs, TR_DEX))
780 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
782 info[i++] = "It affects your dexterity.";
786 if (have_flag(flgs, TR_CON))
789 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
791 info[i++] = "It affects your constitution.";
795 if (have_flag(flgs, TR_CHR))
798 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
800 info[i++] = "It affects your charisma.";
805 if (have_flag(flgs, TR_MAGIC_MASTERY))
808 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
810 info[i++] = "It affects your ability to use magic devices.";
814 if (have_flag(flgs, TR_STEALTH))
817 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
819 info[i++] = "It affects your stealth.";
823 if (have_flag(flgs, TR_SEARCH))
826 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
828 info[i++] = "It affects your searching.";
832 if (have_flag(flgs, TR_INFRA))
835 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
837 info[i++] = "It affects your infravision.";
841 if (have_flag(flgs, TR_TUNNEL))
844 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
846 info[i++] = "It affects your ability to tunnel.";
850 if (have_flag(flgs, TR_SPEED))
853 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
855 info[i++] = "It affects your speed.";
859 if (have_flag(flgs, TR_BLOWS))
862 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
864 info[i++] = "It affects your attack speed.";
869 if (have_flag(flgs, TR_BRAND_ACID))
872 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
874 info[i++] = "It does extra damage from acid.";
878 if (have_flag(flgs, TR_BRAND_ELEC))
881 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
883 info[i++] = "It does extra damage from electricity.";
887 if (have_flag(flgs, TR_BRAND_FIRE))
890 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
892 info[i++] = "It does extra damage from fire.";
896 if (have_flag(flgs, TR_BRAND_COLD))
899 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
901 info[i++] = "It does extra damage from frost.";
906 if (have_flag(flgs, TR_BRAND_POIS))
909 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
911 info[i++] = "It poisons your foes.";
916 if (have_flag(flgs, TR_CHAOTIC))
919 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
921 info[i++] = "It produces chaotic effects.";
926 if (have_flag(flgs, TR_VAMPIRIC))
929 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
931 info[i++] = "It drains life from your foes.";
936 if (have_flag(flgs, TR_IMPACT))
939 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤¤ë¡£";
941 info[i++] = "It can cause earthquakes.";
946 if (have_flag(flgs, TR_VORPAL))
949 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
951 info[i++] = "It is very sharp and can cut your foes.";
956 if (have_flag(flgs, TR_KILL_DRAGON))
959 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
961 info[i++] = "It is a great bane of dragons.";
965 else if (have_flag(flgs, TR_SLAY_DRAGON))
968 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
970 info[i++] = "It is especially deadly against dragons.";
975 if (have_flag(flgs, TR_KILL_ORC))
978 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
980 info[i++] = "It is a great bane of orcs.";
984 if (have_flag(flgs, TR_SLAY_ORC))
987 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
989 info[i++] = "It is especially deadly against orcs.";
994 if (have_flag(flgs, TR_KILL_TROLL))
997 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
999 info[i++] = "It is a great bane of trolls.";
1003 if (have_flag(flgs, TR_SLAY_TROLL))
1006 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1008 info[i++] = "It is especially deadly against trolls.";
1013 if (have_flag(flgs, TR_KILL_GIANT))
1016 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1018 info[i++] = "It is a great bane of giants.";
1021 else if (have_flag(flgs, TR_SLAY_GIANT))
1024 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1026 info[i++] = "It is especially deadly against giants.";
1031 if (have_flag(flgs, TR_KILL_DEMON))
1034 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1036 info[i++] = "It is a great bane of demons.";
1040 if (have_flag(flgs, TR_SLAY_DEMON))
1043 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1045 info[i++] = "It strikes at demons with holy wrath.";
1050 if (have_flag(flgs, TR_KILL_UNDEAD))
1053 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1055 info[i++] = "It is a great bane of undead.";
1059 if (have_flag(flgs, TR_SLAY_UNDEAD))
1062 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1064 info[i++] = "It strikes at undead with holy wrath.";
1069 if (have_flag(flgs, TR_KILL_EVIL))
1072 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1074 info[i++] = "It is a great bane of evil monsters.";
1078 if (have_flag(flgs, TR_SLAY_EVIL))
1081 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1083 info[i++] = "It fights against evil with holy fury.";
1088 if (have_flag(flgs, TR_KILL_ANIMAL))
1091 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1093 info[i++] = "It is a great bane of natural creatures.";
1097 if (have_flag(flgs, TR_SLAY_ANIMAL))
1100 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1102 info[i++] = "It is especially deadly against natural creatures.";
1107 if (have_flag(flgs, TR_KILL_HUMAN))
1110 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1112 info[i++] = "It is a great bane of humans.";
1116 if (have_flag(flgs, TR_SLAY_HUMAN))
1119 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤ÎϤòȯ´ø¤¹¤ë¡£";
1121 info[i++] = "It is especially deadly against humans.";
1126 if (have_flag(flgs, TR_FORCE_WEAPON))
1129 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
1131 info[i++] = "It powerfully strikes at a monster using your mana.";
1135 if (have_flag(flgs, TR_DEC_MANA))
1138 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
1140 info[i++] = "It decreases your mana consumption.";
1144 if (have_flag(flgs, TR_SUST_STR))
1147 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
1149 info[i++] = "It sustains your strength.";
1153 if (have_flag(flgs, TR_SUST_INT))
1156 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
1158 info[i++] = "It sustains your intelligence.";
1162 if (have_flag(flgs, TR_SUST_WIS))
1165 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸¤µ¤ò°Ý»ý¤¹¤ë¡£";
1167 info[i++] = "It sustains your wisdom.";
1171 if (have_flag(flgs, TR_SUST_DEX))
1174 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
1176 info[i++] = "It sustains your dexterity.";
1180 if (have_flag(flgs, TR_SUST_CON))
1183 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
1185 info[i++] = "It sustains your constitution.";
1189 if (have_flag(flgs, TR_SUST_CHR))
1192 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
1194 info[i++] = "It sustains your charisma.";
1199 if (have_flag(flgs, TR_IM_ACID))
1202 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1204 info[i++] = "It provides immunity to acid.";
1208 if (have_flag(flgs, TR_IM_ELEC))
1211 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1213 info[i++] = "It provides immunity to electricity.";
1217 if (have_flag(flgs, TR_IM_FIRE))
1220 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1222 info[i++] = "It provides immunity to fire.";
1226 if (have_flag(flgs, TR_IM_COLD))
1229 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1231 info[i++] = "It provides immunity to cold.";
1236 if (have_flag(flgs, TR_THROW))
1239 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礤ʥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1241 info[i++] = "It is perfectly balanced for throwing.";
1245 if (have_flag(flgs, TR_FREE_ACT))
1248 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
1250 info[i++] = "It provides immunity to paralysis.";
1254 if (have_flag(flgs, TR_HOLD_LIFE))
1257 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ¤ò¼ø¤±¤ë¡£";
1259 info[i++] = "It provides resistance to life draining.";
1263 if (have_flag(flgs, TR_RES_FEAR))
1266 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1268 info[i++] = "It makes you completely fearless.";
1272 if (have_flag(flgs, TR_RES_ACID))
1275 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1277 info[i++] = "It provides resistance to acid.";
1281 if (have_flag(flgs, TR_RES_ELEC))
1284 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1286 info[i++] = "It provides resistance to electricity.";
1290 if (have_flag(flgs, TR_RES_FIRE))
1293 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1295 info[i++] = "It provides resistance to fire.";
1299 if (have_flag(flgs, TR_RES_COLD))
1302 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1304 info[i++] = "It provides resistance to cold.";
1308 if (have_flag(flgs, TR_RES_POIS))
1311 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1313 info[i++] = "It provides resistance to poison.";
1318 if (have_flag(flgs, TR_RES_LITE))
1321 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1323 info[i++] = "It provides resistance to light.";
1327 if (have_flag(flgs, TR_RES_DARK))
1330 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1332 info[i++] = "It provides resistance to dark.";
1337 if (have_flag(flgs, TR_RES_BLIND))
1340 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1342 info[i++] = "It provides resistance to blindness.";
1346 if (have_flag(flgs, TR_RES_CONF))
1349 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1351 info[i++] = "It provides resistance to confusion.";
1355 if (have_flag(flgs, TR_RES_SOUND))
1358 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1360 info[i++] = "It provides resistance to sound.";
1364 if (have_flag(flgs, TR_RES_SHARDS))
1367 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1369 info[i++] = "It provides resistance to shards.";
1374 if (have_flag(flgs, TR_RES_NETHER))
1377 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1379 info[i++] = "It provides resistance to nether.";
1383 if (have_flag(flgs, TR_RES_NEXUS))
1386 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1388 info[i++] = "It provides resistance to nexus.";
1392 if (have_flag(flgs, TR_RES_CHAOS))
1395 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1397 info[i++] = "It provides resistance to chaos.";
1401 if (have_flag(flgs, TR_RES_DISEN))
1404 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ¤ò¼ø¤±¤ë¡£";
1406 info[i++] = "It provides resistance to disenchantment.";
1411 if (have_flag(flgs, TR_LEVITATION))
1414 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1416 info[i++] = "It allows you to levitate.";
1421 if (have_flag(flgs, TR_SEE_INVIS))
1423 info[i++] = _("¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£", "It allows you to see invisible monsters.");
1425 if (have_flag(flgs, TR_TELEPATHY))
1428 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
1430 info[i++] = "It gives telepathic powers.";
1434 if (have_flag(flgs, TR_ESP_ANIMAL))
1437 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
1439 info[i++] = "It senses natural creatures.";
1443 if (have_flag(flgs, TR_ESP_UNDEAD))
1446 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
1448 info[i++] = "It senses undead.";
1452 if (have_flag(flgs, TR_ESP_DEMON))
1455 info[i++] = "¤½¤ì¤Ï°Ëâ¤ò´¶ÃΤ¹¤ë¡£";
1457 info[i++] = "It senses demons.";
1461 if (have_flag(flgs, TR_ESP_ORC))
1464 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
1466 info[i++] = "It senses orcs.";
1470 if (have_flag(flgs, TR_ESP_TROLL))
1473 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
1475 info[i++] = "It senses trolls.";
1479 if (have_flag(flgs, TR_ESP_GIANT))
1482 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
1484 info[i++] = "It senses giants.";
1488 if (have_flag(flgs, TR_ESP_DRAGON))
1491 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
1493 info[i++] = "It senses dragons.";
1497 if (have_flag(flgs, TR_ESP_HUMAN))
1500 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
1502 info[i++] = "It senses humans.";
1506 if (have_flag(flgs, TR_ESP_EVIL))
1509 info[i++] = "¤½¤ì¤Ï¼Ù°¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
1511 info[i++] = "It senses evil creatures.";
1515 if (have_flag(flgs, TR_ESP_GOOD))
1518 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
1520 info[i++] = "It senses good creatures.";
1524 if (have_flag(flgs, TR_ESP_NONLIVING))
1527 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
1529 info[i++] = "It senses non-living creatures.";
1533 if (have_flag(flgs, TR_ESP_UNIQUE))
1536 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
1538 info[i++] = "It senses unique monsters.";
1542 if (have_flag(flgs, TR_SLOW_DIGEST))
1545 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
1547 info[i++] = "It slows your metabolism.";
1551 if (have_flag(flgs, TR_REGEN))
1554 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
1556 info[i++] = "It speeds your regenerative powers.";
1560 if (have_flag(flgs, TR_WARNING))
1563 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
1565 info[i++] = "It warns you of danger";
1569 if (have_flag(flgs, TR_REFLECT))
1571 info[i++] = _("¤½¤ì¤ÏÌð¤Î¼öʸ¤òÈ¿¼Í¤¹¤ë¡£", "It reflects bolt spells.");
1573 if (have_flag(flgs, TR_SH_FIRE))
1575 info[i++] = _("¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£", "It produces a fiery sheath.");
1577 if (have_flag(flgs, TR_SH_ELEC))
1579 info[i++] = _("¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£", "It produces an electric sheath.");
1581 if (have_flag(flgs, TR_SH_COLD))
1584 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1586 info[i++] = "It produces a sheath of coldness.";
1590 if (have_flag(flgs, TR_NO_MAGIC))
1593 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
1595 info[i++] = "It produces an anti-magic shell.";
1599 if (have_flag(flgs, TR_NO_TELE))
1602 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
1604 info[i++] = "It prevents teleportation.";
1608 if (have_flag(flgs, TR_XTRA_MIGHT))
1611 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1613 info[i++] = "It fires missiles with extra might.";
1617 if (have_flag(flgs, TR_XTRA_SHOTS))
1620 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
1622 info[i++] = "It fires missiles excessively fast.";
1627 if (have_flag(flgs, TR_BLESSED))
1630 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
1632 info[i++] = "It has been blessed by the gods.";
1637 if (object_is_cursed(o_ptr))
1639 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
1642 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1644 info[i++] = "It is permanently cursed.";
1648 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
1651 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
1653 info[i++] = "It is heavily cursed.";
1660 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
1662 info[i++] = "It is cursed.";
1666 * It's a trivial infomation since there is
1667 * fake inscription {cursed}
1673 if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
1675 info[i++] = _("¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£", "It carries an ancient foul curse.");
1677 if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
1679 info[i++] = _("¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£", "It aggravates nearby creatures.");
1681 if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
1683 info[i++] = _("¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£", "It drains experience.");
1685 if (o_ptr->curse_flags & TRC_SLOW_REGEN)
1687 info[i++] = _("¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£", "It slows your regenerative powers.");
1689 if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
1691 info[i++] = _("¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£","It adds weak curses.");
1693 if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
1695 info[i++] = _("¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£","It adds heavy curses.");
1697 if ((have_flag(flgs, TR_CALL_ANIMAL)) || (o_ptr->curse_flags & TRC_CALL_ANIMAL))
1699 info[i++] = _("¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts animals.");
1701 if ((have_flag(flgs, TR_CALL_DEMON)) || (o_ptr->curse_flags & TRC_CALL_DEMON))
1703 info[i++] = _("¤½¤ì¤Ï°Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts demons.");
1705 if ((have_flag(flgs, TR_CALL_DRAGON)) || (o_ptr->curse_flags & TRC_CALL_DRAGON))
1707 info[i++] = _("¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts dragons.");
1709 if ((have_flag(flgs, TR_CALL_UNDEAD)) || (o_ptr->curse_flags & TRC_CALL_UNDEAD))
1711 info[i++] = _("¤½¤ì¤Ï»àÎî¤ò¸Æ¤Ó´ó¤»¤ë¡£", "It attracts undeads.");
1713 if ((have_flag(flgs, TR_COWARDICE)) || (o_ptr->curse_flags & TRC_COWARDICE))
1715 info[i++] = _("¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤µ¯¤³¤¹¡£", "It makes you subject to cowardice.");
1717 if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
1719 info[i++] = _("¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤µ¯¤³¤¹¡£", "It induces random teleportation.");
1721 if ((have_flag(flgs, TR_LOW_MELEE)) || o_ptr->curse_flags & TRC_LOW_MELEE)
1723 info[i++] = _("¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£", "It causes you to miss blows.");
1725 if ((have_flag(flgs, TR_LOW_AC)) || (o_ptr->curse_flags & TRC_LOW_AC))
1727 info[i++] = _("¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£", "It helps your enemies' blows.");
1729 if ((have_flag(flgs, TR_LOW_MAGIC)) || (o_ptr->curse_flags & TRC_LOW_MAGIC))
1731 info[i++] = _("¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£", "It encumbers you while spellcasting.");
1733 if ((have_flag(flgs, TR_FAST_DIGEST)) || (o_ptr->curse_flags & TRC_FAST_DIGEST))
1735 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£", "It speeds your metabolism.");
1737 if ((have_flag(flgs, TR_DRAIN_HP)) || (o_ptr->curse_flags & TRC_DRAIN_HP))
1739 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£", "It drains you.");
1741 if ((have_flag(flgs, TR_DRAIN_MANA)) || (o_ptr->curse_flags & TRC_DRAIN_MANA))
1743 info[i++] = _("¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£", "It drains your mana.");
1746 /* Describe about this kind of object instead of THIS fake object */
1747 if (mode & SCROBJ_FAKE_OBJECT)
1749 switch (o_ptr->tval)
1752 switch (o_ptr->sval)
1754 case SV_RING_LORDLY:
1756 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë¡£";
1758 info[i++] = "It provides some random resistances.";
1761 case SV_RING_WARNING:
1763 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1765 info[i++] = "It may provide a low rank ESP.";
1772 switch (o_ptr->sval)
1774 case SV_AMULET_RESISTANCE:
1776 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1778 info[i++] = "It may provides resistance to poison.";
1781 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
1783 info[i++] = "It may provide a random resistances.";
1786 case SV_AMULET_THE_MAGI:
1788 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
1790 info[i++] = "It provides up to three low rank ESPs.";
1798 if (have_flag(flgs, TR_IGNORE_ACID) &&
1799 have_flag(flgs, TR_IGNORE_ELEC) &&
1800 have_flag(flgs, TR_IGNORE_FIRE) &&
1801 have_flag(flgs, TR_IGNORE_COLD))
1804 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1806 info[i++] = "It cannot be harmed by the elements.";
1811 if (have_flag(flgs, TR_IGNORE_ACID))
1814 info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1816 info[i++] = "It cannot be harmed by acid.";
1819 if (have_flag(flgs, TR_IGNORE_ELEC))
1822 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1824 info[i++] = "It cannot be harmed by electricity.";
1827 if (have_flag(flgs, TR_IGNORE_FIRE))
1830 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1832 info[i++] = "It cannot be harmed by fire.";
1835 if (have_flag(flgs, TR_IGNORE_COLD))
1838 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
1840 info[i++] = "It cannot be harmed by cold.";
1845 if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
1847 /* No relevant informations */
1848 if (i <= trivial_info) return (FALSE);
1850 /* Save the screen */
1854 Term_get_size(&wid, &hgt);
1856 /* Display Item name */
1857 if (!(mode & SCROBJ_FAKE_OBJECT))
1858 object_desc(o_name, o_ptr, 0);
1860 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
1864 /* Erase the screen */
1865 for (k = 1; k < hgt; k++) prt("", k, 13);
1867 /* Label the information */
1868 if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
1870 monster_race *r_ptr = &r_info[o_ptr->pval];
1871 int namelen = strlen(r_name + r_ptr->name);
1872 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
1873 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
1874 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
1878 prt(" ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
1880 prt(" Item Attributes:", 1, 15);
1883 /* We will print on top of the map (column 13) */
1884 for (k = 2, j = 0; j < i; j++)
1887 prt(info[j], k++, 15);
1889 /* Every 20 entries (lines 2 to 21), start over */
1890 if ((k == hgt - 2) && (j+1 < i))
1893 prt("-- ³¤¯ --", k, 15);
1895 prt("-- more --", k, 15);
1898 for (; k > 2; k--) prt("", k, 15);
1904 prt("[²¿¤«¥¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
1906 prt("[Press any key to continue]", k, 15);
1911 /* Restore the screen */
1914 /* Gave knowledge */
1921 * @brief ¥ª¥Ö¥¸¥§¥¯¥ÈÁªÂò»þ¤ÎÁªÂò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¥é¥Ù¥ë¤òÊÖ¤¹ /
1922 * Convert an inventory index into a one character label
1923 * @param i ¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID
1924 * @return Âбþ¤¹¤ë¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È
1925 * @details Note that the label does NOT distinguish inven/equip.
1927 char index_to_label(int i)
1929 /* Indexes for "inven" are easy */
1930 if (i < INVEN_RARM) return (I2A(i));
1932 /* Indexes for "equip" are offset */
1933 return (I2A(i - INVEN_RARM));
1937 * @brief ÁªÂò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¥é¥Ù¥ë¤«¤é¥×¥ì¥¤¥ä¡¼¤Î½ê»ý¥ª¥Ö¥¸¥§¥¯¥ÈID¤òÊÖ¤¹ /
1938 * Convert a label into the index of an item in the "inven"
1939 * @return Âбþ¤¹¤ëID¡£³ºÅö¥¹¥í¥Ã¥È¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç-1¤òÊÖ¤¹ / Return "-1" if the label does not indicate a real item
1940 * @details Note that the label does NOT distinguish inven/equip.
1942 s16b label_to_inven(int c)
1947 i = (islower(c) ? A2I(c) : -1);
1949 /* Verify the index */
1950 if ((i < 0) || (i > INVEN_PACK)) return (-1);
1952 /* Empty slots can never be chosen */
1953 if (!inventory[i].k_idx) return (-1);
1955 /* Return the index */
1961 extern bool select_ring_slot;
1965 * @brief ¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID¤¬»ØÎØÏȤ«¤òÊÖ¤¹ /
1966 * @param i ¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID
1967 * @return »ØÎØÏȤʤé¤ÐTRUE¤òÊÖ¤¹¡£
1969 static bool is_ring_slot(int i)
1971 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
1976 * @brief ÁªÂò¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¥é¥Ù¥ë¤«¤é¥×¥ì¥¤¥ä¡¼¤ÎÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID¤òÊÖ¤¹ /
1977 * Convert a label into the index of a item in the "equip"
1978 * @return Âбþ¤¹¤ëID¡£³ºÅö¥¹¥í¥Ã¥È¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç-1¤òÊÖ¤¹ / Return "-1" if the label does not indicate a real item
1980 s16b label_to_equip(int c)
1985 i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
1987 /* Verify the index */
1988 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
1990 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
1992 /* Empty slots can never be chosen */
1993 if (!inventory[i].k_idx) return (-1);
1995 /* Return the index */
2002 * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤Î³ºÅöÁõÈ÷Éô°ÌID¤òÊÖ¤¹ /
2003 * Determine which equipment slot (if any) an item likes
2004 * @param o_ptr ̾¾Î¤ò¼èÆÀ¤¹¤ë¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
2005 * @return Âбþ¤¹¤ëÁõÈ÷Éô°ÌID
2007 s16b wield_slot(object_type *o_ptr)
2009 /* Slot for equipment */
2010 switch (o_ptr->tval)
2017 if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
2018 if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
2019 return (INVEN_LARM);
2026 if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
2027 if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
2028 return (INVEN_RARM);
2038 /* Use the right hand first */
2039 if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
2041 /* Use the left hand for swapping (by default) */
2042 return (INVEN_LEFT);
2048 return (INVEN_NECK);
2053 return (INVEN_LITE);
2060 return (INVEN_BODY);
2065 return (INVEN_OUTER);
2071 return (INVEN_HEAD);
2076 return (INVEN_HANDS);
2081 return (INVEN_FEET);
2085 /* No slot available */
2090 * @brief ½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID¤ÎÉô°Ìɽ¸½¤òÊÖ¤¹ /
2091 * Return a string mentioning how a given item is carried
2092 * @param i Éô°Ìɽ¸½¤òµá¤á¤ë¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID
2093 * @return Éô°Ìɽ¸½¤Îʸ»úÎó¥Ý¥¤¥ó¥¿
2095 cptr mention_use(int i)
2099 /* Examine the location */
2103 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " ξ¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
2105 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
2109 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " ξ¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
2111 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
2115 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
2117 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
2121 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
2123 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
2127 case INVEN_LEFT: p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
2129 case INVEN_LEFT: p = (left_hander ? "On right hand" : "On left hand"); break;
2133 case INVEN_NECK: p = " ¼ó"; break;
2135 case INVEN_NECK: p = "Around neck"; break;
2139 case INVEN_LITE: p = " ¸÷¸»"; break;
2141 case INVEN_LITE: p = "Light source"; break;
2145 case INVEN_BODY: p = " ÂÎ"; break;
2147 case INVEN_BODY: p = "On body"; break;
2151 case INVEN_OUTER: p = "ÂΤξå"; break;
2153 case INVEN_OUTER: p = "About body"; break;
2157 case INVEN_HEAD: p = " Ƭ"; break;
2159 case INVEN_HEAD: p = "On head"; break;
2163 case INVEN_HANDS: p = " ¼ê"; break;
2165 case INVEN_HANDS: p = "On hands"; break;
2169 case INVEN_FEET: p = " "; break;
2171 case INVEN_FEET: p = "On feet"; break;
2175 default: p = "¥¶¥Ã¥¯"; break;
2177 default: p = "In pack"; break;
2181 /* Return the result */
2187 * @brief ½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID¤Î¸½ºß¤Î°·¤¤Êý¤Î¾õÂÖɽ¸½¤òÊÖ¤¹ /
2188 * Return a string describing how a given item is being worn.
2189 * @param i ¾õÂÖɽ¸½¤òµá¤á¤ë¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥ÈID
2190 * @return ¾õÂÖɽ¸½ÆâÍƤÎʸ»úÎó¥Ý¥¤¥ó¥¿
2192 * Currently, only used for items in the equipment, not inventory.
2194 cptr describe_use(int i)
2201 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2203 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
2207 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
2209 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
2213 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
2215 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
2219 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2221 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
2225 case INVEN_LEFT: p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
2227 case INVEN_LEFT: p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
2231 case INVEN_NECK: p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
2233 case INVEN_NECK: p = "wearing around your neck"; break;
2237 case INVEN_LITE: p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
2239 case INVEN_LITE: p = "using to light the way"; break;
2243 case INVEN_BODY: p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
2245 case INVEN_BODY: p = "wearing on your body"; break;
2249 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
2251 case INVEN_OUTER: p = "wearing on your back"; break;
2255 case INVEN_HEAD: p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
2257 case INVEN_HEAD: p = "wearing on your head"; break;
2261 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
2263 case INVEN_HANDS: p = "wearing on your hands"; break;
2267 case INVEN_FEET: p = "¤ˤϤ¤¤Æ¤¤¤ë"; break;
2269 case INVEN_FEET: p = "wearing on your feet"; break;
2273 default: p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
2275 default: p = "carrying in your pack"; break;
2279 /* Return the result */
2285 * @brief tval/sval»ØÄê¤Î¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤¬¥×¥ì¥¤¥ä¡¼¤Î»ÈÍѲÄǽ¤ÊËâË¡½ñ¤«¤É¤¦¤«¤òÊÖ¤¹ /
2286 * Hack: Check if a spellbook is one of the realms we can use. -- TY
2287 * @param tval ¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤Îtval
2288 * @param sval ¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤Îsval
2289 * @return »ÈÍѲÄǽ¤ÊËâË¡½ñ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
2292 bool check_book_realm(const byte book_tval, const byte book_sval)
2294 if (book_tval < TV_LIFE_BOOK) return FALSE;
2295 if (p_ptr->pclass == CLASS_SORCERER)
2297 return is_magic(tval2realm(book_tval));
2299 else if (p_ptr->pclass == CLASS_RED_MAGE)
2301 if (is_magic(tval2realm(book_tval)))
2302 return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
2304 return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
2308 * @brief ¥¢¥¤¥Æ¥à¤¬item_tester_hook¥°¥í¡¼¥Ð¥ë´Ø¿ô¥Ý¥¤¥ó¥¿¤Î¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ë¤«¤òÊÖ¤¹ÈÆÍÑ´Ø¿ô
2309 * Check an item against the item tester info
2310 * @param o_ptr ȽÄê¤ò¹Ô¤¤¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
2311 * @return item_tester_hook¤Î»²¾ÈÀè¡¢¤½¤Î¾¤¤¤¯¤Ä¤«¤ÎÎã³°¤Ë±þ¤¸¤ÆTRUE/FALSE¤òÊÖ¤¹¡£
2313 bool item_tester_okay(object_type *o_ptr)
2315 /* Hack -- allow listing empty slots */
2316 if (item_tester_full) return (TRUE);
2318 /* Require an item */
2319 if (!o_ptr->k_idx) return (FALSE);
2321 /* Hack -- ignore "gold" */
2322 if (o_ptr->tval == TV_GOLD)
2325 extern bool show_gold_on_floor;
2327 if (!show_gold_on_floor) return (FALSE);
2330 /* Check the tval */
2331 if (item_tester_tval)
2333 /* Is it a spellbook? If so, we need a hack -- TY */
2334 if ((item_tester_tval <= TV_DEATH_BOOK) &&
2335 (item_tester_tval >= TV_LIFE_BOOK))
2336 return check_book_realm(o_ptr->tval, o_ptr->sval);
2338 if (item_tester_tval != o_ptr->tval) return (FALSE);
2341 /* Check the hook */
2342 if (item_tester_hook)
2344 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
2353 * @brief ½ê»ý¥¢¥¤¥Æ¥à°ìÍ÷¤òɽ¼¨¤¹¤ë /
2354 * Choice window "shadow" of the "show_inven()" function
2357 void display_inven(void)
2359 register int i, n, z = 0;
2361 byte attr = TERM_WHITE;
2363 char o_name[MAX_NLEN];
2367 Term_get_size(&wid, &hgt);
2369 /* Find the "final" slot */
2370 for (i = 0; i < INVEN_PACK; i++)
2372 o_ptr = &inventory[i];
2374 /* Skip non-objects */
2375 if (!o_ptr->k_idx) continue;
2381 /* Display the pack */
2382 for (i = 0; i < z; i++)
2384 /* Examine the item */
2385 o_ptr = &inventory[i];
2387 /* Start with an empty "index" */
2388 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2390 /* Is this item "acceptable"? */
2391 if (item_tester_okay(o_ptr))
2393 /* Prepare an "index" */
2394 tmp_val[0] = index_to_label(i);
2396 /* Bracket the "index" --(-- */
2400 /* Display the index (or blank space) */
2401 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
2403 /* Obtain an item description */
2404 object_desc(o_name, o_ptr, 0);
2406 /* Obtain the length of the description */
2410 attr = tval_to_attr[o_ptr->tval % 128];
2412 /* Grey out charging items */
2418 /* Display the entry itself */
2419 Term_putstr(3, i, n, attr, o_name);
2421 /* Erase the rest of the line */
2422 Term_erase(3+n, i, 255);
2424 /* Display the weight if needed */
2427 int wgt = o_ptr->weight * o_ptr->number;
2429 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
2431 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2434 prt(tmp_val, i, wid - 9);
2438 /* Erase the rest of the window */
2439 for (i = z; i < hgt; i++)
2441 /* Erase the line */
2442 Term_erase(0, i, 255);
2449 * @brief ÁõÈ÷¥¢¥¤¥Æ¥à°ìÍ÷¤òɽ¼¨¤¹¤ë /
2450 * Choice window "shadow" of the "show_equip()" function
2453 void display_equip(void)
2457 byte attr = TERM_WHITE;
2459 char o_name[MAX_NLEN];
2463 Term_get_size(&wid, &hgt);
2465 /* Display the equipment */
2466 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2468 /* Examine the item */
2469 o_ptr = &inventory[i];
2471 /* Start with an empty "index" */
2472 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
2474 /* Is this item "acceptable"? */
2475 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
2477 /* Prepare an "index" */
2478 tmp_val[0] = index_to_label(i);
2480 /* Bracket the "index" --(-- */
2484 /* Display the index (or blank space) */
2485 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
2487 /* Obtain an item description */
2488 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
2491 strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
2493 strcpy(o_name, "(wielding with two-hands)");
2499 object_desc(o_name, o_ptr, 0);
2500 attr = tval_to_attr[o_ptr->tval % 128];
2503 /* Obtain the length of the description */
2506 /* Grey out charging items */
2512 /* Display the entry itself */
2513 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
2515 /* Erase the rest of the line */
2516 Term_erase(3+n, i - INVEN_RARM, 255);
2518 /* Display the weight (if needed) */
2521 int wgt = o_ptr->weight * o_ptr->number;
2523 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
2525 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
2528 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
2531 /* Display the slot description (if needed) */
2534 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
2535 prt(mention_use(i), i - INVEN_RARM, wid - 15);
2539 /* Erase the rest of the window */
2540 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
2542 /* Clear that line */
2543 Term_erase(0, i, 255);
2549 * @brief ½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥È¤ËÁªÂò¥¿¥°¤òÍ¿¤¨¤ë/¥¿¥°¤Ë³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤«¤òÊÖ¤¹ /
2550 * Find the "first" inventory object with the given "tag".
2551 * @param cp Âбþ¤¹¤ë¥¿¥°ID¤òÍ¿¤¨¤ë»²¾È¥Ý¥¤¥ó¥¿
2552 * @param tag ³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤«¤òÄ´¤Ù¤¿¤¤¥¿¥°
2553 * @param mode ½ê»ý¡¢ÁõÈ÷¤ÎÀÚ¤êÂؤ¨
2554 * @return ¥¿¥°¤Ë³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤Ê¤éTRUE¤òÊÖ¤¹
2556 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
2557 * inscription of an object. Alphabetical characters don't work as a\n
2558 * tag in this form.\n
2560 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
2561 * and "x" is the "current" command_cmd code.\n
2563 static bool get_tag(int *cp, char tag, int mode)
2568 /* Extract index from mode */
2573 end = INVEN_TOTAL - 1;
2578 end = INVEN_PACK - 1;
2585 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2587 /* Check every inventory object */
2588 for (i = start; i <= end; i++)
2590 object_type *o_ptr = &inventory[i];
2592 /* Skip non-objects */
2593 if (!o_ptr->k_idx) continue;
2595 /* Skip empty inscriptions */
2596 if (!o_ptr->inscription) continue;
2598 /* Skip non-choice */
2599 if (!item_tester_okay(o_ptr)) continue;
2602 s = my_strchr(quark_str(o_ptr->inscription), '@');
2604 /* Process all tags */
2607 /* Check the special tags */
2608 if ((s[1] == command_cmd) && (s[2] == tag))
2610 /* Save the actual inventory ID */
2617 /* Find another '@' */
2618 s = my_strchr(s + 1, '@');
2623 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2625 /* Don't allow {@#} with '#' being alphabet */
2626 if (tag < '0' || '9' < tag)
2632 /* Check every object */
2633 for (i = start; i <= end; i++)
2635 object_type *o_ptr = &inventory[i];
2637 /* Skip non-objects */
2638 if (!o_ptr->k_idx) continue;
2640 /* Skip empty inscriptions */
2641 if (!o_ptr->inscription) continue;
2643 /* Skip non-choice */
2644 if (!item_tester_okay(o_ptr)) continue;
2647 s = my_strchr(quark_str(o_ptr->inscription), '@');
2649 /* Process all tags */
2652 /* Check the normal tags */
2655 /* Save the actual inventory ID */
2662 /* Find another '@' */
2663 s = my_strchr(s + 1, '@');
2673 * @brief ¾²¥ª¥Ö¥¸¥§¥¯¥È¤ËÁªÂò¥¿¥°¤òÍ¿¤¨¤ë/¥¿¥°¤Ë³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤«¤òÊÖ¤¹ /
2674 * Find the "first" inventory object with the given "tag".
2675 * @param cp Âбþ¤¹¤ë¥¿¥°ID¤òÍ¿¤¨¤ë»²¾È¥Ý¥¤¥ó¥¿
2676 * @param tag ³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤«¤òÄ´¤Ù¤¿¤¤¥¿¥°
2677 * @param floor_list ¾²¾å¥¢¥¤¥Æ¥à¤ÎÇÛÎó
2678 * @param floor_num ¾²¾å¥¢¥¤¥Æ¥à¤ÎÇÛÎóID
2679 * @return ¥¿¥°¤Ë³ºÅö¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¤Ê¤éTRUE¤òÊÖ¤¹
2681 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
2682 * inscription of an object. Alphabetical characters don't work as a\n
2683 * tag in this form.\n
2685 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
2686 * and "x" is the "current" command_cmd code.\n
2688 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
2693 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
2695 /* Check every object in the grid */
2696 for (i = 0; i < floor_num && i < 23; i++)
2698 object_type *o_ptr = &o_list[floor_list[i]];
2700 /* Skip empty inscriptions */
2701 if (!o_ptr->inscription) continue;
2704 s = my_strchr(quark_str(o_ptr->inscription), '@');
2706 /* Process all tags */
2709 /* Check the special tags */
2710 if ((s[1] == command_cmd) && (s[2] == tag))
2712 /* Save the actual floor object ID */
2719 /* Find another '@' */
2720 s = my_strchr(s + 1, '@');
2725 /**** Find a tag in the form of {@#} (allows only numerals) ***/
2727 /* Don't allow {@#} with '#' being alphabet */
2728 if (tag < '0' || '9' < tag)
2734 /* Check every object in the grid */
2735 for (i = 0; i < floor_num && i < 23; i++)
2737 object_type *o_ptr = &o_list[floor_list[i]];
2739 /* Skip empty inscriptions */
2740 if (!o_ptr->inscription) continue;
2743 s = my_strchr(quark_str(o_ptr->inscription), '@');
2745 /* Process all tags */
2748 /* Check the normal tags */
2751 /* Save the floor object ID */
2758 /* Find another '@' */
2759 s = my_strchr(s + 1, '@');
2769 * @brief ¥¿¥°ID¤Ë¤¢¤ï¤»¤Æ¥¿¥°¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î¥ê¥¹¥È¤òÊÖ¤¹ /
2770 * Move around label characters with correspond tags
2771 * @param label ¥é¥Ù¥ë¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ëʸ»úÎ󻲾ȥݥ¤¥ó¥¿
2772 * @param mode ½ê»ýÉʥꥹ¥È¤«ÁõÈ÷Éʥꥹ¥È¤«¤ÎÀÚ¤êÂؤ¨
2775 static void prepare_label_string(char *label, int mode)
2777 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2778 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
2781 /* Prepare normal labels */
2782 strcpy(label, alphabet_chars);
2784 /* Move each label */
2785 for (i = 0; i < 52; i++)
2788 char c = alphabet_chars[i];
2790 /* Find a tag with this label */
2791 if (get_tag(&index, c, mode))
2793 /* Delete the overwritten label */
2794 if (label[i] == c) label[i] = ' ';
2796 /* Move the label to the place of corresponding tag */
2797 label[index - offset] = c;
2804 * @brief ¥¿¥°ID¤Ë¤¢¤ï¤»¤Æ¥¿¥°¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î¥ê¥¹¥È¤òÊÖ¤¹(¾²¾å¥¢¥¤¥Æ¥àÍÑ) /
2805 * Move around label characters with correspond tags (floor version)
2806 * @param label ¥é¥Ù¥ë¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ëʸ»úÎ󻲾ȥݥ¤¥ó¥¿
2807 * @param floor_list ¾²¾å¥¢¥¤¥Æ¥à¤ÎÇÛÎó
2808 * @param floor_num ¾²¾å¥¢¥¤¥Æ¥à¤ÎÇÛÎóID
2813 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
2815 cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2818 /* Prepare normal labels */
2819 strcpy(label, alphabet_chars);
2821 /* Move each label */
2822 for (i = 0; i < 52; i++)
2825 char c = alphabet_chars[i];
2827 /* Find a tag with this label */
2828 if (get_tag_floor(&index, c, floor_list, floor_num))
2830 /* Delete the overwritten label */
2831 if (label[i] == c) label[i] = ' ';
2833 /* Move the label to the place of corresponding tag */
2841 * @brief ½ê»ý¥¢¥¤¥Æ¥à¤Îɽ¼¨¤ò¹Ô¤¦ /
2842 * Display the inventory.
2843 * @param target_item ¥¢¥¤¥Æ¥à¤ÎÁªÂò½èÍý¤ò¹Ô¤¦¤«Èݤ«¡£
2844 * @return ÁªÂò¤·¤¿¥¢¥¤¥Æ¥à¤Î¥¿¥°
2846 * Hack -- do not display "trailing" empty slots
2848 int show_inven(int target_item)
2850 int i, j, k, l, z = 0;
2851 int col, cur_col, len;
2853 char o_name[MAX_NLEN];
2857 char out_desc[23][MAX_NLEN];
2858 int target_item_label = 0;
2860 char inven_label[52 + 1];
2862 /* Starting column */
2866 Term_get_size(&wid, &hgt);
2868 /* Default "max-length" */
2869 len = wid - col - 1;
2872 /* Find the "final" slot */
2873 for (i = 0; i < INVEN_PACK; i++)
2875 o_ptr = &inventory[i];
2877 /* Skip non-objects */
2878 if (!o_ptr->k_idx) continue;
2884 prepare_label_string(inven_label, USE_INVEN);
2886 /* Display the inventory */
2887 for (k = 0, i = 0; i < z; i++)
2889 o_ptr = &inventory[i];
2891 /* Is this item acceptable? */
2892 if (!item_tester_okay(o_ptr)) continue;
2894 /* Describe the object */
2895 object_desc(o_name, o_ptr, 0);
2897 /* Save the object index, color, and description */
2899 out_color[k] = tval_to_attr[o_ptr->tval % 128];
2901 /* Grey out charging items */
2904 out_color[k] = TERM_L_DARK;
2907 (void)strcpy(out_desc[k], o_name);
2909 /* Find the predicted "line length" */
2910 l = strlen(out_desc[k]) + 5;
2912 /* Be sure to account for the weight */
2913 if (show_weights) l += 9;
2915 /* Account for icon if displayed */
2916 if (show_item_graph)
2919 if (use_bigtile) l++;
2922 /* Maintain the maximum length */
2923 if (l > len) len = l;
2925 /* Advance to next "line" */
2929 /* Find the column to start in */
2930 col = (len > wid - 4) ? 0 : (wid - len - 1);
2932 /* Output each entry */
2933 for (j = 0; j < k; j++)
2939 o_ptr = &inventory[i];
2941 /* Clear the line */
2942 prt("", j + 1, col ? col - 2 : col);
2944 if (use_menu && target_item)
2946 if (j == (target_item-1))
2949 strcpy(tmp_val, "¡Õ");
2951 strcpy(tmp_val, "> ");
2953 target_item_label = i;
2955 else strcpy(tmp_val, " ");
2957 else if (i <= INVEN_PACK)
2959 /* Prepare an index --(-- */
2960 sprintf(tmp_val, "%c)", inven_label[i]);
2964 /* Prepare an index --(-- */
2965 sprintf(tmp_val, "%c)", index_to_label(i));
2968 /* Clear the line with the (possibly indented) index */
2969 put_str(tmp_val, j + 1, col);
2973 /* Display graphics for object, if desired */
2974 if (show_item_graph)
2976 byte a = object_attr(o_ptr);
2977 char c = object_char(o_ptr);
2980 if (a & 0x80) a |= 0x40;
2983 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
2984 if (use_bigtile) cur_col++;
2990 /* Display the entry itself */
2991 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
2993 /* Display the weight if needed */
2996 int wgt = o_ptr->weight * o_ptr->number;
2998 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3000 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3003 prt(tmp_val, j + 1, wid - 9);
3007 /* Make a "shadow" below the list (only if needed) */
3008 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3010 /* Save the new column */
3013 return target_item_label;
3018 * @brief ÁõÈ÷¥¢¥¤¥Æ¥à¤Îɽ¼¨¤ò¹Ô¤¦ /
3019 * Display the equipment.
3020 * @param target_item ¥¢¥¤¥Æ¥à¤ÎÁªÂò½èÍý¤ò¹Ô¤¦¤«Èݤ«¡£
3021 * @return ÁªÂò¤·¤¿¥¢¥¤¥Æ¥à¤Î¥¿¥°
3023 int show_equip(int target_item)
3026 int col, cur_col, len;
3029 char o_name[MAX_NLEN];
3032 char out_desc[23][MAX_NLEN];
3033 int target_item_label = 0;
3035 char equip_label[52 + 1];
3037 /* Starting column */
3041 Term_get_size(&wid, &hgt);
3043 /* Maximal length */
3044 len = wid - col - 1;
3047 /* Scan the equipment list */
3048 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3050 o_ptr = &inventory[i];
3052 /* Is this item acceptable? */
3053 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
3054 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3055 item_tester_no_ryoute)) continue;
3058 object_desc(o_name, o_ptr, 0);
3060 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3063 (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
3065 (void)strcpy(out_desc[k],"(wielding with two-hands)");
3067 out_color[k] = TERM_WHITE;
3071 (void)strcpy(out_desc[k], o_name);
3072 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3076 /* Grey out charging items */
3079 out_color[k] = TERM_L_DARK;
3082 /* Extract the maximal length (see below) */
3084 l = strlen(out_desc[k]) + (2 + 1);
3086 l = strlen(out_desc[k]) + (2 + 3);
3090 /* Increase length for labels (if needed) */
3092 if (show_labels) l += (7 + 2);
3094 if (show_labels) l += (14 + 2);
3098 /* Increase length for weight (if needed) */
3099 if (show_weights) l += 9;
3101 if (show_item_graph) l += 2;
3103 /* Maintain the max-length */
3104 if (l > len) len = l;
3106 /* Advance the entry */
3110 /* Hack -- Find a column to start in */
3112 col = (len > wid - 6) ? 0 : (wid - len - 1);
3114 col = (len > wid - 4) ? 0 : (wid - len - 1);
3117 prepare_label_string(equip_label, USE_EQUIP);
3119 /* Output each entry */
3120 for (j = 0; j < k; j++)
3126 o_ptr = &inventory[i];
3128 /* Clear the line */
3129 prt("", j + 1, col ? col - 2 : col);
3131 if (use_menu && target_item)
3133 if (j == (target_item-1))
3136 strcpy(tmp_val, "¡Õ");
3138 strcpy(tmp_val, "> ");
3140 target_item_label = i;
3142 else strcpy(tmp_val, " ");
3144 else if (i >= INVEN_RARM)
3146 /* Prepare an index --(-- */
3147 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3151 /* Prepare an index --(-- */
3152 sprintf(tmp_val, "%c)", index_to_label(i));
3155 /* Clear the line with the (possibly indented) index */
3156 put_str(tmp_val, j+1, col);
3160 /* Display graphics for object, if desired */
3161 if (show_item_graph)
3163 byte a = object_attr(o_ptr);
3164 char c = object_char(o_ptr);
3167 if (a & 0x80) a |= 0x40;
3170 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3171 if (use_bigtile) cur_col++;
3179 /* Mention the use */
3181 (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
3183 (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
3186 put_str(tmp_val, j+1, cur_col);
3188 /* Display the entry itself */
3190 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
3192 c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
3199 /* Display the entry itself */
3200 c_put_str(out_color[j], out_desc[j], j+1, cur_col);
3203 /* Display the weight if needed */
3206 int wgt = o_ptr->weight * o_ptr->number;
3208 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3210 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3213 prt(tmp_val, j + 1, wid - 9);
3217 /* Make a "shadow" below the list (only if needed) */
3218 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3220 /* Save the new column */
3223 return target_item_label;
3227 * @brief ¥µ¥Ö¥¦¥£¥ó¥É¥¦¤Ë½ê»ýÉÊ¡¢ÁõÈ÷Éʥꥹ¥È¤Îɽ¼¨¤ò¹Ô¤¦ /
3228 * Flip "inven" and "equip" in any sub-windows
3231 void toggle_inven_equip(void)
3236 for (j = 0; j < 8; j++)
3239 if (!angband_term[j]) continue;
3241 /* Flip inven to equip */
3242 if (window_flag[j] & (PW_INVEN))
3245 window_flag[j] &= ~(PW_INVEN);
3246 window_flag[j] |= (PW_EQUIP);
3249 p_ptr->window |= (PW_EQUIP);
3252 /* Flip inven to equip */
3253 else if (window_flag[j] & (PW_EQUIP))
3256 window_flag[j] &= ~(PW_EQUIP);
3257 window_flag[j] |= (PW_INVEN);
3260 p_ptr->window |= (PW_INVEN);
3266 * @brief ÁªÂò¤·¤¿¥¢¥¤¥Æ¥à¤Î³Îǧ½èÍý¤ÎÊä½õ /
3267 * Verify the choice of an item.
3268 * @param item ÁªÂò¥¢¥¤¥Æ¥àID
3269 * @return ³Îǧ¤¬Yes¤Ê¤éTRUE¤òÊÖ¤¹¡£
3270 * @details The item can be negative to mean "item on floor".
3272 static bool verify(cptr prompt, int item)
3274 char o_name[MAX_NLEN];
3275 char out_val[MAX_NLEN+20];
3282 o_ptr = &inventory[item];
3288 o_ptr = &o_list[0 - item];
3292 object_desc(o_name, o_ptr, 0);
3296 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
3298 (void)sprintf(out_val, "%s %s? ", prompt, o_name);
3303 return (get_check(out_val));
3308 * @brief ÁªÂò¤·¤¿¥¢¥¤¥Æ¥à¤Î³Îǧ½èÍý¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
3309 * @praram item ÁªÂò¥¢¥¤¥Æ¥àID
3310 * @return ³Îǧ¤¬Yes¤Ê¤éTRUE¤òÊÖ¤¹¡£
3311 * @details The item can be negative to mean "item on floor".
3312 * Hack -- allow user to "prevent" certain choices
3314 static bool get_item_allow(int item)
3320 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
3325 o_ptr = &inventory[item];
3331 o_ptr = &o_list[0 - item];
3334 /* No inscription */
3335 if (!o_ptr->inscription) return (TRUE);
3338 s = my_strchr(quark_str(o_ptr->inscription), '!');
3340 /* Process preventions */
3343 /* Check the "restriction" */
3344 if ((s[1] == command_cmd) || (s[1] == '*'))
3346 /* Verify the choice */
3348 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
3350 if (!verify("Really try", item)) return (FALSE);
3355 /* Find another '!' */
3356 s = my_strchr(s + 1, '!');
3365 * @brief ¥×¥ì¥¤¥ä¡¼¤Î½ê»ý/ÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥È¤¬Àµµ¬¤Î¤â¤Î¤«¤òÊÖ¤¹ /
3366 * Auxiliary function for "get_item()" -- test an index
3367 * @param item ÁªÂò¥¢¥¤¥Æ¥àID
3368 * @return Àµµ¬¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
3370 static bool get_item_okay(int i)
3373 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
3375 if (select_ring_slot) return is_ring_slot(i);
3377 /* Verify the item */
3378 if (!item_tester_okay(&inventory[i])) return (FALSE);
3385 * @brief ¥×¥ì¥¤¥ä¡¼¤¬¥ª¥Ö¥¸¥§¥¯¥È¤ò½¦¤¦¤³¤È¤¬¤Ç¤¤ë¾õÂÖ¤«¤òÊÖ¤¹ /
3386 * Determine whether get_item() can get some item or not
3387 * @param item ÁªÂò¥¢¥¤¥Æ¥àID
3388 * @return ¥¢¥¤¥Æ¥à¤ò½¦¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
3389 * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
3391 bool can_get_item(void)
3393 int j, floor_list[23], floor_num = 0;
3395 for (j = 0; j < INVEN_TOTAL; j++)
3396 if (item_tester_okay(&inventory[j]))
3399 floor_num = scan_floor(floor_list, py, px, 0x03);
3407 * @brief ¥ª¥Ö¥¸¥§¥¯¥ÈÁªÂò¤ÎÈÆÍÑ´Ø¿ô /
3408 * Let the user select an item, save its "index"
3409 * @param cp ÁªÂò¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ÎID¤òÊÖ¤¹¡£
3410 * @param pmt ÁªÂòÌÜŪ¤Î¥á¥Ã¥»¡¼¥¸
3411 * @param str ÁªÂò¤Ç¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤Ê¤¤¾ì¹ç¤Î¥¥ã¥ó¥»¥ë¥á¥Ã¥»¡¼¥¸
3412 * @praram mode ¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
3413 * @return ¥×¥ì¥¤¥ä¡¼¤Ë¤è¤ê¥¢¥¤¥Æ¥à¤¬ÁªÂò¤µ¤ì¤¿¤Ê¤éTRUE¤òÊÖ¤¹¡£/
3414 * Return TRUE only if an acceptable item was chosen by the user.\n
3416 * The selected item must satisfy the "item_tester_hook()" function,\n
3417 * if that hook is set, and the "item_tester_tval", if that value is set.\n
3419 * All "item_tester" restrictions are cleared before this function returns.\n
3421 * The user is allowed to choose acceptable items from the equipment,\n
3422 * inventory, or floor, respectively, if the proper flag was given,\n
3423 * and there are any acceptable items in that location.\n
3425 * The equipment or inventory are displayed (even if no acceptable\n
3426 * items are in that location) if the proper flag was given.\n
3428 * If there are no acceptable items available anywhere, and "str" is\n
3429 * not NULL, then it will be used as the text of a warning message\n
3430 * before the function returns.\n
3432 * Note that the user must press "-" to specify the item on the floor,\n
3433 * and there is no way to "examine" the item on the floor, while the\n
3434 * use of "capital" letters will "examine" an inventory/equipment item,\n
3435 * and prompt for its use.\n
3437 * If a legal item is selected from the inventory, we save it in "cp"\n
3438 * directly (0 to 35), and return TRUE.\n
3440 * If a legal item is selected from the floor, we save it in "cp" as\n
3441 * a negative (-1 to -511), and return TRUE.\n
3443 * If no item is available, we do nothing to "cp", and we display a\n
3444 * warning message, using "str" if available, and return FALSE.\n
3446 * If no item is selected, we do nothing to "cp", and return FALSE.\n
3448 * Global "p_ptr->command_new" is used when viewing the inventory or equipment\n
3449 * to allow the user to enter a command while viewing those screens, and\n
3450 * also to induce "auto-enter" of stores, and other such stuff.\n
3452 * Global "p_ptr->command_see" may be set before calling this function to start\n
3453 * out in "browse" mode. It is cleared before this function returns.\n
3455 * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.\n
3456 * If it is TRUE then we are viewing inventory, else equipment.\n
3458 * We always erase the prompt when we are done, leaving a blank line,\n
3459 * or a warning message, if appropriate, if no items are available.\n
3461 bool get_item(int *cp, cptr pmt, cptr str, int mode)
3463 s16b this_o_idx, next_o_idx = 0;
3467 int j, k, i1, i2, e1, e2;
3477 bool allow_floor = FALSE;
3479 bool toggle = FALSE;
3485 extern bool select_the_force;
3487 int menu_line = (use_menu ? 1 : 0);
3493 static char prev_tag = '\0';
3494 char cur_tag = '\0';
3496 #endif /* ALLOW_REPEAT */
3498 #ifdef ALLOW_EASY_FLOOR /* TNB */
3500 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
3502 #endif /* ALLOW_EASY_FLOOR -- TNB */
3505 if (mode & USE_EQUIP) equip = TRUE;
3506 if (mode & USE_INVEN) inven = TRUE;
3507 if (mode & USE_FLOOR) floor = TRUE;
3511 /* Get the item index */
3512 if (repeat_pull(cp))
3515 if (select_the_force && (*cp == INVEN_FORCE))
3517 item_tester_tval = 0;
3518 item_tester_hook = NULL;
3519 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3524 else if (floor && (*cp < 0))
3531 /* Acquire object */
3534 /* Validate the item */
3535 if (item_tester_okay(o_ptr))
3537 /* Forget restrictions */
3538 item_tester_tval = 0;
3539 item_tester_hook = NULL;
3540 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3547 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
3548 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
3550 if (prev_tag && command_cmd)
3552 /* Look up the tag and validate the item */
3553 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
3554 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
3555 else if (!get_item_okay(k)) /* Reject */;
3558 /* Accept that choice */
3561 /* Forget restrictions */
3562 item_tester_tval = 0;
3563 item_tester_hook = NULL;
3564 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3570 prev_tag = '\0'; /* prev_tag is no longer effective */
3573 /* Verify the item */
3574 else if (get_item_okay(*cp))
3576 /* Forget restrictions */
3577 item_tester_tval = 0;
3578 item_tester_hook = NULL;
3579 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
3587 #endif /* ALLOW_REPEAT */
3590 /* Paranoia XXX XXX XXX */
3597 /* No item selected */
3601 /* Full inventory */
3603 i2 = INVEN_PACK - 1;
3605 /* Forbid inventory */
3606 if (!inven) i2 = -1;
3609 for (j = 0; j < INVEN_PACK; j++)
3610 if (item_tester_okay(&inventory[j])) max_inven++;
3613 /* Restrict inventory indexes */
3614 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
3615 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
3618 /* Full equipment */
3620 e2 = INVEN_TOTAL - 1;
3622 /* Forbid equipment */
3623 if (!equip) e2 = -1;
3626 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
3627 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
3628 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
3631 /* Restrict equipment indexes */
3632 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
3633 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
3635 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
3639 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
3641 else if (p_ptr->hidarite) e1 = INVEN_RARM;
3645 /* Restrict floor usage */
3648 /* Scan all objects in the grid */
3649 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
3653 /* Acquire object */
3654 o_ptr = &o_list[this_o_idx];
3656 /* Acquire next object */
3657 next_o_idx = o_ptr->next_o_idx;
3659 /* Accept the item on the floor if legal */
3660 if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
3664 /* Require at least one legal choice */
3665 if (!allow_floor && (i1 > i2) && (e1 > e2))
3667 /* Cancel p_ptr->command_see */
3668 command_see = FALSE;
3676 if (select_the_force) {
3682 /* Analyze choices */
3685 /* Hack -- Start on equipment if requested */
3686 if (command_see && command_wrk && equip)
3691 /* Use inventory if allowed */
3694 command_wrk = FALSE;
3697 /* Use equipment if allowed */
3703 /* Use inventory for floor */
3706 command_wrk = FALSE;
3712 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
3714 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
3716 /* Hack -- start out in "display" mode */
3724 /* Repeat until done */
3727 int get_item_label = 0;
3734 for (j = 0; j < 8; j++)
3737 if (!angband_term[j]) continue;
3739 /* Count windows displaying inven */
3740 if (window_flag[j] & (PW_INVEN)) ni++;
3742 /* Count windows displaying equip */
3743 if (window_flag[j] & (PW_EQUIP)) ne++;
3746 /* Toggle if needed */
3747 if ((command_wrk && ni && !ne) ||
3748 (!command_wrk && !ni && ne))
3751 toggle_inven_equip();
3758 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3760 /* Redraw windows */
3764 /* Inventory screen */
3767 /* Redraw if needed */
3768 if (command_see) get_item_label = show_inven(menu_line);
3771 /* Equipment screen */
3774 /* Redraw if needed */
3775 if (command_see) get_item_label = show_equip(menu_line);
3778 /* Viewing inventory */
3781 /* Begin the prompt */
3783 sprintf(out_val, "»ý¤Áʪ:");
3785 sprintf(out_val, "Inven:");
3788 /* Some legal items */
3789 if ((i1 <= i2) && !use_menu)
3791 /* Build the prompt */
3793 sprintf(tmp_val, "%c-%c,'(',')',",
3795 sprintf(tmp_val, " %c-%c,'(',')',",
3797 index_to_label(i1), index_to_label(i2));
3800 strcat(out_val, tmp_val);
3803 /* Indicate ability to "view" */
3805 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3807 if (!command_see && !use_menu) strcat(out_val, " * to see,");
3812 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
3814 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
3818 /* Viewing equipment */
3821 /* Begin the prompt */
3823 sprintf(out_val, "ÁõÈ÷ÉÊ:");
3825 sprintf(out_val, "Equip:");
3828 /* Some legal items */
3829 if ((e1 <= e2) && !use_menu)
3831 /* Build the prompt */
3833 sprintf(tmp_val, "%c-%c,'(',')',",
3835 sprintf(tmp_val, " %c-%c,'(',')',",
3837 index_to_label(e1), index_to_label(e2));
3840 strcat(out_val, tmp_val);
3843 /* Indicate ability to "view" */
3845 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
3847 if (!command_see) strcat(out_val, " * to see,");
3852 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
3854 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
3858 /* Indicate legality of the "floor" item */
3860 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
3861 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
3863 if (allow_floor) strcat(out_val, " - for floor,");
3864 if (select_the_force) strcat(out_val, " w for the Force,");
3867 /* Finish the prompt */
3868 strcat(out_val, " ESC");
3870 /* Build the prompt */
3871 sprintf(tmp_val, "(%s) %s", out_val, pmt);
3873 /* Show the prompt */
3881 int max_line = (command_wrk ? max_equip : max_inven);
3897 menu_line += (max_line - 1);
3916 /* Verify legality */
3917 if (!inven || !equip)
3923 /* Hack -- Fix screen */
3933 /* Switch inven/equip */
3934 command_wrk = !command_wrk;
3935 max_line = (command_wrk ? max_equip : max_inven);
3936 if (menu_line > max_line) menu_line = max_line;
3938 /* Need to redraw */
3947 if (command_wrk == USE_FLOOR)
3950 (*cp) = -get_item_label;
3954 /* Validate the item */
3955 if (!get_item_okay(get_item_label))
3961 /* Allow player to "refuse" certain actions */
3962 if (!get_item_allow(get_item_label))
3968 /* Accept that choice */
3969 (*cp) = get_item_label;
3978 if (select_the_force) {
3986 if (menu_line > max_line) menu_line -= max_line;
4007 command_see = FALSE;
4027 /* Verify legality */
4028 if (!inven || !equip)
4034 /* Hack -- Fix screen */
4044 /* Switch inven/equip */
4045 command_wrk = !command_wrk;
4047 /* Need to redraw */
4053 /* Use floor item */
4056 /* Scan all objects in the grid */
4057 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4061 /* Acquire object */
4062 o_ptr = &o_list[this_o_idx];
4064 /* Acquire next object */
4065 next_o_idx = o_ptr->next_o_idx;
4067 /* Validate the item */
4068 if (!item_tester_okay(o_ptr)) continue;
4073 /* Verify the item (if required) */
4075 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
4077 if (other_query_flag && !verify("Try", k)) continue;
4081 /* Allow player to "refuse" certain actions */
4082 if (!get_item_allow(k)) continue;
4084 /* Accept that choice */
4101 case '1': case '2': case '3':
4102 case '4': case '5': case '6':
4103 case '7': case '8': case '9':
4105 /* Look up the tag */
4106 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4112 /* Hack -- Validate the item */
4113 if ((k < INVEN_RARM) ? !inven : !equip)
4119 /* Validate the item */
4120 if (!get_item_okay(k))
4126 /* Allow player to "refuse" certain actions */
4127 if (!get_item_allow(k))
4133 /* Accept that choice */
4139 #endif /* ALLOW_REPEAT */
4147 /* Choose "default" inventory item */
4150 k = ((i1 == i2) ? i1 : -1);
4153 /* Choose "default" equipment item */
4156 k = ((e1 == e2) ? e1 : -1);
4159 /* Validate the item */
4160 if (!get_item_okay(k))
4166 /* Allow player to "refuse" certain actions */
4167 if (!get_item_allow(k))
4173 /* Accept that choice */
4183 if (select_the_force) {
4196 bool not_found = FALSE;
4198 /* Look up the alphabetical tag */
4199 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
4204 /* Hack -- Validate the item */
4205 else if ((k < INVEN_RARM) ? !inven : !equip)
4210 /* Validate the item */
4211 else if (!get_item_okay(k))
4218 /* Accept that choice */
4224 #endif /* ALLOW_REPEAT */
4228 /* Extract "query" setting */
4229 ver = isupper(which);
4230 which = tolower(which);
4232 /* Convert letter to inventory index */
4235 if (which == '(') k = i1;
4236 else if (which == ')') k = i2;
4237 else k = label_to_inven(which);
4240 /* Convert letter to equipment index */
4243 if (which == '(') k = e1;
4244 else if (which == ')') k = e2;
4245 else k = label_to_equip(which);
4248 /* Validate the item */
4249 if (!get_item_okay(k))
4255 /* Verify the item */
4257 if (ver && !verify("ËÜÅö¤Ë", k))
4259 if (ver && !verify("Try", k))
4267 /* Allow player to "refuse" certain actions */
4268 if (!get_item_allow(k))
4274 /* Accept that choice */
4285 /* Fix the screen if necessary */
4291 /* Hack -- Cancel "display" */
4292 command_see = FALSE;
4296 /* Forget the item_tester_tval restriction */
4297 item_tester_tval = 0;
4299 item_tester_no_ryoute = FALSE;
4301 /* Forget the item_tester_hook restriction */
4302 item_tester_hook = NULL;
4305 /* Clean up 'show choices' */
4306 /* Toggle again if needed */
4307 if (toggle) toggle_inven_equip();
4310 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4316 /* Clear the prompt line */
4319 /* Warning if needed */
4320 if (oops && str) msg_print(str);
4326 if (command_cmd) prev_tag = cur_tag;
4327 #endif /* ALLOW_REPEAT */
4329 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4337 #ifdef ALLOW_EASY_FLOOR
4340 * @brief ¾²²¼¤ËÍî¤Á¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô¤òÊÖ¤¹ / scan_floor
4341 * @param items ¥ª¥Ö¥¸¥§¥¯¥È¤ÎID¥ê¥¹¥È¤òÊÖ¤¹¤¿¤á¤ÎÇÛÎ󻲾ȥݥ¤¥ó¥¿
4342 * @param y Áöºº¤¹¤ë¥Õ¥í¥¢¤ÎYºÂɸ
4343 * @param x Áöºº¤¹¤ë¥Õ¥í¥¢¤ÎXºÂɸ
4344 * @param mode ¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
4345 * @return ÂоݤΥޥ¹¤ËÍî¤Á¤Æ¤¤¤ë¥¢¥¤¥Æ¥à¿ô
4347 * Return a list of o_list[] indexes of items at the given cave
4348 * location. Valid flags are:
4350 * mode & 0x01 -- Item tester
4351 * mode & 0x02 -- Marked items only
4352 * mode & 0x04 -- Stop after first
4354 int scan_floor(int *items, int y, int x, int mode)
4356 int this_o_idx, next_o_idx;
4361 if (!in_bounds(y, x)) return 0;
4363 /* Scan all objects in the grid */
4364 for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
4368 /* Acquire object */
4369 o_ptr = &o_list[this_o_idx];
4371 /* Acquire next object */
4372 next_o_idx = o_ptr->next_o_idx;
4375 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
4378 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
4380 /* Accept this item */
4381 /* XXX Hack -- Enforce limit */
4383 items[num] = this_o_idx;
4388 if (mode & 0x04) break;
4397 * @brief ¾²²¼¤ËÍî¤Á¤Æ¤¤¤ë¥¢¥¤¥Æ¥à¤Î°ìÍ÷¤òÊÖ¤¹ / Display a list of the items on the floor at the given location.
4398 * @param items ¥ª¥Ö¥¸¥§¥¯¥È¤ÎID¥ê¥¹¥È¤òÊÖ¤¹¤¿¤á¤ÎÇÛÎ󻲾ȥݥ¤¥ó¥¿
4399 * @param target_item ¥«¡¼¥½¥ë¤Î½é´üÃÍ
4400 * @param y Áöºº¤¹¤ë¥Õ¥í¥¢¤ÎYºÂɸ
4401 * @param x Áöºº¤¹¤ë¥Õ¥í¥¢¤ÎXºÂɸ
4402 * @param min_width ɽ¼¨¤ÎŤµ
4403 * @return ÁªÂò¤·¤¿¥¢¥¤¥Æ¥à¤ÎID
4406 int show_floor(int target_item, int y, int x, int *min_width)
4413 char o_name[MAX_NLEN];
4419 char out_desc[23][MAX_NLEN];
4420 int target_item_label = 0;
4422 int floor_list[23], floor_num;
4424 char floor_label[52 + 1];
4426 bool dont_need_to_show_weights = TRUE;
4429 Term_get_size(&wid, &hgt);
4431 /* Default length */
4432 len = MAX((*min_width), 20);
4435 /* Scan for objects in the grid, using item_tester_okay() */
4436 floor_num = scan_floor(floor_list, y, x, 0x03);
4438 /* Display the floor objects */
4439 for (k = 0, i = 0; i < floor_num && i < 23; i++)
4441 o_ptr = &o_list[floor_list[i]];
4443 /* Describe the object */
4444 object_desc(o_name, o_ptr, 0);
4446 /* Save the index */
4449 /* Acquire inventory color */
4450 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
4452 /* Save the object description */
4453 strcpy(out_desc[k], o_name);
4455 /* Find the predicted "line length" */
4456 l = strlen(out_desc[k]) + 5;
4458 /* Be sure to account for the weight */
4459 if (show_weights) l += 9;
4461 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
4463 /* Maintain the maximum length */
4464 if (l > len) len = l;
4466 /* Advance to next "line" */
4470 if (show_weights && dont_need_to_show_weights) len -= 9;
4475 /* Find the column to start in */
4476 col = (len > wid - 4) ? 0 : (wid - len - 1);
4478 prepare_label_string_floor(floor_label, floor_list, floor_num);
4480 /* Output each entry */
4481 for (j = 0; j < k; j++)
4484 i = floor_list[out_index[j]];
4489 /* Clear the line */
4490 prt("", j + 1, col ? col - 2 : col);
4492 if (use_menu && target_item)
4494 if (j == (target_item-1))
4497 strcpy(tmp_val, "¡Õ");
4499 strcpy(tmp_val, "> ");
4501 target_item_label = i;
4503 else strcpy(tmp_val, " ");
4507 /* Prepare an index --(-- */
4508 sprintf(tmp_val, "%c)", floor_label[j]);
4511 /* Clear the line with the (possibly indented) index */
4512 put_str(tmp_val, j + 1, col);
4514 /* Display the entry itself */
4515 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
4517 /* Display the weight if needed */
4518 if (show_weights && (o_ptr->tval != TV_GOLD))
4520 int wgt = o_ptr->weight * o_ptr->number;
4522 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4524 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4527 prt(tmp_val, j + 1, wid - 9);
4531 /* Make a "shadow" below the list (only if needed) */
4532 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4534 return target_item_label;
4538 * @brief ¥ª¥Ö¥¸¥§¥¯¥ÈÁªÂò¤ÎÈÆÍÑ´Ø¿ô(¾²¾å¥¢¥¤¥Æ¥àÍÑ) /
4539 * Let the user select an item, save its "index"
4540 * @param cp ÁªÂò¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ÎID¤òÊÖ¤¹¡£
4541 * @param pmt ÁªÂòÌÜŪ¤Î¥á¥Ã¥»¡¼¥¸
4542 * @param str ÁªÂò¤Ç¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬¤Ê¤¤¾ì¹ç¤Î¥¥ã¥ó¥»¥ë¥á¥Ã¥»¡¼¥¸
4543 * @praram mode ¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
4544 * @return ¥×¥ì¥¤¥ä¡¼¤Ë¤è¤ê¥¢¥¤¥Æ¥à¤¬ÁªÂò¤µ¤ì¤¿¤Ê¤éTRUE¤òÊÖ¤¹¡£/
4546 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
4548 char n1 = ' ', n2 = ' ', which = ' ';
4550 int j, k, i1, i2, e1, e2;
4557 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
4558 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
4559 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
4561 bool allow_equip = FALSE;
4562 bool allow_inven = FALSE;
4563 bool allow_floor = FALSE;
4565 bool toggle = FALSE;
4570 int floor_num, floor_list[23], floor_top = 0;
4573 extern bool select_the_force;
4575 int menu_line = (use_menu ? 1 : 0);
4581 static char prev_tag = '\0';
4582 char cur_tag = '\0';
4584 /* Get the item index */
4585 if (repeat_pull(cp))
4588 if (select_the_force && (*cp == INVEN_FORCE))
4590 item_tester_tval = 0;
4591 item_tester_hook = NULL;
4592 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4597 else if (floor && (*cp < 0))
4599 if (prev_tag && command_cmd)
4601 /* Scan all objects in the grid */
4602 floor_num = scan_floor(floor_list, py, px, 0x03);
4604 /* Look up the tag */
4605 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
4607 /* Accept that choice */
4608 (*cp) = 0 - floor_list[k];
4610 /* Forget restrictions */
4611 item_tester_tval = 0;
4612 item_tester_hook = NULL;
4613 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4619 prev_tag = '\0'; /* prev_tag is no longer effective */
4622 /* Validate the item */
4623 else if (item_tester_okay(&o_list[0 - (*cp)]))
4625 /* Forget restrictions */
4626 item_tester_tval = 0;
4627 item_tester_hook = NULL;
4628 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4635 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4636 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4638 if (prev_tag && command_cmd)
4640 /* Look up the tag and validate the item */
4641 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4642 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4643 else if (!get_item_okay(k)) /* Reject */;
4646 /* Accept that choice */
4649 /* Forget restrictions */
4650 item_tester_tval = 0;
4651 item_tester_hook = NULL;
4652 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4658 prev_tag = '\0'; /* prev_tag is no longer effective */
4661 /* Verify the item */
4662 else if (get_item_okay(*cp))
4664 /* Forget restrictions */
4665 item_tester_tval = 0;
4666 item_tester_hook = NULL;
4667 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4675 #endif /* ALLOW_REPEAT */
4678 /* Paranoia XXX XXX XXX */
4685 /* No item selected */
4689 /* Full inventory */
4691 i2 = INVEN_PACK - 1;
4693 /* Forbid inventory */
4694 if (!inven) i2 = -1;
4697 for (j = 0; j < INVEN_PACK; j++)
4698 if (item_tester_okay(&inventory[j])) max_inven++;
4701 /* Restrict inventory indexes */
4702 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4703 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4706 /* Full equipment */
4708 e2 = INVEN_TOTAL - 1;
4710 /* Forbid equipment */
4711 if (!equip) e2 = -1;
4714 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4715 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4716 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4719 /* Restrict equipment indexes */
4720 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4721 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4723 if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4727 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4729 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4733 /* Count "okay" floor items */
4736 /* Restrict floor usage */
4739 /* Scan all objects in the grid */
4740 floor_num = scan_floor(floor_list, py, px, 0x03);
4743 /* Accept inventory */
4744 if (i1 <= i2) allow_inven = TRUE;
4746 /* Accept equipment */
4747 if (e1 <= e2) allow_equip = TRUE;
4750 if (floor_num) allow_floor = TRUE;
4752 /* Require at least one legal choice */
4753 if (!allow_inven && !allow_equip && !allow_floor)
4755 /* Cancel p_ptr->command_see */
4756 command_see = FALSE;
4764 if (select_the_force) {
4770 /* Analyze choices */
4773 /* Hack -- Start on equipment if requested */
4774 if (command_see && (command_wrk == (USE_EQUIP))
4777 command_wrk = (USE_EQUIP);
4780 /* Use inventory if allowed */
4781 else if (allow_inven)
4783 command_wrk = (USE_INVEN);
4786 /* Use equipment if allowed */
4787 else if (allow_equip)
4789 command_wrk = (USE_EQUIP);
4792 /* Use floor if allowed */
4793 else if (allow_floor)
4795 command_wrk = (USE_FLOOR);
4800 * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4802 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4804 /* Hack -- start out in "display" mode */
4811 /* Repeat until done */
4814 int get_item_label = 0;
4821 for (j = 0; j < 8; j++)
4824 if (!angband_term[j]) continue;
4826 /* Count windows displaying inven */
4827 if (window_flag[j] & (PW_INVEN)) ni++;
4829 /* Count windows displaying equip */
4830 if (window_flag[j] & (PW_EQUIP)) ne++;
4833 /* Toggle if needed */
4834 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
4835 (command_wrk == (USE_INVEN) && !ni && ne))
4838 toggle_inven_equip();
4845 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4847 /* Redraw windows */
4850 /* Inventory screen */
4851 if (command_wrk == (USE_INVEN))
4853 /* Extract the legal requests */
4857 /* Redraw if needed */
4858 if (command_see) get_item_label = show_inven(menu_line);
4861 /* Equipment screen */
4862 else if (command_wrk == (USE_EQUIP))
4864 /* Extract the legal requests */
4865 n1 = I2A(e1 - INVEN_RARM);
4866 n2 = I2A(e2 - INVEN_RARM);
4868 /* Redraw if needed */
4869 if (command_see) get_item_label = show_equip(menu_line);
4873 else if (command_wrk == (USE_FLOOR))
4876 k = MIN(floor_top + 23, floor_num) - 1;
4878 /* Extract the legal requests */
4879 n1 = I2A(j - floor_top);
4880 n2 = I2A(k - floor_top);
4882 /* Redraw if needed */
4883 if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
4886 /* Viewing inventory */
4887 if (command_wrk == (USE_INVEN))
4889 /* Begin the prompt */
4891 sprintf(out_val, "»ý¤Áʪ:");
4893 sprintf(out_val, "Inven:");
4898 /* Build the prompt */
4900 sprintf(tmp_val, "%c-%c,'(',')',",
4902 sprintf(tmp_val, " %c-%c,'(',')',",
4904 index_to_label(i1), index_to_label(i2));
4907 strcat(out_val, tmp_val);
4910 /* Indicate ability to "view" */
4912 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4914 if (!command_see && !use_menu) strcat(out_val, " * to see,");
4922 strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
4923 else if (allow_floor)
4924 strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
4926 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
4929 strcat(out_val, " / for Equip,");
4930 else if (allow_floor)
4931 strcat(out_val, " 6 for Equip,");
4933 strcat(out_val, " 4 or 6 for Equip,");
4942 strcat(out_val, " '-'¾²¾å,");
4943 else if (allow_equip)
4944 strcat(out_val, " '4' ¾²¾å,");
4946 strcat(out_val, " '4'or'6' ¾²¾å,");
4949 strcat(out_val, " - for floor,");
4950 else if (allow_equip)
4951 strcat(out_val, " 4 for floor,");
4953 strcat(out_val, " 4 or 6 for floor,");
4958 /* Viewing equipment */
4959 else if (command_wrk == (USE_EQUIP))
4961 /* Begin the prompt */
4963 sprintf(out_val, "ÁõÈ÷ÉÊ:");
4965 sprintf(out_val, "Equip:");
4970 /* Build the prompt */
4972 sprintf(tmp_val, "%c-%c,'(',')',",
4974 sprintf(tmp_val, " %c-%c,'(',')',",
4976 index_to_label(e1), index_to_label(e2));
4979 strcat(out_val, tmp_val);
4982 /* Indicate ability to "view" */
4984 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4986 if (!command_see && !use_menu) strcat(out_val, " * to see,");
4994 strcat(out_val, " '/' »ý¤Áʪ,");
4995 else if (allow_floor)
4996 strcat(out_val, " '4' »ý¤Áʪ,");
4998 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5001 strcat(out_val, " / for Inven,");
5002 else if (allow_floor)
5003 strcat(out_val, " 4 for Inven,");
5005 strcat(out_val, " 4 or 6 for Inven,");
5014 strcat(out_val, " '-'¾²¾å,");
5015 else if (allow_inven)
5016 strcat(out_val, " '6' ¾²¾å,");
5018 strcat(out_val, " '4'or'6' ¾²¾å,");
5021 strcat(out_val, " - for floor,");
5022 else if (allow_inven)
5023 strcat(out_val, " 6 for floor,");
5025 strcat(out_val, " 4 or 6 for floor,");
5031 else if (command_wrk == (USE_FLOOR))
5033 /* Begin the prompt */
5035 sprintf(out_val, "¾²¾å:");
5037 sprintf(out_val, "Floor:");
5042 /* Build the prompt */
5044 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5046 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5050 strcat(out_val, tmp_val);
5053 /* Indicate ability to "view" */
5055 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5057 if (!command_see && !use_menu) strcat(out_val, " * to see,");
5062 if (allow_inven && allow_equip)
5065 strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5067 strcat(out_val, " 4 for Equip, 6 for Inven,");
5070 else if (allow_inven)
5073 strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5075 strcat(out_val, " 4 or 6 for Inven,");
5078 else if (allow_equip)
5081 strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5083 strcat(out_val, " 4 or 6 for Equip,");
5088 else if (allow_inven)
5091 strcat(out_val, " '/' »ý¤Áʪ,");
5093 strcat(out_val, " / for Inven,");
5096 else if (allow_equip)
5099 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
5101 strcat(out_val, " / for Equip,");
5106 if (command_see && !use_menu)
5109 strcat(out_val, " Enter ¼¡,");
5111 strcat(out_val, " Enter for scroll down,");
5118 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
5120 if (select_the_force) strcat(out_val, " w for the Force,");
5123 /* Finish the prompt */
5124 strcat(out_val, " ESC");
5126 /* Build the prompt */
5127 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5129 /* Show the prompt */
5138 if (command_wrk == USE_INVEN) max_line = max_inven;
5139 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5140 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5156 menu_line += (max_line - 1);
5172 /* Verify legality */
5173 if (command_wrk == (USE_INVEN))
5175 if (allow_floor) command_wrk = USE_FLOOR;
5176 else if (allow_equip) command_wrk = USE_EQUIP;
5183 else if (command_wrk == (USE_EQUIP))
5185 if (allow_inven) command_wrk = USE_INVEN;
5186 else if (allow_floor) command_wrk = USE_FLOOR;
5193 else if (command_wrk == (USE_FLOOR))
5195 if (allow_equip) command_wrk = USE_EQUIP;
5196 else if (allow_inven) command_wrk = USE_INVEN;
5209 /* Hack -- Fix screen */
5219 /* Switch inven/equip */
5220 if (command_wrk == USE_INVEN) max_line = max_inven;
5221 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5222 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5223 if (menu_line > max_line) menu_line = max_line;
5225 /* Need to redraw */
5233 /* Verify legality */
5234 if (command_wrk == (USE_INVEN))
5236 if (allow_equip) command_wrk = USE_EQUIP;
5237 else if (allow_floor) command_wrk = USE_FLOOR;
5244 else if (command_wrk == (USE_EQUIP))
5246 if (allow_floor) command_wrk = USE_FLOOR;
5247 else if (allow_inven) command_wrk = USE_INVEN;
5254 else if (command_wrk == (USE_FLOOR))
5256 if (allow_inven) command_wrk = USE_INVEN;
5257 else if (allow_equip) command_wrk = USE_EQUIP;
5270 /* Hack -- Fix screen */
5280 /* Switch inven/equip */
5281 if (command_wrk == USE_INVEN) max_line = max_inven;
5282 else if (command_wrk == USE_EQUIP) max_line = max_equip;
5283 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
5284 if (menu_line > max_line) menu_line = max_line;
5286 /* Need to redraw */
5295 if (command_wrk == USE_FLOOR)
5298 (*cp) = -get_item_label;
5302 /* Validate the item */
5303 if (!get_item_okay(get_item_label))
5309 /* Allow player to "refuse" certain actions */
5310 if (!get_item_allow(get_item_label))
5316 /* Accept that choice */
5317 (*cp) = get_item_label;
5326 if (select_the_force) {
5334 if (menu_line > max_line) menu_line -= max_line;
5355 command_see = FALSE;
5378 cave_type *c_ptr = &cave[py][px];
5380 if (command_wrk != (USE_FLOOR)) break;
5382 /* Get the object being moved. */
5383 o_idx = c_ptr->o_idx;
5385 /* Only rotate a pile of two or more objects. */
5386 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
5388 /* Remove the first object from the list. */
5389 excise_object_idx(o_idx);
5391 /* Find end of the list. */
5393 while (o_list[i].next_o_idx)
5394 i = o_list[i].next_o_idx;
5396 /* Add after the last object. */
5397 o_list[i].next_o_idx = o_idx;
5399 /* Re-scan floor list */
5400 floor_num = scan_floor(floor_list, py, px, 0x03);
5402 /* Hack -- Fix screen */
5417 if (command_wrk == (USE_INVEN))
5424 command_wrk = (USE_EQUIP);
5426 else if (command_wrk == (USE_EQUIP))
5433 command_wrk = (USE_INVEN);
5435 else if (command_wrk == (USE_FLOOR))
5439 command_wrk = (USE_INVEN);
5441 else if (allow_equip)
5443 command_wrk = (USE_EQUIP);
5452 /* Hack -- Fix screen */
5462 /* Need to redraw */
5475 * If we are already examining the floor, and there
5476 * is only one item, we will always select it.
5477 * If we aren't examining the floor and there is only
5478 * one item, we will select it if floor_query_flag
5483 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
5486 k = 0 - floor_list[0];
5488 /* Allow player to "refuse" certain actions */
5489 if (!get_item_allow(k))
5495 /* Accept that choice */
5504 /* Hack -- Fix screen */
5514 command_wrk = (USE_FLOOR);
5520 case '1': case '2': case '3':
5521 case '4': case '5': case '6':
5522 case '7': case '8': case '9':
5524 if (command_wrk != USE_FLOOR)
5526 /* Look up the tag */
5527 if (!get_tag(&k, which, command_wrk))
5533 /* Hack -- Validate the item */
5534 if ((k < INVEN_RARM) ? !inven : !equip)
5540 /* Validate the item */
5541 if (!get_item_okay(k))
5549 /* Look up the alphabetical tag */
5550 if (get_tag_floor(&k, which, floor_list, floor_num))
5553 k = 0 - floor_list[k];
5562 /* Allow player to "refuse" certain actions */
5563 if (!get_item_allow(k))
5569 /* Accept that choice */
5575 #endif /* ALLOW_REPEAT */
5583 /* Choose "default" inventory item */
5584 if (command_wrk == (USE_INVEN))
5586 k = ((i1 == i2) ? i1 : -1);
5589 /* Choose "default" equipment item */
5590 else if (command_wrk == (USE_EQUIP))
5592 k = ((e1 == e2) ? e1 : -1);
5595 /* Choose "default" floor item */
5596 else if (command_wrk == (USE_FLOOR))
5601 k = 0 - floor_list[0];
5603 /* Allow player to "refuse" certain actions */
5604 if (!get_item_allow(k))
5610 /* Accept that choice */
5618 /* Validate the item */
5619 if (!get_item_okay(k))
5625 /* Allow player to "refuse" certain actions */
5626 if (!get_item_allow(k))
5632 /* Accept that choice */
5642 if (select_the_force) {
5656 if (command_wrk != USE_FLOOR)
5658 bool not_found = FALSE;
5660 /* Look up the alphabetical tag */
5661 if (!get_tag(&k, which, command_wrk))
5666 /* Hack -- Validate the item */
5667 else if ((k < INVEN_RARM) ? !inven : !equip)
5672 /* Validate the item */
5673 else if (!get_item_okay(k))
5680 /* Accept that choice */
5686 #endif /* ALLOW_REPEAT */
5692 /* Look up the alphabetical tag */
5693 if (get_tag_floor(&k, which, floor_list, floor_num))
5696 k = 0 - floor_list[k];
5698 /* Accept that choice */
5704 #endif /* ALLOW_REPEAT */
5709 /* Extract "query" setting */
5710 ver = isupper(which);
5711 which = tolower(which);
5713 /* Convert letter to inventory index */
5714 if (command_wrk == (USE_INVEN))
5716 if (which == '(') k = i1;
5717 else if (which == ')') k = i2;
5718 else k = label_to_inven(which);
5721 /* Convert letter to equipment index */
5722 else if (command_wrk == (USE_EQUIP))
5724 if (which == '(') k = e1;
5725 else if (which == ')') k = e2;
5726 else k = label_to_equip(which);
5729 /* Convert letter to floor index */
5730 else if (command_wrk == USE_FLOOR)
5732 if (which == '(') k = 0;
5733 else if (which == ')') k = floor_num - 1;
5734 else k = islower(which) ? A2I(which) : -1;
5735 if (k < 0 || k >= floor_num || k >= 23)
5742 k = 0 - floor_list[k];
5745 /* Validate the item */
5746 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
5752 /* Verify the item */
5754 if (ver && !verify("ËÜÅö¤Ë", k))
5756 if (ver && !verify("Try", k))
5764 /* Allow player to "refuse" certain actions */
5765 if (!get_item_allow(k))
5771 /* Accept that choice */
5781 /* Fix the screen if necessary */
5787 /* Hack -- Cancel "display" */
5788 command_see = FALSE;
5792 /* Forget the item_tester_tval restriction */
5793 item_tester_tval = 0;
5795 /* Forget the item_tester_hook restriction */
5796 item_tester_hook = NULL;
5799 /* Clean up 'show choices' */
5800 /* Toggle again if needed */
5801 if (toggle) toggle_inven_equip();
5804 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5810 /* Clear the prompt line */
5813 /* Warning if needed */
5814 if (oops && str) msg_print(str);
5820 if (command_cmd) prev_tag = cur_tag;
5821 #endif /* ALLOW_REPEAT */
5823 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5831 * @brief ¾²¾å¤Î¥¢¥¤¥Æ¥à¤ò½¦¤¦ÁªÂòÍÑ¥µ¥Ö¥ë¡¼¥Á¥ó
5832 * @return ¥×¥ì¥¤¥ä¡¼¤Ë¤è¤ê¥¢¥¤¥Æ¥à¤¬ÁªÂò¤µ¤ì¤¿¤Ê¤éTRUE¤òÊÖ¤¹¡£
5834 static bool py_pickup_floor_aux(void)
5842 /* Restrict the choices */
5843 item_tester_hook = inven_carry_okay;
5847 q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
5848 s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
5850 q = "Get which item? ";
5851 s = "You no longer have any room for the objects on the floor.";
5854 if (get_item(&item, q, s, (USE_FLOOR)))
5856 this_o_idx = 0 - item;
5863 /* Pick up the object */
5864 py_pickup_aux(this_o_idx);
5870 * @brief ¾²¾å¤Î¥¢¥¤¥Æ¥à¤ò½¦¤¦¥á¥¤¥ó½èÍý
5871 * @param pick FALSE¤Ê¤é¶âÁ¬¤Î¼«Æ°½¦¤¤¤Î¤ß¤ò¹Ô¤¦/ FALSE then only gold will be picked up
5874 * This is called by py_pickup() when easy_floor is TRUE.
5876 void py_pickup_floor(bool pickup)
5878 s16b this_o_idx, next_o_idx = 0;
5880 char o_name[MAX_NLEN];
5883 int floor_num = 0, floor_o_idx = 0;
5887 /* Scan the pile of objects */
5888 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5892 /* Access the object */
5893 o_ptr = &o_list[this_o_idx];
5895 /* Describe the object */
5896 object_desc(o_name, o_ptr, 0);
5898 /* Access the next object */
5899 next_o_idx = o_ptr->next_o_idx;
5901 /* Hack -- disturb */
5905 if (o_ptr->tval == TV_GOLD)
5909 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
5910 (long)o_ptr->pval, o_name);
5912 msg_format("You have found %ld gold pieces worth of %s.",
5913 (long) o_ptr->pval, o_name);
5917 /* Collect the gold */
5918 p_ptr->au += o_ptr->pval;
5921 p_ptr->redraw |= (PR_GOLD);
5924 p_ptr->window |= (PW_PLAYER);
5926 /* Delete the gold */
5927 delete_object_idx(this_o_idx);
5929 /* Check the next object */
5932 else if (o_ptr->marked & OM_NOMSG)
5934 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
5935 * ignored. Otherwise, they are included in the prompt. */
5936 o_ptr->marked &= ~(OM_NOMSG);
5940 /* Count non-gold objects that can be picked up. */
5941 if (inven_carry_okay(o_ptr))
5946 /* Count non-gold objects */
5949 /* Remember this index */
5950 floor_o_idx = this_o_idx;
5953 /* There are no non-gold objects */
5957 /* Mention the number of objects */
5963 /* Access the object */
5964 o_ptr = &o_list[floor_o_idx];
5966 #ifdef ALLOW_EASY_SENSE
5968 /* Option: Make object sensing easy */
5971 /* Sense the object */
5972 (void) sense_object(o_ptr);
5975 #endif /* ALLOW_EASY_SENSE */
5977 /* Describe the object */
5978 object_desc(o_name, o_ptr, 0);
5982 msg_format("%s¤¬¤¢¤ë¡£", o_name);
5984 msg_format("You see %s.", o_name);
5989 /* Multiple objects */
5994 msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
5996 msg_format("You see a pile of %d items.", floor_num);
6005 /* The player has no room for anything on the floor. */
6011 /* Access the object */
6012 o_ptr = &o_list[floor_o_idx];
6014 #ifdef ALLOW_EASY_SENSE
6016 /* Option: Make object sensing easy */
6019 /* Sense the object */
6020 (void) sense_object(o_ptr);
6023 #endif /* ALLOW_EASY_SENSE */
6025 /* Describe the object */
6026 object_desc(o_name, o_ptr, 0);
6030 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6032 msg_format("You have no room for %s.", o_name);
6037 /* Multiple objects */
6042 msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6044 msg_print("You have no room for any of the objects on the floor.");
6056 /* Hack -- query every object */
6057 if (carry_query_flag)
6059 char out_val[MAX_NLEN+20];
6061 /* Access the object */
6062 o_ptr = &o_list[floor_o_idx];
6064 #ifdef ALLOW_EASY_SENSE
6066 /* Option: Make object sensing easy */
6069 /* Sense the object */
6070 (void) sense_object(o_ptr);
6073 #endif /* ALLOW_EASY_SENSE */
6075 /* Describe the object */
6076 object_desc(o_name, o_ptr, 0);
6078 /* Build a prompt */
6080 (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
6082 (void) sprintf(out_val, "Pick up %s? ", o_name);
6086 /* Ask the user to confirm */
6087 if (!get_check(out_val))
6094 /* Access the object */
6095 o_ptr = &o_list[floor_o_idx];
6097 #ifdef ALLOW_EASY_SENSE
6099 /* Option: Make object sensing easy */
6102 /* Sense the object */
6103 (void) sense_object(o_ptr);
6106 #endif /* ALLOW_EASY_SENSE */
6108 /* Pick up the object */
6109 py_pickup_aux(floor_o_idx);
6112 /* Allow the user to choose an object */
6115 while (can_pickup--)
6117 if (!py_pickup_floor_aux()) break;
6122 #endif /* ALLOW_EASY_FLOOR */