OSDN Git Service

固定アーティファクトの発動は全部外部フラグ化し終わった。
[hengband/hengband.git] / src / object1.c
1 /* File: object1.c */
2
3 /*
4  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
5  *
6  * This software may be copied and distributed for educational, research,
7  * and not for profit purposes provided that this copyright and statement
8  * are included in all such copies.  Other copyrights may also apply.
9  */
10
11 /* Purpose: Object code, part 1 */
12
13 #include "angband.h"
14
15 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
16 #ifdef verify
17 #undef verify
18 #endif
19 #endif
20 /*
21  * Reset the "visual" lists
22  *
23  * This involves resetting various things to their "default" state.
24  *
25  * If the "prefs" flag is TRUE, then we will also load the appropriate
26  * "user pref file" based on the current setting of the "use_graphics"
27  * flag.  This is useful for switching "graphics" on/off.
28  *
29  * The features, objects, and monsters, should all be encoded in the
30  * relevant "font.pref" and/or "graf.prf" files.  XXX XXX XXX
31  *
32  * The "prefs" parameter is no longer meaningful.  XXX XXX XXX
33  */
34 void reset_visuals(void)
35 {
36         int i, j;
37
38         /* Extract some info about terrain features */
39         for (i = 0; i < max_f_idx; i++)
40         {
41                 feature_type *f_ptr = &f_info[i];
42
43                 /* Assume we will use the underlying values */
44                 for (j = 0; j < F_LIT_MAX; j++)
45                 {
46                         f_ptr->x_attr[j] = f_ptr->d_attr[j];
47                         f_ptr->x_char[j] = f_ptr->d_char[j];
48                 }
49         }
50
51         /* Extract default attr/char code for objects */
52         for (i = 0; i < max_k_idx; i++)
53         {
54                 object_kind *k_ptr = &k_info[i];
55
56                 /* Default attr/char */
57                 k_ptr->x_attr = k_ptr->d_attr;
58                 k_ptr->x_char = k_ptr->d_char;
59         }
60
61         /* Extract default attr/char code for monsters */
62         for (i = 0; i < max_r_idx; i++)
63         {
64                 monster_race *r_ptr = &r_info[i];
65
66                 /* Default attr/char */
67                 r_ptr->x_attr = r_ptr->d_attr;
68                 r_ptr->x_char = r_ptr->d_char;
69         }
70
71         if (use_graphics)
72         {
73                 char buf[1024];
74
75                 /* Process "graf.prf" */
76                 process_pref_file("graf.prf");
77
78                 /* Access the "character" pref file */
79                 sprintf(buf, "graf-%s.prf", player_base);
80
81                 /* Process "graf-<playername>.prf" */
82                 process_pref_file(buf);
83         }
84
85         /* Normal symbols */
86         else
87         {
88                 char buf[1024];
89
90                 /* Process "font.prf" */
91                 process_pref_file("font.prf");
92
93                 /* Access the "character" pref file */
94                 sprintf(buf, "font-%s.prf", player_base);
95
96                 /* Process "font-<playername>.prf" */
97                 process_pref_file(buf);
98         }
99 }
100
101
102 /*
103  * Obtain the "flags" for an item
104  */
105 void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
106 {
107         object_kind *k_ptr = &k_info[o_ptr->k_idx];
108         int i;
109
110         /* Base object */
111         for (i = 0; i < TR_FLAG_SIZE; i++)
112                 flgs[i] = k_ptr->flags[i];
113
114         /* Artifact */
115         if (object_is_fixed_artifact(o_ptr))
116         {
117                 artifact_type *a_ptr = &a_info[o_ptr->name1];
118
119                 for (i = 0; i < TR_FLAG_SIZE; i++)
120                         flgs[i] = a_ptr->flags[i];
121         }
122
123         /* Ego-item */
124         if (object_is_ego(o_ptr))
125         {
126                 ego_item_type *e_ptr = &e_info[o_ptr->name2];
127
128                 for (i = 0; i < TR_FLAG_SIZE; i++)
129                         flgs[i] |= e_ptr->flags[i];
130
131                 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
132                 {
133                         remove_flag(flgs, TR_SH_FIRE);
134                 }
135                 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
136                 {
137                         remove_flag(flgs, TR_INFRA);
138                 }
139                 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
140                 {
141                         remove_flag(flgs, TR_RES_BLIND);
142                         remove_flag(flgs, TR_SEE_INVIS);
143                 }
144         }
145
146         /* Random artifact ! */
147         for (i = 0; i < TR_FLAG_SIZE; i++)
148                 flgs[i] |= o_ptr->art_flags[i];
149
150         if (object_is_smith(o_ptr))
151         {
152                 int add = o_ptr->xtra3 - 1;
153
154                 if (add < TR_FLAG_MAX)
155                 {
156                         add_flag(flgs, add);
157                 }
158                 else if (add == ESSENCE_TMP_RES_ACID)
159                 {
160                         add_flag(flgs, TR_RES_ACID);
161                         add_flag(flgs, TR_ACTIVATE);
162                 }
163                 else if (add == ESSENCE_TMP_RES_ELEC)
164                 {
165                         add_flag(flgs, TR_RES_ELEC);
166                         add_flag(flgs, TR_ACTIVATE);
167                 }
168                 else if (add == ESSENCE_TMP_RES_FIRE)
169                 {
170                         add_flag(flgs, TR_RES_FIRE);
171                         add_flag(flgs, TR_ACTIVATE);
172                 }
173                 else if (add == ESSENCE_TMP_RES_COLD)
174                 {
175                         add_flag(flgs, TR_RES_COLD);
176                         add_flag(flgs, TR_ACTIVATE);
177                 }
178                 else if (add == ESSENCE_SH_FIRE)
179                 {
180                         add_flag(flgs, TR_RES_FIRE);
181                         add_flag(flgs, TR_SH_FIRE);
182                 }
183                 else if (add == ESSENCE_SH_ELEC)
184                 {
185                         add_flag(flgs, TR_RES_ELEC);
186                         add_flag(flgs, TR_SH_ELEC);
187                 }
188                 else if (add == ESSENCE_SH_COLD)
189                 {
190                         add_flag(flgs, TR_RES_COLD);
191                         add_flag(flgs, TR_SH_COLD);
192                 }
193                 else if (add == ESSENCE_RESISTANCE)
194                 {
195                         add_flag(flgs, TR_RES_ACID);
196                         add_flag(flgs, TR_RES_ELEC);
197                         add_flag(flgs, TR_RES_FIRE);
198                         add_flag(flgs, TR_RES_COLD);
199                 }
200                 else if (add == TR_IMPACT)
201                 {
202                         add_flag(flgs, TR_ACTIVATE);
203                 }
204         }
205 }
206
207
208
209 /*
210  * Obtain the "flags" for an item which are known to the player
211  */
212 void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
213 {
214         bool spoil = FALSE;
215         int i;
216
217         object_kind *k_ptr = &k_info[o_ptr->k_idx];
218
219         /* Clear */
220         for (i = 0; i < TR_FLAG_SIZE; i++)
221                 flgs[i] = 0;
222
223         if (!object_is_aware(o_ptr)) return;
224
225         /* Base object */
226         for (i = 0; i < TR_FLAG_SIZE; i++)
227                 flgs[i] = k_ptr->flags[i];
228
229         /* Must be identified */
230         if (!object_is_known(o_ptr)) return;
231
232         /* Ego-item (known basic flags) */
233         if (object_is_ego(o_ptr))
234         {
235                 ego_item_type *e_ptr = &e_info[o_ptr->name2];
236
237                 for (i = 0; i < TR_FLAG_SIZE; i++)
238                         flgs[i] |= e_ptr->flags[i];
239
240                 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
241                 {
242                         remove_flag(flgs, TR_SH_FIRE);
243                 }
244                 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
245                 {
246                         remove_flag(flgs, TR_INFRA);
247                 }
248                 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
249                 {
250                         remove_flag(flgs, TR_RES_BLIND);
251                         remove_flag(flgs, TR_SEE_INVIS);
252                 }
253         }
254
255
256 #ifdef SPOIL_ARTIFACTS
257         /* Full knowledge for some artifacts */
258         if (object_is_artifact(o_ptr)) spoil = TRUE;
259 #endif /* SPOIL_ARTIFACTS */
260
261 #ifdef SPOIL_EGO_ITEMS
262         /* Full knowledge for some ego-items */
263         if (object_is_ego(o_ptr)) spoil = TRUE;
264 #endif /* SPOIL_EGO_ITEMS */
265
266         /* Need full knowledge or spoilers */
267         if (spoil || (o_ptr->ident & IDENT_MENTAL))
268         {
269                 /* Artifact */
270                 if (object_is_fixed_artifact(o_ptr))
271                 {
272                         artifact_type *a_ptr = &a_info[o_ptr->name1];
273
274                         for (i = 0; i < TR_FLAG_SIZE; i++)
275                                 flgs[i] = a_ptr->flags[i];
276                 }
277
278                 /* Random artifact ! */
279                 for (i = 0; i < TR_FLAG_SIZE; i++)
280                         flgs[i] |= o_ptr->art_flags[i];
281         }
282
283         if (object_is_smith(o_ptr))
284         {
285                 int add = o_ptr->xtra3 - 1;
286
287                 if (add < TR_FLAG_MAX)
288                 {
289                         add_flag(flgs, add);
290                 }
291                 else if (add == ESSENCE_TMP_RES_ACID)
292                 {
293                         add_flag(flgs, TR_RES_ACID);
294                 }
295                 else if (add == ESSENCE_TMP_RES_ELEC)
296                 {
297                         add_flag(flgs, TR_RES_ELEC);
298                 }
299                 else if (add == ESSENCE_TMP_RES_FIRE)
300                 {
301                         add_flag(flgs, TR_RES_FIRE);
302                 }
303                 else if (add == ESSENCE_TMP_RES_COLD)
304                 {
305                         add_flag(flgs, TR_RES_COLD);
306                 }
307                 else if (add == ESSENCE_SH_FIRE)
308                 {
309                         add_flag(flgs, TR_RES_FIRE);
310                         add_flag(flgs, TR_SH_FIRE);
311                 }
312                 else if (add == ESSENCE_SH_ELEC)
313                 {
314                         add_flag(flgs, TR_RES_ELEC);
315                         add_flag(flgs, TR_SH_ELEC);
316                 }
317                 else if (add == ESSENCE_SH_COLD)
318                 {
319                         add_flag(flgs, TR_RES_COLD);
320                         add_flag(flgs, TR_SH_COLD);
321                 }
322                 else if (add == ESSENCE_RESISTANCE)
323                 {
324                         add_flag(flgs, TR_RES_ACID);
325                         add_flag(flgs, TR_RES_ELEC);
326                         add_flag(flgs, TR_RES_FIRE);
327                         add_flag(flgs, TR_RES_COLD);
328                 }
329         }
330 }
331
332
333 /*
334  * Determine the "Activation" (if any) for an artifact
335  * Return a string, or NULL for "no activation"
336  */
337 cptr item_activation(object_type *o_ptr)
338 {
339         u32b flgs[TR_FLAG_SIZE];
340
341         /* Extract the flags */
342         object_flags(o_ptr, flgs);
343
344         /* Require activation ability */
345 #ifdef JP
346         if (!(have_flag(flgs, TR_ACTIVATE))) return ("¤Ê¤·");
347 #else
348         if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
349 #endif
350
351         /*
352          * We need to deduce somehow that it is a random artifact -- one
353          * problem: It could be a random artifact which has NOT YET received
354          * a name. Thus we eliminate other possibilities instead of checking
355          * for art_name
356          */
357
358         if (object_is_fixed_artifact(o_ptr))
359         {
360                 if (!o_ptr->xtra2) o_ptr->xtra2 = a_info[o_ptr->name1].act_idx;
361         }
362
363         if ((object_is_artifact(o_ptr) || object_is_ego(o_ptr)) &&
364                 (o_ptr->xtra2))
365         {
366                 switch (o_ptr->xtra2)
367                 {
368 #ifdef JP
369                         /* General activation */
370
371                         case ACT_SUNLIGHT:
372                                 return "ÂÀÍÛ¸÷Àþ : 10 ¥¿¡¼¥óËè";
373                         case ACT_BO_MISS_1:
374                                 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
375                         case ACT_BA_POIS_1:
376                                 return "°­½­±À (12) : 4+d4 ¥¿¡¼¥óËè";
377                         case ACT_BO_ELEC_1:
378                                 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
379                         case ACT_BO_ACID_1:
380                                 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
381                         case ACT_BO_COLD_1:
382                                 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
383                         case ACT_BO_FIRE_1:
384                                 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
385                         case ACT_BA_COLD_1:
386                                 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (48) : 6+d6 ¥¿¡¼¥óËè";
387                         case ACT_BA_FIRE_1:
388                                 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (72) : 9+d9 ¥¿¡¼¥óËè";
389                         case ACT_DRAIN_1:
390                                 return "Ã⩹¶·â(100) : 100+d100 ¥¿¡¼¥óËè";
391                         case ACT_BA_COLD_2:
392                                 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) : 12+d12 ¥¿¡¼¥óËè";
393                         case ACT_BA_ELEC_2:
394                                 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 12+d12 ¥¿¡¼¥óËè";
395                         case ACT_DRAIN_2:
396                                 return "À¸Ì¿Îϵۼý(120) : 400 ¥¿¡¼¥óËè";
397                         case ACT_VAMPIRE_1:
398                                 return "µÛ·ì¥É¥ì¥¤¥ó (3*50) : 400 ¥¿¡¼¥óËè";
399                         case ACT_BO_MISS_2:
400                                 return "Ìð (150) : 90+d90 ¥¿¡¼¥óËè";
401                         case ACT_BA_FIRE_3:
402                                 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (300) : 225+d225 ¥¿¡¼¥óËè";
403                         case ACT_BA_COLD_3:
404                                 return "µðÂ祢¥¤¥¹¡¦¥Ü¡¼¥ë (400) : 325+d325 ¥¿¡¼¥óËè";
405                         case ACT_BA_ELEC_3:
406                                 return "µðÂ祵¥ó¥À¡¼¡¦¥Ü¡¼¥ë (500) : 425+d425 ¥¿¡¼¥óËè";
407                         case ACT_WHIRLWIND:
408                                 return "¥«¥Þ¥¤¥¿¥Á : 250 ¥¿¡¼¥óËè";
409                         case ACT_VAMPIRE_2:
410                                 return "µÛ·ì¥É¥ì¥¤¥ó (3*100) : 400 ¥¿¡¼¥óËè";
411                         case ACT_CALL_CHAOS:
412                                 return "º®ÆÙ¾¤Íè : 350 ¥¿¡¼¥óËè"; /*nuke me*/
413                         case ACT_ROCKET:
414                                 return "¥í¥±¥Ã¥È (120+level) : 400 ¥¿¡¼¥óËè";
415                         case ACT_DISP_EVIL:
416                                 return "¼Ù°­Â໶ (x5) : 100+d100 ¥¿¡¼¥óËè";
417                         case ACT_BA_MISS_3:
418                                 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹ (300) : 500 ¥¿¡¼¥óËè";
419                         case ACT_DISP_GOOD:
420                                 return "Á±ÎÉÂ໶ (x5) : 100+d100 ¥¿¡¼¥óËè";
421                         case ACT_BO_MANA:
422                                 return "ËâË¡¤ÎÌð(150) : 90+d90 ¥¿¡¼¥óËè";
423                         case ACT_BA_FIRE_2:
424                                 return "µðÂç¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë(120) : 15 ¥¿¡¼¥óËè";
425                         case ACT_BA_WATER:
426                                 return "¥¦¥©¡¼¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 250 ¥¿¡¼¥óËè";
427                         case ACT_BA_STAR:
428                                 return "µðÂ祹¥¿¡¼¡¦¥Ü¡¼¥ë(200) : 200+d200 ¥¿¡¼¥óËè";
429                         case ACT_BA_DARK:
430                                 return "°Å¹õ¤ÎÍò(250) : 150+d150 ¥¿¡¼¥óËè";
431                         case ACT_BA_MANA:
432                                 return "ËâÎϤÎÍò(400) : 250+d250¥¿¡¼¥óËè";
433                         case ACT_PESTICIDE:
434                                 return "³²Ãî¤Î¶î½ü : 55+d55¥¿¡¼¥óËè";
435                         case ACT_BLINDING_LIGHT:
436                                 return "âÁ¤·¤¤¸÷ : 250 ¥¿¡¼¥óËè";
437                         case ACT_BIZARRE:
438                                 return "¿®¤¸Æñ¤¤¤³¤È : 450+d450 ¥¿¡¼¥óËè";
439                         case ACT_CAST_BA_STAR:
440                                 return "¥¹¥¿¡¼¡¦¥Ü¡¼¥ë¡¦¥À¥¹¥È(150) : 1000 ¥¿¡¼¥óËè";
441                         case ACT_BLADETURNER:
442                                 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹ (300), »Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢ÂÑÀ­";
443                         case ACT_CONFUSE:
444                                 return "¥Ñ¥Ë¥Ã¥¯¡¦¥â¥ó¥¹¥¿¡¼ : 15 ¥¿¡¼¥óËè";
445                         case ACT_SLEEP:
446                                 return "¼þ°Ï¤Î¥â¥ó¥¹¥¿¡¼¤ò̲¤é¤»¤ë : 55 ¥¿¡¼¥óËè";
447                         case ACT_QUAKE:
448                                 return "ÃÏ¿Ì (Ⱦ·Â 10) : 50 ¥¿¡¼¥óËè";
449                         case ACT_TERROR:
450                                 return "¶²¹² : 3 * (level+10) ¥¿¡¼¥óËè";
451                         case ACT_TELE_AWAY:
452                                 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
453                         case ACT_BANISH_EVIL:
454                                 return "¼Ù°­¾ÃÌÇ : 250+d250 ¥¿¡¼¥óËè";
455                         case ACT_GENOCIDE:
456                                 return "Ëõ»¦ : 500 ¥¿¡¼¥óËè";
457                         case ACT_MASS_GENO:
458                                 return "¼þÊÕËõ»¦ : 1000 ¥¿¡¼¥óËè";
459                         case ACT_SCARE_AREA:
460                                 return "¥â¥ó¥¹¥¿¡¼¶²¹² : 40+d40¥¿¡¼¥óËè";
461                         case ACT_AGGRAVATE:
462                                 if (o_ptr->name1 == ART_HYOUSIGI) return "Çï»ÒÌÚ¤òÂǤÁ¤Ê¤é¤¹ : ¤¤¤Ä¤Ç¤â";
463                                 return "¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë : ¤¤¤Ä¤Ç¤â";
464                         case ACT_CHARM_ANIMAL:
465                                 return "ưʪ̥λ : 200 ¥¿¡¼¥óËè";
466                         case ACT_CHARM_UNDEAD:
467                                 return "¥¢¥ó¥Ç¥Ã¥É½¾Â° : 333 ¥¿¡¼¥óËè";
468                         case ACT_CHARM_OTHER:
469                                 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 400 ¥¿¡¼¥óËè";
470                         case ACT_CHARM_ANIMALS:
471                                 return "ưʪͧÏ : 500 ¥¿¡¼¥óËè";
472                         case ACT_CHARM_OTHERS:
473                                 return "¼þÊÕ̥λ : 750 ¥¿¡¼¥óËè";
474                         case ACT_SUMMON_ANIMAL:
475                                 return "ưʪ¾¤´­ : 200+d300 ¥¿¡¼¥óËè";
476                         case ACT_SUMMON_PHANTOM:
477                                 return "¸¸Î´­ : 200+d200 ¥¿¡¼¥óËè";
478                         case ACT_SUMMON_ELEMENTAL:
479                                 return "¥¨¥ì¥á¥ó¥¿¥ë¾¤´­ : 750 ¥¿¡¼¥óËè";
480                         case ACT_SUMMON_DEMON:
481                                 return "°­Ë⾤´­ : 666+d333 ¥¿¡¼¥óËè";
482                         case ACT_SUMMON_UNDEAD:
483                                 return "¥¢¥ó¥Ç¥Ã¥É¾¤´­ : 666+d333 ¥¿¡¼¥óËè";
484                         case ACT_SUMMON_HOUND:
485                                 return "¥Ï¥¦¥ó¥É¾¤´­ : 300+d150 ¥¿¡¼¥óËè";
486                         case ACT_SUMMON_DAWN:
487                                 return "¶Ç¤Î»ÕÃľ¤´­ : 500+d500 ¥¿¡¼¥óËè";
488                         case ACT_SUMMON_OCTOPUS:
489                                 return "Âý¤ÎÂç·²¾¤´­ : 300+d150¥¿¡¼¥óËè";
490
491                         case ACT_CHOIR_SINGS:
492                                 return "²óÉü (777)¡¢Ìþ¤·¡¢»Îµ¤¹âÍÈ : 300 ¥¿¡¼¥óËè";
493                         case ACT_CURE_LW:
494                                 return "¶²Éݽüµî/ÂÎÎϲóÉü(30) : 10 ¥¿¡¼¥óËè";
495                         case ACT_CURE_MW:
496                                 return "½ý²óÉü(4d8) : 3+d3 ¥¿¡¼¥óËè";
497                         case ACT_CURE_POISON:
498                                 return "¶²Éݽüµî/ÆǾä· : 5 ¥¿¡¼¥óËè";
499                         case ACT_REST_LIFE:
500                                 return "·Ð¸³ÃÍÉü³è : 450 ¥¿¡¼¥óËè";
501                         case ACT_REST_ALL:
502                                 return "Á´¥¹¥Æ¡¼¥¿¥¹¤È·Ð¸³ÃÍÉü³è : 750 ¥¿¡¼¥óËè";
503                         case ACT_CURE_700:
504                                 return "ÂÎÎϲóÉü(700) : 250 ¥¿¡¼¥óËè";
505                         case ACT_CURE_1000:
506                                 return "ÂÎÎϲóÉü(1000) : 888 ¥¿¡¼¥óËè";
507                         case ACT_CURING:
508                                 return "Ìþ¤· : 100¥¿¡¼¥óËè";
509                         case ACT_CURE_MANA_FULL:
510                                 return "ËâÎÏÉü³è: 777 ¥¿¡¼¥óËè";
511                         case ACT_ESP:
512                                 return "¥Æ¥ì¥Ñ¥·¡¼ (´ü´Ö 25+d30) : 200 ¥¿¡¼¥óËè";
513                         case ACT_BERSERK:
514                                 return "»Îµ¤¹âÍȤȽËÊ¡ (´ü´Ö 50+d50) : 100+d100 ¥¿¡¼¥óËè";
515                         case ACT_PROT_EVIL:
516                                 return "Âмٰ­·ë³¦ (´ü´Ö level*3 + d25) : 200+d200 ¥¿¡¼¥óËè";
517                         case ACT_RESIST_ALL:
518                                 return "Á´ÂÑÀ­ (´ü´Ö 20+d20) : 111 ¥¿¡¼¥óËè";
519                         case ACT_SPEED:
520                                 return "²Ã® (´ü´Ö 20+d20) : 250 ¥¿¡¼¥óËè";
521                         case ACT_XTRA_SPEED:
522                                 return "²Ã® (´ü´Ö 75+d75) : 200+d200 ¥¿¡¼¥óËè";
523                         case ACT_WRAITH:
524                                 return "Í©Âβ½ (´ü´Ö level/2 + d(level/2)) : 1000 ¥¿¡¼¥óËè";
525                         case ACT_INVULN:
526                                 return "̵Ũ²½ (´ü´Ö 8+d8) : 1000 ¥¿¡¼¥óËè";
527                         case ACT_HELO:
528                                 return "»Îµ¤¹âÍÈ : 30+d30¥¿¡¼¥óËè";
529                         case ACT_HELO_SPEED:
530                                 return "»Îµ¤¹âÍÈ, ¥¹¥Ô¡¼¥É(50+d50¥¿¡¼¥ó) : 100+d200 ¥¿¡¼¥óËè";
531                         case ACT_LIGHT:
532                                 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
533                         case ACT_MAP_LIGHT:
534                                 return "ËâË¡¤ÎÃϿޤȸ÷ : 50+d50 ¥¿¡¼¥óËè";
535                         case ACT_DETECT_ALL:
536                                 return "Á´´¶ÃΠ: 55+d55 ¥¿¡¼¥óËè";
537                         case ACT_DETECT_XTRA:
538                                 return "Á´´¶ÃΡ¢Ãµº÷¡¢*´ÕÄê* : 100 ¥¿¡¼¥óËè";
539                         case ACT_ID_FULL:
540                                 return "*´ÕÄê* : 75 ¥¿¡¼¥óËè";
541                         case ACT_ID_PLAIN:
542                                 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
543                         case ACT_RUNE_EXPLO:
544                                 return "Çúȯ¤Î¥ë¡¼¥ó : 200 ¥¿¡¼¥óËè";
545                         case ACT_RUNE_PROT:
546                                 return "¼é¤ê¤Î¥ë¡¼¥ó : 400 ¥¿¡¼¥óËè";
547                         case ACT_SATIATE:
548                                 return "¶õÊ¢½¼Â­ : 200 ¥¿¡¼¥óËè";
549                         case ACT_DEST_DOOR:
550                                 return "¥É¥¢Ç˲õ : 10 ¥¿¡¼¥óËè";
551                         case ACT_STONE_MUD:
552                                 return "´äÀÐÍϲò : 3 ¥¿¡¼¥óËè";
553                         case ACT_RECHARGE:
554                                 return "ËâÎϽ¼Å¶ : 70 ¥¿¡¼¥óËè";
555                         case ACT_ALCHEMY:
556                                 return "Ï£¶â½Ñ : 500 ¥¿¡¼¥óËè";
557                         case ACT_DIM_DOOR:
558                                 return "¼¡¸µ¤ÎÈâ : 100 ¥¿¡¼¥óËè";
559                         case ACT_TELEPORT:
560                                 return "¥Æ¥ì¥Ý¡¼¥È (range 100) : 25 ¥¿¡¼¥óËè";
561                         case ACT_RECALL:
562                                 return "µ¢´Ô¤Î¾Û : 200 ¥¿¡¼¥óËè";
563                         case ACT_JUDGE:
564                                 return "ÂÎÎϤȰú¤­Âؤ¨¤ËÀéΤ´ã¤Èµ¢´Ô : 20+d20 ¥¿¡¼¥óËè";
565                         case ACT_TELEKINESIS:
566                                 return "ʪÂΤò°ú¤­´ó¤»¤ë(½ÅÎÌ25kg¤Þ¤Ç) : 25+d25¥¿¡¼¥óËè";
567                         case ACT_DETECT_UNIQUE:
568                                 return "¤³¤Î³¬¤Ë¤¤¤ë¥æ¥Ë¡¼¥¯¥â¥ó¥¹¥¿¡¼¤òɽ¼¨ : 200¥¿¡¼¥óËè";
569                         case ACT_ESCAPE:
570                                 return "ƨÁö : 35 ¥¿¡¼¥óËè";
571                         case ACT_DISP_CURSE_XTRA:
572                                 return "*²ò¼ö*¤ÈÄ´ºº: ¤¤¤Ä¤Ç¤â";
573                         case ACT_BRAND_FIRE_BOLTS:
574                                 return "¿ÏÀè¤Î¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È : 999 ¥¿¡¼¥óËè";
575                         case ACT_RECHARGE_XTRA:
576                                 return "ËâÎϽ¼Å¶ : 200 ¥¿¡¼¥óËè";
577                         case ACT_LORE:
578                                 return "´í¸±¤òȼ¤¦´ÕÄê : ¤¤¤Ä¤Ç¤â";
579                         case ACT_SHIKOFUMI:
580                                 return "»Í¸ÔƧ¤ß : 100+d100¥¿¡¼¥óËè";
581
582                         /* Unique activation */
583                         case ACT_FISHING:
584                                 return "Äà¤ê¤ò¤¹¤ë : ¤¤¤Ä¤Ç¤â";
585                         case ACT_INROU:
586                                 return "Îã¤Î¥¢¥ì : 150+d150 ¥¿¡¼¥óËè";
587                         case ACT_MURAMASA:
588                                 return "ÏÓÎϤξ徺 : ³ÎΨ50%¤Ç²õ¤ì¤ë";
589                         case ACT_BLOODY_MOON:
590                                 return "°À­Êѹ¹ : 3333 ¥¿¡¼¥óËè";
591                         case ACT_CRIMSON:
592                                 return "¥Õ¥¡¥¤¥¢¡ª : 15 ¥¿¡¼¥óËè";
593
594                         default:
595                                 return "̤ÄêµÁ";
596 #else
597                         /* General activation */
598
599                         case ACT_SUNLIGHT:
600                                 return "beam of sunlight every 10 turns";
601                         case ACT_BO_MISS_1:
602                                 return "magic missile (2d6) every 2 turns";
603                         case ACT_BA_POIS_1:
604                                 return "stinking cloud (12) every 4+d4 turns";
605                         case ACT_BO_ELEC_1:
606                                 return "lightning bolt (4d8) every 5+d5 turns";
607                         case ACT_BO_ACID_1:
608                                 return "acid bolt (5d8) every 6+d6 turns";
609                         case ACT_BO_COLD_1:
610                                 return "frost bolt (6d8) every 7+d7 turns";
611                         case ACT_BO_FIRE_1:
612                                 return "fire bolt (9d8) every 8+d8 turns";
613                         case ACT_BA_COLD_1:
614                                 return "ball of cold (48) every 6+d6 turns";
615                         case ACT_BA_FIRE_1:
616                                 return "ball of fire (72) every 9+d9 turns";
617                         case ACT_DRAIN_1:
618                                 return "a strangling attack (100) every 100+d100 turns";
619                         case ACT_BA_COLD_2:
620                                 return "ball of cold (100) every 12+d12 turns";
621                         case ACT_BA_ELEC_2:
622                                 return "ball of lightning (100) every 12+d12 turns";
623                         case ACT_DRAIN_2:
624                                 return "drain life (120) every 400 turns";
625                         case ACT_VAMPIRE_1:
626                                 return "vampiric drain (3*50) every 400 turns";
627                         case ACT_BO_MISS_2:
628                                 return "arrows (150) every 90+d90 turns";
629                         case ACT_BA_FIRE_2:
630                                 return "fire ball (300) every 225+d225 turns";
631                         case ACT_BA_COLD_3:
632                                 return "ball of cold (400) every 325+d325 turns";
633                         case ACT_BA_ELEC_3:
634                                 return "ball of lightning (500) every 425+d425 turns";
635                         case ACT_WHIRLWIND:
636                                 return "whirlwind attack every 250 turns";
637                         case ACT_VAMPIRE_2:
638                                 return "vampiric drain (3*100) every 400 turns";
639                         case ACT_CALL_CHAOS:
640                                 return "call chaos every 350 turns";
641                         case ACT_ROCKET:
642                                 return "launch rocket (120+level) every 400 turns";
643                         case ACT_DISP_EVIL:
644                                 return "dispel evil (x5) every 100+d100 turns";
645                         case ACT_BA_MISS_3:
646                                 return "elemental breath (300) every 500 turns";
647                         case ACT_DISP_GOOD:
648                                 return "dispel good (x5) every 100+d100 turns";
649                         case ACT_BO_MANA:
650                                 return "a magical arrow (150) every 90+d90 turns";
651                         case ACT_BA_FIRE_2:
652                                 return "large fire ball (120) every 15 turns";
653                         case ACT_BA_WATER:
654                                 return "water ball (200) every 250 turns";
655                         case ACT_BA_STAR:
656                                 return "large star ball (200) every 200+d200 turns";
657                         case ACT_BA_DARK:
658                                 return "darkness storm (250) every 150+d150 turns";
659                         case ACT_BA_MANA:
660                                 return "a mana storm every 250+d250 turns";
661                         case ACT_PESTICIDE:
662                                 return "dispel small life every 55+d55 turns";
663                         case ACT_BLINDING_LIGHT:
664                                 return "blinding light every 250 turns";
665                         case ACT_BIZARRE:
666                                 return "bizarre things every 450+d450 turns";
667                         case ACT_CAST_BA_STAR:
668                                 return "cast star balls (150) every 1000 turns";
669                         case ACT_BLADETURNER:
670                                 return "breathe elements (300), hero, bless, and resistance";
671
672                         case ACT_CONFUSE:
673                                 return "confuse monster every 15 turns";
674                         case ACT_SLEEP:
675                                 return "sleep nearby monsters every 55 turns";
676                         case ACT_QUAKE:
677                                 return "earthquake (rad 10) every 50 turns";
678                         case ACT_TERROR:
679                                 return "terror every 3 * (level+10) turns";
680                         case ACT_TELE_AWAY:
681                                 return "teleport away every 200 turns";
682                         case ACT_BANISH_EVIL:
683                                 return "banish evil every 250+d250 turns";
684                         case ACT_GENOCIDE:
685                                 return "genocide every 500 turns";
686                         case ACT_MASS_GENO:
687                                 return "mass genocide every 1000 turns";
688                         case ACT_SCARE_AREA:
689                                 return "frighten monsters every 40+d40 turns";
690                         case ACT_AGGRAVATE:
691                                 if (o_ptr->name1 == ART_HYOUSIGI) return "beat wooden clappers every turn";
692                                 return "aggravete monsters every turn";
693
694                         case ACT_CHARM_ANIMAL:
695                                 return "charm animal every 200 turns";
696                         case ACT_CHARM_UNDEAD:
697                                 return "enslave undead every 333 turns";
698                         case ACT_CHARM_OTHER:
699                                 return "charm monster every 400 turns";
700                         case ACT_CHARM_ANIMALS:
701                                 return "animal friendship every 500 turns";
702                         case ACT_CHARM_OTHERS:
703                                 return "mass charm every 750 turns";
704                         case ACT_SUMMON_ANIMAL:
705                                 return "summon animal every 200+d300 turns";
706                         case ACT_SUMMON_PHANTOM:
707                                 return "summon phantasmal servant every 200+d200 turns";
708                         case ACT_SUMMON_ELEMENTAL:
709                                 return "summon elemental every 750 turns";
710                         case ACT_SUMMON_DEMON:
711                                 return "summon demon every 666+d333 turns";
712                         case ACT_SUMMON_UNDEAD:
713                                 return "summon undead every 666+d333 turns";
714                         case ACT_SUMMON_HOUND:
715                                 return "summon hound every 300+d150 turns";
716                         case ACT_SUMMON_DAWN:
717                                 return "summon the Legion of the Dawn every 500+d500 turns";
718                         case ACT_SUMMON_OCTOPUS:
719                                 return "summon octopus every 300+d150 turns";
720
721                         case ACT_CHOIR_SINGS:
722                                 return "heal 777 hit points, curing and heloism every 300 turns";
723                         case ACT_CURE_LW:
724                                 return "remove fear and heal 30 hp every 10 turns";
725                         case ACT_CURE_MW:
726                                 return "heal 4d8 and wounds every 3+d3 turns";
727                         case ACT_CURE_POISON:
728                                 return "remove fear and cure poison every 5 turns";
729                         case ACT_REST_LIFE:
730                                 return "restore life levels every 450 turns";
731                         case ACT_REST_ALL:
732                                 return "restore stats and life levels every 750 turns";
733                         case ACT_CURE_700:
734                                 return "heal 700 hit points every 250 turns";
735                         case ACT_CURE_1000:
736                                 return "heal 1000 hit points every 888 turns";
737                         case ACT_CURING:
738                                 return "curing every 100 turns";
739                         case ACT_CURE_MANA_FULL:
740                                 return "restore mana every 777 turns";
741                         case ACT_ESP:
742                                 return "telepathy (dur 25+d30) every 200 turns";
743                         case ACT_BERSERK:
744                                 return "heroism and blessed (dur 50+d50) every 100+d100 turns";
745                         case ACT_PROT_EVIL:
746                                 return "protect evil (dur level*3 + d25) every 200+d200 turns";
747                         case ACT_RESIST_ALL:
748                                 return "resist elements (dur 20+d20) every 111 turns";
749                         case ACT_SPEED:
750                                 return "speed (dur 20+d20) every 100+d100 turns";
751                         case ACT_XTRA_SPEED:
752                                 return "speed (dur 75+d75) every 100+d100 turns";
753                         case ACT_WRAITH:
754                                 return "wraith form (dur level/2 + d(level/2)) every 1000 turns";
755                         case ACT_INVULN:
756                                 return "invulnerability (dur 8+d8) every 1000 turns";
757                         case ACT_HELO:
758                                 return "heroism every 30+d30 turns";
759                         case ACT_HELO_SPEED:
760                                 return "hero and +10 to speed (50) every 100+200d turns";
761                         case ACT_RESIST_ACID:
762                                 return "resist acid (dur 20+d20) every 40+d40 turns";
763                         case ACT_RESIST_FIRE:
764                                 return "resist fire (dur 20+d20) every 40+d40 turns";
765                         case ACT_RESIST_COLD:
766                                 return "resist cold (dur 20+d20) every 40+d40 turns";
767                         case ACT_RESIST_ELEC:
768                                 return "resist thunder (dur 20+d20) every 40+d40 turns";
769                         case ACT_RESIST_POIS:
770                                 return "resist poison (dur 20+d20) every 40+d40 turns";
771                         case ACT_LIGHT:
772                                 return "light area (dam 2d15) every 10+d10 turns";
773                         case ACT_MAP_LIGHT:
774                                 return "light (dam 2d15) & map area every 50+d50 turns";
775                         case ACT_DETECT_ALL:
776                                 return "detection every 55+d55 turns";
777                         case ACT_DETECT_XTRA:
778                                 return "detection, probing and identify true every 100 turns";
779                         case ACT_ID_FULL:
780                                 return "identify true every 75 turns";
781                         case ACT_ID_PLAIN:
782                                 return "identify spell every 10 turns";
783                         case ACT_RUNE_EXPLO:
784                                 return "explosive rune every 200 turns";
785                         case ACT_RUNE_PROT:
786                                 return "rune of protection every 400 turns";
787                         case ACT_SATIATE:
788                                 return "satisfy hunger every 200 turns";
789                         case ACT_DEST_DOOR:
790                                 return "destroy doors every 10 turns";
791                         case ACT_STONE_MUD:
792                                 return "stone to mud every 3 turns";
793                         case ACT_RECHARGE:
794                                 return "recharging every 70 turns";
795                         case ACT_ALCHEMY:
796                                 return "alchemy every 500 turns";
797                         case ACT_DIM_DOOR:
798                                 return "dimension door every 100 turns";
799                         case ACT_TELEPORT:
800                                 return "teleport (range 100) every 25 turns";
801                         case ACT_RECALL:
802                                 return "word of recall every 200 turns";
803                         case ACT_TELEKINESIS:
804                                 return "a telekinesis (500 lb) every 25+d25 turns";
805                         case ACT_JUDGE:
806                                 return "clairvoyance and recall, draining you every 20+d20 turns";
807                         case ACT_DETECT_UNIQUE:
808                                 return "list of the uniques on the level every 200 turns";
809                         case ACT_ESCAPE:
810                                 return "a getaway every 35 turns";
811                         case ACT_DISP_CURSE_XTRA:
812                                 return "dispel curse and probing every turn";
813                         case ACT_BRAND_FIRE_BOLTS:
814                                 return "fire branding of bolts every 999 turns";
815                         case ACT_RECHARGE_XTRA:
816                                 return "recharge item every 200 turns";
817                         case ACT_LORE:
818                                 return "perilous identify every turn";
819                         case ACT_SHIKOFUMI:
820                                 return "shiko every 100+d100 turns";
821
822                         /* Unique activation */
823                         case ACT_FISHING:
824                                 return "fishing : every time";
825                         case ACT_INROU:
826                                 return "reveal your identity every 150+d150 turns";
827                         case ACT_MURAMASA:
828                                 return "increase STR (destroyed 50%)";
829                         case ACT_BLOODY_MOON:
830                                 return "change zokusei every 3333 turns";
831                         case ACT_CRIMSON:
832                                 return "fire! every 15 turns";
833
834                         default:
835                                 return "something undefined";
836 #endif
837                 }
838         }
839
840         /* Some artifacts can be activated */
841         switch (o_ptr->name1)
842         {
843                 /* Nothing */
844         default:
845 #ifdef JP
846                 return "̤ÄêµÁ";
847 #else
848                 return "something undefined";
849 #endif
850         }
851
852         if (object_is_smith(o_ptr))
853         {
854                 switch (o_ptr->xtra3 - 1)
855                 {
856                 case ESSENCE_TMP_RES_ACID:
857 #ifdef JP
858                         return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
859 #else
860                         return "resist acid every 50+d50 turns";
861 #endif
862
863                 case ESSENCE_TMP_RES_ELEC:
864 #ifdef JP
865                         return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
866 #else
867                         return "resist elec every 50+d50 turns";
868 #endif
869
870                 case ESSENCE_TMP_RES_FIRE:
871 #ifdef JP
872                         return "²Ð¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
873 #else
874                         return "resist fire every 50+d50 turns";
875 #endif
876
877                 case ESSENCE_TMP_RES_COLD:
878 #ifdef JP
879                         return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
880 #else
881                         return "resist cold every 50+d50 turns";
882 #endif
883
884                 case TR_IMPACT:
885 #ifdef JP
886                         return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
887 #else
888                         return "earthquake every 100+d100 turns";
889 #endif
890                 }
891         }
892
893         if (o_ptr->name2 == EGO_TRUMP)
894         {
895 #ifdef JP
896 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
897 #else
898                 return "teleport every 50+d50 turns";
899 #endif
900
901         }
902
903         if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
904         {
905 #ifdef JP
906 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
907 #else
908                         return "illumination every 10+d10 turns";
909 #endif
910         }
911
912         else if (o_ptr->name2 == EGO_EARTHQUAKES)
913         {
914 #ifdef JP
915 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
916 #else
917                 return "earthquake every 100+d100 turns";
918 #endif
919
920         }
921
922         else if (o_ptr->name2 == EGO_JUMP)
923         {
924 #ifdef JP
925 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
926 #else
927                 return "blink every 10+d10 turns";
928 #endif
929
930         }
931
932         if (o_ptr->tval == TV_RING)
933         {
934                 if (object_is_ego(o_ptr))
935                 {
936                         switch (o_ptr->name2)
937                         {
938                         case EGO_RING_HERO:
939 #ifdef JP
940 return "»Îµ¤¹âÍÈ : 100+d100¥¿¡¼¥óËè";
941 #else
942                                 return "heroism every 100+d100 turns";
943 #endif
944                         case EGO_RING_MAGIC_MIS:
945 #ifdef JP
946 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
947 #else
948                         return "magic missile (2d6) every 2 turns";
949 #endif
950                         case EGO_RING_FIRE_BOLT:
951 #ifdef JP
952 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
953 #else
954                         return "fire bolt (9d8) every 8+d8 turns";
955 #endif
956                         case EGO_RING_COLD_BOLT:
957 #ifdef JP
958 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
959 #else
960                                 return "frost bolt (6d8) every 7+d7 turns";
961 #endif
962                         case EGO_RING_ELEC_BOLT:
963 #ifdef JP
964 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
965 #else
966                                 return "lightning bolt (4d8) every 5+d5 turns";
967 #endif
968                         case EGO_RING_ACID_BOLT:
969 #ifdef JP
970 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
971 #else
972                                 return "acid bolt (5d8) every 6+d6 turns";
973 #endif
974                         case EGO_RING_MANA_BOLT:
975 #ifdef JP
976 return "ËâÎϤÎÌð(120) : 120+d120 ¥¿¡¼¥óËè";
977 #else
978                         return "a mana bolt (120) every 120+d120 turns";
979 #endif
980                         case EGO_RING_FIRE_BALL:
981 #ifdef JP
982 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
983 #else
984                                 return "fire ball (100) every 80+d80 turns";
985 #endif
986                         case EGO_RING_COLD_BALL:
987 #ifdef JP
988 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
989 #else
990                                 return "cold ball (100) every 80+d80 turns";
991 #endif
992                         case EGO_RING_ELEC_BALL:
993 #ifdef JP
994 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
995 #else
996                                 return "elec ball (100) every 80+d80 turns";
997 #endif
998                         case EGO_RING_ACID_BALL:
999 #ifdef JP
1000 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
1001 #else
1002                                 return "acid ball (100) every 80+d80 turns";
1003 #endif
1004                         case EGO_RING_MANA_BALL:
1005 #ifdef JP
1006 return "ËâÎϤÎÍò (250) : 300 ¥¿¡¼¥óËè";
1007 #else
1008                                 return "mana storm (250) every 300 turns";
1009 #endif
1010                         case EGO_RING_DRAGON_F:
1011                                 if (o_ptr->sval == SV_RING_FLAMES)
1012 #ifdef JP
1013 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 200 ¥¿¡¼¥óËè";
1014 #else
1015                                         return "breath of fire (200) and resist fire every 200 turns";
1016 #endif
1017                                 else
1018 #ifdef JP
1019 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
1020 #else
1021                                         return "fire breath (200) every 250 turns";
1022 #endif
1023                         case EGO_RING_DRAGON_C:
1024                                 if (o_ptr->sval == SV_RING_ICE)
1025 #ifdef JP
1026 return "Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 200 ¥¿¡¼¥óËè";
1027 #else
1028                                         return "breath of cold (200) and resist cold every 200 turns";
1029 #endif
1030                                 else
1031 #ifdef JP
1032 return "Î䵤¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
1033 #else
1034                                         return "cold breath (200) every 250 turns";
1035 #endif
1036                         case EGO_RING_M_DETECT:
1037 #ifdef JP
1038 return "Á´¥â¥ó¥¹¥¿¡¼´¶ÃΠ: 150 ¥¿¡¼¥óËè";
1039 #else
1040                                 return "detect all monsters every 150 turns";
1041 #endif
1042                         case EGO_RING_D_SPEED:
1043 #ifdef JP
1044 return "¥¹¥Ô¡¼¥É(15+d30¥¿¡¼¥ó) : 100 ¥¿¡¼¥óËè";
1045 #else
1046                                 return "haste self (15+d30 turns) every 100 turns";
1047 #endif
1048                         case EGO_RING_BERSERKER:
1049 #ifdef JP
1050 return "¶¸Àï»Î²½(25+d25¥¿¡¼¥ó) : 75+d75 ¥¿¡¼¥óËè";
1051 #else
1052                                 return "berserk (25+d25 turns) every 75+d75 turns";
1053 #endif
1054                         case EGO_RING_TELE_AWAY:
1055 #ifdef JP
1056 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
1057 #else
1058                         return "teleport away every 150 turns";
1059 #endif
1060                         case EGO_RING_TRUE:
1061 #ifdef JP
1062 return "»Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢µæ¶Ë¤ÎÂÑÀ­ : 777 ¥¿¡¼¥óËè";
1063 #else
1064                         return "hero, bless, and ultimate resistance every 777 turns";
1065 #endif
1066                         }
1067                 }
1068                 switch (o_ptr->sval)
1069                 {
1070                         case SV_RING_FLAMES:
1071 #ifdef JP
1072 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
1073 #else
1074                                 return "ball of fire (100) and resist fire every 50+d50 turns";
1075 #endif
1076
1077                         case SV_RING_ICE:
1078 #ifdef JP
1079 return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
1080 #else
1081                                 return "ball of cold (100) and resist cold every 50+d50 turns";
1082 #endif
1083
1084                         case SV_RING_ACID:
1085 #ifdef JP
1086 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
1087 #else
1088                                 return "ball of acid (100) and resist acid every 50+d50 turns";
1089 #endif
1090
1091                         case SV_RING_ELEC:
1092 #ifdef JP
1093 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
1094 #else
1095                                 return "ball of elec (100) and resist elec every 50+d50 turns";
1096 #endif
1097
1098                         default:
1099                                 return NULL;
1100                 }
1101         }
1102
1103         if (o_ptr->tval == TV_AMULET)
1104         {
1105                 if (object_is_ego(o_ptr))
1106                 {
1107                         switch (o_ptr->name2)
1108                         {
1109                         case EGO_AMU_IDENT:
1110 #ifdef JP
1111                                 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
1112 #else
1113                                 return "identify every 10 turns";
1114 #endif
1115                         case EGO_AMU_CHARM:
1116 #ifdef JP
1117                                 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
1118 #else
1119                                 return "charm monster every 200 turns";
1120 #endif
1121                         case EGO_AMU_JUMP:
1122 #ifdef JP
1123                                 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
1124 #else
1125                                 return "blink every 10+d10 turns";
1126 #endif
1127                         case EGO_AMU_TELEPORT:
1128 #ifdef JP
1129                                 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
1130 #else
1131                                 return "teleport every 50+d50 turns";
1132 #endif
1133                         case EGO_AMU_D_DOOR:
1134 #ifdef JP
1135                                 return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
1136 #else
1137                                 return "dimension door every 200 turns";
1138 #endif
1139                         case EGO_AMU_RES_FIRE_:
1140 #ifdef JP
1141                                 return "²Ð±ê¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1142 #else
1143                                 return "resist fire every 50+d50 turns";
1144 #endif
1145                         case EGO_AMU_RES_COLD_:
1146 #ifdef JP
1147                                 return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1148 #else
1149                                 return "resist cold every 50+d50 turns";
1150 #endif
1151                         case EGO_AMU_RES_ELEC_:
1152 #ifdef JP
1153                                 return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1154 #else
1155                                 return "resist elec every 50+d50 turns";
1156 #endif
1157                         case EGO_AMU_RES_ACID_:
1158 #ifdef JP
1159                                 return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1160 #else
1161                                 return "resist acid every 50+d50 turns";
1162 #endif
1163                         case EGO_AMU_DETECTION:
1164 #ifdef JP
1165                                 return "Á´´¶ÃΠ: 55+d55¥¿¡¼¥óËè";
1166 #else
1167                                 return "detect all floor every 55+d55 turns";
1168 #endif
1169                         }
1170                 }
1171         }
1172
1173         if (o_ptr->tval == TV_WHISTLE)
1174         {
1175 #ifdef JP
1176 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
1177 #else
1178                 return "call pet every 100+d100 turns";
1179 #endif
1180         }
1181
1182         if (o_ptr->tval == TV_CAPTURE)
1183         {
1184 #ifdef JP
1185 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
1186 #else
1187                 return "captures or releases a monster.";
1188 #endif
1189         }
1190
1191         /* Require dragon scale mail */
1192 #ifdef JP
1193 if (o_ptr->tval != TV_DRAG_ARMOR) return ("´ñ̯¤Ê¸÷");
1194 #else
1195         if (o_ptr->tval != TV_DRAG_ARMOR) return ("a strange glow");
1196 #endif
1197
1198
1199         /* Branch on the sub-type */
1200         switch (o_ptr->sval)
1201         {
1202                 case SV_DRAGON_BLUE:
1203                 {
1204 #ifdef JP
1205 return "°ðºÊ¤Î¥Ö¥ì¥¹(100) : 150+d150 ¥¿¡¼¥óËè";
1206 #else
1207                         return "breathe lightning (100) every 150+d150 turns";
1208 #endif
1209
1210                 }
1211                 case SV_DRAGON_WHITE:
1212                 {
1213 #ifdef JP
1214 return "Î䵤¤Î¥Ö¥ì¥¹(110) : 150+d150 ¥¿¡¼¥óËè";
1215 #else
1216                         return "breathe frost (110) every 150+d150 turns";
1217 #endif
1218
1219                 }
1220                 case SV_DRAGON_BLACK:
1221                 {
1222 #ifdef JP
1223 return "»À¤Î¥Ö¥ì¥¹(130) : 150+d150 ¥¿¡¼¥óËè";
1224 #else
1225                         return "breathe acid (130) every 150+d150 turns";
1226 #endif
1227
1228                 }
1229                 case SV_DRAGON_GREEN:
1230                 {
1231 #ifdef JP
1232 return "ÆǤΥ¬¥¹¤Î¥Ö¥ì¥¹(150) : 180+d180 ¥¿¡¼¥óËè";
1233 #else
1234                         return "breathe poison gas (150) every 180+d180 turns";
1235 #endif
1236
1237                 }
1238                 case SV_DRAGON_RED:
1239                 {
1240 #ifdef JP
1241 return "²Ð±ê¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
1242 #else
1243                         return "breathe fire (200) every 200+d200 turns";
1244 #endif
1245
1246                 }
1247                 case SV_DRAGON_MULTIHUED:
1248                 {
1249 #ifdef JP
1250 return "Ëü¿§¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè";
1251 #else
1252                         return "breathe multi-hued (250) every 200+d200 turns";
1253 #endif
1254
1255                 }
1256                 case SV_DRAGON_BRONZE:
1257                 {
1258 #ifdef JP
1259 return "º®Íð¤Î¥Ö¥ì¥¹(120) : 180+d180 ¥¿¡¼¥óËè";
1260 #else
1261                         return "breathe confusion (120) every 180+d180 turns";
1262 #endif
1263
1264                 }
1265                 case SV_DRAGON_GOLD:
1266                 {
1267 #ifdef JP
1268 return "¹ì²»¤Î¥Ö¥ì¥¹(130) : 180+d180 ¥¿¡¼¥óËè";
1269 #else
1270                         return "breathe sound (130) every 180+d180 turns";
1271 #endif
1272
1273                 }
1274                 case SV_DRAGON_CHAOS:
1275                 {
1276 #ifdef JP
1277 return "¥«¥ª¥¹/Îô²½¤Î¥Ö¥ì¥¹(220) : 200+d200 ¥¿¡¼¥óËè";
1278 #else
1279                         return "breathe chaos/disenchant (220) every 200+d200 turns";
1280 #endif
1281
1282                 }
1283                 case SV_DRAGON_LAW:
1284                 {
1285 #ifdef JP
1286 return "¹ì²»/ÇËÊҤΥ֥쥹(230) : 200+d200 ¥¿¡¼¥óËè";
1287 #else
1288                         return "breathe sound/shards (230) every 200+d200 turns";
1289 #endif
1290
1291                 }
1292                 case SV_DRAGON_BALANCE:
1293                 {
1294 #ifdef JP
1295 return "¥Ð¥é¥ó¥¹¤Î¥Ö¥ì¥¹ (250) 200+d200 ¥¿¡¼¥óËè";
1296 #else
1297                         return "breathe balance (250) every 200+d200 turns";
1298 #endif
1299
1300                 }
1301                 case SV_DRAGON_SHINING:
1302                 {
1303 #ifdef JP
1304 return "Á®¸÷/°Å¹õ¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
1305 #else
1306                         return "breathe light/darkness (200) every 200+d200 turns";
1307 #endif
1308
1309                 }
1310                 case SV_DRAGON_POWER:
1311                 {
1312 #ifdef JP
1313 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
1314 #else
1315                         return "breathe the elements (300) every 200+d200 turns";
1316 #endif
1317
1318                 }
1319         }
1320
1321         /* Oops */
1322 #ifdef JP
1323 return "¶õµ¤¤Î©";
1324 #else
1325         return "breathe air";
1326 #endif
1327
1328 }
1329
1330
1331 /*
1332  * Describe a "fully identified" item
1333  */
1334 bool screen_object(object_type *o_ptr, u32b mode)
1335 {
1336         int                     i = 0, j, k;
1337
1338         u32b flgs[TR_FLAG_SIZE];
1339
1340         char temp[70 * 20];
1341         cptr            info[128];
1342         char o_name[MAX_NLEN];
1343         int wid, hgt;
1344
1345         int trivial_info = 0;
1346
1347         /* Extract the flags */
1348         object_flags(o_ptr, flgs);
1349
1350         /* Extract the description */
1351         {
1352                 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
1353                             (k_text + k_info[o_ptr->k_idx].text),
1354                             77 - 15, temp, sizeof(temp));
1355                 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
1356                 { info[i] = &temp[j]; i++;}
1357         }
1358
1359         if (object_is_equipment(o_ptr))
1360         {
1361                 /* Descriptions of a basic equipment is just a flavor */
1362                 trivial_info = i;
1363         }
1364
1365         /* Mega-Hack -- describe activation */
1366         if (have_flag(flgs, TR_ACTIVATE))
1367         {
1368 #ifdef JP
1369 info[i++] = "»ÏÆ°¤·¤¿¤È¤­¤Î¸ú²Ì...";
1370 #else
1371                 info[i++] = "It can be activated for...";
1372 #endif
1373
1374                 info[i++] = item_activation(o_ptr);
1375 #ifdef JP
1376 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
1377 #else
1378                 info[i++] = "...if it is being worn.";
1379 #endif
1380
1381         }
1382
1383         /* Figurines, a hack */
1384         if (o_ptr->tval == TV_FIGURINE)
1385         {
1386 #ifdef JP
1387 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
1388 #else
1389                 info[i++] = "It will transform into a pet when thrown.";
1390 #endif
1391
1392         }
1393
1394         /* Figurines, a hack */
1395         if (o_ptr->name1 == ART_STONEMASK)
1396         {
1397 #ifdef JP
1398 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
1399 #else
1400                 info[i++] = "It makes you turn into a vampire permanently.";
1401 #endif
1402
1403         }
1404
1405         if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
1406         {
1407 #ifdef JP
1408 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
1409 #else
1410                 info[i++] = "It will attempt to kill a monster instantly.";
1411 #endif
1412
1413         }
1414
1415         if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
1416         {
1417 #ifdef JP
1418 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
1419 #else
1420                 info[i++] = "It causes you to strike yourself sometimes.";
1421 #endif
1422
1423 #ifdef JP
1424 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
1425 #else
1426                 info[i++] = "It always penetrates invulnerability barriers.";
1427 #endif
1428         }
1429
1430         if (o_ptr->name2 == EGO_2WEAPON)
1431         {
1432 #ifdef JP
1433 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
1434 #else
1435                 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
1436 #endif
1437
1438         }
1439
1440         if (have_flag(flgs, TR_EASY_SPELL))
1441         {
1442 #ifdef JP
1443 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
1444 #else
1445                 info[i++] = "It affects your ability to cast spells.";
1446 #endif
1447         }
1448
1449         if (o_ptr->name2 == EGO_AMU_FOOL)
1450         {
1451 #ifdef JP
1452 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
1453 #else
1454                 info[i++] = "It interferes with casting spells.";
1455 #endif
1456         }
1457
1458         if (o_ptr->name2 == EGO_RING_THROW)
1459         {
1460 #ifdef JP
1461 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
1462 #else
1463                 info[i++] = "It provides great strength when you throw an item.";
1464 #endif
1465         }
1466
1467         if (o_ptr->name2 == EGO_AMU_NAIVETY)
1468         {
1469 #ifdef JP
1470 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
1471 #else
1472                 info[i++] = "It decreases your magic resistance.";
1473 #endif
1474         }
1475
1476         if (o_ptr->tval == TV_STATUE)
1477         {
1478                 monster_race *r_ptr = &r_info[o_ptr->pval];
1479
1480                 if (o_ptr->pval == MON_BULLGATES)
1481 #ifdef JP
1482                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
1483 #else
1484                         info[i++] = "It is shameful.";
1485 #endif
1486                 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
1487 #ifdef JP
1488                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
1489 #else
1490                 info[i++] = "It is fearful.";
1491 #endif
1492                 else
1493 #ifdef JP
1494                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
1495 #else
1496                 info[i++] = "It is cheerful.";
1497 #endif
1498         }
1499         
1500         /* Hack -- describe lite's */
1501         if (o_ptr->tval == TV_LITE)
1502         {
1503                 if (o_ptr->name2 == EGO_LITE_DARKNESS)
1504                 {
1505 #ifdef JP
1506                         info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
1507 #else
1508                         info[i++] = "It provides no light.";
1509 #endif
1510
1511                         if (o_ptr->sval == SV_LITE_FEANOR)
1512                         {
1513 #ifdef JP
1514                                 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
1515 #else
1516                                 info[i++] = "It decreases radius of light source by 3.";
1517 #endif
1518                         }
1519                         else if (o_ptr->sval == SV_LITE_LANTERN)
1520                         {
1521 #ifdef JP
1522                                 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
1523 #else
1524                                 info[i++] = "It decreases radius of light source by 2.";
1525 #endif
1526                         }
1527                         else
1528                         {
1529 #ifdef JP
1530                                 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
1531 #else
1532                                 info[i++] = "It decreases radius of light source by 1.";
1533 #endif
1534                         }
1535                 }
1536                 else if (object_is_fixed_artifact(o_ptr))
1537                 {
1538 #ifdef JP
1539 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1540 #else
1541                         info[i++] = "It provides light (radius 3) forever.";
1542 #endif
1543
1544                 }
1545                 else if (o_ptr->name2 == EGO_LITE_SHINE)
1546                 {
1547                         if (o_ptr->sval == SV_LITE_FEANOR)
1548                         {
1549 #ifdef JP
1550 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1551 #else
1552                                 info[i++] = "It provides light (radius 3) forever.";
1553 #endif
1554
1555                         }
1556                         else if (o_ptr->sval == SV_LITE_LANTERN)
1557                         {
1558 #ifdef JP
1559 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
1560 #else
1561                                 info[i++] = "It provides light (radius 3) when fueled.";
1562 #endif
1563
1564                         }
1565                         else
1566                         {
1567 #ifdef JP
1568 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1569 #else
1570                                 info[i++] = "It provides light (radius 2) when fueled.";
1571 #endif
1572
1573                         }
1574                 }
1575                 else
1576                 {
1577                         if (o_ptr->sval == SV_LITE_FEANOR)
1578                         {
1579 #ifdef JP
1580 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1581 #else
1582                                 info[i++] = "It provides light (radius 2) forever.";
1583 #endif
1584
1585                         }
1586                         else if (o_ptr->sval == SV_LITE_LANTERN)
1587                         {
1588 #ifdef JP
1589 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
1590 #else
1591                                 info[i++] = "It provides light (radius 2) when fueled.";
1592 #endif
1593
1594                         }
1595                         else
1596                         {
1597 #ifdef JP
1598 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
1599 #else
1600                                 info[i++] = "It provides light (radius 1) when fueled.";
1601 #endif
1602
1603                         }
1604                 }
1605                 if (o_ptr->name2 == EGO_LITE_LONG)
1606                 {
1607 #ifdef JP
1608 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
1609 #else
1610                         info[i++] = "It provides light for much longer time.";
1611 #endif
1612                 }
1613         }
1614
1615
1616         /* And then describe it fully */
1617
1618         if (have_flag(flgs, TR_RIDING))
1619         {
1620                 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
1621 #ifdef JP
1622 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
1623 #else
1624                         info[i++] = "It is made for use while riding.";
1625 #endif
1626                 else
1627                 {
1628 #ifdef JP
1629                         info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
1630 #else
1631                         info[i++] = "It is suitable for use while riding.";
1632 #endif
1633                         /* This information is not important enough */
1634                         trivial_info++;
1635                 }
1636         }
1637         if (have_flag(flgs, TR_STR))
1638         {
1639 #ifdef JP
1640 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1641 #else
1642                 info[i++] = "It affects your strength.";
1643 #endif
1644
1645         }
1646         if (have_flag(flgs, TR_INT))
1647         {
1648 #ifdef JP
1649 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1650 #else
1651                 info[i++] = "It affects your intelligence.";
1652 #endif
1653
1654         }
1655         if (have_flag(flgs, TR_WIS))
1656         {
1657 #ifdef JP
1658 info[i++] = "¤½¤ì¤Ï¸­¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1659 #else
1660                 info[i++] = "It affects your wisdom.";
1661 #endif
1662
1663         }
1664         if (have_flag(flgs, TR_DEX))
1665         {
1666 #ifdef JP
1667 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1668 #else
1669                 info[i++] = "It affects your dexterity.";
1670 #endif
1671
1672         }
1673         if (have_flag(flgs, TR_CON))
1674         {
1675 #ifdef JP
1676 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1677 #else
1678                 info[i++] = "It affects your constitution.";
1679 #endif
1680
1681         }
1682         if (have_flag(flgs, TR_CHR))
1683         {
1684 #ifdef JP
1685 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1686 #else
1687                 info[i++] = "It affects your charisma.";
1688 #endif
1689
1690         }
1691
1692         if (have_flag(flgs, TR_MAGIC_MASTERY))
1693         {
1694 #ifdef JP
1695 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1696 #else
1697                 info[i++] = "It affects your ability to use magic devices.";
1698 #endif
1699
1700         }
1701         if (have_flag(flgs, TR_STEALTH))
1702         {
1703 #ifdef JP
1704 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1705 #else
1706                 info[i++] = "It affects your stealth.";
1707 #endif
1708
1709         }
1710         if (have_flag(flgs, TR_SEARCH))
1711         {
1712 #ifdef JP
1713 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1714 #else
1715                 info[i++] = "It affects your searching.";
1716 #endif
1717
1718         }
1719         if (have_flag(flgs, TR_INFRA))
1720         {
1721 #ifdef JP
1722 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1723 #else
1724                 info[i++] = "It affects your infravision.";
1725 #endif
1726
1727         }
1728         if (have_flag(flgs, TR_TUNNEL))
1729         {
1730 #ifdef JP
1731 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹¡£";
1732 #else
1733                 info[i++] = "It affects your ability to tunnel.";
1734 #endif
1735
1736         }
1737         if (have_flag(flgs, TR_SPEED))
1738         {
1739 #ifdef JP
1740 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1741 #else
1742                 info[i++] = "It affects your speed.";
1743 #endif
1744
1745         }
1746         if (have_flag(flgs, TR_BLOWS))
1747         {
1748 #ifdef JP
1749 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¡£";
1750 #else
1751                 info[i++] = "It affects your attack speed.";
1752 #endif
1753
1754         }
1755
1756         if (have_flag(flgs, TR_BRAND_ACID))
1757         {
1758 #ifdef JP
1759 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1760 #else
1761                 info[i++] = "It does extra damage from acid.";
1762 #endif
1763
1764         }
1765         if (have_flag(flgs, TR_BRAND_ELEC))
1766         {
1767 #ifdef JP
1768 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1769 #else
1770                 info[i++] = "It does extra damage from electricity.";
1771 #endif
1772
1773         }
1774         if (have_flag(flgs, TR_BRAND_FIRE))
1775         {
1776 #ifdef JP
1777 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1778 #else
1779                 info[i++] = "It does extra damage from fire.";
1780 #endif
1781
1782         }
1783         if (have_flag(flgs, TR_BRAND_COLD))
1784         {
1785 #ifdef JP
1786 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
1787 #else
1788                 info[i++] = "It does extra damage from frost.";
1789 #endif
1790
1791         }
1792
1793         if (have_flag(flgs, TR_BRAND_POIS))
1794         {
1795 #ifdef JP
1796 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
1797 #else
1798                 info[i++] = "It poisons your foes.";
1799 #endif
1800
1801         }
1802
1803         if (have_flag(flgs, TR_CHAOTIC))
1804         {
1805 #ifdef JP
1806 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
1807 #else
1808                 info[i++] = "It produces chaotic effects.";
1809 #endif
1810
1811         }
1812
1813         if (have_flag(flgs, TR_VAMPIRIC))
1814         {
1815 #ifdef JP
1816 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
1817 #else
1818                 info[i++] = "It drains life from your foes.";
1819 #endif
1820
1821         }
1822
1823         if (have_flag(flgs, TR_IMPACT))
1824         {
1825 #ifdef JP
1826 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤­¤ë¡£";
1827 #else
1828                 info[i++] = "It can cause earthquakes.";
1829 #endif
1830
1831         }
1832
1833         if (have_flag(flgs, TR_VORPAL))
1834         {
1835 #ifdef JP
1836 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
1837 #else
1838                 info[i++] = "It is very sharp and can cut your foes.";
1839 #endif
1840
1841         }
1842
1843         if (have_flag(flgs, TR_KILL_DRAGON))
1844         {
1845 #ifdef JP
1846 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1847 #else
1848                 info[i++] = "It is a great bane of dragons.";
1849 #endif
1850
1851         }
1852         else if (have_flag(flgs, TR_SLAY_DRAGON))
1853         {
1854 #ifdef JP
1855 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
1856 #else
1857                 info[i++] = "It is especially deadly against dragons.";
1858 #endif
1859
1860         }
1861
1862         if (have_flag(flgs, TR_KILL_ORC))
1863         {
1864 #ifdef JP
1865 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1866 #else
1867                 info[i++] = "It is a great bane of orcs.";
1868 #endif
1869
1870         }
1871         if (have_flag(flgs, TR_SLAY_ORC))
1872         {
1873 #ifdef JP
1874 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
1875 #else
1876                 info[i++] = "It is especially deadly against orcs.";
1877 #endif
1878
1879         }
1880
1881         if (have_flag(flgs, TR_KILL_TROLL))
1882         {
1883 #ifdef JP
1884 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1885 #else
1886                 info[i++] = "It is a great bane of trolls.";
1887 #endif
1888
1889         }
1890         if (have_flag(flgs, TR_SLAY_TROLL))
1891         {
1892 #ifdef JP
1893 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
1894 #else
1895                 info[i++] = "It is especially deadly against trolls.";
1896 #endif
1897
1898         }
1899
1900         if (have_flag(flgs, TR_KILL_GIANT))
1901         {
1902 #ifdef JP
1903 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1904 #else
1905                 info[i++] = "It is a great bane of giants.";
1906 #endif
1907         }
1908         else if (have_flag(flgs, TR_SLAY_GIANT))
1909         {
1910 #ifdef JP
1911 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
1912 #else
1913                 info[i++] = "It is especially deadly against giants.";
1914 #endif
1915
1916         }
1917
1918         if (have_flag(flgs, TR_KILL_DEMON))
1919         {
1920 #ifdef JP
1921 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1922 #else
1923                 info[i++] = "It is a great bane of demons.";
1924 #endif
1925
1926         }
1927         if (have_flag(flgs, TR_SLAY_DEMON))
1928         {
1929 #ifdef JP
1930 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1931 #else
1932                 info[i++] = "It strikes at demons with holy wrath.";
1933 #endif
1934
1935         }
1936
1937         if (have_flag(flgs, TR_KILL_UNDEAD))
1938         {
1939 #ifdef JP
1940 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1941 #else
1942                 info[i++] = "It is a great bane of undead.";
1943 #endif
1944
1945         }
1946         if (have_flag(flgs, TR_SLAY_UNDEAD))
1947         {
1948 #ifdef JP
1949 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
1950 #else
1951                 info[i++] = "It strikes at undead with holy wrath.";
1952 #endif
1953
1954         }
1955
1956         if (have_flag(flgs, TR_KILL_EVIL))
1957         {
1958 #ifdef JP
1959 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1960 #else
1961                 info[i++] = "It is a great bane of evil monsters.";
1962 #endif
1963
1964         }
1965         if (have_flag(flgs, TR_SLAY_EVIL))
1966         {
1967 #ifdef JP
1968 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
1969 #else
1970                 info[i++] = "It fights against evil with holy fury.";
1971 #endif
1972
1973         }
1974
1975         if (have_flag(flgs, TR_KILL_ANIMAL))
1976         {
1977 #ifdef JP
1978 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1979 #else
1980                 info[i++] = "It is a great bane of natural creatures.";
1981 #endif
1982
1983         }
1984         if (have_flag(flgs, TR_SLAY_ANIMAL))
1985         {
1986 #ifdef JP
1987 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
1988 #else
1989                 info[i++] = "It is especially deadly against natural creatures.";
1990 #endif
1991
1992         }
1993
1994         if (have_flag(flgs, TR_KILL_HUMAN))
1995         {
1996 #ifdef JP
1997 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
1998 #else
1999                 info[i++] = "It is a great bane of humans.";
2000 #endif
2001
2002         }
2003         if (have_flag(flgs, TR_SLAY_HUMAN))
2004         {
2005 #ifdef JP
2006 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2007 #else
2008                 info[i++] = "It is especially deadly against humans.";
2009 #endif
2010
2011         }
2012
2013         if (have_flag(flgs, TR_FORCE_WEAPON))
2014         {
2015 #ifdef JP
2016 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
2017 #else
2018                 info[i++] = "It powerfully strikes at a monster using your mana.";
2019 #endif
2020
2021         }
2022         if (have_flag(flgs, TR_DEC_MANA))
2023         {
2024 #ifdef JP
2025 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
2026 #else
2027                 info[i++] = "It decreases your mana consumption.";
2028 #endif
2029
2030         }
2031         if (have_flag(flgs, TR_SUST_STR))
2032         {
2033 #ifdef JP
2034 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
2035 #else
2036                 info[i++] = "It sustains your strength.";
2037 #endif
2038
2039         }
2040         if (have_flag(flgs, TR_SUST_INT))
2041         {
2042 #ifdef JP
2043 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
2044 #else
2045                 info[i++] = "It sustains your intelligence.";
2046 #endif
2047
2048         }
2049         if (have_flag(flgs, TR_SUST_WIS))
2050         {
2051 #ifdef JP
2052 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸­¤µ¤ò°Ý»ý¤¹¤ë¡£";
2053 #else
2054                 info[i++] = "It sustains your wisdom.";
2055 #endif
2056
2057         }
2058         if (have_flag(flgs, TR_SUST_DEX))
2059         {
2060 #ifdef JP
2061 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
2062 #else
2063                 info[i++] = "It sustains your dexterity.";
2064 #endif
2065
2066         }
2067         if (have_flag(flgs, TR_SUST_CON))
2068         {
2069 #ifdef JP
2070 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
2071 #else
2072                 info[i++] = "It sustains your constitution.";
2073 #endif
2074
2075         }
2076         if (have_flag(flgs, TR_SUST_CHR))
2077         {
2078 #ifdef JP
2079 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
2080 #else
2081                 info[i++] = "It sustains your charisma.";
2082 #endif
2083
2084         }
2085
2086         if (have_flag(flgs, TR_IM_ACID))
2087         {
2088 #ifdef JP
2089 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
2090 #else
2091                 info[i++] = "It provides immunity to acid.";
2092 #endif
2093
2094         }
2095         if (have_flag(flgs, TR_IM_ELEC))
2096         {
2097 #ifdef JP
2098 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
2099 #else
2100                 info[i++] = "It provides immunity to electricity.";
2101 #endif
2102
2103         }
2104         if (have_flag(flgs, TR_IM_FIRE))
2105         {
2106 #ifdef JP
2107 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
2108 #else
2109                 info[i++] = "It provides immunity to fire.";
2110 #endif
2111
2112         }
2113         if (have_flag(flgs, TR_IM_COLD))
2114         {
2115 #ifdef JP
2116 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
2117 #else
2118                 info[i++] = "It provides immunity to cold.";
2119 #endif
2120
2121         }
2122
2123         if (have_flag(flgs, TR_THROW))
2124         {
2125 #ifdef JP
2126 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
2127 #else
2128                 info[i++] = "It is perfectly balanced for throwing.";
2129 #endif
2130         }
2131
2132         if (have_flag(flgs, TR_FREE_ACT))
2133         {
2134 #ifdef JP
2135 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
2136 #else
2137                 info[i++] = "It provides immunity to paralysis.";
2138 #endif
2139
2140         }
2141         if (have_flag(flgs, TR_HOLD_LIFE))
2142         {
2143 #ifdef JP
2144 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ­¤ò¼ø¤±¤ë¡£";
2145 #else
2146                 info[i++] = "It provides resistance to life draining.";
2147 #endif
2148
2149         }
2150         if (have_flag(flgs, TR_RES_FEAR))
2151         {
2152 #ifdef JP
2153 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ­¤ò¼ø¤±¤ë¡£";
2154 #else
2155                 info[i++] = "It makes you completely fearless.";
2156 #endif
2157
2158         }
2159         if (have_flag(flgs, TR_RES_ACID))
2160         {
2161 #ifdef JP
2162 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2163 #else
2164                 info[i++] = "It provides resistance to acid.";
2165 #endif
2166
2167         }
2168         if (have_flag(flgs, TR_RES_ELEC))
2169         {
2170 #ifdef JP
2171 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2172 #else
2173                 info[i++] = "It provides resistance to electricity.";
2174 #endif
2175
2176         }
2177         if (have_flag(flgs, TR_RES_FIRE))
2178         {
2179 #ifdef JP
2180 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2181 #else
2182                 info[i++] = "It provides resistance to fire.";
2183 #endif
2184
2185         }
2186         if (have_flag(flgs, TR_RES_COLD))
2187         {
2188 #ifdef JP
2189 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2190 #else
2191                 info[i++] = "It provides resistance to cold.";
2192 #endif
2193
2194         }
2195         if (have_flag(flgs, TR_RES_POIS))
2196         {
2197 #ifdef JP
2198 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2199 #else
2200                 info[i++] = "It provides resistance to poison.";
2201 #endif
2202
2203         }
2204
2205         if (have_flag(flgs, TR_RES_LITE))
2206         {
2207 #ifdef JP
2208 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2209 #else
2210                 info[i++] = "It provides resistance to light.";
2211 #endif
2212
2213         }
2214         if (have_flag(flgs, TR_RES_DARK))
2215         {
2216 #ifdef JP
2217 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2218 #else
2219                 info[i++] = "It provides resistance to dark.";
2220 #endif
2221
2222         }
2223
2224         if (have_flag(flgs, TR_RES_BLIND))
2225         {
2226 #ifdef JP
2227 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2228 #else
2229                 info[i++] = "It provides resistance to blindness.";
2230 #endif
2231
2232         }
2233         if (have_flag(flgs, TR_RES_CONF))
2234         {
2235 #ifdef JP
2236 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2237 #else
2238                 info[i++] = "It provides resistance to confusion.";
2239 #endif
2240
2241         }
2242         if (have_flag(flgs, TR_RES_SOUND))
2243         {
2244 #ifdef JP
2245 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2246 #else
2247                 info[i++] = "It provides resistance to sound.";
2248 #endif
2249
2250         }
2251         if (have_flag(flgs, TR_RES_SHARDS))
2252         {
2253 #ifdef JP
2254 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2255 #else
2256                 info[i++] = "It provides resistance to shards.";
2257 #endif
2258
2259         }
2260
2261         if (have_flag(flgs, TR_RES_NETHER))
2262         {
2263 #ifdef JP
2264 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2265 #else
2266                 info[i++] = "It provides resistance to nether.";
2267 #endif
2268
2269         }
2270         if (have_flag(flgs, TR_RES_NEXUS))
2271         {
2272 #ifdef JP
2273 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2274 #else
2275                 info[i++] = "It provides resistance to nexus.";
2276 #endif
2277
2278         }
2279         if (have_flag(flgs, TR_RES_CHAOS))
2280         {
2281 #ifdef JP
2282 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2283 #else
2284                 info[i++] = "It provides resistance to chaos.";
2285 #endif
2286
2287         }
2288         if (have_flag(flgs, TR_RES_DISEN))
2289         {
2290 #ifdef JP
2291 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
2292 #else
2293                 info[i++] = "It provides resistance to disenchantment.";
2294 #endif
2295
2296         }
2297
2298         if (have_flag(flgs, TR_LEVITATION))
2299         {
2300 #ifdef JP
2301 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
2302 #else
2303                 info[i++] = "It allows you to levitate.";
2304 #endif
2305
2306         }
2307         if (have_flag(flgs, TR_LITE))
2308         {
2309                 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
2310 #ifdef JP
2311 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
2312 #else
2313                         info[i++] = "It decreases radius of your light source by 1.";
2314 #endif
2315                 else
2316 #ifdef JP
2317 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
2318 #else
2319                         info[i++] = "It provides permanent light. (radius +1)";
2320 #endif
2321
2322         }
2323         if (have_flag(flgs, TR_SEE_INVIS))
2324         {
2325 #ifdef JP
2326 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
2327 #else
2328                 info[i++] = "It allows you to see invisible monsters.";
2329 #endif
2330
2331         }
2332         if (have_flag(flgs, TR_TELEPATHY))
2333         {
2334 #ifdef JP
2335 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
2336 #else
2337                 info[i++] = "It gives telepathic powers.";
2338 #endif
2339
2340         }
2341         if (have_flag(flgs, TR_ESP_ANIMAL))
2342         {
2343 #ifdef JP
2344 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
2345 #else
2346                 info[i++] = "It senses natural creatures.";
2347 #endif
2348
2349         }
2350         if (have_flag(flgs, TR_ESP_UNDEAD))
2351         {
2352 #ifdef JP
2353 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
2354 #else
2355                 info[i++] = "It senses undead.";
2356 #endif
2357
2358         }
2359         if (have_flag(flgs, TR_ESP_DEMON))
2360         {
2361 #ifdef JP
2362 info[i++] = "¤½¤ì¤Ï°­Ëâ¤ò´¶ÃΤ¹¤ë¡£";
2363 #else
2364                 info[i++] = "It senses demons.";
2365 #endif
2366
2367         }
2368         if (have_flag(flgs, TR_ESP_ORC))
2369         {
2370 #ifdef JP
2371 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
2372 #else
2373                 info[i++] = "It senses orcs.";
2374 #endif
2375
2376         }
2377         if (have_flag(flgs, TR_ESP_TROLL))
2378         {
2379 #ifdef JP
2380 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
2381 #else
2382                 info[i++] = "It senses trolls.";
2383 #endif
2384
2385         }
2386         if (have_flag(flgs, TR_ESP_GIANT))
2387         {
2388 #ifdef JP
2389 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
2390 #else
2391                 info[i++] = "It senses giants.";
2392 #endif
2393
2394         }
2395         if (have_flag(flgs, TR_ESP_DRAGON))
2396         {
2397 #ifdef JP
2398 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
2399 #else
2400                 info[i++] = "It senses dragons.";
2401 #endif
2402
2403         }
2404         if (have_flag(flgs, TR_ESP_HUMAN))
2405         {
2406 #ifdef JP
2407 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
2408 #else
2409                 info[i++] = "It senses humans.";
2410 #endif
2411
2412         }
2413         if (have_flag(flgs, TR_ESP_EVIL))
2414         {
2415 #ifdef JP
2416 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
2417 #else
2418                 info[i++] = "It senses evil creatures.";
2419 #endif
2420
2421         }
2422         if (have_flag(flgs, TR_ESP_GOOD))
2423         {
2424 #ifdef JP
2425 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
2426 #else
2427                 info[i++] = "It senses good creatures.";
2428 #endif
2429
2430         }
2431         if (have_flag(flgs, TR_ESP_NONLIVING))
2432         {
2433 #ifdef JP
2434 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
2435 #else
2436                 info[i++] = "It senses non-living creatures.";
2437 #endif
2438
2439         }
2440         if (have_flag(flgs, TR_ESP_UNIQUE))
2441         {
2442 #ifdef JP
2443 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
2444 #else
2445                 info[i++] = "It senses unique monsters.";
2446 #endif
2447
2448         }
2449         if (have_flag(flgs, TR_SLOW_DIGEST))
2450         {
2451 #ifdef JP
2452 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
2453 #else
2454                 info[i++] = "It slows your metabolism.";
2455 #endif
2456
2457         }
2458         if (have_flag(flgs, TR_REGEN))
2459         {
2460 #ifdef JP
2461 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
2462 #else
2463                 info[i++] = "It speeds your regenerative powers.";
2464 #endif
2465
2466         }
2467         if (have_flag(flgs, TR_WARNING))
2468         {
2469 #ifdef JP
2470 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
2471 #else
2472                 info[i++] = "It warns you of danger";
2473 #endif
2474
2475         }
2476         if (have_flag(flgs, TR_REFLECT))
2477         {
2478 #ifdef JP
2479 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
2480 #else
2481                 info[i++] = "It reflects bolts and arrows.";
2482 #endif
2483
2484         }
2485         if (have_flag(flgs, TR_SH_FIRE))
2486         {
2487 #ifdef JP
2488 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2489 #else
2490                 info[i++] = "It produces a fiery sheath.";
2491 #endif
2492
2493         }
2494         if (have_flag(flgs, TR_SH_ELEC))
2495         {
2496 #ifdef JP
2497 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2498 #else
2499                 info[i++] = "It produces an electric sheath.";
2500 #endif
2501
2502         }
2503         if (have_flag(flgs, TR_SH_COLD))
2504         {
2505 #ifdef JP
2506 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2507 #else
2508                 info[i++] = "It produces a sheath of coldness.";
2509 #endif
2510
2511         }
2512         if (have_flag(flgs, TR_NO_MAGIC))
2513         {
2514 #ifdef JP
2515 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
2516 #else
2517                 info[i++] = "It produces an anti-magic shell.";
2518 #endif
2519
2520         }
2521         if (have_flag(flgs, TR_NO_TELE))
2522         {
2523 #ifdef JP
2524 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
2525 #else
2526                 info[i++] = "It prevents teleportation.";
2527 #endif
2528
2529         }
2530         if (have_flag(flgs, TR_XTRA_MIGHT))
2531         {
2532 #ifdef JP
2533 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
2534 #else
2535                 info[i++] = "It fires missiles with extra might.";
2536 #endif
2537
2538         }
2539         if (have_flag(flgs, TR_XTRA_SHOTS))
2540         {
2541 #ifdef JP
2542 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
2543 #else
2544                 info[i++] = "It fires missiles excessively fast.";
2545 #endif
2546
2547         }
2548
2549         if (have_flag(flgs, TR_BLESSED))
2550         {
2551 #ifdef JP
2552 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
2553 #else
2554                 info[i++] = "It has been blessed by the gods.";
2555 #endif
2556
2557         }
2558
2559         if (object_is_cursed(o_ptr))
2560         {
2561                 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
2562                 {
2563 #ifdef JP
2564 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
2565 #else
2566                         info[i++] = "It is permanently cursed.";
2567 #endif
2568
2569                 }
2570                 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
2571                 {
2572 #ifdef JP
2573 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
2574 #else
2575                         info[i++] = "It is heavily cursed.";
2576 #endif
2577
2578                 }
2579                 else
2580                 {
2581 #ifdef JP
2582 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
2583 #else
2584                         info[i++] = "It is cursed.";
2585 #endif
2586
2587                         /*
2588                          * It's a trivial infomation since there is
2589                          * fake inscription {cursed}
2590                          */
2591                         trivial_info++;
2592                 }
2593         }
2594
2595         if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
2596         {
2597 #ifdef JP
2598 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
2599 #else
2600                 info[i++] = "It carries an ancient foul curse.";
2601 #endif
2602
2603         }
2604         if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
2605         {
2606 #ifdef JP
2607 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
2608 #else
2609                 info[i++] = "It aggravates nearby creatures.";
2610 #endif
2611
2612         }
2613         if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
2614         {
2615 #ifdef JP
2616 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
2617 #else
2618                 info[i++] = "It drains experience.";
2619 #endif
2620
2621         }
2622         if (o_ptr->curse_flags & TRC_SLOW_REGEN)
2623         {
2624 #ifdef JP
2625 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
2626 #else
2627                 info[i++] = "It slows your regenerative powers.";
2628 #endif
2629
2630         }
2631         if (o_ptr->curse_flags & TRC_ADD_L_CURSE)
2632         {
2633 #ifdef JP
2634 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
2635 #else
2636                 info[i++] = "It adds weak curses.";
2637 #endif
2638
2639         }
2640         if (o_ptr->curse_flags & TRC_ADD_H_CURSE)
2641         {
2642 #ifdef JP
2643 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
2644 #else
2645                 info[i++] = "It adds heavy curses.";
2646 #endif
2647
2648         }
2649         if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
2650         {
2651 #ifdef JP
2652 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2653 #else
2654                 info[i++] = "It attracts animals.";
2655 #endif
2656
2657         }
2658         if (o_ptr->curse_flags & TRC_CALL_DEMON)
2659         {
2660 #ifdef JP
2661 info[i++] = "¤½¤ì¤Ï°­Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2662 #else
2663                 info[i++] = "It attracts demons.";
2664 #endif
2665
2666         }
2667         if (o_ptr->curse_flags & TRC_CALL_DRAGON)
2668         {
2669 #ifdef JP
2670 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
2671 #else
2672                 info[i++] = "It attracts dragons.";
2673 #endif
2674
2675         }
2676         if (o_ptr->curse_flags & TRC_COWARDICE)
2677         {
2678 #ifdef JP
2679 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤­µ¯¤³¤¹¡£";
2680 #else
2681                 info[i++] = "It makes you subject to cowardice.";
2682 #endif
2683
2684         }
2685         if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
2686         {
2687 #ifdef JP
2688 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤­µ¯¤³¤¹¡£";
2689 #else
2690                 info[i++] = "It induces random teleportation.";
2691 #endif
2692
2693         }
2694         if (o_ptr->curse_flags & TRC_LOW_MELEE)
2695         {
2696 #ifdef JP
2697 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
2698 #else
2699                 info[i++] = "It causes you to miss blows.";
2700 #endif
2701
2702         }
2703         if (o_ptr->curse_flags & TRC_LOW_AC)
2704         {
2705 #ifdef JP
2706 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
2707 #else
2708                 info[i++] = "It helps your enemies' blows.";
2709 #endif
2710
2711         }
2712         if (o_ptr->curse_flags & TRC_LOW_MAGIC)
2713         {
2714 #ifdef JP
2715 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
2716 #else
2717                 info[i++] = "It encumbers you while spellcasting.";
2718 #endif
2719
2720         }
2721         if (o_ptr->curse_flags & TRC_FAST_DIGEST)
2722         {
2723 #ifdef JP
2724 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
2725 #else
2726                 info[i++] = "It speeds your metabolism.";
2727 #endif
2728
2729         }
2730         if (o_ptr->curse_flags & TRC_DRAIN_HP)
2731         {
2732 #ifdef JP
2733 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
2734 #else
2735                 info[i++] = "It drains you.";
2736 #endif
2737
2738         }
2739         if (o_ptr->curse_flags & TRC_DRAIN_MANA)
2740         {
2741 #ifdef JP
2742 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
2743 #else
2744                 info[i++] = "It drains your mana.";
2745 #endif
2746
2747         }
2748
2749         /* Describe about this kind of object instead of THIS fake object */
2750         if (mode & SCROBJ_FAKE_OBJECT)
2751         {
2752                 switch (o_ptr->tval)
2753                 {
2754                 case TV_RING:
2755                         switch (o_ptr->sval)
2756                         {
2757                         case SV_RING_LORDLY:
2758 #ifdef JP
2759                                 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë¡£";
2760 #else
2761                                 info[i++] = "It provides some random resistances.";
2762 #endif
2763                                 break;
2764                         case SV_RING_WARNING:
2765 #ifdef JP
2766                                 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2767 #else
2768                                 info[i++] = "It may provide a low rank ESP.";
2769 #endif
2770                                 break;
2771                         }
2772                         break;
2773
2774                 case TV_AMULET:
2775                         switch (o_ptr->sval)
2776                         {
2777                         case SV_AMULET_RESISTANCE:
2778 #ifdef JP
2779                                 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2780 #else
2781                                 info[i++] = "It may provides resistance to poison.";
2782 #endif
2783 #ifdef JP
2784                                 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
2785 #else
2786                                 info[i++] = "It may provide a random resistances.";
2787 #endif
2788                                 break;
2789                         case SV_AMULET_THE_MAGI:
2790 #ifdef JP
2791                                 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
2792 #else
2793                                 info[i++] = "It provides up to three low rank ESPs.";
2794 #endif
2795                                 break;
2796                         }
2797                         break;
2798                 }
2799         }
2800
2801         if (have_flag(flgs, TR_IGNORE_ACID) &&
2802             have_flag(flgs, TR_IGNORE_ELEC) &&
2803             have_flag(flgs, TR_IGNORE_FIRE) &&
2804             have_flag(flgs, TR_IGNORE_COLD))
2805         {
2806 #ifdef JP
2807                 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2808 #else
2809                 info[i++] = "It cannot be harmed by the elements.";
2810 #endif
2811         }
2812         else
2813         {
2814                 if (have_flag(flgs, TR_IGNORE_ACID))
2815                 {
2816 #ifdef JP
2817                         info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2818 #else
2819                         info[i++] = "It cannot be harmed by acid.";
2820 #endif
2821                 }
2822                 if (have_flag(flgs, TR_IGNORE_ELEC))
2823                 {
2824 #ifdef JP
2825                         info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2826 #else
2827                         info[i++] = "It cannot be harmed by electricity.";
2828 #endif
2829                 }
2830                 if (have_flag(flgs, TR_IGNORE_FIRE))
2831                 {
2832 #ifdef JP
2833                         info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2834 #else
2835                         info[i++] = "It cannot be harmed by fire.";
2836 #endif
2837                 }
2838                 if (have_flag(flgs, TR_IGNORE_COLD))
2839                 {
2840 #ifdef JP
2841                         info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
2842 #else
2843                         info[i++] = "It cannot be harmed by cold.";
2844 #endif
2845                 }
2846         }
2847
2848         if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
2849
2850         /* No relevant informations */
2851         if (i <= trivial_info) return (FALSE);
2852
2853         /* Save the screen */
2854         screen_save();
2855
2856         /* Get size */
2857         Term_get_size(&wid, &hgt);
2858
2859         /* Display Item name */
2860         if (!(mode & SCROBJ_FAKE_OBJECT))
2861                 object_desc(o_name, o_ptr, 0);
2862         else
2863                 object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
2864
2865         prt(o_name, 0, 0);
2866
2867         /* Erase the screen */
2868         for (k = 1; k < hgt; k++) prt("", k, 13);
2869
2870         /* Label the information */
2871         if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
2872         {
2873                 monster_race *r_ptr = &r_info[o_ptr->pval];
2874                 int namelen = strlen(r_name + r_ptr->name);
2875                 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
2876                 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
2877                 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
2878         }
2879         else
2880 #ifdef JP
2881 prt("     ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
2882 #else
2883         prt("     Item Attributes:", 1, 15);
2884 #endif
2885
2886         /* We will print on top of the map (column 13) */
2887         for (k = 2, j = 0; j < i; j++)
2888         {
2889                 /* Show the info */
2890                 prt(info[j], k++, 15);
2891
2892                 /* Every 20 entries (lines 2 to 21), start over */
2893                 if ((k == hgt - 2) && (j+1 < i))
2894                 {
2895 #ifdef JP
2896 prt("-- Â³¤¯ --", k, 15);
2897 #else
2898                         prt("-- more --", k, 15);
2899 #endif
2900                         inkey();
2901                         for (; k > 2; k--) prt("", k, 15);
2902                 }
2903         }
2904
2905         /* Wait for it */
2906 #ifdef JP
2907 prt("[²¿¤«¥­¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
2908 #else
2909         prt("[Press any key to continue]", k, 15);
2910 #endif
2911
2912         inkey();
2913
2914         /* Restore the screen */
2915         screen_load();
2916
2917         /* Gave knowledge */
2918         return (TRUE);
2919 }
2920
2921
2922
2923 /*
2924  * Convert an inventory index into a one character label
2925  * Note that the label does NOT distinguish inven/equip.
2926  */
2927 char index_to_label(int i)
2928 {
2929         /* Indexes for "inven" are easy */
2930         if (i < INVEN_RARM) return (I2A(i));
2931
2932         /* Indexes for "equip" are offset */
2933         return (I2A(i - INVEN_RARM));
2934 }
2935
2936
2937 /*
2938  * Convert a label into the index of an item in the "inven"
2939  * Return "-1" if the label does not indicate a real item
2940  */
2941 s16b label_to_inven(int c)
2942 {
2943         int i;
2944
2945         /* Convert */
2946         i = (islower(c) ? A2I(c) : -1);
2947
2948         /* Verify the index */
2949         if ((i < 0) || (i > INVEN_PACK)) return (-1);
2950
2951         /* Empty slots can never be chosen */
2952         if (!inventory[i].k_idx) return (-1);
2953
2954         /* Return the index */
2955         return (i);
2956 }
2957
2958
2959 /* See cmd5.c */
2960 extern bool select_ring_slot;
2961
2962
2963 static bool is_ring_slot(int i)
2964 {
2965         return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
2966 }
2967
2968
2969 /*
2970  * Convert a label into the index of a item in the "equip"
2971  * Return "-1" if the label does not indicate a real item
2972  */
2973 s16b label_to_equip(int c)
2974 {
2975         int i;
2976
2977         /* Convert */
2978         i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
2979
2980         /* Verify the index */
2981         if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
2982
2983         if (select_ring_slot) return is_ring_slot(i) ? i : -1;
2984
2985         /* Empty slots can never be chosen */
2986         if (!inventory[i].k_idx) return (-1);
2987
2988         /* Return the index */
2989         return (i);
2990 }
2991
2992
2993
2994 /*
2995  * Determine which equipment slot (if any) an item likes
2996  */
2997 s16b wield_slot(object_type *o_ptr)
2998 {
2999         /* Slot for equipment */
3000         switch (o_ptr->tval)
3001         {
3002                 case TV_DIGGING:
3003                 case TV_HAFTED:
3004                 case TV_POLEARM:
3005                 case TV_SWORD:
3006                 {
3007                         if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
3008                         if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
3009                         return (INVEN_LARM);
3010                 }
3011
3012                 case TV_CAPTURE:
3013                 case TV_CARD:
3014                 case TV_SHIELD:
3015                 {
3016                         if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
3017                         if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
3018                         return (INVEN_RARM);
3019                 }
3020
3021                 case TV_BOW:
3022                 {
3023                         return (INVEN_BOW);
3024                 }
3025
3026                 case TV_RING:
3027                 {
3028                         /* Use the right hand first */
3029                         if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
3030
3031                         /* Use the left hand for swapping (by default) */
3032                         return (INVEN_LEFT);
3033                 }
3034
3035                 case TV_AMULET:
3036                 case TV_WHISTLE:
3037                 {
3038                         return (INVEN_NECK);
3039                 }
3040
3041                 case TV_LITE:
3042                 {
3043                         return (INVEN_LITE);
3044                 }
3045
3046                 case TV_DRAG_ARMOR:
3047                 case TV_HARD_ARMOR:
3048                 case TV_SOFT_ARMOR:
3049                 {
3050                         return (INVEN_BODY);
3051                 }
3052
3053                 case TV_CLOAK:
3054                 {
3055                         return (INVEN_OUTER);
3056                 }
3057
3058                 case TV_CROWN:
3059                 case TV_HELM:
3060                 {
3061                         return (INVEN_HEAD);
3062                 }
3063
3064                 case TV_GLOVES:
3065                 {
3066                         return (INVEN_HANDS);
3067                 }
3068
3069                 case TV_BOOTS:
3070                 {
3071                         return (INVEN_FEET);
3072                 }
3073         }
3074
3075         /* No slot available */
3076         return (-1);
3077 }
3078
3079
3080 /*
3081  * Return a string mentioning how a given item is carried
3082  */
3083 cptr mention_use(int i)
3084 {
3085         cptr p;
3086
3087         /* Examine the location */
3088         switch (i)
3089         {
3090 #ifdef JP
3091                 case INVEN_RARM:  p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->migite) ? " Î¾¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê")); break;
3092 #else
3093                 case INVEN_RARM:  p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
3094 #endif
3095
3096 #ifdef JP
3097                 case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ" : ((p_ptr->ryoute && p_ptr->hidarite) ? " Î¾¼ê" : (left_hander ? " ±¦¼ê" : " º¸¼ê")); break;
3098 #else
3099                 case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
3100 #endif
3101
3102 #ifdef JP
3103                 case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "±¿ÈÂÃæ" : "¼Í·âÍÑ"; break;
3104 #else
3105                 case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
3106 #endif
3107
3108 #ifdef JP
3109                 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
3110 #else
3111                 case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
3112 #endif
3113
3114 #ifdef JP
3115                 case INVEN_LEFT:  p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
3116 #else
3117                 case INVEN_LEFT:  p = (left_hander ? "On right hand" : "On left hand"); break;
3118 #endif
3119
3120 #ifdef JP
3121                 case INVEN_NECK:  p = "  ¼ó"; break;
3122 #else
3123                 case INVEN_NECK:  p = "Around neck"; break;
3124 #endif
3125
3126 #ifdef JP
3127                 case INVEN_LITE:  p = " ¸÷¸»"; break;
3128 #else
3129                 case INVEN_LITE:  p = "Light source"; break;
3130 #endif
3131
3132 #ifdef JP
3133                 case INVEN_BODY:  p = "  ÂÎ"; break;
3134 #else
3135                 case INVEN_BODY:  p = "On body"; break;
3136 #endif
3137
3138 #ifdef JP
3139                 case INVEN_OUTER: p = "ÂΤξå"; break;
3140 #else
3141                 case INVEN_OUTER: p = "About body"; break;
3142 #endif
3143
3144 #ifdef JP
3145                 case INVEN_HEAD:  p = "  Ƭ"; break;
3146 #else
3147                 case INVEN_HEAD:  p = "On head"; break;
3148 #endif
3149
3150 #ifdef JP
3151                 case INVEN_HANDS: p = "  ¼ê"; break;
3152 #else
3153                 case INVEN_HANDS: p = "On hands"; break;
3154 #endif
3155
3156 #ifdef JP
3157                 case INVEN_FEET:  p = "  ­"; break;
3158 #else
3159                 case INVEN_FEET:  p = "On feet"; break;
3160 #endif
3161
3162 #ifdef JP
3163                 default:          p = "¥¶¥Ã¥¯"; break;
3164 #else
3165                 default:          p = "In pack"; break;
3166 #endif
3167         }
3168
3169         /* Return the result */
3170         return p;
3171 }
3172
3173
3174 /*
3175  * Return a string describing how a given item is being worn.
3176  * Currently, only used for items in the equipment, not inventory.
3177  */
3178 cptr describe_use(int i)
3179 {
3180         cptr p;
3181
3182         switch (i)
3183         {
3184 #ifdef JP
3185                 case INVEN_RARM:  p = p_ptr->heavy_wield[0] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->migite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
3186 #else
3187                 case INVEN_RARM:  p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
3188 #endif
3189
3190 #ifdef JP
3191                 case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "±¿ÈÂÃæ¤Î" : ((p_ptr->ryoute && p_ptr->hidarite) ? "ξ¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? "±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : "º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë")); break;
3192 #else
3193                 case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
3194 #endif
3195
3196 #ifdef JP
3197                 case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î" : "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
3198 #else
3199                 case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
3200 #endif
3201
3202 #ifdef JP
3203                 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
3204 #else
3205                 case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
3206 #endif
3207
3208 #ifdef JP
3209                 case INVEN_LEFT:  p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
3210 #else
3211                 case INVEN_LEFT:  p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
3212 #endif
3213
3214 #ifdef JP
3215                 case INVEN_NECK:  p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
3216 #else
3217                 case INVEN_NECK:  p = "wearing around your neck"; break;
3218 #endif
3219
3220 #ifdef JP
3221                 case INVEN_LITE:  p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
3222 #else
3223                 case INVEN_LITE:  p = "using to light the way"; break;
3224 #endif
3225
3226 #ifdef JP
3227                 case INVEN_BODY:  p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
3228 #else
3229                 case INVEN_BODY:  p = "wearing on your body"; break;
3230 #endif
3231
3232 #ifdef JP
3233                 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
3234 #else
3235                 case INVEN_OUTER: p = "wearing on your back"; break;
3236 #endif
3237
3238 #ifdef JP
3239                 case INVEN_HEAD:  p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
3240 #else
3241                 case INVEN_HEAD:  p = "wearing on your head"; break;
3242 #endif
3243
3244 #ifdef JP
3245                 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
3246 #else
3247                 case INVEN_HANDS: p = "wearing on your hands"; break;
3248 #endif
3249
3250 #ifdef JP
3251                 case INVEN_FEET:  p = "­¤Ë¤Ï¤¤¤Æ¤¤¤ë"; break;
3252 #else
3253                 case INVEN_FEET:  p = "wearing on your feet"; break;
3254 #endif
3255
3256 #ifdef JP
3257                 default:          p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
3258 #else
3259                 default:          p = "carrying in your pack"; break;
3260 #endif
3261         }
3262
3263         /* Return the result */
3264         return p;
3265 }
3266
3267
3268 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
3269
3270 bool check_book_realm(const byte book_tval, const byte book_sval)
3271 {
3272         if (book_tval < TV_LIFE_BOOK) return FALSE;
3273         if (p_ptr->pclass == CLASS_SORCERER)
3274         {
3275                 return is_magic(tval2realm(book_tval));
3276         }
3277         else if (p_ptr->pclass == CLASS_RED_MAGE)
3278         {
3279                 if (is_magic(tval2realm(book_tval)))
3280                         return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
3281         }
3282         return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
3283 }
3284
3285
3286 /*
3287  * Check an item against the item tester info
3288  */
3289 bool item_tester_okay(object_type *o_ptr)
3290 {
3291         /* Hack -- allow listing empty slots */
3292         if (item_tester_full) return (TRUE);
3293
3294         /* Require an item */
3295         if (!o_ptr->k_idx) return (FALSE);
3296
3297         /* Hack -- ignore "gold" */
3298         if (o_ptr->tval == TV_GOLD)
3299         {
3300                 /* See xtra2.c */
3301                 extern bool show_gold_on_floor;
3302
3303                 if (!show_gold_on_floor) return (FALSE);
3304         }
3305
3306         /* Check the tval */
3307         if (item_tester_tval)
3308         {
3309                 /* Is it a spellbook? If so, we need a hack -- TY */
3310                 if ((item_tester_tval <= TV_DEATH_BOOK) &&
3311                         (item_tester_tval >= TV_LIFE_BOOK))
3312                         return check_book_realm(o_ptr->tval, o_ptr->sval);
3313                 else
3314                         if (item_tester_tval != o_ptr->tval) return (FALSE);
3315         }
3316
3317         /* Check the hook */
3318         if (item_tester_hook)
3319         {
3320                 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
3321         }
3322
3323         /* Assume okay */
3324         return (TRUE);
3325 }
3326
3327
3328
3329
3330 /*
3331  * Choice window "shadow" of the "show_inven()" function
3332  */
3333 void display_inven(void)
3334 {
3335         register        int i, n, z = 0;
3336         object_type     *o_ptr;
3337         byte            attr = TERM_WHITE;
3338         char            tmp_val[80];
3339         char            o_name[MAX_NLEN];
3340         int             wid, hgt;
3341
3342         /* Get size */
3343         Term_get_size(&wid, &hgt);
3344
3345         /* Find the "final" slot */
3346         for (i = 0; i < INVEN_PACK; i++)
3347         {
3348                 o_ptr = &inventory[i];
3349
3350                 /* Skip non-objects */
3351                 if (!o_ptr->k_idx) continue;
3352
3353                 /* Track */
3354                 z = i + 1;
3355         }
3356
3357         /* Display the pack */
3358         for (i = 0; i < z; i++)
3359         {
3360                 /* Examine the item */
3361                 o_ptr = &inventory[i];
3362
3363                 /* Start with an empty "index" */
3364                 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3365
3366                 /* Is this item "acceptable"? */
3367                 if (item_tester_okay(o_ptr))
3368                 {
3369                         /* Prepare an "index" */
3370                         tmp_val[0] = index_to_label(i);
3371
3372                         /* Bracket the "index" --(-- */
3373                         tmp_val[1] = ')';
3374                 }
3375
3376                 /* Display the index (or blank space) */
3377                 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
3378
3379                 /* Obtain an item description */
3380                 object_desc(o_name, o_ptr, 0);
3381
3382                 /* Obtain the length of the description */
3383                 n = strlen(o_name);
3384
3385                 /* Get a color */
3386                 attr = tval_to_attr[o_ptr->tval % 128];
3387
3388                 /* Grey out charging items */
3389                 if (o_ptr->timeout)
3390                 {
3391                         attr = TERM_L_DARK;
3392                 }
3393
3394                 /* Display the entry itself */
3395                 Term_putstr(3, i, n, attr, o_name);
3396
3397                 /* Erase the rest of the line */
3398                 Term_erase(3+n, i, 255);
3399
3400                 /* Display the weight if needed */
3401                 if (show_weights)
3402                 {
3403                         int wgt = o_ptr->weight * o_ptr->number;
3404 #ifdef JP
3405                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
3406 #else
3407                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3408 #endif
3409
3410                         prt(tmp_val, i, wid - 9);
3411                 }
3412         }
3413
3414         /* Erase the rest of the window */
3415         for (i = z; i < hgt; i++)
3416         {
3417                 /* Erase the line */
3418                 Term_erase(0, i, 255);
3419         }
3420 }
3421
3422
3423
3424 /*
3425  * Choice window "shadow" of the "show_equip()" function
3426  */
3427 void display_equip(void)
3428 {
3429         register        int i, n;
3430         object_type     *o_ptr;
3431         byte            attr = TERM_WHITE;
3432         char            tmp_val[80];
3433         char            o_name[MAX_NLEN];
3434         int             wid, hgt;
3435
3436         /* Get size */
3437         Term_get_size(&wid, &hgt);
3438
3439         /* Display the equipment */
3440         for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3441         {
3442                 /* Examine the item */
3443                 o_ptr = &inventory[i];
3444
3445                 /* Start with an empty "index" */
3446                 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3447
3448                 /* Is this item "acceptable"? */
3449                 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
3450                 {
3451                         /* Prepare an "index" */
3452                         tmp_val[0] = index_to_label(i);
3453
3454                         /* Bracket the "index" --(-- */
3455                         tmp_val[1] = ')';
3456                 }
3457
3458                 /* Display the index (or blank space) */
3459                 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
3460
3461                 /* Obtain an item description */
3462                 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3463                 {
3464 #ifdef JP
3465                         strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
3466 #else
3467                         strcpy(o_name, "(wielding with two-hands)");
3468 #endif
3469                         attr = TERM_WHITE;
3470                 }
3471                 else
3472                 {
3473                         object_desc(o_name, o_ptr, 0);
3474                         attr = tval_to_attr[o_ptr->tval % 128];
3475                 }
3476
3477                 /* Obtain the length of the description */
3478                 n = strlen(o_name);
3479
3480                 /* Grey out charging items */
3481                 if (o_ptr->timeout)
3482                 {
3483                         attr = TERM_L_DARK;
3484                 }
3485
3486                 /* Display the entry itself */
3487                 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
3488
3489                 /* Erase the rest of the line */
3490                 Term_erase(3+n, i - INVEN_RARM, 255);
3491
3492                 /* Display the weight (if needed) */
3493                 if (show_weights)
3494                 {
3495                         int wgt = o_ptr->weight * o_ptr->number;
3496 #ifdef JP
3497                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3498 #else
3499                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3500 #endif
3501
3502                         prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
3503                 }
3504
3505                 /* Display the slot description (if needed) */
3506                 if (show_labels)
3507                 {
3508                         Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
3509                         prt(mention_use(i), i - INVEN_RARM, wid - 15);
3510                 }
3511         }
3512
3513         /* Erase the rest of the window */
3514         for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
3515         {
3516                 /* Clear that line */
3517                 Term_erase(0, i, 255);
3518         }
3519 }
3520
3521
3522 /*
3523  * Find the "first" inventory object with the given "tag".
3524  *
3525  * A "tag" is a numeral "n" appearing as "@n" anywhere in the
3526  * inscription of an object.  Alphabetical characters don't work as a
3527  * tag in this form.
3528  *
3529  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
3530  * and "x" is the "current" command_cmd code.
3531  */
3532 static bool get_tag(int *cp, char tag, int mode)
3533 {
3534         int i, start, end;
3535         cptr s;
3536
3537         /* Extract index from mode */
3538         switch (mode)
3539         {
3540         case USE_EQUIP:
3541                 start = INVEN_RARM;
3542                 end = INVEN_TOTAL - 1;
3543                 break;
3544
3545         case USE_INVEN:
3546                 start = 0;
3547                 end = INVEN_PACK - 1;
3548                 break;
3549
3550         default:
3551                 return FALSE;
3552         }
3553
3554         /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
3555
3556         /* Check every inventory object */
3557         for (i = start; i <= end; i++)
3558         {
3559                 object_type *o_ptr = &inventory[i];
3560
3561                 /* Skip non-objects */
3562                 if (!o_ptr->k_idx) continue;
3563
3564                 /* Skip empty inscriptions */
3565                 if (!o_ptr->inscription) continue;
3566
3567                 /* Skip non-choice */
3568                 if (!item_tester_okay(o_ptr)) continue;
3569
3570                 /* Find a '@' */
3571                 s = my_strchr(quark_str(o_ptr->inscription), '@');
3572
3573                 /* Process all tags */
3574                 while (s)
3575                 {
3576                         /* Check the special tags */
3577                         if ((s[1] == command_cmd) && (s[2] == tag))
3578                         {
3579                                 /* Save the actual inventory ID */
3580                                 *cp = i;
3581
3582                                 /* Success */
3583                                 return (TRUE);
3584                         }
3585
3586                         /* Find another '@' */
3587                         s = my_strchr(s + 1, '@');
3588                 }
3589         }
3590
3591
3592         /**** Find a tag in the form of {@#} (allows only numerals)  ***/
3593
3594         /* Don't allow {@#} with '#' being alphabet */
3595         if (tag < '0' || '9' < tag)
3596         {
3597                 /* No such tag */
3598                 return FALSE;
3599         }
3600
3601         /* Check every object */
3602         for (i = start; i <= end; i++)
3603         {
3604                 object_type *o_ptr = &inventory[i];
3605
3606                 /* Skip non-objects */
3607                 if (!o_ptr->k_idx) continue;
3608
3609                 /* Skip empty inscriptions */
3610                 if (!o_ptr->inscription) continue;
3611
3612                 /* Skip non-choice */
3613                 if (!item_tester_okay(o_ptr)) continue;
3614
3615                 /* Find a '@' */
3616                 s = my_strchr(quark_str(o_ptr->inscription), '@');
3617
3618                 /* Process all tags */
3619                 while (s)
3620                 {
3621                         /* Check the normal tags */
3622                         if (s[1] == tag)
3623                         {
3624                                 /* Save the actual inventory ID */
3625                                 *cp = i;
3626
3627                                 /* Success */
3628                                 return (TRUE);
3629                         }
3630
3631                         /* Find another '@' */
3632                         s = my_strchr(s + 1, '@');
3633                 }
3634         }
3635
3636         /* No such tag */
3637         return (FALSE);
3638 }
3639
3640
3641 /*
3642  * Find the "first" floor object with the given "tag".
3643  *
3644  * A "tag" is a numeral "n" appearing as "@n" anywhere in the
3645  * inscription of an object.  Alphabetical characters don't work as a
3646  * tag in this form.
3647  *
3648  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
3649  * and "x" is the "current" command_cmd code.
3650  */
3651 static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
3652 {
3653         int i;
3654         cptr s;
3655
3656         /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
3657
3658         /* Check every object in the grid */
3659         for (i = 0; i < floor_num && i < 23; i++)
3660         {
3661                 object_type *o_ptr = &o_list[floor_list[i]];
3662
3663                 /* Skip empty inscriptions */
3664                 if (!o_ptr->inscription) continue;
3665
3666                 /* Find a '@' */
3667                 s = my_strchr(quark_str(o_ptr->inscription), '@');
3668
3669                 /* Process all tags */
3670                 while (s)
3671                 {
3672                         /* Check the special tags */
3673                         if ((s[1] == command_cmd) && (s[2] == tag))
3674                         {
3675                                 /* Save the actual floor object ID */
3676                                 *cp = i;
3677
3678                                 /* Success */
3679                                 return (TRUE);
3680                         }
3681
3682                         /* Find another '@' */
3683                         s = my_strchr(s + 1, '@');
3684                 }
3685         }
3686
3687
3688         /**** Find a tag in the form of {@#} (allows only numerals)  ***/
3689
3690         /* Don't allow {@#} with '#' being alphabet */
3691         if (tag < '0' || '9' < tag)
3692         {
3693                 /* No such tag */
3694                 return FALSE;
3695         }
3696
3697         /* Check every object in the grid */
3698         for (i = 0; i < floor_num && i < 23; i++)
3699         {
3700                 object_type *o_ptr = &o_list[floor_list[i]];
3701
3702                 /* Skip empty inscriptions */
3703                 if (!o_ptr->inscription) continue;
3704
3705                 /* Find a '@' */
3706                 s = my_strchr(quark_str(o_ptr->inscription), '@');
3707
3708                 /* Process all tags */
3709                 while (s)
3710                 {
3711                         /* Check the normal tags */
3712                         if (s[1] == tag)
3713                         {
3714                                 /* Save the floor object ID */
3715                                 *cp = i;
3716
3717                                 /* Success */
3718                                 return (TRUE);
3719                         }
3720
3721                         /* Find another '@' */
3722                         s = my_strchr(s + 1, '@');
3723                 }
3724         }
3725
3726         /* No such tag */
3727         return (FALSE);
3728 }
3729
3730
3731 /*
3732  * Move around label characters with correspond tags
3733  */
3734 static void prepare_label_string(char *label, int mode)
3735 {
3736         cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
3737         int  offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
3738         int  i;
3739
3740         /* Prepare normal labels */
3741         strcpy(label, alphabet_chars);
3742
3743         /* Move each label */
3744         for (i = 0; i < 52; i++)
3745         {
3746                 int index;
3747                 char c = alphabet_chars[i];
3748
3749                 /* Find a tag with this label */
3750                 if (get_tag(&index, c, mode))
3751                 {
3752                         /* Delete the overwritten label */
3753                         if (label[i] == c) label[i] = ' ';
3754
3755                         /* Move the label to the place of corresponding tag */
3756                         label[index - offset] = c;
3757                 }
3758         }
3759 }
3760
3761
3762 /*
3763  * Move around label characters with correspond tags (floor version)
3764  */
3765 static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
3766 {
3767         cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
3768         int  i;
3769
3770         /* Prepare normal labels */
3771         strcpy(label, alphabet_chars);
3772
3773         /* Move each label */
3774         for (i = 0; i < 52; i++)
3775         {
3776                 int index;
3777                 char c = alphabet_chars[i];
3778
3779                 /* Find a tag with this label */
3780                 if (get_tag_floor(&index, c, floor_list, floor_num))
3781                 {
3782                         /* Delete the overwritten label */
3783                         if (label[i] == c) label[i] = ' ';
3784
3785                         /* Move the label to the place of corresponding tag */
3786                         label[index] = c;
3787                 }
3788         }
3789 }
3790
3791
3792 /*
3793  * Display the inventory.
3794  *
3795  * Hack -- do not display "trailing" empty slots
3796  */
3797 int show_inven(int target_item)
3798 {
3799         int             i, j, k, l, z = 0;
3800         int             col, cur_col, len;
3801         object_type     *o_ptr;
3802         char            o_name[MAX_NLEN];
3803         char            tmp_val[80];
3804         int             out_index[23];
3805         byte            out_color[23];
3806         char            out_desc[23][MAX_NLEN];
3807         int             target_item_label = 0;
3808         int             wid, hgt;
3809         char            inven_label[52 + 1];
3810
3811         /* Starting column */
3812         col = command_gap;
3813
3814         /* Get size */
3815         Term_get_size(&wid, &hgt);
3816
3817         /* Default "max-length" */
3818         len = wid - col - 1;
3819
3820
3821         /* Find the "final" slot */
3822         for (i = 0; i < INVEN_PACK; i++)
3823         {
3824                 o_ptr = &inventory[i];
3825
3826                 /* Skip non-objects */
3827                 if (!o_ptr->k_idx) continue;
3828
3829                 /* Track */
3830                 z = i + 1;
3831         }
3832
3833         prepare_label_string(inven_label, USE_INVEN);
3834
3835         /* Display the inventory */
3836         for (k = 0, i = 0; i < z; i++)
3837         {
3838                 o_ptr = &inventory[i];
3839
3840                 /* Is this item acceptable? */
3841                 if (!item_tester_okay(o_ptr)) continue;
3842
3843                 /* Describe the object */
3844                 object_desc(o_name, o_ptr, 0);
3845
3846                 /* Save the object index, color, and description */
3847                 out_index[k] = i;
3848                 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3849
3850                 /* Grey out charging items */
3851                 if (o_ptr->timeout)
3852                 {
3853                         out_color[k] = TERM_L_DARK;
3854                 }
3855
3856                 (void)strcpy(out_desc[k], o_name);
3857
3858                 /* Find the predicted "line length" */
3859                 l = strlen(out_desc[k]) + 5;
3860
3861                 /* Be sure to account for the weight */
3862                 if (show_weights) l += 9;
3863
3864                 /* Account for icon if displayed */
3865                 if (show_item_graph)
3866                 {
3867                         l += 2;
3868                         if (use_bigtile) l++;
3869                 }
3870
3871                 /* Maintain the maximum length */
3872                 if (l > len) len = l;
3873
3874                 /* Advance to next "line" */
3875                 k++;
3876         }
3877
3878         /* Find the column to start in */
3879         col = (len > wid - 4) ? 0 : (wid - len - 1);
3880
3881         /* Output each entry */
3882         for (j = 0; j < k; j++)
3883         {
3884                 /* Get the index */
3885                 i = out_index[j];
3886
3887                 /* Get the item */
3888                 o_ptr = &inventory[i];
3889
3890                 /* Clear the line */
3891                 prt("", j + 1, col ? col - 2 : col);
3892
3893                 if (use_menu && target_item)
3894                 {
3895                         if (j == (target_item-1))
3896                         {
3897 #ifdef JP
3898                                 strcpy(tmp_val, "¡Õ");
3899 #else
3900                                 strcpy(tmp_val, "> ");
3901 #endif
3902                                 target_item_label = i;
3903                         }
3904                         else strcpy(tmp_val, "  ");
3905                 }
3906                 else if (i <= INVEN_PACK)
3907                 {
3908                         /* Prepare an index --(-- */
3909                         sprintf(tmp_val, "%c)", inven_label[i]);
3910                 }
3911                 else
3912                 {
3913                         /* Prepare an index --(-- */
3914                         sprintf(tmp_val, "%c)", index_to_label(i));
3915                 }
3916
3917                 /* Clear the line with the (possibly indented) index */
3918                 put_str(tmp_val, j + 1, col);
3919
3920                 cur_col = col + 3;
3921
3922                 /* Display graphics for object, if desired */
3923                 if (show_item_graph)
3924                 {
3925                         byte  a = object_attr(o_ptr);
3926                         char c = object_char(o_ptr);
3927
3928 #ifdef AMIGA
3929                         if (a & 0x80) a |= 0x40;
3930 #endif
3931
3932                         Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3933                         if (use_bigtile) cur_col++;
3934
3935                         cur_col += 2;
3936                 }
3937
3938
3939                 /* Display the entry itself */
3940                 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3941
3942                 /* Display the weight if needed */
3943                 if (show_weights)
3944                 {
3945                         int wgt = o_ptr->weight * o_ptr->number;
3946 #ifdef JP
3947                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
3948 #else
3949                         (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3950 #endif
3951
3952                         prt(tmp_val, j + 1, wid - 9);
3953                 }
3954         }
3955
3956         /* Make a "shadow" below the list (only if needed) */
3957         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3958
3959         /* Save the new column */
3960         command_gap = col;
3961
3962         return target_item_label;
3963 }
3964
3965
3966
3967 /*
3968  * Display the equipment.
3969  */
3970 int show_equip(int target_item)
3971 {
3972         int             i, j, k, l;
3973         int             col, cur_col, len;
3974         object_type     *o_ptr;
3975         char            tmp_val[80];
3976         char            o_name[MAX_NLEN];
3977         int             out_index[23];
3978         byte            out_color[23];
3979         char            out_desc[23][MAX_NLEN];
3980         int             target_item_label = 0;
3981         int             wid, hgt;
3982         char            equip_label[52 + 1];
3983
3984         /* Starting column */
3985         col = command_gap;
3986
3987         /* Get size */
3988         Term_get_size(&wid, &hgt);
3989
3990         /* Maximal length */
3991         len = wid - col - 1;
3992
3993
3994         /* Scan the equipment list */
3995         for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3996         {
3997                 o_ptr = &inventory[i];
3998
3999                 /* Is this item acceptable? */
4000                 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
4001                     (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
4002                      item_tester_no_ryoute)) continue;
4003
4004                 /* Description */
4005                 object_desc(o_name, o_ptr, 0);
4006
4007                 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
4008                 {
4009 #ifdef JP
4010                         (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
4011 #else
4012                         (void)strcpy(out_desc[k],"(wielding with two-hands)");
4013 #endif
4014                         out_color[k] = TERM_WHITE;
4015                 }
4016                 else
4017                 {
4018                         (void)strcpy(out_desc[k], o_name);
4019                         out_color[k] = tval_to_attr[o_ptr->tval % 128];
4020                 }
4021
4022                 out_index[k] = i;
4023                 /* Grey out charging items */
4024                 if (o_ptr->timeout)
4025                 {
4026                         out_color[k] = TERM_L_DARK;
4027                 }
4028
4029                 /* Extract the maximal length (see below) */
4030 #ifdef JP
4031                 l = strlen(out_desc[k]) + (2 + 1);
4032 #else
4033                 l = strlen(out_desc[k]) + (2 + 3);
4034 #endif
4035
4036
4037                 /* Increase length for labels (if needed) */
4038 #ifdef JP
4039                 if (show_labels) l += (7 + 2);
4040 #else
4041                 if (show_labels) l += (14 + 2);
4042 #endif
4043
4044
4045                 /* Increase length for weight (if needed) */
4046                 if (show_weights) l += 9;
4047
4048                 if (show_item_graph) l += 2;
4049
4050                 /* Maintain the max-length */
4051                 if (l > len) len = l;
4052
4053                 /* Advance the entry */
4054                 k++;
4055         }
4056
4057         /* Hack -- Find a column to start in */
4058 #ifdef JP
4059         col = (len > wid - 6) ? 0 : (wid - len - 1);
4060 #else
4061         col = (len > wid - 4) ? 0 : (wid - len - 1);
4062 #endif
4063
4064         prepare_label_string(equip_label, USE_EQUIP);
4065
4066         /* Output each entry */
4067         for (j = 0; j < k; j++)
4068         {
4069                 /* Get the index */
4070                 i = out_index[j];
4071
4072                 /* Get the item */
4073                 o_ptr = &inventory[i];
4074
4075                 /* Clear the line */
4076                 prt("", j + 1, col ? col - 2 : col);
4077
4078                 if (use_menu && target_item)
4079                 {
4080                         if (j == (target_item-1))
4081                         {
4082 #ifdef JP
4083                                 strcpy(tmp_val, "¡Õ");
4084 #else
4085                                 strcpy(tmp_val, "> ");
4086 #endif
4087                                 target_item_label = i;
4088                         }
4089                         else strcpy(tmp_val, "  ");
4090                 }
4091                 else if (i >= INVEN_RARM)
4092                 {
4093                         /* Prepare an index --(-- */
4094                         sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
4095                 }
4096                 else /* Paranoia */
4097                 {
4098                         /* Prepare an index --(-- */
4099                         sprintf(tmp_val, "%c)", index_to_label(i));
4100                 }
4101
4102                 /* Clear the line with the (possibly indented) index */
4103                 put_str(tmp_val, j+1, col);
4104
4105                 cur_col = col + 3;
4106
4107                 /* Display graphics for object, if desired */
4108                 if (show_item_graph)
4109                 {
4110                         byte a = object_attr(o_ptr);
4111                         char c = object_char(o_ptr);
4112
4113 #ifdef AMIGA
4114                         if (a & 0x80) a |= 0x40;
4115 #endif
4116
4117                         Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
4118                         if (use_bigtile) cur_col++;
4119
4120                         cur_col += 2;
4121                 }
4122
4123                 /* Use labels */
4124                 if (show_labels)
4125                 {
4126                         /* Mention the use */
4127 #ifdef JP
4128                         (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
4129 #else
4130                         (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
4131 #endif
4132
4133                         put_str(tmp_val, j+1, cur_col);
4134
4135                         /* Display the entry itself */
4136 #ifdef JP
4137                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
4138 #else
4139                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
4140 #endif
4141                 }
4142
4143                 /* No labels */
4144                 else
4145                 {
4146                         /* Display the entry itself */
4147                         c_put_str(out_color[j], out_desc[j], j+1, cur_col);
4148                 }
4149
4150                 /* Display the weight if needed */
4151                 if (show_weights)
4152                 {
4153                         int wgt = o_ptr->weight * o_ptr->number;
4154 #ifdef JP
4155                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4156 #else
4157                         (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
4158 #endif
4159
4160                         prt(tmp_val, j + 1, wid - 9);
4161                 }
4162         }
4163
4164         /* Make a "shadow" below the list (only if needed) */
4165         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4166
4167         /* Save the new column */
4168         command_gap = col;
4169
4170         return target_item_label;
4171 }
4172
4173
4174
4175
4176 /*
4177  * Flip "inven" and "equip" in any sub-windows
4178  */
4179 void toggle_inven_equip(void)
4180 {
4181         int j;
4182
4183         /* Scan windows */
4184         for (j = 0; j < 8; j++)
4185         {
4186                 /* Unused */
4187                 if (!angband_term[j]) continue;
4188
4189                 /* Flip inven to equip */
4190                 if (window_flag[j] & (PW_INVEN))
4191                 {
4192                         /* Flip flags */
4193                         window_flag[j] &= ~(PW_INVEN);
4194                         window_flag[j] |= (PW_EQUIP);
4195
4196                         /* Window stuff */
4197                         p_ptr->window |= (PW_EQUIP);
4198                 }
4199
4200                 /* Flip inven to equip */
4201                 else if (window_flag[j] & (PW_EQUIP))
4202                 {
4203                         /* Flip flags */
4204                         window_flag[j] &= ~(PW_EQUIP);
4205                         window_flag[j] |= (PW_INVEN);
4206
4207                         /* Window stuff */
4208                         p_ptr->window |= (PW_INVEN);
4209                 }
4210         }
4211 }
4212
4213
4214
4215 /*
4216  * Verify the choice of an item.
4217  *
4218  * The item can be negative to mean "item on floor".
4219  */
4220 static bool verify(cptr prompt, int item)
4221 {
4222         char        o_name[MAX_NLEN];
4223         char        out_val[MAX_NLEN+20];
4224         object_type *o_ptr;
4225
4226
4227         /* Inventory */
4228         if (item >= 0)
4229         {
4230                 o_ptr = &inventory[item];
4231         }
4232
4233         /* Floor */
4234         else
4235         {
4236                 o_ptr = &o_list[0 - item];
4237         }
4238
4239         /* Describe */
4240         object_desc(o_name, o_ptr, 0);
4241
4242         /* Prompt */
4243 #ifdef JP
4244 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
4245 #else
4246         (void)sprintf(out_val, "%s %s? ", prompt, o_name);
4247 #endif
4248
4249
4250         /* Query */
4251         return (get_check(out_val));
4252 }
4253
4254
4255 /*
4256  * Hack -- allow user to "prevent" certain choices
4257  *
4258  * The item can be negative to mean "item on floor".
4259  */
4260 static bool get_item_allow(int item)
4261 {
4262         cptr s;
4263
4264         object_type *o_ptr;
4265
4266         if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
4267
4268         /* Inventory */
4269         if (item >= 0)
4270         {
4271                 o_ptr = &inventory[item];
4272         }
4273
4274         /* Floor */
4275         else
4276         {
4277                 o_ptr = &o_list[0 - item];
4278         }
4279
4280         /* No inscription */
4281         if (!o_ptr->inscription) return (TRUE);
4282
4283         /* Find a '!' */
4284         s = my_strchr(quark_str(o_ptr->inscription), '!');
4285
4286         /* Process preventions */
4287         while (s)
4288         {
4289                 /* Check the "restriction" */
4290                 if ((s[1] == command_cmd) || (s[1] == '*'))
4291                 {
4292                         /* Verify the choice */
4293 #ifdef JP
4294 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
4295 #else
4296                         if (!verify("Really try", item)) return (FALSE);
4297 #endif
4298
4299                 }
4300
4301                 /* Find another '!' */
4302                 s = my_strchr(s + 1, '!');
4303         }
4304
4305         /* Allow it */
4306         return (TRUE);
4307 }
4308
4309
4310
4311 /*
4312  * Auxiliary function for "get_item()" -- test an index
4313  */
4314 static bool get_item_okay(int i)
4315 {
4316         /* Illegal items */
4317         if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
4318
4319         if (select_ring_slot) return is_ring_slot(i);
4320
4321         /* Verify the item */
4322         if (!item_tester_okay(&inventory[i])) return (FALSE);
4323
4324         /* Assume okay */
4325         return (TRUE);
4326 }
4327
4328
4329
4330 /*
4331  * Determine whether get_item() can get some item or not
4332  * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
4333  */
4334 bool can_get_item(void)
4335 {
4336         int j, floor_list[23], floor_num = 0;
4337
4338         for (j = 0; j < INVEN_TOTAL; j++)
4339                 if (item_tester_okay(&inventory[j]))
4340                         return TRUE;
4341
4342         floor_num = scan_floor(floor_list, py, px, 0x03);
4343         if (floor_num)
4344                 return TRUE;
4345
4346         return FALSE;
4347 }
4348
4349 /*
4350  * Let the user select an item, save its "index"
4351  *
4352  * Return TRUE only if an acceptable item was chosen by the user.
4353  *
4354  * The selected item must satisfy the "item_tester_hook()" function,
4355  * if that hook is set, and the "item_tester_tval", if that value is set.
4356  *
4357  * All "item_tester" restrictions are cleared before this function returns.
4358  *
4359  * The user is allowed to choose acceptable items from the equipment,
4360  * inventory, or floor, respectively, if the proper flag was given,
4361  * and there are any acceptable items in that location.
4362  *
4363  * The equipment or inventory are displayed (even if no acceptable
4364  * items are in that location) if the proper flag was given.
4365  *
4366  * If there are no acceptable items available anywhere, and "str" is
4367  * not NULL, then it will be used as the text of a warning message
4368  * before the function returns.
4369  *
4370  * Note that the user must press "-" to specify the item on the floor,
4371  * and there is no way to "examine" the item on the floor, while the
4372  * use of "capital" letters will "examine" an inventory/equipment item,
4373  * and prompt for its use.
4374  *
4375  * If a legal item is selected from the inventory, we save it in "cp"
4376  * directly (0 to 35), and return TRUE.
4377  *
4378  * If a legal item is selected from the floor, we save it in "cp" as
4379  * a negative (-1 to -511), and return TRUE.
4380  *
4381  * If no item is available, we do nothing to "cp", and we display a
4382  * warning message, using "str" if available, and return FALSE.
4383  *
4384  * If no item is selected, we do nothing to "cp", and return FALSE.
4385  *
4386  * Global "p_ptr->command_new" is used when viewing the inventory or equipment
4387  * to allow the user to enter a command while viewing those screens, and
4388  * also to induce "auto-enter" of stores, and other such stuff.
4389  *
4390  * Global "p_ptr->command_see" may be set before calling this function to start
4391  * out in "browse" mode.  It is cleared before this function returns.
4392  *
4393  * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
4394  * If it is TRUE then we are viewing inventory, else equipment.
4395  *
4396  * We always erase the prompt when we are done, leaving a blank line,
4397  * or a warning message, if appropriate, if no items are available.
4398  */
4399 bool get_item(int *cp, cptr pmt, cptr str, int mode)
4400 {
4401         s16b this_o_idx, next_o_idx = 0;
4402
4403         char which = ' ';
4404
4405         int j, k, i1, i2, e1, e2;
4406
4407         bool done, item;
4408
4409         bool oops = FALSE;
4410
4411         bool equip = FALSE;
4412         bool inven = FALSE;
4413         bool floor = FALSE;
4414
4415         bool allow_floor = FALSE;
4416
4417         bool toggle = FALSE;
4418
4419         char tmp_val[160];
4420         char out_val[160];
4421
4422         /* See cmd5.c */
4423         extern bool select_the_force;
4424
4425         int menu_line = (use_menu ? 1 : 0);
4426         int max_inven = 0;
4427         int max_equip = 0;
4428
4429 #ifdef ALLOW_REPEAT
4430
4431         static char prev_tag = '\0';
4432         char cur_tag = '\0';
4433
4434 #endif /* ALLOW_REPEAT */
4435
4436 #ifdef ALLOW_EASY_FLOOR /* TNB */
4437
4438         if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
4439
4440 #endif /* ALLOW_EASY_FLOOR -- TNB */
4441
4442         /* Extract args */
4443         if (mode & USE_EQUIP) equip = TRUE;
4444         if (mode & USE_INVEN) inven = TRUE;
4445         if (mode & USE_FLOOR) floor = TRUE;
4446
4447 #ifdef ALLOW_REPEAT
4448
4449         /* Get the item index */
4450         if (repeat_pull(cp))
4451         {
4452                 /* the_force */
4453                 if (select_the_force && (*cp == INVEN_FORCE))
4454                 {
4455                         item_tester_tval = 0;
4456                         item_tester_hook = NULL;
4457                         command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4458                         return (TRUE);
4459                 }
4460
4461                 /* Floor item? */
4462                 else if (floor && (*cp < 0))
4463                 {
4464                         object_type *o_ptr;
4465
4466                         /* Special index */
4467                         k = 0 - (*cp);
4468
4469                         /* Acquire object */
4470                         o_ptr = &o_list[k];
4471
4472                         /* Validate the item */
4473                         if (item_tester_okay(o_ptr))
4474                         {
4475                                 /* Forget restrictions */
4476                                 item_tester_tval = 0;
4477                                 item_tester_hook = NULL;
4478                                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4479
4480                                 /* Success */
4481                                 return TRUE;
4482                         }
4483                 }
4484
4485                 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
4486                          (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
4487                 {
4488                         if (prev_tag && command_cmd)
4489                         {
4490                                 /* Look up the tag and validate the item */
4491                                 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
4492                                 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
4493                                 else if (!get_item_okay(k)) /* Reject */;
4494                                 else
4495                                 {
4496                                         /* Accept that choice */
4497                                         (*cp) = k;
4498
4499                                         /* Forget restrictions */
4500                                         item_tester_tval = 0;
4501                                         item_tester_hook = NULL;
4502                                         command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4503
4504                                         /* Success */
4505                                         return TRUE;
4506                                 }
4507
4508                                 prev_tag = '\0'; /* prev_tag is no longer effective */
4509                         }
4510
4511                         /* Verify the item */
4512                         else if (get_item_okay(*cp))
4513                         {
4514                                 /* Forget restrictions */
4515                                 item_tester_tval = 0;
4516                                 item_tester_hook = NULL;
4517                                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
4518
4519                                 /* Success */
4520                                 return TRUE;
4521                         }
4522                 }
4523         }
4524
4525 #endif /* ALLOW_REPEAT */
4526
4527
4528         /* Paranoia XXX XXX XXX */
4529         msg_print(NULL);
4530
4531
4532         /* Not done */
4533         done = FALSE;
4534
4535         /* No item selected */
4536         item = FALSE;
4537
4538
4539         /* Full inventory */
4540         i1 = 0;
4541         i2 = INVEN_PACK - 1;
4542
4543         /* Forbid inventory */
4544         if (!inven) i2 = -1;
4545         else if (use_menu)
4546         {
4547                 for (j = 0; j < INVEN_PACK; j++)
4548                         if (item_tester_okay(&inventory[j])) max_inven++;
4549         }
4550
4551         /* Restrict inventory indexes */
4552         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
4553         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
4554
4555
4556         /* Full equipment */
4557         e1 = INVEN_RARM;
4558         e2 = INVEN_TOTAL - 1;
4559
4560         /* Forbid equipment */
4561         if (!equip) e2 = -1;
4562         else if (use_menu)
4563         {
4564                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
4565                         if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
4566                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
4567         }
4568
4569         /* Restrict equipment indexes */
4570         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
4571         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
4572
4573         if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
4574         {
4575                 if (p_ptr->migite)
4576                 {
4577                         if (e2 < INVEN_LARM) e2 = INVEN_LARM;
4578                 }
4579                 else if (p_ptr->hidarite) e1 = INVEN_RARM;
4580         }
4581
4582
4583         /* Restrict floor usage */
4584         if (floor)
4585         {
4586                 /* Scan all objects in the grid */
4587                 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4588                 {
4589                         object_type *o_ptr;
4590
4591                         /* Acquire object */
4592                         o_ptr = &o_list[this_o_idx];
4593
4594                         /* Acquire next object */
4595                         next_o_idx = o_ptr->next_o_idx;
4596
4597                         /* Accept the item on the floor if legal */
4598                         if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
4599                 }
4600         }
4601
4602         /* Require at least one legal choice */
4603         if (!allow_floor && (i1 > i2) && (e1 > e2))
4604         {
4605                 /* Cancel p_ptr->command_see */
4606                 command_see = FALSE;
4607
4608                 /* Oops */
4609                 oops = TRUE;
4610
4611                 /* Done */
4612                 done = TRUE;
4613
4614                 if (select_the_force) {
4615                     *cp = INVEN_FORCE;
4616                     item = TRUE;
4617                 }
4618         }
4619
4620         /* Analyze choices */
4621         else
4622         {
4623                 /* Hack -- Start on equipment if requested */
4624                 if (command_see && command_wrk && equip)
4625                 {
4626                         command_wrk = TRUE;
4627                 }
4628
4629                 /* Use inventory if allowed */
4630                 else if (inven)
4631                 {
4632                         command_wrk = FALSE;
4633                 }
4634
4635                 /* Use equipment if allowed */
4636                 else if (equip)
4637                 {
4638                         command_wrk = TRUE;
4639                 }
4640
4641                 /* Use inventory for floor */
4642                 else
4643                 {
4644                         command_wrk = FALSE;
4645                 }
4646         }
4647
4648
4649         /*
4650          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
4651          */
4652         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
4653
4654         /* Hack -- start out in "display" mode */
4655         if (command_see)
4656         {
4657                 /* Save screen */
4658                 screen_save();
4659         }
4660
4661
4662         /* Repeat until done */
4663         while (!done)
4664         {
4665                 int get_item_label = 0;
4666
4667                 /* Show choices */
4668                 int ni = 0;
4669                 int ne = 0;
4670
4671                 /* Scan windows */
4672                 for (j = 0; j < 8; j++)
4673                 {
4674                         /* Unused */
4675                         if (!angband_term[j]) continue;
4676
4677                         /* Count windows displaying inven */
4678                         if (window_flag[j] & (PW_INVEN)) ni++;
4679
4680                         /* Count windows displaying equip */
4681                         if (window_flag[j] & (PW_EQUIP)) ne++;
4682                 }
4683
4684                 /* Toggle if needed */
4685                 if ((command_wrk && ni && !ne) ||
4686                     (!command_wrk && !ni && ne))
4687                 {
4688                         /* Toggle */
4689                         toggle_inven_equip();
4690
4691                         /* Track toggles */
4692                         toggle = !toggle;
4693                 }
4694
4695                 /* Update */
4696                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4697
4698                 /* Redraw windows */
4699                 window_stuff();
4700
4701
4702                 /* Inventory screen */
4703                 if (!command_wrk)
4704                 {
4705                         /* Redraw if needed */
4706                         if (command_see) get_item_label = show_inven(menu_line);
4707                 }
4708
4709                 /* Equipment screen */
4710                 else
4711                 {
4712                         /* Redraw if needed */
4713                         if (command_see) get_item_label = show_equip(menu_line);
4714                 }
4715
4716                 /* Viewing inventory */
4717                 if (!command_wrk)
4718                 {
4719                         /* Begin the prompt */
4720 #ifdef JP
4721                         sprintf(out_val, "»ý¤Áʪ:");
4722 #else
4723                         sprintf(out_val, "Inven:");
4724 #endif
4725
4726                         /* Some legal items */
4727                         if ((i1 <= i2) && !use_menu)
4728                         {
4729                                 /* Build the prompt */
4730 #ifdef JP
4731                                 sprintf(tmp_val, "%c-%c,'(',')',",
4732 #else
4733                                 sprintf(tmp_val, " %c-%c,'(',')',",
4734 #endif
4735                                         index_to_label(i1), index_to_label(i2));
4736
4737                                 /* Append */
4738                                 strcat(out_val, tmp_val);
4739                         }
4740
4741                         /* Indicate ability to "view" */
4742 #ifdef JP
4743                         if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4744 #else
4745                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
4746 #endif
4747
4748                         /* Append */
4749 #ifdef JP
4750                         if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
4751 #else
4752                         if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
4753 #endif
4754                 }
4755
4756                 /* Viewing equipment */
4757                 else
4758                 {
4759                         /* Begin the prompt */
4760 #ifdef JP
4761                         sprintf(out_val, "ÁõÈ÷ÉÊ:");
4762 #else
4763                         sprintf(out_val, "Equip:");
4764 #endif
4765
4766                         /* Some legal items */
4767                         if ((e1 <= e2) && !use_menu)
4768                         {
4769                                 /* Build the prompt */
4770 #ifdef JP
4771                                 sprintf(tmp_val, "%c-%c,'(',')',",
4772 #else
4773                                 sprintf(tmp_val, " %c-%c,'(',')',",
4774 #endif
4775                                         index_to_label(e1), index_to_label(e2));
4776
4777                                 /* Append */
4778                                 strcat(out_val, tmp_val);
4779                         }
4780
4781                         /* Indicate ability to "view" */
4782 #ifdef JP
4783                         if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
4784 #else
4785                         if (!command_see) strcat(out_val, " * to see,");
4786 #endif
4787
4788                         /* Append */
4789 #ifdef JP
4790                         if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
4791 #else
4792                         if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
4793 #endif
4794                 }
4795
4796                 /* Indicate legality of the "floor" item */
4797 #ifdef JP
4798                 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
4799                 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
4800 #else
4801                 if (allow_floor) strcat(out_val, " - for floor,");
4802                 if (select_the_force) strcat(out_val, " w for the Force,");
4803 #endif
4804
4805                 /* Finish the prompt */
4806                 strcat(out_val, " ESC");
4807
4808                 /* Build the prompt */
4809                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
4810
4811                 /* Show the prompt */
4812                 prt(tmp_val, 0, 0);
4813
4814                 /* Get a key */
4815                 which = inkey();
4816
4817                 if (use_menu)
4818                 {
4819                 int max_line = (command_wrk ? max_equip : max_inven);
4820                 switch (which)
4821                 {
4822                         case ESCAPE:
4823                         case 'z':
4824                         case 'Z':
4825                         case '0':
4826                         {
4827                                 done = TRUE;
4828                                 break;
4829                         }
4830
4831                         case '8':
4832                         case 'k':
4833                         case 'K':
4834                         {
4835                                 menu_line += (max_line - 1);
4836                                 break;
4837                         }
4838
4839                         case '2':
4840                         case 'j':
4841                         case 'J':
4842                         {
4843                                 menu_line++;
4844                                 break;
4845                         }
4846
4847                         case '4':
4848                         case '6':
4849                         case 'h':
4850                         case 'H':
4851                         case 'l':
4852                         case 'L':
4853                         {
4854                                 /* Verify legality */
4855                                 if (!inven || !equip)
4856                                 {
4857                                         bell();
4858                                         break;
4859                                 }
4860
4861                                 /* Hack -- Fix screen */
4862                                 if (command_see)
4863                                 {
4864                                         /* Load screen */
4865                                         screen_load();
4866
4867                                         /* Save screen */
4868                                         screen_save();
4869                                 }
4870
4871                                 /* Switch inven/equip */
4872                                 command_wrk = !command_wrk;
4873                                 max_line = (command_wrk ? max_equip : max_inven);
4874                                 if (menu_line > max_line) menu_line = max_line;
4875
4876                                 /* Need to redraw */
4877                                 break;
4878                         }
4879
4880                         case 'x':
4881                         case 'X':
4882                         case '\r':
4883                         case '\n':
4884                         {
4885                                 if (command_wrk == USE_FLOOR)
4886                                 {
4887                                         /* Special index */
4888                                         (*cp) = -get_item_label;
4889                                 }
4890                                 else
4891                                 {
4892                                         /* Validate the item */
4893                                         if (!get_item_okay(get_item_label))
4894                                         {
4895                                                 bell();
4896                                                 break;
4897                                         }
4898
4899                                         /* Allow player to "refuse" certain actions */
4900                                         if (!get_item_allow(get_item_label))
4901                                         {
4902                                                 done = TRUE;
4903                                                 break;
4904                                         }
4905
4906                                         /* Accept that choice */
4907                                         (*cp) = get_item_label;
4908                                 }
4909
4910                                 item = TRUE;
4911                                 done = TRUE;
4912                                 break;
4913                         }
4914                         case 'w':
4915                         {
4916                                 if (select_the_force) {
4917                                         *cp = INVEN_FORCE;
4918                                         item = TRUE;
4919                                         done = TRUE;
4920                                         break;
4921                                 }
4922                         }
4923                 }
4924                 if (menu_line > max_line) menu_line -= max_line;
4925                 }
4926                 else
4927                 {
4928                 /* Parse it */
4929                 switch (which)
4930                 {
4931                         case ESCAPE:
4932                         {
4933                                 done = TRUE;
4934                                 break;
4935                         }
4936
4937                         case '*':
4938                         case '?':
4939                         case ' ':
4940                         {
4941                                 /* Hide the list */
4942                                 if (command_see)
4943                                 {
4944                                         /* Flip flag */
4945                                         command_see = FALSE;
4946
4947                                         /* Load screen */
4948                                         screen_load();
4949                                 }
4950
4951                                 /* Show the list */
4952                                 else
4953                                 {
4954                                         /* Save screen */
4955                                         screen_save();
4956
4957                                         /* Flip flag */
4958                                         command_see = TRUE;
4959                                 }
4960                                 break;
4961                         }
4962
4963                         case '/':
4964                         {
4965                                 /* Verify legality */
4966                                 if (!inven || !equip)
4967                                 {
4968                                         bell();
4969                                         break;
4970                                 }
4971
4972                                 /* Hack -- Fix screen */
4973                                 if (command_see)
4974                                 {
4975                                         /* Load screen */
4976                                         screen_load();
4977
4978                                         /* Save screen */
4979                                         screen_save();
4980                                 }
4981
4982                                 /* Switch inven/equip */
4983                                 command_wrk = !command_wrk;
4984
4985                                 /* Need to redraw */
4986                                 break;
4987                         }
4988
4989                         case '-':
4990                         {
4991                                 /* Use floor item */
4992                                 if (allow_floor)
4993                                 {
4994                                         /* Scan all objects in the grid */
4995                                         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
4996                                         {
4997                                                 object_type *o_ptr;
4998
4999                                                 /* Acquire object */
5000                                                 o_ptr = &o_list[this_o_idx];
5001
5002                                                 /* Acquire next object */
5003                                                 next_o_idx = o_ptr->next_o_idx;
5004
5005                                                 /* Validate the item */
5006                                                 if (!item_tester_okay(o_ptr)) continue;
5007
5008                                                 /* Special index */
5009                                                 k = 0 - this_o_idx;
5010
5011                                                 /* Verify the item (if required) */
5012 #ifdef JP
5013 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
5014 #else
5015                                                 if (other_query_flag && !verify("Try", k)) continue;
5016 #endif
5017
5018
5019                                                 /* Allow player to "refuse" certain actions */
5020                                                 if (!get_item_allow(k)) continue;
5021
5022                                                 /* Accept that choice */
5023                                                 (*cp) = k;
5024                                                 item = TRUE;
5025                                                 done = TRUE;
5026                                                 break;
5027                                         }
5028
5029                                         /* Outer break */
5030                                         if (done) break;
5031                                 }
5032
5033                                 /* Oops */
5034                                 bell();
5035                                 break;
5036                         }
5037
5038                         case '0':
5039                         case '1': case '2': case '3':
5040                         case '4': case '5': case '6':
5041                         case '7': case '8': case '9':
5042                         {
5043                                 /* Look up the tag */
5044                                 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
5045                                 {
5046                                         bell();
5047                                         break;
5048                                 }
5049
5050                                 /* Hack -- Validate the item */
5051                                 if ((k < INVEN_RARM) ? !inven : !equip)
5052                                 {
5053                                         bell();
5054                                         break;
5055                                 }
5056
5057                                 /* Validate the item */
5058                                 if (!get_item_okay(k))
5059                                 {
5060                                         bell();
5061                                         break;
5062                                 }
5063
5064                                 /* Allow player to "refuse" certain actions */
5065                                 if (!get_item_allow(k))
5066                                 {
5067                                         done = TRUE;
5068                                         break;
5069                                 }
5070
5071                                 /* Accept that choice */
5072                                 (*cp) = k;
5073                                 item = TRUE;
5074                                 done = TRUE;
5075 #ifdef ALLOW_REPEAT
5076                                 cur_tag = which;
5077 #endif /* ALLOW_REPEAT */
5078                                 break;
5079                         }
5080
5081 #if 0
5082                         case '\n':
5083                         case '\r':
5084                         {
5085                                 /* Choose "default" inventory item */
5086                                 if (!command_wrk)
5087                                 {
5088                                         k = ((i1 == i2) ? i1 : -1);
5089                                 }
5090
5091                                 /* Choose "default" equipment item */
5092                                 else
5093                                 {
5094                                         k = ((e1 == e2) ? e1 : -1);
5095                                 }
5096
5097                                 /* Validate the item */
5098                                 if (!get_item_okay(k))
5099                                 {
5100                                         bell();
5101                                         break;
5102                                 }
5103
5104                                 /* Allow player to "refuse" certain actions */
5105                                 if (!get_item_allow(k))
5106                                 {
5107                                         done = TRUE;
5108                                         break;
5109                                 }
5110
5111                                 /* Accept that choice */
5112                                 (*cp) = k;
5113                                 item = TRUE;
5114                                 done = TRUE;
5115                                 break;
5116                         }
5117 #endif
5118
5119                         case 'w':
5120                         {
5121                                 if (select_the_force) {
5122                                         *cp = INVEN_FORCE;
5123                                         item = TRUE;
5124                                         done = TRUE;
5125                                         break;
5126                                 }
5127
5128                                 /* Fall through */
5129                         }
5130
5131                         default:
5132                         {
5133                                 int ver;
5134                                 bool not_found = FALSE;
5135
5136                                 /* Look up the alphabetical tag */
5137                                 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
5138                                 {
5139                                         not_found = TRUE;
5140                                 }
5141
5142                                 /* Hack -- Validate the item */
5143                                 else if ((k < INVEN_RARM) ? !inven : !equip)
5144                                 {
5145                                         not_found = TRUE;
5146                                 }
5147
5148                                 /* Validate the item */
5149                                 else if (!get_item_okay(k))
5150                                 {
5151                                         not_found = TRUE;
5152                                 }
5153
5154                                 if (!not_found)
5155                                 {
5156                                         /* Accept that choice */
5157                                         (*cp) = k;
5158                                         item = TRUE;
5159                                         done = TRUE;
5160 #ifdef ALLOW_REPEAT
5161                                         cur_tag = which;
5162 #endif /* ALLOW_REPEAT */
5163                                         break;
5164                                 }
5165
5166                                 /* Extract "query" setting */
5167                                 ver = isupper(which);
5168                                 which = tolower(which);
5169
5170                                 /* Convert letter to inventory index */
5171                                 if (!command_wrk)
5172                                 {
5173                                         if (which == '(') k = i1;
5174                                         else if (which == ')') k = i2;
5175                                         else k = label_to_inven(which);
5176                                 }
5177
5178                                 /* Convert letter to equipment index */
5179                                 else
5180                                 {
5181                                         if (which == '(') k = e1;
5182                                         else if (which == ')') k = e2;
5183                                         else k = label_to_equip(which);
5184                                 }
5185
5186                                 /* Validate the item */
5187                                 if (!get_item_okay(k))
5188                                 {
5189                                         bell();
5190                                         break;
5191                                 }
5192
5193                                 /* Verify the item */
5194 #ifdef JP
5195 if (ver && !verify("ËÜÅö¤Ë", k))
5196 #else
5197                                 if (ver && !verify("Try", k))
5198 #endif
5199
5200                                 {
5201                                         done = TRUE;
5202                                         break;
5203                                 }
5204
5205                                 /* Allow player to "refuse" certain actions */
5206                                 if (!get_item_allow(k))
5207                                 {
5208                                         done = TRUE;
5209                                         break;
5210                                 }
5211
5212                                 /* Accept that choice */
5213                                 (*cp) = k;
5214                                 item = TRUE;
5215                                 done = TRUE;
5216                                 break;
5217                         }
5218                 }
5219                 }
5220         }
5221
5222
5223         /* Fix the screen if necessary */
5224         if (command_see)
5225         {
5226                 /* Load screen */
5227                 screen_load();
5228
5229                 /* Hack -- Cancel "display" */
5230                 command_see = FALSE;
5231         }
5232
5233
5234         /* Forget the item_tester_tval restriction */
5235         item_tester_tval = 0;
5236
5237         item_tester_no_ryoute = FALSE;
5238
5239         /* Forget the item_tester_hook restriction */
5240         item_tester_hook = NULL;
5241
5242
5243         /* Clean up  'show choices' */
5244         /* Toggle again if needed */
5245         if (toggle) toggle_inven_equip();
5246
5247         /* Update */
5248         p_ptr->window |= (PW_INVEN | PW_EQUIP);
5249
5250         /* Window stuff */
5251         window_stuff();
5252
5253
5254         /* Clear the prompt line */
5255         prt("", 0, 0);
5256
5257         /* Warning if needed */
5258         if (oops && str) msg_print(str);
5259
5260         if (item)
5261         {
5262 #ifdef ALLOW_REPEAT
5263                 repeat_push(*cp);
5264                 if (command_cmd) prev_tag = cur_tag;
5265 #endif /* ALLOW_REPEAT */
5266
5267                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5268         }
5269
5270         /* Result */
5271         return (item);
5272 }
5273
5274
5275 #ifdef ALLOW_EASY_FLOOR
5276
5277 /*
5278  * scan_floor --
5279  *
5280  * Return a list of o_list[] indexes of items at the given cave
5281  * location. Valid flags are:
5282  *
5283  *              mode & 0x01 -- Item tester
5284  *              mode & 0x02 -- Marked items only
5285  *              mode & 0x04 -- Stop after first
5286  */
5287 int scan_floor(int *items, int y, int x, int mode)
5288 {
5289         int this_o_idx, next_o_idx;
5290
5291         int num = 0;
5292
5293         /* Sanity */
5294         if (!in_bounds(y, x)) return 0;
5295
5296         /* Scan all objects in the grid */
5297         for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
5298         {
5299                 object_type *o_ptr;
5300
5301                 /* Acquire object */
5302                 o_ptr = &o_list[this_o_idx];
5303
5304                 /* Acquire next object */
5305                 next_o_idx = o_ptr->next_o_idx;
5306
5307                 /* Item tester */
5308                 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
5309
5310                 /* Marked */
5311                 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
5312
5313                 /* Accept this item */
5314                 /* XXX Hack -- Enforce limit */
5315                 if (num < 23)
5316                         items[num] = this_o_idx;
5317
5318                 num++;
5319
5320                 /* Only one */
5321                 if (mode & 0x04) break;
5322         }
5323
5324         /* Result */
5325         return num;
5326 }
5327
5328
5329 /*
5330  * Display a list of the items on the floor at the given location.
5331  */
5332 int show_floor(int target_item, int y, int x, int *min_width)
5333 {
5334         int i, j, k, l;
5335         int col, len;
5336
5337         object_type *o_ptr;
5338
5339         char o_name[MAX_NLEN];
5340
5341         char tmp_val[80];
5342
5343         int out_index[23];
5344         byte out_color[23];
5345         char out_desc[23][MAX_NLEN];
5346         int target_item_label = 0;
5347
5348         int floor_list[23], floor_num;
5349         int wid, hgt;
5350         char floor_label[52 + 1];
5351
5352         bool dont_need_to_show_weights = TRUE;
5353
5354         /* Get size */
5355         Term_get_size(&wid, &hgt);
5356
5357         /* Default length */
5358         len = MAX((*min_width), 20);
5359
5360
5361         /* Scan for objects in the grid, using item_tester_okay() */
5362         floor_num = scan_floor(floor_list, y, x, 0x03);
5363
5364         /* Display the floor objects */
5365         for (k = 0, i = 0; i < floor_num && i < 23; i++)
5366         {
5367                 o_ptr = &o_list[floor_list[i]];
5368
5369                 /* Describe the object */
5370                 object_desc(o_name, o_ptr, 0);
5371
5372                 /* Save the index */
5373                 out_index[k] = i;
5374
5375                 /* Acquire inventory color */
5376                 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
5377
5378                 /* Save the object description */
5379                 strcpy(out_desc[k], o_name);
5380
5381                 /* Find the predicted "line length" */
5382                 l = strlen(out_desc[k]) + 5;
5383
5384                 /* Be sure to account for the weight */
5385                 if (show_weights) l += 9;
5386
5387                 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
5388
5389                 /* Maintain the maximum length */
5390                 if (l > len) len = l;
5391
5392                 /* Advance to next "line" */
5393                 k++;
5394         }
5395
5396         if (show_weights && dont_need_to_show_weights) len -= 9;
5397
5398         /* Save width */
5399         *min_width = len;
5400
5401         /* Find the column to start in */
5402         col = (len > wid - 4) ? 0 : (wid - len - 1);
5403
5404         prepare_label_string_floor(floor_label, floor_list, floor_num);
5405
5406         /* Output each entry */
5407         for (j = 0; j < k; j++)
5408         {
5409                 /* Get the index */
5410                 i = floor_list[out_index[j]];
5411
5412                 /* Get the item */
5413                 o_ptr = &o_list[i];
5414
5415                 /* Clear the line */
5416                 prt("", j + 1, col ? col - 2 : col);
5417
5418                 if (use_menu && target_item)
5419                 {
5420                         if (j == (target_item-1))
5421                         {
5422 #ifdef JP
5423                                 strcpy(tmp_val, "¡Õ");
5424 #else
5425                                 strcpy(tmp_val, "> ");
5426 #endif
5427                                 target_item_label = i;
5428                         }
5429                         else strcpy(tmp_val, "   ");
5430                 }
5431                 else
5432                 {
5433                         /* Prepare an index --(-- */
5434                         sprintf(tmp_val, "%c)", floor_label[j]);
5435                 }
5436
5437                 /* Clear the line with the (possibly indented) index */
5438                 put_str(tmp_val, j + 1, col);
5439
5440                 /* Display the entry itself */
5441                 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
5442
5443                 /* Display the weight if needed */
5444                 if (show_weights && (o_ptr->tval != TV_GOLD))
5445                 {
5446                         int wgt = o_ptr->weight * o_ptr->number;
5447 #ifdef JP
5448                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
5449 #else
5450                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
5451 #endif
5452
5453                         prt(tmp_val, j + 1, wid - 9);
5454                 }
5455         }
5456
5457         /* Make a "shadow" below the list (only if needed) */
5458         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
5459
5460         return target_item_label;
5461 }
5462
5463 /*
5464  * This version of get_item() is called by get_item() when
5465  * the easy_floor is on.
5466  */
5467 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
5468 {
5469         char n1 = ' ', n2 = ' ', which = ' ';
5470
5471         int j, k, i1, i2, e1, e2;
5472
5473         bool done, item;
5474
5475         bool oops = FALSE;
5476
5477         /* Extract args */
5478         bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
5479         bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
5480         bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
5481
5482         bool allow_equip = FALSE;
5483         bool allow_inven = FALSE;
5484         bool allow_floor = FALSE;
5485
5486         bool toggle = FALSE;
5487
5488         char tmp_val[160];
5489         char out_val[160];
5490
5491         int floor_num, floor_list[23], floor_top = 0;
5492         int min_width = 0;
5493
5494         extern bool select_the_force;
5495
5496         int menu_line = (use_menu ? 1 : 0);
5497         int max_inven = 0;
5498         int max_equip = 0;
5499
5500 #ifdef ALLOW_REPEAT
5501
5502         static char prev_tag = '\0';
5503         char cur_tag = '\0';
5504
5505         /* Get the item index */
5506         if (repeat_pull(cp))
5507         {
5508                 /* the_force */
5509                 if (select_the_force && (*cp == INVEN_FORCE))
5510                 {
5511                         item_tester_tval = 0;
5512                         item_tester_hook = NULL;
5513                         command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5514                         return (TRUE);
5515                 }
5516
5517                 /* Floor item? */
5518                 else if (floor && (*cp < 0))
5519                 {
5520                         if (prev_tag && command_cmd)
5521                         {
5522                                 /* Scan all objects in the grid */
5523                                 floor_num = scan_floor(floor_list, py, px, 0x03);
5524
5525                                 /* Look up the tag */
5526                                 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
5527                                 {
5528                                         /* Accept that choice */
5529                                         (*cp) = 0 - floor_list[k];
5530
5531                                         /* Forget restrictions */
5532                                         item_tester_tval = 0;
5533                                         item_tester_hook = NULL;
5534                                         command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5535
5536                                         /* Success */
5537                                         return TRUE;
5538                                 }
5539
5540                                 prev_tag = '\0'; /* prev_tag is no longer effective */
5541                         }
5542
5543                         /* Validate the item */
5544                         else if (item_tester_okay(&o_list[0 - (*cp)]))
5545                         {
5546                                 /* Forget restrictions */
5547                                 item_tester_tval = 0;
5548                                 item_tester_hook = NULL;
5549                                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5550
5551                                 /* Success */
5552                                 return TRUE;
5553                         }
5554                 }
5555
5556                 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
5557                          (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
5558                 {
5559                         if (prev_tag && command_cmd)
5560                         {
5561                                 /* Look up the tag and validate the item */
5562                                 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
5563                                 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
5564                                 else if (!get_item_okay(k)) /* Reject */;
5565                                 else
5566                                 {
5567                                         /* Accept that choice */
5568                                         (*cp) = k;
5569
5570                                         /* Forget restrictions */
5571                                         item_tester_tval = 0;
5572                                         item_tester_hook = NULL;
5573                                         command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5574
5575                                         /* Success */
5576                                         return TRUE;
5577                                 }
5578
5579                                 prev_tag = '\0'; /* prev_tag is no longer effective */
5580                         }
5581
5582                         /* Verify the item */
5583                         else if (get_item_okay(*cp))
5584                         {
5585                                 /* Forget restrictions */
5586                                 item_tester_tval = 0;
5587                                 item_tester_hook = NULL;
5588                                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
5589
5590                                 /* Success */
5591                                 return TRUE;
5592                         }
5593                 }
5594         }
5595
5596 #endif /* ALLOW_REPEAT */
5597
5598
5599         /* Paranoia XXX XXX XXX */
5600         msg_print(NULL);
5601
5602
5603         /* Not done */
5604         done = FALSE;
5605
5606         /* No item selected */
5607         item = FALSE;
5608
5609
5610         /* Full inventory */
5611         i1 = 0;
5612         i2 = INVEN_PACK - 1;
5613
5614         /* Forbid inventory */
5615         if (!inven) i2 = -1;
5616         else if (use_menu)
5617         {
5618                 for (j = 0; j < INVEN_PACK; j++)
5619                         if (item_tester_okay(&inventory[j])) max_inven++;
5620         }
5621
5622         /* Restrict inventory indexes */
5623         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
5624         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
5625
5626
5627         /* Full equipment */
5628         e1 = INVEN_RARM;
5629         e2 = INVEN_TOTAL - 1;
5630
5631         /* Forbid equipment */
5632         if (!equip) e2 = -1;
5633         else if (use_menu)
5634         {
5635                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
5636                         if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
5637                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
5638         }
5639
5640         /* Restrict equipment indexes */
5641         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
5642         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
5643
5644         if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
5645         {
5646                 if (p_ptr->migite)
5647                 {
5648                         if (e2 < INVEN_LARM) e2 = INVEN_LARM;
5649                 }
5650                 else if (p_ptr->hidarite) e1 = INVEN_RARM;
5651         }
5652
5653
5654         /* Count "okay" floor items */
5655         floor_num = 0;
5656
5657         /* Restrict floor usage */
5658         if (floor)
5659         {
5660                 /* Scan all objects in the grid */
5661                 floor_num = scan_floor(floor_list, py, px, 0x03);
5662         }
5663
5664         /* Accept inventory */
5665         if (i1 <= i2) allow_inven = TRUE;
5666
5667         /* Accept equipment */
5668         if (e1 <= e2) allow_equip = TRUE;
5669
5670         /* Accept floor */
5671         if (floor_num) allow_floor = TRUE;
5672
5673         /* Require at least one legal choice */
5674         if (!allow_inven && !allow_equip && !allow_floor)
5675         {
5676                 /* Cancel p_ptr->command_see */
5677                 command_see = FALSE;
5678
5679                 /* Oops */
5680                 oops = TRUE;
5681
5682                 /* Done */
5683                 done = TRUE;
5684
5685                 if (select_the_force) {
5686                     *cp = INVEN_FORCE;
5687                     item = TRUE;
5688                 }
5689         }
5690
5691         /* Analyze choices */
5692         else
5693         {
5694                 /* Hack -- Start on equipment if requested */
5695                 if (command_see && (command_wrk == (USE_EQUIP))
5696                         && allow_equip)
5697                 {
5698                         command_wrk = (USE_EQUIP);
5699                 }
5700
5701                 /* Use inventory if allowed */
5702                 else if (allow_inven)
5703                 {
5704                         command_wrk = (USE_INVEN);
5705                 }
5706
5707                 /* Use equipment if allowed */
5708                 else if (allow_equip)
5709                 {
5710                         command_wrk = (USE_EQUIP);
5711                 }
5712
5713                 /* Use floor if allowed */
5714                 else if (allow_floor)
5715                 {
5716                         command_wrk = (USE_FLOOR);
5717                 }
5718         }
5719
5720         /*
5721          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
5722          */
5723         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
5724
5725         /* Hack -- start out in "display" mode */
5726         if (command_see)
5727         {
5728                 /* Save screen */
5729                 screen_save();
5730         }
5731
5732         /* Repeat until done */
5733         while (!done)
5734         {
5735                 int get_item_label = 0;
5736
5737                 /* Show choices */
5738                 int ni = 0;
5739                 int ne = 0;
5740
5741                 /* Scan windows */
5742                 for (j = 0; j < 8; j++)
5743                 {
5744                         /* Unused */
5745                         if (!angband_term[j]) continue;
5746
5747                         /* Count windows displaying inven */
5748                         if (window_flag[j] & (PW_INVEN)) ni++;
5749
5750                         /* Count windows displaying equip */
5751                         if (window_flag[j] & (PW_EQUIP)) ne++;
5752                 }
5753
5754                 /* Toggle if needed */
5755                 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
5756                     (command_wrk == (USE_INVEN) && !ni && ne))
5757                 {
5758                         /* Toggle */
5759                         toggle_inven_equip();
5760
5761                         /* Track toggles */
5762                         toggle = !toggle;
5763                 }
5764
5765                 /* Update */
5766                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5767
5768                 /* Redraw windows */
5769                 window_stuff();
5770
5771                 /* Inventory screen */
5772                 if (command_wrk == (USE_INVEN))
5773                 {
5774                         /* Extract the legal requests */
5775                         n1 = I2A(i1);
5776                         n2 = I2A(i2);
5777
5778                         /* Redraw if needed */
5779                         if (command_see) get_item_label = show_inven(menu_line);
5780                 }
5781
5782                 /* Equipment screen */
5783                 else if (command_wrk == (USE_EQUIP))
5784                 {
5785                         /* Extract the legal requests */
5786                         n1 = I2A(e1 - INVEN_RARM);
5787                         n2 = I2A(e2 - INVEN_RARM);
5788
5789                         /* Redraw if needed */
5790                         if (command_see) get_item_label = show_equip(menu_line);
5791                 }
5792
5793                 /* Floor screen */
5794                 else if (command_wrk == (USE_FLOOR))
5795                 {
5796                         j = floor_top;
5797                         k = MIN(floor_top + 23, floor_num) - 1;
5798
5799                         /* Extract the legal requests */
5800                         n1 = I2A(j - floor_top);
5801                         n2 = I2A(k - floor_top);
5802
5803                         /* Redraw if needed */
5804                         if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
5805                 }
5806
5807                 /* Viewing inventory */
5808                 if (command_wrk == (USE_INVEN))
5809                 {
5810                         /* Begin the prompt */
5811 #ifdef JP
5812                         sprintf(out_val, "»ý¤Áʪ:");
5813 #else
5814                         sprintf(out_val, "Inven:");
5815 #endif
5816
5817                         if (!use_menu)
5818                         {
5819                                 /* Build the prompt */
5820 #ifdef JP
5821                                 sprintf(tmp_val, "%c-%c,'(',')',",
5822 #else
5823                                 sprintf(tmp_val, " %c-%c,'(',')',",
5824 #endif
5825                                         index_to_label(i1), index_to_label(i2));
5826
5827                                 /* Append */
5828                                 strcat(out_val, tmp_val);
5829                         }
5830
5831                         /* Indicate ability to "view" */
5832 #ifdef JP
5833                         if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5834 #else
5835                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
5836 #endif
5837
5838                         /* Append */
5839                         if (allow_equip)
5840                         {
5841 #ifdef JP
5842                                 if (!use_menu)
5843                                         strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
5844                                 else if (allow_floor)
5845                                         strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
5846                                 else
5847                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
5848 #else
5849                                 if (!use_menu)
5850                                         strcat(out_val, " / for Equip,");
5851                                 else if (allow_floor)
5852                                         strcat(out_val, " 6 for Equip,");
5853                                 else
5854                                         strcat(out_val, " 4 or 6 for Equip,");
5855 #endif
5856                         }
5857
5858                         /* Append */
5859                         if (allow_floor)
5860                         {
5861 #ifdef JP
5862                                 if (!use_menu)
5863                                         strcat(out_val, " '-'¾²¾å,");
5864                                 else if (allow_equip)
5865                                         strcat(out_val, " '4' ¾²¾å,");
5866                                 else
5867                                         strcat(out_val, " '4'or'6' ¾²¾å,");
5868 #else
5869                                 if (!use_menu)
5870                                         strcat(out_val, " - for floor,");
5871                                 else if (allow_equip)
5872                                         strcat(out_val, " 4 for floor,");
5873                                 else
5874                                         strcat(out_val, " 4 or 6 for floor,");
5875 #endif
5876                         }
5877                 }
5878
5879                 /* Viewing equipment */
5880                 else if (command_wrk == (USE_EQUIP))
5881                 {
5882                         /* Begin the prompt */
5883 #ifdef JP
5884                         sprintf(out_val, "ÁõÈ÷ÉÊ:");
5885 #else
5886                         sprintf(out_val, "Equip:");
5887 #endif
5888
5889                         if (!use_menu)
5890                         {
5891                                 /* Build the prompt */
5892 #ifdef JP
5893                                 sprintf(tmp_val, "%c-%c,'(',')',",
5894 #else
5895                                 sprintf(tmp_val, " %c-%c,'(',')',",
5896 #endif
5897                                         index_to_label(e1), index_to_label(e2));
5898
5899                                 /* Append */
5900                                 strcat(out_val, tmp_val);
5901                         }
5902
5903                         /* Indicate ability to "view" */
5904 #ifdef JP
5905                         if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5906 #else
5907                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
5908 #endif
5909
5910                         /* Append */
5911                         if (allow_inven)
5912                         {
5913 #ifdef JP
5914                                 if (!use_menu)
5915                                         strcat(out_val, " '/' »ý¤Áʪ,");
5916                                 else if (allow_floor)
5917                                         strcat(out_val, " '4' »ý¤Áʪ,");
5918                                 else
5919                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5920 #else
5921                                 if (!use_menu)
5922                                         strcat(out_val, " / for Inven,");
5923                                 else if (allow_floor)
5924                                         strcat(out_val, " 4 for Inven,");
5925                                 else
5926                                         strcat(out_val, " 4 or 6 for Inven,");
5927 #endif
5928                         }
5929
5930                         /* Append */
5931                         if (allow_floor)
5932                         {
5933 #ifdef JP
5934                                 if (!use_menu)
5935                                         strcat(out_val, " '-'¾²¾å,");
5936                                 else if (allow_inven)
5937                                         strcat(out_val, " '6' ¾²¾å,");
5938                                 else
5939                                         strcat(out_val, " '4'or'6' ¾²¾å,");
5940 #else
5941                                 if (!use_menu)
5942                                         strcat(out_val, " - for floor,");
5943                                 else if (allow_inven)
5944                                         strcat(out_val, " 6 for floor,");
5945                                 else
5946                                         strcat(out_val, " 4 or 6 for floor,");
5947 #endif
5948                         }
5949                 }
5950
5951                 /* Viewing floor */
5952                 else if (command_wrk == (USE_FLOOR))
5953                 {
5954                         /* Begin the prompt */
5955 #ifdef JP
5956                         sprintf(out_val, "¾²¾å:");
5957 #else
5958                         sprintf(out_val, "Floor:");
5959 #endif
5960
5961                         if (!use_menu)
5962                         {
5963                                 /* Build the prompt */
5964 #ifdef JP
5965                                 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
5966 #else
5967                                 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
5968 #endif
5969
5970                                 /* Append */
5971                                 strcat(out_val, tmp_val);
5972                         }
5973
5974                         /* Indicate ability to "view" */
5975 #ifdef JP
5976                         if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5977 #else
5978                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
5979 #endif
5980
5981                         if (use_menu)
5982                         {
5983                                 if (allow_inven && allow_equip)
5984                                 {
5985 #ifdef JP
5986                                         strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
5987 #else
5988                                         strcat(out_val, " 4 for Equip, 6 for Inven,");
5989 #endif
5990                                 }
5991                                 else if (allow_inven)
5992                                 {
5993 #ifdef JP
5994                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
5995 #else
5996                                         strcat(out_val, " 4 or 6 for Inven,");
5997 #endif
5998                                 }
5999                                 else if (allow_equip)
6000                                 {
6001 #ifdef JP
6002                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6003 #else
6004                                         strcat(out_val, " 4 or 6 for Equip,");
6005 #endif
6006                                 }
6007                         }
6008                         /* Append */
6009                         else if (allow_inven)
6010                         {
6011 #ifdef JP
6012                                 strcat(out_val, " '/' »ý¤Áʪ,");
6013 #else
6014                                 strcat(out_val, " / for Inven,");
6015 #endif
6016                         }
6017                         else if (allow_equip)
6018                         {
6019 #ifdef JP
6020                                 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
6021 #else
6022                                 strcat(out_val, " / for Equip,");
6023 #endif
6024                         }
6025
6026                         /* Append */
6027                         if (command_see && !use_menu)
6028                         {
6029 #ifdef JP
6030                                 strcat(out_val, " Enter ¼¡,");
6031 #else
6032                                 strcat(out_val, " Enter for scroll down,");
6033 #endif
6034                         }
6035                 }
6036
6037                 /* Append */
6038 #ifdef JP
6039                 if (select_the_force) strcat(out_val, " 'w'Îýµ¤½Ñ,");
6040 #else
6041                 if (select_the_force) strcat(out_val, " w for the Force,");
6042 #endif
6043
6044                 /* Finish the prompt */
6045                 strcat(out_val, " ESC");
6046
6047                 /* Build the prompt */
6048                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
6049
6050                 /* Show the prompt */
6051                 prt(tmp_val, 0, 0);
6052
6053                 /* Get a key */
6054                 which = inkey();
6055
6056                 if (use_menu)
6057                 {
6058                 int max_line = 1;
6059                 if (command_wrk == USE_INVEN) max_line = max_inven;
6060                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6061                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6062                 switch (which)
6063                 {
6064                         case ESCAPE:
6065                         case 'z':
6066                         case 'Z':
6067                         case '0':
6068                         {
6069                                 done = TRUE;
6070                                 break;
6071                         }
6072
6073                         case '8':
6074                         case 'k':
6075                         case 'K':
6076                         {
6077                                 menu_line += (max_line - 1);
6078                                 break;
6079                         }
6080
6081                         case '2':
6082                         case 'j':
6083                         case 'J':
6084                         {
6085                                 menu_line++;
6086                                 break;
6087                         }
6088
6089                         case '4':
6090                         case 'h':
6091                         case 'H':
6092                         {
6093                                 /* Verify legality */
6094                                 if (command_wrk == (USE_INVEN))
6095                                 {
6096                                         if (allow_floor) command_wrk = USE_FLOOR;
6097                                         else if (allow_equip) command_wrk = USE_EQUIP;
6098                                         else
6099                                         {
6100                                                 bell();
6101                                                 break;
6102                                         }
6103                                 }
6104                                 else if (command_wrk == (USE_EQUIP))
6105                                 {
6106                                         if (allow_inven) command_wrk = USE_INVEN;
6107                                         else if (allow_floor) command_wrk = USE_FLOOR;
6108                                         else
6109                                         {
6110                                                 bell();
6111                                                 break;
6112                                         }
6113                                 }
6114                                 else if (command_wrk == (USE_FLOOR))
6115                                 {
6116                                         if (allow_equip) command_wrk = USE_EQUIP;
6117                                         else if (allow_inven) command_wrk = USE_INVEN;
6118                                         else
6119                                         {
6120                                                 bell();
6121                                                 break;
6122                                         }
6123                                 }
6124                                 else
6125                                 {
6126                                         bell();
6127                                         break;
6128                                 }
6129
6130                                 /* Hack -- Fix screen */
6131                                 if (command_see)
6132                                 {
6133                                         /* Load screen */
6134                                         screen_load();
6135
6136                                         /* Save screen */
6137                                         screen_save();
6138                                 }
6139
6140                                 /* Switch inven/equip */
6141                                 if (command_wrk == USE_INVEN) max_line = max_inven;
6142                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6143                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6144                                 if (menu_line > max_line) menu_line = max_line;
6145
6146                                 /* Need to redraw */
6147                                 break;
6148                         }
6149
6150                         case '6':
6151                         case 'l':
6152                         case 'L':
6153                         {
6154                                 /* Verify legality */
6155                                 if (command_wrk == (USE_INVEN))
6156                                 {
6157                                         if (allow_equip) command_wrk = USE_EQUIP;
6158                                         else if (allow_floor) command_wrk = USE_FLOOR;
6159                                         else
6160                                         {
6161                                                 bell();
6162                                                 break;
6163                                         }
6164                                 }
6165                                 else if (command_wrk == (USE_EQUIP))
6166                                 {
6167                                         if (allow_floor) command_wrk = USE_FLOOR;
6168                                         else if (allow_inven) command_wrk = USE_INVEN;
6169                                         else
6170                                         {
6171                                                 bell();
6172                                                 break;
6173                                         }
6174                                 }
6175                                 else if (command_wrk == (USE_FLOOR))
6176                                 {
6177                                         if (allow_inven) command_wrk = USE_INVEN;
6178                                         else if (allow_equip) command_wrk = USE_EQUIP;
6179                                         else
6180                                         {
6181                                                 bell();
6182                                                 break;
6183                                         }
6184                                 }
6185                                 else
6186                                 {
6187                                         bell();
6188                                         break;
6189                                 }
6190
6191                                 /* Hack -- Fix screen */
6192                                 if (command_see)
6193                                 {
6194                                         /* Load screen */
6195                                         screen_load();
6196
6197                                         /* Save screen */
6198                                         screen_save();
6199                                 }
6200
6201                                 /* Switch inven/equip */
6202                                 if (command_wrk == USE_INVEN) max_line = max_inven;
6203                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6204                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6205                                 if (menu_line > max_line) menu_line = max_line;
6206
6207                                 /* Need to redraw */
6208                                 break;
6209                         }
6210
6211                         case 'x':
6212                         case 'X':
6213                         case '\r':
6214                         case '\n':
6215                         {
6216                                 if (command_wrk == USE_FLOOR)
6217                                 {
6218                                         /* Special index */
6219                                         (*cp) = -get_item_label;
6220                                 }
6221                                 else
6222                                 {
6223                                         /* Validate the item */
6224                                         if (!get_item_okay(get_item_label))
6225                                         {
6226                                                 bell();
6227                                                 break;
6228                                         }
6229
6230                                         /* Allow player to "refuse" certain actions */
6231                                         if (!get_item_allow(get_item_label))
6232                                         {
6233                                                 done = TRUE;
6234                                                 break;
6235                                         }
6236
6237                                         /* Accept that choice */
6238                                         (*cp) = get_item_label;
6239                                 }
6240
6241                                 item = TRUE;
6242                                 done = TRUE;
6243                                 break;
6244                         }
6245                         case 'w':
6246                         {
6247                                 if (select_the_force) {
6248                                         *cp = INVEN_FORCE;
6249                                         item = TRUE;
6250                                         done = TRUE;
6251                                         break;
6252                                 }
6253                         }
6254                 }
6255                 if (menu_line > max_line) menu_line -= max_line;
6256                 }
6257                 else
6258                 {
6259                 /* Parse it */
6260                 switch (which)
6261                 {
6262                         case ESCAPE:
6263                         {
6264                                 done = TRUE;
6265                                 break;
6266                         }
6267
6268                         case '*':
6269                         case '?':
6270                         case ' ':
6271                         {
6272                                 /* Hide the list */
6273                                 if (command_see)
6274                                 {
6275                                         /* Flip flag */
6276                                         command_see = FALSE;
6277
6278                                         /* Load screen */
6279                                         screen_load();
6280                                 }
6281
6282                                 /* Show the list */
6283                                 else
6284                                 {
6285                                         /* Save screen */
6286                                         screen_save();
6287
6288                                         /* Flip flag */
6289                                         command_see = TRUE;
6290                                 }
6291                                 break;
6292                         }
6293
6294                         case '\n':
6295                         case '\r':
6296                         case '+':
6297                         {
6298                                 int i, o_idx;
6299                                 cave_type *c_ptr = &cave[py][px];
6300
6301                                 if (command_wrk != (USE_FLOOR)) break;
6302
6303                                 /* Get the object being moved. */
6304                                 o_idx = c_ptr->o_idx;
6305
6306                                 /* Only rotate a pile of two or more objects. */
6307                                 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
6308
6309                                 /* Remove the first object from the list. */
6310                                 excise_object_idx(o_idx);
6311
6312                                 /* Find end of the list. */
6313                                 i = c_ptr->o_idx;
6314                                 while (o_list[i].next_o_idx)
6315                                         i = o_list[i].next_o_idx;
6316
6317                                 /* Add after the last object. */
6318                                 o_list[i].next_o_idx = o_idx;
6319
6320                                 /* Re-scan floor list */ 
6321                                 floor_num = scan_floor(floor_list, py, px, 0x03);
6322
6323                                 /* Hack -- Fix screen */
6324                                 if (command_see)
6325                                 {
6326                                         /* Load screen */
6327                                         screen_load();
6328
6329                                         /* Save screen */
6330                                         screen_save();
6331                                 }
6332
6333                                 break;
6334                         }
6335
6336                         case '/':
6337                         {
6338                                 if (command_wrk == (USE_INVEN))
6339                                 {
6340                                         if (!allow_equip)
6341                                         {
6342                                                 bell();
6343                                                 break;
6344                                         }
6345                                         command_wrk = (USE_EQUIP);
6346                                 }
6347                                 else if (command_wrk == (USE_EQUIP))
6348                                 {
6349                                         if (!allow_inven)
6350                                         {
6351                                                 bell();
6352                                                 break;
6353                                         }
6354                                         command_wrk = (USE_INVEN);
6355                                 }
6356                                 else if (command_wrk == (USE_FLOOR))
6357                                 {
6358                                         if (allow_inven)
6359                                         {
6360                                                 command_wrk = (USE_INVEN);
6361                                         }
6362                                         else if (allow_equip)
6363                                         {
6364                                                 command_wrk = (USE_EQUIP);
6365                                         }
6366                                         else
6367                                         {
6368                                                 bell();
6369                                                 break;
6370                                         }
6371                                 }
6372
6373                                 /* Hack -- Fix screen */
6374                                 if (command_see)
6375                                 {
6376                                         /* Load screen */
6377                                         screen_load();
6378
6379                                         /* Save screen */
6380                                         screen_save();
6381                                 }
6382
6383                                 /* Need to redraw */
6384                                 break;
6385                         }
6386
6387                         case '-':
6388                         {
6389                                 if (!allow_floor)
6390                                 {
6391                                         bell();
6392                                         break;
6393                                 }
6394
6395                                 /*
6396                                  * If we are already examining the floor, and there
6397                                  * is only one item, we will always select it.
6398                                  * If we aren't examining the floor and there is only
6399                                  * one item, we will select it if floor_query_flag
6400                                  * is FALSE.
6401                                  */
6402                                 if (floor_num == 1)
6403                                 {
6404                                         if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
6405                                         {
6406                                                 /* Special index */
6407                                                 k = 0 - floor_list[0];
6408
6409                                                 /* Allow player to "refuse" certain actions */
6410                                                 if (!get_item_allow(k))
6411                                                 {
6412                                                         done = TRUE;
6413                                                         break;
6414                                                 }
6415
6416                                                 /* Accept that choice */
6417                                                 (*cp) = k;
6418                                                 item = TRUE;
6419                                                 done = TRUE;
6420
6421                                                 break;
6422                                         }
6423                                 }
6424
6425                                 /* Hack -- Fix screen */
6426                                 if (command_see)
6427                                 {
6428                                         /* Load screen */
6429                                         screen_load();
6430
6431                                         /* Save screen */
6432                                         screen_save();
6433                                 }
6434
6435                                 command_wrk = (USE_FLOOR);
6436
6437                                 break;
6438                         }
6439
6440                         case '0':
6441                         case '1': case '2': case '3':
6442                         case '4': case '5': case '6':
6443                         case '7': case '8': case '9':
6444                         {
6445                                 if (command_wrk != USE_FLOOR)
6446                                 {
6447                                         /* Look up the tag */
6448                                         if (!get_tag(&k, which, command_wrk))
6449                                         {
6450                                                 bell();
6451                                                 break;
6452                                         }
6453
6454                                         /* Hack -- Validate the item */
6455                                         if ((k < INVEN_RARM) ? !inven : !equip)
6456                                         {
6457                                                 bell();
6458                                                 break;
6459                                         }
6460
6461                                         /* Validate the item */
6462                                         if (!get_item_okay(k))
6463                                         {
6464                                                 bell();
6465                                                 break;
6466                                         }
6467                                 }
6468                                 else
6469                                 {
6470                                         /* Look up the alphabetical tag */
6471                                         if (get_tag_floor(&k, which, floor_list, floor_num))
6472                                         {
6473                                                 /* Special index */
6474                                                 k = 0 - floor_list[k];
6475                                         }
6476                                         else
6477                                         {
6478                                                 bell();
6479                                                 break;
6480                                         }
6481                                 }
6482
6483                                 /* Allow player to "refuse" certain actions */
6484                                 if (!get_item_allow(k))
6485                                 {
6486                                         done = TRUE;
6487                                         break;
6488                                 }
6489
6490                                 /* Accept that choice */
6491                                 (*cp) = k;
6492                                 item = TRUE;
6493                                 done = TRUE;
6494 #ifdef ALLOW_REPEAT
6495                                 cur_tag = which;
6496 #endif /* ALLOW_REPEAT */
6497                                 break;
6498                         }
6499
6500 #if 0
6501                         case '\n':
6502                         case '\r':
6503                         {
6504                                 /* Choose "default" inventory item */
6505                                 if (command_wrk == (USE_INVEN))
6506                                 {
6507                                         k = ((i1 == i2) ? i1 : -1);
6508                                 }
6509
6510                                 /* Choose "default" equipment item */
6511                                 else if (command_wrk == (USE_EQUIP))
6512                                 {
6513                                         k = ((e1 == e2) ? e1 : -1);
6514                                 }
6515
6516                                 /* Choose "default" floor item */
6517                                 else if (command_wrk == (USE_FLOOR))
6518                                 {
6519                                         if (floor_num == 1)
6520                                         {
6521                                                 /* Special index */
6522                                                 k = 0 - floor_list[0];
6523
6524                                                 /* Allow player to "refuse" certain actions */
6525                                                 if (!get_item_allow(k))
6526                                                 {
6527                                                         done = TRUE;
6528                                                         break;
6529                                                 }
6530
6531                                                 /* Accept that choice */
6532                                                 (*cp) = k;
6533                                                 item = TRUE;
6534                                                 done = TRUE;
6535                                         }
6536                                         break;
6537                                 }
6538
6539                                 /* Validate the item */
6540                                 if (!get_item_okay(k))
6541                                 {
6542                                         bell();
6543                                         break;
6544                                 }
6545
6546                                 /* Allow player to "refuse" certain actions */
6547                                 if (!get_item_allow(k))
6548                                 {
6549                                         done = TRUE;
6550                                         break;
6551                                 }
6552
6553                                 /* Accept that choice */
6554                                 (*cp) = k;
6555                                 item = TRUE;
6556                                 done = TRUE;
6557                                 break;
6558                         }
6559 #endif
6560
6561                         case 'w':
6562                         {
6563                                 if (select_the_force) {
6564                                         *cp = INVEN_FORCE;
6565                                         item = TRUE;
6566                                         done = TRUE;
6567                                         break;
6568                                 }
6569
6570                                 /* Fall through */
6571                         }
6572
6573                         default:
6574                         {
6575                                 int ver;
6576
6577                                 if (command_wrk != USE_FLOOR)
6578                                 {
6579                                         bool not_found = FALSE;
6580
6581                                         /* Look up the alphabetical tag */
6582                                         if (!get_tag(&k, which, command_wrk))
6583                                         {
6584                                                 not_found = TRUE;
6585                                         }
6586
6587                                         /* Hack -- Validate the item */
6588                                         else if ((k < INVEN_RARM) ? !inven : !equip)
6589                                         {
6590                                                 not_found = TRUE;
6591                                         }
6592
6593                                         /* Validate the item */
6594                                         else if (!get_item_okay(k))
6595                                         {
6596                                                 not_found = TRUE;
6597                                         }
6598
6599                                         if (!not_found)
6600                                         {
6601                                                 /* Accept that choice */
6602                                                 (*cp) = k;
6603                                                 item = TRUE;
6604                                                 done = TRUE;
6605 #ifdef ALLOW_REPEAT
6606                                                 cur_tag = which;
6607 #endif /* ALLOW_REPEAT */
6608                                                 break;
6609                                         }
6610                                 }
6611                                 else
6612                                 {
6613                                         /* Look up the alphabetical tag */
6614                                         if (get_tag_floor(&k, which, floor_list, floor_num))
6615                                         {
6616                                                 /* Special index */
6617                                                 k = 0 - floor_list[k];
6618
6619                                                 /* Accept that choice */
6620                                                 (*cp) = k;
6621                                                 item = TRUE;
6622                                                 done = TRUE;
6623 #ifdef ALLOW_REPEAT
6624                                                 cur_tag = which;
6625 #endif /* ALLOW_REPEAT */
6626                                                 break;
6627                                         }
6628                                 }
6629
6630                                 /* Extract "query" setting */
6631                                 ver = isupper(which);
6632                                 which = tolower(which);
6633
6634                                 /* Convert letter to inventory index */
6635                                 if (command_wrk == (USE_INVEN))
6636                                 {
6637                                         if (which == '(') k = i1;
6638                                         else if (which == ')') k = i2;
6639                                         else k = label_to_inven(which);
6640                                 }
6641
6642                                 /* Convert letter to equipment index */
6643                                 else if (command_wrk == (USE_EQUIP))
6644                                 {
6645                                         if (which == '(') k = e1;
6646                                         else if (which == ')') k = e2;
6647                                         else k = label_to_equip(which);
6648                                 }
6649
6650                                 /* Convert letter to floor index */
6651                                 else if (command_wrk == USE_FLOOR)
6652                                 {
6653                                         if (which == '(') k = 0;
6654                                         else if (which == ')') k = floor_num - 1;
6655                                         else k = islower(which) ? A2I(which) : -1;
6656                                         if (k < 0 || k >= floor_num || k >= 23)
6657                                         {
6658                                                 bell();
6659                                                 break;
6660                                         }
6661
6662                                         /* Special index */
6663                                         k = 0 - floor_list[k];
6664                                 }
6665
6666                                 /* Validate the item */
6667                                 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
6668                                 {
6669                                         bell();
6670                                         break;
6671                                 }
6672
6673                                 /* Verify the item */
6674 #ifdef JP
6675 if (ver && !verify("ËÜÅö¤Ë", k))
6676 #else
6677                                 if (ver && !verify("Try", k))
6678 #endif
6679
6680                                 {
6681                                         done = TRUE;
6682                                         break;
6683                                 }
6684
6685                                 /* Allow player to "refuse" certain actions */
6686                                 if (!get_item_allow(k))
6687                                 {
6688                                         done = TRUE;
6689                                         break;
6690                                 }
6691
6692                                 /* Accept that choice */
6693                                 (*cp) = k;
6694                                 item = TRUE;
6695                                 done = TRUE;
6696                                 break;
6697                         }
6698                 }
6699                 }
6700         }
6701
6702         /* Fix the screen if necessary */
6703         if (command_see)
6704         {
6705                 /* Load screen */
6706                 screen_load();
6707
6708                 /* Hack -- Cancel "display" */
6709                 command_see = FALSE;
6710         }
6711
6712
6713         /* Forget the item_tester_tval restriction */
6714         item_tester_tval = 0;
6715
6716         /* Forget the item_tester_hook restriction */
6717         item_tester_hook = NULL;
6718
6719
6720         /* Clean up  'show choices' */
6721         /* Toggle again if needed */
6722         if (toggle) toggle_inven_equip();
6723
6724         /* Update */
6725         p_ptr->window |= (PW_INVEN | PW_EQUIP);
6726
6727         /* Window stuff */
6728         window_stuff();
6729
6730
6731         /* Clear the prompt line */
6732         prt("", 0, 0);
6733
6734         /* Warning if needed */
6735         if (oops && str) msg_print(str);
6736
6737         if (item)
6738         {
6739 #ifdef ALLOW_REPEAT
6740                 repeat_push(*cp);
6741                 if (command_cmd) prev_tag = cur_tag;
6742 #endif /* ALLOW_REPEAT */
6743
6744                 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
6745         }
6746
6747         /* Result */
6748         return (item);
6749 }
6750
6751
6752 static bool py_pickup_floor_aux(void)
6753 {
6754         s16b this_o_idx;
6755
6756         cptr q, s;
6757
6758         int item;
6759
6760         /* Restrict the choices */
6761         item_tester_hook = inven_carry_okay;
6762
6763         /* Get an object */
6764 #ifdef JP
6765         q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
6766         s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
6767 #else
6768         q = "Get which item? ";
6769         s = "You no longer have any room for the objects on the floor.";
6770 #endif
6771
6772         if (get_item(&item, q, s, (USE_FLOOR)))
6773         {
6774                 this_o_idx = 0 - item;
6775         }
6776         else
6777         {
6778                 return (FALSE);
6779         }
6780
6781         /* Pick up the object */
6782         py_pickup_aux(this_o_idx);
6783
6784         return (TRUE);
6785 }
6786
6787
6788 /*
6789  * Make the player carry everything in a grid
6790  *
6791  * If "pickup" is FALSE then only gold will be picked up
6792  *
6793  * This is called by py_pickup() when easy_floor is TRUE.
6794  */
6795 void py_pickup_floor(bool pickup)
6796 {
6797         s16b this_o_idx, next_o_idx = 0;
6798
6799         char o_name[MAX_NLEN];
6800         object_type *o_ptr;
6801
6802         int floor_num = 0, floor_list[23], floor_o_idx = 0;
6803
6804         int can_pickup = 0;
6805
6806         /* Scan the pile of objects */
6807         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
6808         {
6809                 object_type *o_ptr;
6810
6811                 /* Access the object */
6812                 o_ptr = &o_list[this_o_idx];
6813
6814                 /* Describe the object */
6815                 object_desc(o_name, o_ptr, 0);
6816
6817                 /* Access the next object */
6818                 next_o_idx = o_ptr->next_o_idx;
6819
6820                 /* Hack -- disturb */
6821                 disturb(0, 0);
6822
6823                 /* Pick up gold */
6824                 if (o_ptr->tval == TV_GOLD)
6825                 {
6826                         /* Message */
6827 #ifdef JP
6828                 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
6829                            (long)o_ptr->pval, o_name);
6830 #else
6831                         msg_format("You have found %ld gold pieces worth of %s.",
6832                                 (long) o_ptr->pval, o_name);
6833 #endif
6834
6835
6836                         /* Collect the gold */
6837                         p_ptr->au += o_ptr->pval;
6838
6839                         /* Redraw gold */
6840                         p_ptr->redraw |= (PR_GOLD);
6841
6842                         /* Window stuff */
6843                         p_ptr->window |= (PW_PLAYER);
6844
6845                         /* Delete the gold */
6846                         delete_object_idx(this_o_idx);
6847
6848                         /* Check the next object */
6849                         continue;
6850                 }
6851                 else if (o_ptr->marked & OM_NOMSG)
6852                 {
6853                         /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
6854                          * ignored. Otherwise, they are included in the prompt. */
6855                         o_ptr->marked &= ~(OM_NOMSG);
6856                         continue;
6857                 }
6858
6859                 /* Count non-gold objects that can be picked up. */
6860                 if (inven_carry_okay(o_ptr))
6861                 {
6862                         can_pickup++;
6863                 }
6864
6865                 /* Remember this object index */
6866                 if (floor_num < 23)
6867                         floor_list[floor_num] = this_o_idx;
6868
6869                 /* Count non-gold objects */
6870                 floor_num++;
6871
6872                 /* Remember this index */
6873                 floor_o_idx = this_o_idx;
6874         }
6875
6876         /* There are no non-gold objects */
6877         if (!floor_num)
6878                 return;
6879
6880         /* Mention the number of objects */
6881         if (!pickup)
6882         {
6883                 /* One object */
6884                 if (floor_num == 1)
6885                 {
6886                         /* Access the object */
6887                         o_ptr = &o_list[floor_o_idx];
6888
6889 #ifdef ALLOW_EASY_SENSE
6890
6891                         /* Option: Make object sensing easy */
6892                         if (easy_sense)
6893                         {
6894                                 /* Sense the object */
6895                                 (void) sense_object(o_ptr);
6896                         }
6897
6898 #endif /* ALLOW_EASY_SENSE */
6899
6900                         /* Describe the object */
6901                         object_desc(o_name, o_ptr, 0);
6902
6903                         /* Message */
6904 #ifdef JP
6905                                 msg_format("%s¤¬¤¢¤ë¡£", o_name);
6906 #else
6907                         msg_format("You see %s.", o_name);
6908 #endif
6909
6910                 }
6911
6912                 /* Multiple objects */
6913                 else
6914                 {
6915                         /* Message */
6916 #ifdef JP
6917                         msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
6918 #else
6919                         msg_format("You see a pile of %d items.", floor_num);
6920 #endif
6921
6922                 }
6923
6924                 /* Done */
6925                 return;
6926         }
6927
6928         /* The player has no room for anything on the floor. */
6929         if (!can_pickup)
6930         {
6931                 /* One object */
6932                 if (floor_num == 1)
6933                 {
6934                         /* Access the object */
6935                         o_ptr = &o_list[floor_o_idx];
6936
6937 #ifdef ALLOW_EASY_SENSE
6938
6939                         /* Option: Make object sensing easy */
6940                         if (easy_sense)
6941                         {
6942                                 /* Sense the object */
6943                                 (void) sense_object(o_ptr);
6944                         }
6945
6946 #endif /* ALLOW_EASY_SENSE */
6947
6948                         /* Describe the object */
6949                         object_desc(o_name, o_ptr, 0);
6950
6951                         /* Message */
6952 #ifdef JP
6953                                 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
6954 #else
6955                         msg_format("You have no room for %s.", o_name);
6956 #endif
6957
6958                 }
6959
6960                 /* Multiple objects */
6961                 else
6962                 {
6963                         /* Message */
6964 #ifdef JP
6965                         msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
6966 #else
6967                         msg_print("You have no room for any of the objects on the floor.");
6968 #endif
6969
6970                 }
6971
6972                 /* Done */
6973                 return;
6974         }
6975
6976         /* One object */
6977         if (floor_num == 1)
6978         {
6979                 /* Hack -- query every object */
6980                 if (carry_query_flag)
6981                 {
6982                         char out_val[MAX_NLEN+20];
6983
6984                         /* Access the object */
6985                         o_ptr = &o_list[floor_o_idx];
6986
6987 #ifdef ALLOW_EASY_SENSE
6988
6989                         /* Option: Make object sensing easy */
6990                         if (easy_sense)
6991                         {
6992                                 /* Sense the object */
6993                                 (void) sense_object(o_ptr);
6994                         }
6995
6996 #endif /* ALLOW_EASY_SENSE */
6997
6998                         /* Describe the object */
6999                         object_desc(o_name, o_ptr, 0);
7000
7001                         /* Build a prompt */
7002 #ifdef JP
7003                         (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
7004 #else
7005                         (void) sprintf(out_val, "Pick up %s? ", o_name);
7006 #endif
7007
7008
7009                         /* Ask the user to confirm */
7010                         if (!get_check(out_val))
7011                         {
7012                                 /* Done */
7013                                 return;
7014                         }
7015                 }
7016
7017                 /* Access the object */
7018                 o_ptr = &o_list[floor_o_idx];
7019
7020 #ifdef ALLOW_EASY_SENSE
7021
7022                 /* Option: Make object sensing easy */
7023                 if (easy_sense)
7024                 {
7025                         /* Sense the object */
7026                         (void) sense_object(o_ptr);
7027                 }
7028
7029 #endif /* ALLOW_EASY_SENSE */
7030
7031                 /* Pick up the object */
7032                 py_pickup_aux(floor_o_idx);
7033         }
7034
7035         /* Allow the user to choose an object */
7036         else
7037         {
7038                 while (can_pickup--)
7039                 {
7040                         if (!py_pickup_floor_aux()) break;
7041                 }
7042         }
7043 }
7044
7045 #endif /* ALLOW_EASY_FLOOR */