OSDN Git Service

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