OSDN Git Service

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