OSDN Git Service

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