OSDN Git Service

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