OSDN Git Service

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