OSDN Git Service

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