OSDN Git Service

装備品の中で{@wf}等の銘があると、get_tag()が反応してしまい、持ちものリスト
[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 (item_tester_hook_smith(o_ptr))
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 (item_tester_hook_smith(o_ptr))
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 (item_tester_hook_smith(o_ptr))
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
1891                 case ESSENCE_TMP_RES_ELEC:
1892 #ifdef JP
1893                         return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1894 #else
1895                         return "resist elec every 50+d50 turns";
1896 #endif
1897
1898                 case ESSENCE_TMP_RES_FIRE:
1899 #ifdef JP
1900                         return "²Ð¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1901 #else
1902                         return "resist fire every 50+d50 turns";
1903 #endif
1904
1905                 case ESSENCE_TMP_RES_COLD:
1906 #ifdef JP
1907                         return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
1908 #else
1909                         return "resist cold every 50+d50 turns";
1910 #endif
1911
1912                 case TR_IMPACT:
1913 #ifdef JP
1914                         return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
1915 #else
1916                         return "earthquake every 100+d100 turns";
1917 #endif
1918                 }
1919         }
1920
1921         if (o_ptr->name2 == EGO_TRUMP)
1922         {
1923 #ifdef JP
1924 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
1925 #else
1926                 return "teleport every 50+d50 turns";
1927 #endif
1928
1929         }
1930
1931         if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
1932         {
1933 #ifdef JP
1934 return "¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó : 10+d10 ¥¿¡¼¥óËè";
1935 #else
1936                         return "illumination every 10+d10 turns";
1937 #endif
1938         }
1939
1940         else if (o_ptr->name2 == EGO_EARTHQUAKES)
1941         {
1942 #ifdef JP
1943 return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
1944 #else
1945                 return "earthquake every 100+d100 turns";
1946 #endif
1947
1948         }
1949
1950         else if (o_ptr->name2 == EGO_JUMP)
1951         {
1952 #ifdef JP
1953 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
1954 #else
1955                 return "blink every 10+d10 turns";
1956 #endif
1957
1958         }
1959
1960         if (o_ptr->tval == TV_RING)
1961         {
1962                 if (o_ptr->name2)
1963                 {
1964                         switch (o_ptr->name2)
1965                         {
1966                         case EGO_RING_HERO:
1967 #ifdef JP
1968 return "»Îµ¤¹âÍÈ : 100+d100¥¿¡¼¥óËè";
1969 #else
1970                                 return "heroism every 100+d100 turns";
1971 #endif
1972                         case EGO_RING_MAGIC_MIS:
1973 #ifdef JP
1974 return "¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë(2d6) : 2 ¥¿¡¼¥óËè";
1975 #else
1976                         return "magic missile (2d6) every 2 turns";
1977 #endif
1978                         case EGO_RING_FIRE_BOLT:
1979 #ifdef JP
1980 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È(9d8) : 8+d8 ¥¿¡¼¥óËè";
1981 #else
1982                         return "fire bolt (9d8) every 8+d8 turns";
1983 #endif
1984                         case EGO_RING_COLD_BOLT:
1985 #ifdef JP
1986 return "¥¢¥¤¥¹¡¦¥Ü¥ë¥È(6d8) : 7+d7 ¥¿¡¼¥óËè";
1987 #else
1988                                 return "frost bolt (6d8) every 7+d7 turns";
1989 #endif
1990                         case EGO_RING_ELEC_BOLT:
1991 #ifdef JP
1992 return "¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È(4d8) : 5+d5 ¥¿¡¼¥óËè";
1993 #else
1994                                 return "lightning bolt (4d8) every 5+d5 turns";
1995 #endif
1996                         case EGO_RING_ACID_BOLT:
1997 #ifdef JP
1998 return "¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È(5d8) : 6+d6 ¥¿¡¼¥óËè";
1999 #else
2000                                 return "acid bolt (5d8) every 6+d6 turns";
2001 #endif
2002                         case EGO_RING_MANA_BOLT:
2003 #ifdef JP
2004 return "ËâÎϤÎÌð(120) : 120+d120 ¥¿¡¼¥óËè";
2005 #else
2006                         return "a mana bolt (120) every 120+d120 turns";
2007 #endif
2008                         case EGO_RING_FIRE_BALL:
2009 #ifdef JP
2010 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2011 #else
2012                                 return "fire ball (100) every 80+d80 turns";
2013 #endif
2014                         case EGO_RING_COLD_BALL:
2015 #ifdef JP
2016 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2017 #else
2018                                 return "cold ball (100) every 80+d80 turns";
2019 #endif
2020                         case EGO_RING_ELEC_BALL:
2021 #ifdef JP
2022 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2023 #else
2024                                 return "elec ball (100) every 80+d80 turns";
2025 #endif
2026                         case EGO_RING_ACID_BALL:
2027 #ifdef JP
2028 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) : 80+d80 ¥¿¡¼¥óËè";
2029 #else
2030                                 return "acid ball (100) every 80+d80 turns";
2031 #endif
2032                         case EGO_RING_MANA_BALL:
2033 #ifdef JP
2034 return "ËâÎϤÎÍò (250) : 300 ¥¿¡¼¥óËè";
2035 #else
2036                                 return "mana storm (250) every 300 turns";
2037 #endif
2038                         case EGO_RING_DRAGON_F:
2039                                 if (o_ptr->sval == SV_RING_FLAMES)
2040 #ifdef JP
2041 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 200 ¥¿¡¼¥óËè";
2042 #else
2043                                         return "breath of fire (200) and resist fire every 200 turns";
2044 #endif
2045                                 else
2046 #ifdef JP
2047 return "²Ð±ê¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
2048 #else
2049                                         return "fire breath (200) every 250 turns";
2050 #endif
2051                         case EGO_RING_DRAGON_C:
2052                                 if (o_ptr->sval == SV_RING_ICE)
2053 #ifdef JP
2054 return "Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 200 ¥¿¡¼¥óËè";
2055 #else
2056                                         return "breath of cold (200) and resist cold every 200 turns";
2057 #endif
2058                                 else
2059 #ifdef JP
2060 return "Î䵤¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
2061 #else
2062                                         return "cold breath (200) every 250 turns";
2063 #endif
2064                         case EGO_RING_M_DETECT:
2065 #ifdef JP
2066 return "Á´¥â¥ó¥¹¥¿¡¼´¶ÃΠ: 150 ¥¿¡¼¥óËè";
2067 #else
2068                                 return "detect all monsters every 150 turns";
2069 #endif
2070                         case EGO_RING_D_SPEED:
2071 #ifdef JP
2072 return "¥¹¥Ô¡¼¥É(15+d30¥¿¡¼¥ó) : 100 ¥¿¡¼¥óËè";
2073 #else
2074                                 return "haste self (15+d30 turns) every 100 turns";
2075 #endif
2076                         case EGO_RING_BERSERKER:
2077 #ifdef JP
2078 return "¶¸Àï»Î²½(25+d25¥¿¡¼¥ó) : 75+d75 ¥¿¡¼¥óËè";
2079 #else
2080                                 return "berserk (25+d25 turns) every 75+d75 turns";
2081 #endif
2082                         case EGO_RING_TELE_AWAY:
2083 #ifdef JP
2084 return "¥Æ¥ì¥Ý¡¼¥È¡¦¥¢¥¦¥§¥¤ : 150 ¥¿¡¼¥óËè";
2085 #else
2086                         return "teleport away every 150 turns";
2087 #endif
2088                         case EGO_RING_TRUE:
2089 #ifdef JP
2090 return "»Îµ¤¹âÍÈ¡¢½ËÊ¡¡¢µæ¶Ë¤ÎÂÑÀ­ : 777 ¥¿¡¼¥óËè";
2091 #else
2092                         return "hero, bless, and ultimate resistance every 777 turns";
2093 #endif
2094                         }
2095                 }
2096                 switch (o_ptr->sval)
2097                 {
2098                         case SV_RING_FLAMES:
2099 #ifdef JP
2100 return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
2101 #else
2102                                 return "ball of fire (100) and resist fire every 50+d50 turns";
2103 #endif
2104
2105                         case SV_RING_ICE:
2106 #ifdef JP
2107 return "¥³¡¼¥ë¥É¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
2108 #else
2109                                 return "ball of cold (100) and resist cold every 50+d50 turns";
2110 #endif
2111
2112                         case SV_RING_ACID:
2113 #ifdef JP
2114 return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
2115 #else
2116                                 return "ball of acid (100) and resist acid every 50+d50 turns";
2117 #endif
2118
2119                         case SV_RING_ELEC:
2120 #ifdef JP
2121 return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
2122 #else
2123                                 return "ball of elec (100) and resist elec every 50+d50 turns";
2124 #endif
2125
2126                         default:
2127                                 return NULL;
2128                 }
2129         }
2130
2131         if (o_ptr->tval == TV_AMULET)
2132         {
2133                 if (o_ptr->name2)
2134                 {
2135                         switch (o_ptr->name2)
2136                         {
2137                         case EGO_AMU_IDENT:
2138 #ifdef JP
2139                                 return "´ÕÄê : 10 ¥¿¡¼¥óËè";
2140 #else
2141                                 return "identify every 10 turns";
2142 #endif
2143                         case EGO_AMU_CHARM:
2144 #ifdef JP
2145                                 return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
2146 #else
2147                                 return "charm monster every 200 turns";
2148 #endif
2149                         case EGO_AMU_JUMP:
2150 #ifdef JP
2151                                 return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
2152 #else
2153                                 return "blink every 10+d10 turns";
2154 #endif
2155                         case EGO_AMU_TELEPORT:
2156 #ifdef JP
2157                                 return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
2158 #else
2159                                 return "teleport every 50+d50 turns";
2160 #endif
2161                         case EGO_AMU_D_DOOR:
2162 #ifdef JP
2163                                 return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
2164 #else
2165                                 return "dimension door every 200 turns";
2166 #endif
2167                         case EGO_AMU_RES_FIRE_:
2168 #ifdef JP
2169                                 return "²Ð±ê¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
2170 #else
2171                                 return "resist fire every 50+d50 turns";
2172 #endif
2173                         case EGO_AMU_RES_COLD_:
2174 #ifdef JP
2175                                 return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
2176 #else
2177                                 return "resist cold every 50+d50 turns";
2178 #endif
2179                         case EGO_AMU_RES_ELEC_:
2180 #ifdef JP
2181                                 return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
2182 #else
2183                                 return "resist elec every 50+d50 turns";
2184 #endif
2185                         case EGO_AMU_RES_ACID_:
2186 #ifdef JP
2187                                 return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
2188 #else
2189                                 return "resist acid every 50+d50 turns";
2190 #endif
2191                         case EGO_AMU_DETECTION:
2192 #ifdef JP
2193                                 return "Á´´¶ÃΠ: 55+d55¥¿¡¼¥óËè";
2194 #else
2195                                 return "detect all floor every 55+d55 turns";
2196 #endif
2197                         }
2198                 }
2199         }
2200
2201         if (o_ptr->tval == TV_WHISTLE)
2202         {
2203 #ifdef JP
2204 return "¥Ú¥Ã¥È¸Æ¤Ó´ó¤» : 100+d100¥¿¡¼¥óËè";
2205 #else
2206                 return "call pet every 100+d100 turns";
2207 #endif
2208         }
2209
2210         if (o_ptr->tval == TV_CAPTURE)
2211         {
2212 #ifdef JP
2213 return "¥â¥ó¥¹¥¿¡¼¤òÊᤨ¤ë¡¢Ëô¤Ï²òÊü¤¹¤ë¡£";
2214 #else
2215                 return "captures or releases a monster.";
2216 #endif
2217         }
2218
2219         /* Require dragon scale mail */
2220 #ifdef JP
2221 if (o_ptr->tval != TV_DRAG_ARMOR) return ("´ñ̯¤Ê¸÷");
2222 #else
2223         if (o_ptr->tval != TV_DRAG_ARMOR) return ("a strange glow");
2224 #endif
2225
2226
2227         /* Branch on the sub-type */
2228         switch (o_ptr->sval)
2229         {
2230                 case SV_DRAGON_BLUE:
2231                 {
2232 #ifdef JP
2233 return "°ðºÊ¤Î¥Ö¥ì¥¹(100) : 150+d150 ¥¿¡¼¥óËè";
2234 #else
2235                         return "breathe lightning (100) every 150+d150 turns";
2236 #endif
2237
2238                 }
2239                 case SV_DRAGON_WHITE:
2240                 {
2241 #ifdef JP
2242 return "Î䵤¤Î¥Ö¥ì¥¹(110) : 150+d150 ¥¿¡¼¥óËè";
2243 #else
2244                         return "breathe frost (110) every 150+d150 turns";
2245 #endif
2246
2247                 }
2248                 case SV_DRAGON_BLACK:
2249                 {
2250 #ifdef JP
2251 return "»À¤Î¥Ö¥ì¥¹(130) : 150+d150 ¥¿¡¼¥óËè";
2252 #else
2253                         return "breathe acid (130) every 150+d150 turns";
2254 #endif
2255
2256                 }
2257                 case SV_DRAGON_GREEN:
2258                 {
2259 #ifdef JP
2260 return "ÆǤΥ¬¥¹¤Î¥Ö¥ì¥¹(150) : 180+d180 ¥¿¡¼¥óËè";
2261 #else
2262                         return "breathe poison gas (150) every 180+d180 turns";
2263 #endif
2264
2265                 }
2266                 case SV_DRAGON_RED:
2267                 {
2268 #ifdef JP
2269 return "²Ð±ê¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
2270 #else
2271                         return "breathe fire (200) every 200+d200 turns";
2272 #endif
2273
2274                 }
2275                 case SV_DRAGON_MULTIHUED:
2276                 {
2277 #ifdef JP
2278 return "Ëü¿§¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè";
2279 #else
2280                         return "breathe multi-hued (250) every 200+d200 turns";
2281 #endif
2282
2283                 }
2284                 case SV_DRAGON_BRONZE:
2285                 {
2286 #ifdef JP
2287 return "º®Íð¤Î¥Ö¥ì¥¹(120) : 180+d180 ¥¿¡¼¥óËè";
2288 #else
2289                         return "breathe confusion (120) every 180+d180 turns";
2290 #endif
2291
2292                 }
2293                 case SV_DRAGON_GOLD:
2294                 {
2295 #ifdef JP
2296 return "¹ì²»¤Î¥Ö¥ì¥¹(130) : 180+d180 ¥¿¡¼¥óËè";
2297 #else
2298                         return "breathe sound (130) every 180+d180 turns";
2299 #endif
2300
2301                 }
2302                 case SV_DRAGON_CHAOS:
2303                 {
2304 #ifdef JP
2305 return "¥«¥ª¥¹/Îô²½¤Î¥Ö¥ì¥¹(220) : 200+d200 ¥¿¡¼¥óËè";
2306 #else
2307                         return "breathe chaos/disenchant (220) every 200+d200 turns";
2308 #endif
2309
2310                 }
2311                 case SV_DRAGON_LAW:
2312                 {
2313 #ifdef JP
2314 return "¹ì²»/ÇËÊҤΥ֥쥹(230) : 200+d200 ¥¿¡¼¥óËè";
2315 #else
2316                         return "breathe sound/shards (230) every 200+d200 turns";
2317 #endif
2318
2319                 }
2320                 case SV_DRAGON_BALANCE:
2321                 {
2322 #ifdef JP
2323 return "¥Ð¥é¥ó¥¹¤Î¥Ö¥ì¥¹ (250) 200+d200 ¥¿¡¼¥óËè";
2324 #else
2325                         return "breathe balance (250) every 200+d200 turns";
2326 #endif
2327
2328                 }
2329                 case SV_DRAGON_SHINING:
2330                 {
2331 #ifdef JP
2332 return "Á®¸÷/°Å¹õ¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
2333 #else
2334                         return "breathe light/darkness (200) every 200+d200 turns";
2335 #endif
2336
2337                 }
2338                 case SV_DRAGON_POWER:
2339                 {
2340 #ifdef JP
2341 return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
2342 #else
2343                         return "breathe the elements (300) every 200+d200 turns";
2344 #endif
2345
2346                 }
2347         }
2348
2349         /* Oops */
2350 #ifdef JP
2351 return "¶õµ¤¤Î©";
2352 #else
2353         return "breathe air";
2354 #endif
2355
2356 }
2357
2358
2359 /*
2360  * Describe a "fully identified" item
2361  */
2362 bool screen_object(object_type *o_ptr, bool real)
2363 {
2364         int                     i = 0, j, k;
2365
2366         u32b flgs[TR_FLAG_SIZE];
2367
2368         cptr            info[128];
2369         char o_name[MAX_NLEN];
2370         int wid, hgt;
2371
2372         /* Extract the flags */
2373         object_flags(o_ptr, flgs);
2374
2375         /* Extract the description */
2376         {
2377                 char temp[70 * 20];
2378
2379                 roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
2380                             (k_text + k_info[lookup_kind(o_ptr->tval, o_ptr->sval)].text),
2381                             77 - 15, temp, sizeof(temp));
2382                 for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
2383                 { info[i] = &temp[j]; i++;}
2384         }
2385
2386         /* Mega-Hack -- describe activation */
2387         if (have_flag(flgs, TR_ACTIVATE))
2388         {
2389 #ifdef JP
2390 info[i++] = "»ÏÆ°¤·¤¿¤È¤­¤Î¸ú²Ì...";
2391 #else
2392                 info[i++] = "It can be activated for...";
2393 #endif
2394
2395                 info[i++] = item_activation(o_ptr);
2396 #ifdef JP
2397 info[i++] = "...¤¿¤À¤·ÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£";
2398 #else
2399                 info[i++] = "...if it is being worn.";
2400 #endif
2401
2402         }
2403
2404         /* Figurines, a hack */
2405         if (o_ptr->tval == TV_FIGURINE)
2406         {
2407 #ifdef JP
2408 info[i++] = "¤½¤ì¤ÏÅꤲ¤¿»þ¥Ú¥Ã¥È¤ËÊѲ½¤¹¤ë¡£";
2409 #else
2410                 info[i++] = "It will transform into a pet when thrown.";
2411 #endif
2412
2413         }
2414
2415         /* Figurines, a hack */
2416         if (o_ptr->name1 == ART_STONEMASK)
2417         {
2418 #ifdef JP
2419 info[i++] = "¤½¤ì¤òÁõÈ÷¤·¤¿¼Ô¤ÏµÛ·ìµ´¤Ë¤Ê¤ë¡£";
2420 #else
2421                 info[i++] = "It makes you turn into a vampire permanently.";
2422 #endif
2423
2424         }
2425
2426         if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
2427         {
2428 #ifdef JP
2429 info[i++] = "¤½¤ì¤ÏÁê¼ê¤ò°ì·â¤ÇÅݤ¹¤³¤È¤¬¤¢¤ë¡£";
2430 #else
2431                 info[i++] = "It will attempt to kill a monster instantly.";
2432 #endif
2433
2434         }
2435
2436         if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
2437         {
2438 #ifdef JP
2439 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
2440 #else
2441                 info[i++] = "It causes you to strike yourself sometimes.";
2442 #endif
2443
2444 #ifdef JP
2445 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
2446 #else
2447                 info[i++] = "It always penetrates invulnerability barriers.";
2448 #endif
2449         }
2450
2451         if (o_ptr->name2 == EGO_2WEAPON)
2452         {
2453 #ifdef JP
2454 info[i++] = "¤½¤ì¤ÏÆóÅáή¤Ç¤ÎÌ¿ÃæΨ¤ò¸þ¾å¤µ¤»¤ë¡£";
2455 #else
2456                 info[i++] = "It affects your ability to hit when you are wielding two weapons.";
2457 #endif
2458
2459         }
2460
2461         if (have_flag(flgs, TR_EASY_SPELL))
2462         {
2463 #ifdef JP
2464 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
2465 #else
2466                 info[i++] = "It affects your ability to cast spells.";
2467 #endif
2468         }
2469
2470         if (o_ptr->name2 == EGO_AMU_FOOL)
2471         {
2472 #ifdef JP
2473 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
2474 #else
2475                 info[i++] = "It interferes with casting spells.";
2476 #endif
2477         }
2478
2479         if (o_ptr->name2 == EGO_RING_THROW)
2480         {
2481 #ifdef JP
2482 info[i++] = "¤½¤ì¤Ïʪ¤ò¶¯¤¯Åꤲ¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
2483 #else
2484                 info[i++] = "It provides great strength when you throw an item.";
2485 #endif
2486         }
2487
2488         if (o_ptr->name2 == EGO_AMU_NAIVETY)
2489         {
2490 #ifdef JP
2491 info[i++] = "¤½¤ì¤ÏËâË¡Äñ¹³ÎϤò²¼¤²¤ë¡£";
2492 #else
2493                 info[i++] = "It decreases your magic resistance.";
2494 #endif
2495         }
2496
2497         if (o_ptr->tval == TV_STATUE)
2498         {
2499                 monster_race *r_ptr = &r_info[o_ptr->pval];
2500
2501                 if (o_ptr->pval == MON_BULLGATES)
2502 #ifdef JP
2503                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤ÈÃѤº¤«¤·¤¤¡£";
2504 #else
2505                         info[i++] = "It is shameful.";
2506 #endif
2507                 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
2508 #ifdef JP
2509                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È¶²¤¤¡£";
2510 #else
2511                 info[i++] = "It is fearful.";
2512 #endif
2513                 else
2514 #ifdef JP
2515                         info[i++] = "¤½¤ì¤ÏÉô²°¤Ë¾þ¤ë¤È³Ú¤·¤¤¡£";
2516 #else
2517                 info[i++] = "It is cheerful.";
2518 #endif
2519         }
2520         
2521         /* Hack -- describe lite's */
2522         if (o_ptr->tval == TV_LITE)
2523         {
2524                 if (o_ptr->name2 == EGO_LITE_DARKNESS)
2525                 {
2526 #ifdef JP
2527                         info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
2528 #else
2529                         info[i++] = "It provides no light.";
2530 #endif
2531
2532                         if (o_ptr->sval == SV_LITE_FEANOR ||
2533                             o_ptr->sval == SV_LITE_LANTERN)
2534                         {
2535 #ifdef JP
2536                                 info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
2537 #else
2538                                 info[i++] = "It decreases radius of light source by 2.";
2539 #endif
2540                         }
2541                         else
2542                         {
2543 #ifdef JP
2544                                 info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
2545 #else
2546                                 info[i++] = "It decreases radius of light source by 1.";
2547 #endif
2548                         }
2549                 }
2550                 else if (artifact_p(o_ptr))
2551                 {
2552 #ifdef JP
2553 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2554 #else
2555                         info[i++] = "It provides light (radius 3) forever.";
2556 #endif
2557
2558                 }
2559                 else if (o_ptr->name2 == EGO_LITE_SHINE)
2560                 {
2561                         if (o_ptr->sval == SV_LITE_FEANOR)
2562                         {
2563 #ifdef JP
2564 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2565 #else
2566                                 info[i++] = "It provides light (radius 3) forever.";
2567 #endif
2568
2569                         }
2570                         else if (o_ptr->sval == SV_LITE_LANTERN)
2571                         {
2572 #ifdef JP
2573 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
2574 #else
2575                                 info[i++] = "It provides light (radius 3) when fueled.";
2576 #endif
2577
2578                         }
2579                         else
2580                         {
2581 #ifdef JP
2582 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2583 #else
2584                                 info[i++] = "It provides light (radius 2) when fueled.";
2585 #endif
2586
2587                         }
2588                 }
2589                 else
2590                 {
2591                         if (o_ptr->sval == SV_LITE_FEANOR)
2592                         {
2593 #ifdef JP
2594 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2595 #else
2596                                 info[i++] = "It provides light (radius 2) forever.";
2597 #endif
2598
2599                         }
2600                         else if (o_ptr->sval == SV_LITE_LANTERN)
2601                         {
2602 #ifdef JP
2603 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 2)¤ò¼ø¤±¤ë¡£";
2604 #else
2605                                 info[i++] = "It provides light (radius 2) when fueled.";
2606 #endif
2607
2608                         }
2609                         else
2610                         {
2611 #ifdef JP
2612 info[i++] = "¤½¤ì¤ÏdzÎÁÊäµë¤Ë¤è¤Ã¤ÆÌÀ¤«¤ê(Ⱦ·Â 1)¤ò¼ø¤±¤ë¡£";
2613 #else
2614                                 info[i++] = "It provides light (radius 1) when fueled.";
2615 #endif
2616
2617                         }
2618                 }
2619                 if (o_ptr->name2 == EGO_LITE_LONG)
2620                 {
2621 #ifdef JP
2622 info[i++] = "¤½¤ì¤ÏŤ¤¥¿¡¼¥óÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
2623 #else
2624                         info[i++] = "It provides light for much longer time.";
2625 #endif
2626                 }
2627         }
2628
2629
2630         /* And then describe it fully */
2631
2632         if (have_flag(flgs, TR_RIDING))
2633         {
2634                 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
2635 #ifdef JP
2636 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤ÏÈó¾ï¤Ë»È¤¤¤ä¤¹¤¤¡£";
2637 #else
2638                         info[i++] = "It is made for use while riding.";
2639 #endif
2640                 else
2641 #ifdef JP
2642 info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
2643 #else
2644                         info[i++] = "It is suitable for use while riding.";
2645 #endif
2646
2647         }
2648         if (have_flag(flgs, TR_STR))
2649         {
2650 #ifdef JP
2651 info[i++] = "¤½¤ì¤ÏÏÓÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2652 #else
2653                 info[i++] = "It affects your strength.";
2654 #endif
2655
2656         }
2657         if (have_flag(flgs, TR_INT))
2658         {
2659 #ifdef JP
2660 info[i++] = "¤½¤ì¤ÏÃÎǽ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2661 #else
2662                 info[i++] = "It affects your intelligence.";
2663 #endif
2664
2665         }
2666         if (have_flag(flgs, TR_WIS))
2667         {
2668 #ifdef JP
2669 info[i++] = "¤½¤ì¤Ï¸­¤µ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2670 #else
2671                 info[i++] = "It affects your wisdom.";
2672 #endif
2673
2674         }
2675         if (have_flag(flgs, TR_DEX))
2676         {
2677 #ifdef JP
2678 info[i++] = "¤½¤ì¤Ï´ïÍѤµ¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2679 #else
2680                 info[i++] = "It affects your dexterity.";
2681 #endif
2682
2683         }
2684         if (have_flag(flgs, TR_CON))
2685         {
2686 #ifdef JP
2687 info[i++] = "¤½¤ì¤ÏÂѵ×ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2688 #else
2689                 info[i++] = "It affects your constitution.";
2690 #endif
2691
2692         }
2693         if (have_flag(flgs, TR_CHR))
2694         {
2695 #ifdef JP
2696 info[i++] = "¤½¤ì¤ÏÌ¥ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2697 #else
2698                 info[i++] = "It affects your charisma.";
2699 #endif
2700
2701         }
2702
2703         if (have_flag(flgs, TR_MAGIC_MASTERY))
2704         {
2705 #ifdef JP
2706 info[i++] = "¤½¤ì¤ÏËâË¡Æ»¶ñ»ÈÍÑǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2707 #else
2708                 info[i++] = "It affects your ability to use magic devices.";
2709 #endif
2710
2711         }
2712         if (have_flag(flgs, TR_STEALTH))
2713         {
2714 #ifdef JP
2715 info[i++] = "¤½¤ì¤Ï±£Ì©¹ÔưǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2716 #else
2717                 info[i++] = "It affects your stealth.";
2718 #endif
2719
2720         }
2721         if (have_flag(flgs, TR_SEARCH))
2722         {
2723 #ifdef JP
2724 info[i++] = "¤½¤ì¤Ïõº÷ǽÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2725 #else
2726                 info[i++] = "It affects your searching.";
2727 #endif
2728
2729         }
2730         if (have_flag(flgs, TR_INFRA))
2731         {
2732 #ifdef JP
2733 info[i++] = "¤½¤ì¤ÏÀÖ³°Àþ»ëÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2734 #else
2735                 info[i++] = "It affects your infravision.";
2736 #endif
2737
2738         }
2739         if (have_flag(flgs, TR_TUNNEL))
2740         {
2741 #ifdef JP
2742 info[i++] = "¤½¤ì¤ÏºÎ·¡Ç½ÎϤ˱ƶÁ¤òµÚ¤Ü¤¹";
2743 #else
2744                 info[i++] = "It affects your ability to tunnel.";
2745 #endif
2746
2747         }
2748         if (have_flag(flgs, TR_SPEED))
2749         {
2750 #ifdef JP
2751 info[i++] = "¤½¤ì¤Ï¥¹¥Ô¡¼¥É¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2752 #else
2753                 info[i++] = "It affects your speed.";
2754 #endif
2755
2756         }
2757         if (have_flag(flgs, TR_BLOWS))
2758         {
2759 #ifdef JP
2760 info[i++] = "¤½¤ì¤ÏÂÇ·â²ó¿ô¤Ë±Æ¶Á¤òµÚ¤Ü¤¹";
2761 #else
2762                 info[i++] = "It affects your attack speed.";
2763 #endif
2764
2765         }
2766
2767         if (have_flag(flgs, TR_BRAND_ACID))
2768         {
2769 #ifdef JP
2770 info[i++] = "¤½¤ì¤Ï»À¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2771 #else
2772                 info[i++] = "It does extra damage from acid.";
2773 #endif
2774
2775         }
2776         if (have_flag(flgs, TR_BRAND_ELEC))
2777         {
2778 #ifdef JP
2779 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2780 #else
2781                 info[i++] = "It does extra damage from electricity.";
2782 #endif
2783
2784         }
2785         if (have_flag(flgs, TR_BRAND_FIRE))
2786         {
2787 #ifdef JP
2788 info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2789 #else
2790                 info[i++] = "It does extra damage from fire.";
2791 #endif
2792
2793         }
2794         if (have_flag(flgs, TR_BRAND_COLD))
2795         {
2796 #ifdef JP
2797 info[i++] = "¤½¤ì¤ÏÎ䵤¤Ë¤è¤Ã¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë";
2798 #else
2799                 info[i++] = "It does extra damage from frost.";
2800 #endif
2801
2802         }
2803
2804         if (have_flag(flgs, TR_BRAND_POIS))
2805         {
2806 #ifdef JP
2807 info[i++] = "¤½¤ì¤ÏŨ¤òÆǤ¹¤ë¡£";
2808 #else
2809                 info[i++] = "It poisons your foes.";
2810 #endif
2811
2812         }
2813
2814         if (have_flag(flgs, TR_CHAOTIC))
2815         {
2816 #ifdef JP
2817 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹Åª¤Ê¸ú²Ì¤òµÚ¤Ü¤¹¡£";
2818 #else
2819                 info[i++] = "It produces chaotic effects.";
2820 #endif
2821
2822         }
2823
2824         if (have_flag(flgs, TR_VAMPIRIC))
2825         {
2826 #ifdef JP
2827 info[i++] = "¤½¤ì¤ÏŨ¤«¤é¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤òµÛ¼ý¤¹¤ë¡£";
2828 #else
2829                 info[i++] = "It drains life from your foes.";
2830 #endif
2831
2832         }
2833
2834         if (have_flag(flgs, TR_IMPACT))
2835         {
2836 #ifdef JP
2837 info[i++] = "¤½¤ì¤ÏÃϿ̤òµ¯¤³¤¹¤³¤È¤¬¤Ç¤­¤ë¡£";
2838 #else
2839                 info[i++] = "It can cause earthquakes.";
2840 #endif
2841
2842         }
2843
2844         if (have_flag(flgs, TR_VORPAL))
2845         {
2846 #ifdef JP
2847 info[i++] = "¤½¤ì¤ÏÈó¾ï¤ËÀÚ¤ìÌ£¤¬±Ô¤¯Å¨¤òÀÚÃǤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
2848 #else
2849                 info[i++] = "It is very sharp and can cut your foes.";
2850 #endif
2851
2852         }
2853
2854         if (have_flag(flgs, TR_KILL_DRAGON))
2855         {
2856 #ifdef JP
2857 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2858 #else
2859                 info[i++] = "It is a great bane of dragons.";
2860 #endif
2861
2862         }
2863         else if (have_flag(flgs, TR_SLAY_DRAGON))
2864         {
2865 #ifdef JP
2866 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2867 #else
2868                 info[i++] = "It is especially deadly against dragons.";
2869 #endif
2870
2871         }
2872
2873         if (have_flag(flgs, TR_KILL_ORC))
2874         {
2875 #ifdef JP
2876 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2877 #else
2878                 info[i++] = "It is a great bane of orcs.";
2879 #endif
2880
2881         }
2882         if (have_flag(flgs, TR_SLAY_ORC))
2883         {
2884 #ifdef JP
2885 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2886 #else
2887                 info[i++] = "It is especially deadly against orcs.";
2888 #endif
2889
2890         }
2891
2892         if (have_flag(flgs, TR_KILL_TROLL))
2893         {
2894 #ifdef JP
2895 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2896 #else
2897                 info[i++] = "It is a great bane of trolls.";
2898 #endif
2899
2900         }
2901         if (have_flag(flgs, TR_SLAY_TROLL))
2902         {
2903 #ifdef JP
2904 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2905 #else
2906                 info[i++] = "It is especially deadly against trolls.";
2907 #endif
2908
2909         }
2910
2911         if (have_flag(flgs, TR_KILL_GIANT))
2912         {
2913 #ifdef JP
2914 info[i++] = "¤½¤ì¤Ïµð¿Í¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2915 #else
2916                 info[i++] = "It is a great bane of giants.";
2917 #endif
2918         }
2919         else if (have_flag(flgs, TR_SLAY_GIANT))
2920         {
2921 #ifdef JP
2922 info[i++] = "¤½¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2923 #else
2924                 info[i++] = "It is especially deadly against giants.";
2925 #endif
2926
2927         }
2928
2929         if (have_flag(flgs, TR_KILL_DEMON))
2930         {
2931 #ifdef JP
2932 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2933 #else
2934                 info[i++] = "It is a great bane of demons.";
2935 #endif
2936
2937         }
2938         if (have_flag(flgs, TR_SLAY_DEMON))
2939         {
2940 #ifdef JP
2941 info[i++] = "¤½¤ì¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
2942 #else
2943                 info[i++] = "It strikes at demons with holy wrath.";
2944 #endif
2945
2946         }
2947
2948         if (have_flag(flgs, TR_KILL_UNDEAD))
2949         {
2950 #ifdef JP
2951 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2952 #else
2953                 info[i++] = "It is a great bane of undead.";
2954 #endif
2955
2956         }
2957         if (have_flag(flgs, TR_SLAY_UNDEAD))
2958         {
2959 #ifdef JP
2960 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
2961 #else
2962                 info[i++] = "It strikes at undead with holy wrath.";
2963 #endif
2964
2965         }
2966
2967         if (have_flag(flgs, TR_KILL_EVIL))
2968         {
2969 #ifdef JP
2970 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¤ë¸ºß¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2971 #else
2972                 info[i++] = "It is a great bane of evil monsters.";
2973 #endif
2974
2975         }
2976         if (have_flag(flgs, TR_SLAY_EVIL))
2977         {
2978 #ifdef JP
2979 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¤ë¸ºß¤ËÂФ·¤ÆÀ»¤Ê¤ëÎϤǹ¶·â¤¹¤ë¡£";
2980 #else
2981                 info[i++] = "It fights against evil with holy fury.";
2982 #endif
2983
2984         }
2985
2986         if (have_flag(flgs, TR_KILL_ANIMAL))
2987         {
2988 #ifdef JP
2989 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
2990 #else
2991                 info[i++] = "It is a great bane of natural creatures.";
2992 #endif
2993
2994         }
2995         if (have_flag(flgs, TR_SLAY_ANIMAL))
2996         {
2997 #ifdef JP
2998 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤Îưʪ¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
2999 #else
3000                 info[i++] = "It is especially deadly against natural creatures.";
3001 #endif
3002
3003         }
3004
3005         if (have_flag(flgs, TR_KILL_HUMAN))
3006         {
3007 #ifdef JP
3008 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤Ë¤È¤Ã¤Æ¤ÎŷŨ¤Ç¤¢¤ë¡£";
3009 #else
3010                 info[i++] = "It is a great bane of humans.";
3011 #endif
3012
3013         }
3014         if (have_flag(flgs, TR_SLAY_HUMAN))
3015         {
3016 #ifdef JP
3017 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶²¤ë¤Ù¤­ÎϤòȯ´ø¤¹¤ë¡£";
3018 #else
3019                 info[i++] = "It is especially deadly against humans.";
3020 #endif
3021
3022         }
3023
3024         if (have_flag(flgs, TR_FORCE_WEAPON))
3025         {
3026 #ifdef JP
3027 info[i++] = "¤½¤ì¤Ï»ÈÍѼԤÎËâÎϤò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
3028 #else
3029                 info[i++] = "It powerfully strikes at a monster using your mana.";
3030 #endif
3031
3032         }
3033         if (have_flag(flgs, TR_DEC_MANA))
3034         {
3035 #ifdef JP
3036 info[i++] = "¤½¤ì¤ÏËâÎϤξÃÈñ¤ò²¡¤µ¤¨¤ë¡£";
3037 #else
3038                 info[i++] = "It decreases your mana consumption.";
3039 #endif
3040
3041         }
3042         if (have_flag(flgs, TR_SUST_STR))
3043         {
3044 #ifdef JP
3045 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÏÓÎϤò°Ý»ý¤¹¤ë¡£";
3046 #else
3047                 info[i++] = "It sustains your strength.";
3048 #endif
3049
3050         }
3051         if (have_flag(flgs, TR_SUST_INT))
3052         {
3053 #ifdef JP
3054 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÃÎǽ¤ò°Ý»ý¤¹¤ë¡£";
3055 #else
3056                 info[i++] = "It sustains your intelligence.";
3057 #endif
3058
3059         }
3060         if (have_flag(flgs, TR_SUST_WIS))
3061         {
3062 #ifdef JP
3063 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¸­¤µ¤ò°Ý»ý¤¹¤ë¡£";
3064 #else
3065                 info[i++] = "It sustains your wisdom.";
3066 #endif
3067
3068         }
3069         if (have_flag(flgs, TR_SUST_DEX))
3070         {
3071 #ifdef JP
3072 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î´ïÍѤµ¤ò°Ý»ý¤¹¤ë¡£";
3073 #else
3074                 info[i++] = "It sustains your dexterity.";
3075 #endif
3076
3077         }
3078         if (have_flag(flgs, TR_SUST_CON))
3079         {
3080 #ifdef JP
3081 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂѵ×ÎϤò°Ý»ý¤¹¤ë¡£";
3082 #else
3083                 info[i++] = "It sustains your constitution.";
3084 #endif
3085
3086         }
3087         if (have_flag(flgs, TR_SUST_CHR))
3088         {
3089 #ifdef JP
3090 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÌ¥ÎϤò°Ý»ý¤¹¤ë¡£";
3091 #else
3092                 info[i++] = "It sustains your charisma.";
3093 #endif
3094
3095         }
3096
3097         if (have_flag(flgs, TR_IM_ACID))
3098         {
3099 #ifdef JP
3100 info[i++] = "¤½¤ì¤Ï»À¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3101 #else
3102                 info[i++] = "It provides immunity to acid.";
3103 #endif
3104
3105         }
3106         if (have_flag(flgs, TR_IM_ELEC))
3107         {
3108 #ifdef JP
3109 info[i++] = "¤½¤ì¤ÏÅÅ·â¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3110 #else
3111                 info[i++] = "It provides immunity to electricity.";
3112 #endif
3113
3114         }
3115         if (have_flag(flgs, TR_IM_FIRE))
3116         {
3117 #ifdef JP
3118 info[i++] = "¤½¤ì¤Ï²Ð¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3119 #else
3120                 info[i++] = "It provides immunity to fire.";
3121 #endif
3122
3123         }
3124         if (have_flag(flgs, TR_IM_COLD))
3125         {
3126 #ifdef JP
3127 info[i++] = "¤½¤ì¤Ï´¨¤µ¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3128 #else
3129                 info[i++] = "It provides immunity to cold.";
3130 #endif
3131
3132         }
3133
3134         if (have_flag(flgs, TR_THROW))
3135         {
3136 #ifdef JP
3137 info[i++] = "¤½¤ì¤ÏŨ¤ËÅꤲ¤ÆÂ礭¤Ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
3138 #else
3139                 info[i++] = "It is perfectly balanced for throwing.";
3140 #endif
3141         }
3142
3143         if (have_flag(flgs, TR_FREE_ACT))
3144         {
3145 #ifdef JP
3146 info[i++] = "¤½¤ì¤ÏËãáã¤ËÂФ¹¤ë´°Á´¤ÊÌȱ֤ò¼ø¤±¤ë¡£";
3147 #else
3148                 info[i++] = "It provides immunity to paralysis.";
3149 #endif
3150
3151         }
3152         if (have_flag(flgs, TR_HOLD_LIFE))
3153         {
3154 #ifdef JP
3155 info[i++] = "¤½¤ì¤ÏÀ¸Ì¿Îϵۼý¤ËÂФ¹¤ëÂÑÀ­¤ò¼ø¤±¤ë¡£";
3156 #else
3157                 info[i++] = "It provides resistance to life draining.";
3158 #endif
3159
3160         }
3161         if (have_flag(flgs, TR_RES_FEAR))
3162         {
3163 #ifdef JP
3164 info[i++] = "¤½¤ì¤Ï¶²Éݤؤδ°Á´¤ÊÂÑÀ­¤ò¼ø¤±¤ë¡£";
3165 #else
3166                 info[i++] = "It makes you completely fearless.";
3167 #endif
3168
3169         }
3170         if (have_flag(flgs, TR_RES_ACID))
3171         {
3172 #ifdef JP
3173 info[i++] = "¤½¤ì¤Ï»À¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3174 #else
3175                 info[i++] = "It provides resistance to acid.";
3176 #endif
3177
3178         }
3179         if (have_flag(flgs, TR_RES_ELEC))
3180         {
3181 #ifdef JP
3182 info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3183 #else
3184                 info[i++] = "It provides resistance to electricity.";
3185 #endif
3186
3187         }
3188         if (have_flag(flgs, TR_RES_FIRE))
3189         {
3190 #ifdef JP
3191 info[i++] = "¤½¤ì¤Ï²Ð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3192 #else
3193                 info[i++] = "It provides resistance to fire.";
3194 #endif
3195
3196         }
3197         if (have_flag(flgs, TR_RES_COLD))
3198         {
3199 #ifdef JP
3200 info[i++] = "¤½¤ì¤Ï´¨¤µ¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3201 #else
3202                 info[i++] = "It provides resistance to cold.";
3203 #endif
3204
3205         }
3206         if (have_flag(flgs, TR_RES_POIS))
3207         {
3208 #ifdef JP
3209 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3210 #else
3211                 info[i++] = "It provides resistance to poison.";
3212 #endif
3213
3214         }
3215
3216         if (have_flag(flgs, TR_RES_LITE))
3217         {
3218 #ifdef JP
3219 info[i++] = "¤½¤ì¤ÏÁ®¸÷¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3220 #else
3221                 info[i++] = "It provides resistance to light.";
3222 #endif
3223
3224         }
3225         if (have_flag(flgs, TR_RES_DARK))
3226         {
3227 #ifdef JP
3228 info[i++] = "¤½¤ì¤Ï°Å¹õ¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3229 #else
3230                 info[i++] = "It provides resistance to dark.";
3231 #endif
3232
3233         }
3234
3235         if (have_flag(flgs, TR_RES_BLIND))
3236         {
3237 #ifdef JP
3238 info[i++] = "¤½¤ì¤ÏÌÕÌܤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3239 #else
3240                 info[i++] = "It provides resistance to blindness.";
3241 #endif
3242
3243         }
3244         if (have_flag(flgs, TR_RES_CONF))
3245         {
3246 #ifdef JP
3247 info[i++] = "¤½¤ì¤Ïº®Íð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3248 #else
3249                 info[i++] = "It provides resistance to confusion.";
3250 #endif
3251
3252         }
3253         if (have_flag(flgs, TR_RES_SOUND))
3254         {
3255 #ifdef JP
3256 info[i++] = "¤½¤ì¤Ï¹ì²»¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3257 #else
3258                 info[i++] = "It provides resistance to sound.";
3259 #endif
3260
3261         }
3262         if (have_flag(flgs, TR_RES_SHARDS))
3263         {
3264 #ifdef JP
3265 info[i++] = "¤½¤ì¤ÏÇËÊҤؤÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3266 #else
3267                 info[i++] = "It provides resistance to shards.";
3268 #endif
3269
3270         }
3271
3272         if (have_flag(flgs, TR_RES_NETHER))
3273         {
3274 #ifdef JP
3275 info[i++] = "¤½¤ì¤ÏÃϹö¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3276 #else
3277                 info[i++] = "It provides resistance to nether.";
3278 #endif
3279
3280         }
3281         if (have_flag(flgs, TR_RES_NEXUS))
3282         {
3283 #ifdef JP
3284 info[i++] = "¤½¤ì¤Ï°ø²Ìº®Íð¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3285 #else
3286                 info[i++] = "It provides resistance to nexus.";
3287 #endif
3288
3289         }
3290         if (have_flag(flgs, TR_RES_CHAOS))
3291         {
3292 #ifdef JP
3293 info[i++] = "¤½¤ì¤Ï¥«¥ª¥¹¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3294 #else
3295                 info[i++] = "It provides resistance to chaos.";
3296 #endif
3297
3298         }
3299         if (have_flag(flgs, TR_RES_DISEN))
3300         {
3301 #ifdef JP
3302 info[i++] = "¤½¤ì¤ÏÎô²½¤Ø¤ÎÂÑÀ­¤ò¼ø¤±¤ë¡£";
3303 #else
3304                 info[i++] = "It provides resistance to disenchantment.";
3305 #endif
3306
3307         }
3308
3309         if (have_flag(flgs, TR_FEATHER))
3310         {
3311 #ifdef JP
3312 info[i++] = "¤½¤ì¤ÏÃè¤ËÉ⤯¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
3313 #else
3314                 info[i++] = "It allows you to levitate.";
3315 #endif
3316
3317         }
3318         if (have_flag(flgs, TR_LITE))
3319         {
3320                 if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
3321 #ifdef JP
3322 info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
3323 #else
3324                         info[i++] = "It decreases radius of your light source by 1.";
3325 #endif
3326                 else
3327 #ifdef JP
3328 info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
3329 #else
3330                         info[i++] = "It provides permanent light. (radius +1)";
3331 #endif
3332
3333         }
3334         if (have_flag(flgs, TR_SEE_INVIS))
3335         {
3336 #ifdef JP
3337 info[i++] = "¤½¤ì¤ÏÆ©ÌÀ¤Ê¥â¥ó¥¹¥¿¡¼¤ò¸«¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£";
3338 #else
3339                 info[i++] = "It allows you to see invisible monsters.";
3340 #endif
3341
3342         }
3343         if (have_flag(flgs, TR_TELEPATHY))
3344         {
3345 #ifdef JP
3346 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò¼ø¤±¤ë¡£";
3347 #else
3348                 info[i++] = "It gives telepathic powers.";
3349 #endif
3350
3351         }
3352         if (have_flag(flgs, TR_ESP_ANIMAL))
3353         {
3354 #ifdef JP
3355 info[i++] = "¤½¤ì¤Ï¼«Á³³¦¤ÎÀ¸Êª¤ò´¶ÃΤ¹¤ë¡£";
3356 #else
3357                 info[i++] = "It senses natural creatures.";
3358 #endif
3359
3360         }
3361         if (have_flag(flgs, TR_ESP_UNDEAD))
3362         {
3363 #ifdef JP
3364 info[i++] = "¤½¤ì¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò´¶ÃΤ¹¤ë¡£";
3365 #else
3366                 info[i++] = "It senses undead.";
3367 #endif
3368
3369         }
3370         if (have_flag(flgs, TR_ESP_DEMON))
3371         {
3372 #ifdef JP
3373 info[i++] = "¤½¤ì¤Ï°­Ëâ¤ò´¶ÃΤ¹¤ë¡£";
3374 #else
3375                 info[i++] = "It senses demons.";
3376 #endif
3377
3378         }
3379         if (have_flag(flgs, TR_ESP_ORC))
3380         {
3381 #ifdef JP
3382 info[i++] = "¤½¤ì¤Ï¥ª¡¼¥¯¤ò´¶ÃΤ¹¤ë¡£";
3383 #else
3384                 info[i++] = "It senses orcs.";
3385 #endif
3386
3387         }
3388         if (have_flag(flgs, TR_ESP_TROLL))
3389         {
3390 #ifdef JP
3391 info[i++] = "¤½¤ì¤Ï¥È¥í¥ë¤ò´¶ÃΤ¹¤ë¡£";
3392 #else
3393                 info[i++] = "It senses trolls.";
3394 #endif
3395
3396         }
3397         if (have_flag(flgs, TR_ESP_GIANT))
3398         {
3399 #ifdef JP
3400 info[i++] = "¤½¤ì¤Ïµð¿Í¤ò´¶ÃΤ¹¤ë¡£";
3401 #else
3402                 info[i++] = "It senses giants.";
3403 #endif
3404
3405         }
3406         if (have_flag(flgs, TR_ESP_DRAGON))
3407         {
3408 #ifdef JP
3409 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò´¶ÃΤ¹¤ë¡£";
3410 #else
3411                 info[i++] = "It senses dragons.";
3412 #endif
3413
3414         }
3415         if (have_flag(flgs, TR_ESP_HUMAN))
3416         {
3417 #ifdef JP
3418 info[i++] = "¤½¤ì¤Ï¿Í´Ö¤ò´¶ÃΤ¹¤ë¡£";
3419 #else
3420                 info[i++] = "It senses humans.";
3421 #endif
3422
3423         }
3424         if (have_flag(flgs, TR_ESP_EVIL))
3425         {
3426 #ifdef JP
3427 info[i++] = "¤½¤ì¤Ï¼Ù°­¤Ê¸ºß¤ò´¶ÃΤ¹¤ë¡£";
3428 #else
3429                 info[i++] = "It senses evil creatures.";
3430 #endif
3431
3432         }
3433         if (have_flag(flgs, TR_ESP_GOOD))
3434         {
3435 #ifdef JP
3436 info[i++] = "¤½¤ì¤ÏÁ±Îɤʸºß¤ò´¶ÃΤ¹¤ë¡£";
3437 #else
3438                 info[i++] = "It senses good creatures.";
3439 #endif
3440
3441         }
3442         if (have_flag(flgs, TR_ESP_NONLIVING))
3443         {
3444 #ifdef JP
3445 info[i++] = "¤½¤ì¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤò´¶ÃΤ¹¤ë¡£";
3446 #else
3447                 info[i++] = "It senses non-living creatures.";
3448 #endif
3449
3450         }
3451         if (have_flag(flgs, TR_ESP_UNIQUE))
3452         {
3453 #ifdef JP
3454 info[i++] = "¤½¤ì¤ÏÆÃÊ̤ʶ¯Å¨¤ò´¶ÃΤ¹¤ë¡£";
3455 #else
3456                 info[i++] = "It senses unique monsters.";
3457 #endif
3458
3459         }
3460         if (have_flag(flgs, TR_SLOW_DIGEST))
3461         {
3462 #ifdef JP
3463 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤òÃÙ¤¯¤¹¤ë¡£";
3464 #else
3465                 info[i++] = "It slows your metabolism.";
3466 #endif
3467
3468         }
3469         if (have_flag(flgs, TR_REGEN))
3470         {
3471 #ifdef JP
3472 info[i++] = "¤½¤ì¤ÏÂÎÎϲóÉüÎϤò¶¯²½¤¹¤ë¡£";
3473 #else
3474                 info[i++] = "It speeds your regenerative powers.";
3475 #endif
3476
3477         }
3478         if (have_flag(flgs, TR_WARNING))
3479         {
3480 #ifdef JP
3481 info[i++] = "¤½¤ì¤Ï´í¸±¤ËÂФ·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£";
3482 #else
3483                 info[i++] = "It warns you of danger";
3484 #endif
3485
3486         }
3487         if (have_flag(flgs, TR_REFLECT))
3488         {
3489 #ifdef JP
3490 info[i++] = "¤½¤ì¤ÏÌð¤ä¥Ü¥ë¥È¤òÈ¿¼Í¤¹¤ë¡£";
3491 #else
3492                 info[i++] = "It reflects bolts and arrows.";
3493 #endif
3494
3495         }
3496         if (have_flag(flgs, TR_SH_FIRE))
3497         {
3498 #ifdef JP
3499 info[i++] = "¤½¤ì¤Ï±ê¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3500 #else
3501                 info[i++] = "It produces a fiery sheath.";
3502 #endif
3503
3504         }
3505         if (have_flag(flgs, TR_SH_ELEC))
3506         {
3507 #ifdef JP
3508 info[i++] = "¤½¤ì¤ÏÅŵ¤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3509 #else
3510                 info[i++] = "It produces an electric sheath.";
3511 #endif
3512
3513         }
3514         if (have_flag(flgs, TR_SH_COLD))
3515         {
3516 #ifdef JP
3517 info[i++] = "¤½¤ì¤ÏÎ䵤¤Î¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3518 #else
3519                 info[i++] = "It produces a sheath of coldness.";
3520 #endif
3521
3522         }
3523         if (have_flag(flgs, TR_NO_MAGIC))
3524         {
3525 #ifdef JP
3526 info[i++] = "¤½¤ì¤ÏÈ¿ËâË¡¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
3527 #else
3528                 info[i++] = "It produces an anti-magic shell.";
3529 #endif
3530
3531         }
3532         if (have_flag(flgs, TR_NO_TELE))
3533         {
3534 #ifdef JP
3535 info[i++] = "¤½¤ì¤Ï¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤹¤ë¡£";
3536 #else
3537                 info[i++] = "It prevents teleportation.";
3538 #endif
3539
3540         }
3541         if (have_flag(flgs, TR_XTRA_MIGHT))
3542         {
3543 #ifdef JP
3544 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤò¤è¤ê¶¯ÎϤËȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
3545 #else
3546                 info[i++] = "It fires missiles with extra might.";
3547 #endif
3548
3549         }
3550         if (have_flag(flgs, TR_XTRA_SHOTS))
3551         {
3552 #ifdef JP
3553 info[i++] = "¤½¤ì¤ÏÌ𡿥ܥë¥È¡¿ÃƤòÈó¾ï¤ËÁ᤯ȯ¼Í¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
3554 #else
3555                 info[i++] = "It fires missiles excessively fast.";
3556 #endif
3557
3558         }
3559
3560         if (have_flag(flgs, TR_BLESSED))
3561         {
3562 #ifdef JP
3563 info[i++] = "¤½¤ì¤Ï¿À¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£";
3564 #else
3565                 info[i++] = "It has been blessed by the gods.";
3566 #endif
3567
3568         }
3569
3570         if (cursed_p(o_ptr))
3571         {
3572                 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
3573                 {
3574 #ifdef JP
3575 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Î¼ö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
3576 #else
3577                         info[i++] = "It is permanently cursed.";
3578 #endif
3579
3580                 }
3581                 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
3582                 {
3583 #ifdef JP
3584 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤¬¤«¤±¤é¤ì¤Æ¤¤¤ë¡£";
3585 #else
3586                         info[i++] = "It is heavily cursed.";
3587 #endif
3588
3589                 }
3590                 else
3591                 {
3592 #ifdef JP
3593 info[i++] = "¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¡£";
3594 #else
3595                         info[i++] = "It is cursed.";
3596 #endif
3597
3598                 }
3599         }
3600
3601         if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
3602         {
3603 #ifdef JP
3604 info[i++] = "¤½¤ì¤ÏÂÀ¸Å¤Î²Ò¡¹¤·¤¤±åÇ°¤¬½É¤Ã¤Æ¤¤¤ë¡£";
3605 #else
3606                 info[i++] = "It carries an ancient foul curse.";
3607 #endif
3608
3609         }
3610         if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
3611         {
3612 #ifdef JP
3613 info[i++] = "¤½¤ì¤ÏÉÕ¶á¤Î¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤ë¡£";
3614 #else
3615                 info[i++] = "It aggravates nearby creatures.";
3616 #endif
3617
3618         }
3619         if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
3620         {
3621 #ifdef JP
3622 info[i++] = "¤½¤ì¤Ï·Ð¸³ÃͤòµÛ¤¤¼è¤ë¡£";
3623 #else
3624                 info[i++] = "It drains experience.";
3625 #endif
3626
3627         }
3628         if (o_ptr->curse_flags & TRC_SLOW_REGEN)
3629         {
3630 #ifdef JP
3631 info[i++] = "¤½¤ì¤Ï²óÉüÎϤò¼å¤á¤ë¡£";
3632 #else
3633                 info[i++] = "It slows your regenerative powers.";
3634 #endif
3635
3636         }
3637         if (o_ptr->curse_flags & TRC_ADD_L_CURSE)
3638         {
3639 #ifdef JP
3640 info[i++] = "¤½¤ì¤Ï¼å¤¤¼ö¤¤¤òÁý¤ä¤¹¡£";
3641 #else
3642                 info[i++] = "It adds weak curses.";
3643 #endif
3644
3645         }
3646         if (o_ptr->curse_flags & TRC_ADD_H_CURSE)
3647         {
3648 #ifdef JP
3649 info[i++] = "¤½¤ì¤Ï¶¯ÎϤʼö¤¤¤òÁý¤ä¤¹¡£";
3650 #else
3651                 info[i++] = "It adds heavy curses.";
3652 #endif
3653
3654         }
3655         if (o_ptr->curse_flags & TRC_CALL_ANIMAL)
3656         {
3657 #ifdef JP
3658 info[i++] = "¤½¤ì¤Ïưʪ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3659 #else
3660                 info[i++] = "It attracts animals.";
3661 #endif
3662
3663         }
3664         if (o_ptr->curse_flags & TRC_CALL_DEMON)
3665         {
3666 #ifdef JP
3667 info[i++] = "¤½¤ì¤Ï°­Ëâ¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3668 #else
3669                 info[i++] = "It attracts demons.";
3670 #endif
3671
3672         }
3673         if (o_ptr->curse_flags & TRC_CALL_DRAGON)
3674         {
3675 #ifdef JP
3676 info[i++] = "¤½¤ì¤Ï¥É¥é¥´¥ó¤ò¸Æ¤Ó´ó¤»¤ë¡£";
3677 #else
3678                 info[i++] = "It attracts dragons.";
3679 #endif
3680
3681         }
3682         if (o_ptr->curse_flags & TRC_COWARDICE)
3683         {
3684 #ifdef JP
3685 info[i++] = "¤½¤ì¤Ï¶²ÉÝ´¶¤ò°ú¤­µ¯¤³¤¹¡£";
3686 #else
3687                 info[i++] = "It makes you subject to cowardice.";
3688 #endif
3689
3690         }
3691         if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
3692         {
3693 #ifdef JP
3694 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤Ê¥Æ¥ì¥Ý¡¼¥È¤ò°ú¤­µ¯¤³¤¹¡£";
3695 #else
3696                 info[i++] = "It induces random teleportation.";
3697 #endif
3698
3699         }
3700         if (o_ptr->curse_flags & TRC_LOW_MELEE)
3701         {
3702 #ifdef JP
3703 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
3704 #else
3705                 info[i++] = "It causes you to miss blows.";
3706 #endif
3707
3708         }
3709         if (o_ptr->curse_flags & TRC_LOW_AC)
3710         {
3711 #ifdef JP
3712 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
3713 #else
3714                 info[i++] = "It helps your enemies' blows.";
3715 #endif
3716
3717         }
3718         if (o_ptr->curse_flags & TRC_LOW_MAGIC)
3719         {
3720 #ifdef JP
3721 info[i++] = "¤½¤ì¤ÏËâË¡¤ò¾§¤¨¤Ë¤¯¤¯¤¹¤ë¡£";
3722 #else
3723                 info[i++] = "It encumbers you while spellcasting.";
3724 #endif
3725
3726         }
3727         if (o_ptr->curse_flags & TRC_FAST_DIGEST)
3728         {
3729 #ifdef JP
3730 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¿·ÄÄÂå¼Õ¤ò®¤¯¤¹¤ë¡£";
3731 #else
3732                 info[i++] = "It speeds your metabolism.";
3733 #endif
3734
3735         }
3736         if (o_ptr->curse_flags & TRC_DRAIN_HP)
3737         {
3738 #ifdef JP
3739 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¤¤¼è¤ë¡£";
3740 #else
3741                 info[i++] = "It drains you.";
3742 #endif
3743
3744         }
3745         if (o_ptr->curse_flags & TRC_DRAIN_MANA)
3746         {
3747 #ifdef JP
3748 info[i++] = "¤½¤ì¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¤¤¼è¤ë¡£";
3749 #else
3750                 info[i++] = "It drains your mana.";
3751 #endif
3752
3753         }
3754
3755         /* Describe about this kind of object instead of THIS fake object */
3756         if (!real)
3757         {
3758                 switch (o_ptr->tval)
3759                 {
3760                 case TV_RING:
3761                         switch (o_ptr->sval)
3762                         {
3763                         case SV_RING_LORDLY:
3764 #ifdef JP
3765                                 info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë¡£";
3766 #else
3767                                 info[i++] = "It provides some random resistances.";
3768 #endif
3769                                 break;
3770                         case SV_RING_WARNING:
3771 #ifdef JP
3772                                 info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
3773 #else
3774                                 info[i++] = "It may provide a low rank ESP.";
3775 #endif
3776                                 break;
3777                         }
3778                         break;
3779
3780                 case TV_AMULET:
3781                         switch (o_ptr->sval)
3782                         {
3783                         case SV_AMULET_RESISTANCE:
3784 #ifdef JP
3785                                 info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
3786 #else
3787                                 info[i++] = "It may provides resistance to poison.";
3788 #endif
3789 #ifdef JP
3790                                 info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
3791 #else
3792                                 info[i++] = "It may provide a random resistances.";
3793 #endif
3794                                 break;
3795                         case SV_AMULET_THE_MAGI:
3796 #ifdef JP
3797                                 info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
3798 #else
3799                                 info[i++] = "It provides up to three low rank ESPs.";
3800 #endif
3801                                 break;
3802                         }
3803                         break;
3804                 }
3805         }
3806
3807         if (have_flag(flgs, TR_IGNORE_ACID) &&
3808             have_flag(flgs, TR_IGNORE_ELEC) &&
3809             have_flag(flgs, TR_IGNORE_FIRE) &&
3810             have_flag(flgs, TR_IGNORE_COLD))
3811         {
3812 #ifdef JP
3813                 info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3814 #else
3815                 info[i++] = "It cannot be harmed by the elements.";
3816 #endif
3817         }
3818         else
3819         {
3820                 if (have_flag(flgs, TR_IGNORE_ACID))
3821                 {
3822 #ifdef JP
3823                         info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3824 #else
3825                         info[i++] = "It cannot be harmed by acid.";
3826 #endif
3827                 }
3828                 if (have_flag(flgs, TR_IGNORE_ELEC))
3829                 {
3830 #ifdef JP
3831                         info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3832 #else
3833                         info[i++] = "It cannot be harmed by electricity.";
3834 #endif
3835                 }
3836                 if (have_flag(flgs, TR_IGNORE_FIRE))
3837                 {
3838 #ifdef JP
3839                         info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3840 #else
3841                         info[i++] = "It cannot be harmed by fire.";
3842 #endif
3843                 }
3844                 if (have_flag(flgs, TR_IGNORE_COLD))
3845                 {
3846 #ifdef JP
3847                         info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
3848 #else
3849                         info[i++] = "It cannot be harmed by cold.";
3850 #endif
3851                 }
3852         }
3853
3854         /* No special effects */
3855         if (!i) return (FALSE);
3856
3857         /* Save the screen */
3858         screen_save();
3859
3860         /* Get size */
3861         Term_get_size(&wid, &hgt);
3862
3863         /* Display Item name */
3864         if (real)
3865                 object_desc(o_name, o_ptr, TRUE, 3);
3866         else
3867                 object_desc_store(o_name, o_ptr, TRUE, 0);
3868
3869         prt(o_name, 0, 0);
3870
3871         /* Erase the screen */
3872         for (k = 1; k < hgt; k++) prt("", k, 13);
3873
3874         /* Label the information */
3875         if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
3876         {
3877                 monster_race *r_ptr = &r_info[o_ptr->pval];
3878                 int namelen = strlen(r_name + r_ptr->name);
3879                 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
3880                 c_prt(r_ptr->d_attr, format("%c", r_ptr->d_char), 1, 18+namelen);
3881                 prt("'", 1, 19+namelen);
3882         }
3883         else
3884 #ifdef JP
3885 prt("     ¥¢¥¤¥Æ¥à¤ÎǽÎÏ:", 1, 15);
3886 #else
3887         prt("     Item Attributes:", 1, 15);
3888 #endif
3889
3890         /* We will print on top of the map (column 13) */
3891         for (k = 2, j = 0; j < i; j++)
3892         {
3893                 /* Show the info */
3894                 prt(info[j], k++, 15);
3895
3896                 /* Every 20 entries (lines 2 to 21), start over */
3897                 if ((k == hgt - 2) && (j+1 < i))
3898                 {
3899 #ifdef JP
3900 prt("-- Â³¤¯ --", k, 15);
3901 #else
3902                         prt("-- more --", k, 15);
3903 #endif
3904                         inkey();
3905                         for (; k > 2; k--) prt("", k, 15);
3906                 }
3907         }
3908
3909         /* Wait for it */
3910 #ifdef JP
3911 prt("[²¿¤«¥­¡¼¤ò²¡¤¹¤È¥²¡¼¥à¤ËÌá¤ê¤Þ¤¹]", k, 15);
3912 #else
3913         prt("[Press any key to continue]", k, 15);
3914 #endif
3915
3916         inkey();
3917
3918         /* Restore the screen */
3919         screen_load();
3920
3921         /* Gave knowledge */
3922         return (TRUE);
3923 }
3924
3925
3926
3927 /*
3928  * Convert an inventory index into a one character label
3929  * Note that the label does NOT distinguish inven/equip.
3930  */
3931 char index_to_label(int i)
3932 {
3933         /* Indexes for "inven" are easy */
3934         if (i < INVEN_RARM) return (I2A(i));
3935
3936         /* Indexes for "equip" are offset */
3937         return (I2A(i - INVEN_RARM));
3938 }
3939
3940
3941 /*
3942  * Convert a label into the index of an item in the "inven"
3943  * Return "-1" if the label does not indicate a real item
3944  */
3945 s16b label_to_inven(int c)
3946 {
3947         int i;
3948
3949         /* Convert */
3950         i = (islower(c) ? A2I(c) : -1);
3951
3952         /* Verify the index */
3953         if ((i < 0) || (i > INVEN_PACK)) return (-1);
3954
3955         /* Empty slots can never be chosen */
3956         if (!inventory[i].k_idx) return (-1);
3957
3958         /* Return the index */
3959         return (i);
3960 }
3961
3962
3963 /*
3964  * Convert a label into the index of a item in the "equip"
3965  * Return "-1" if the label does not indicate a real item
3966  */
3967 s16b label_to_equip(int c)
3968 {
3969         int i;
3970
3971         /* Convert */
3972         i = (islower(c) ? A2I(c) : -1) + INVEN_RARM;
3973
3974         /* Verify the index */
3975         if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
3976
3977         /* Empty slots can never be chosen */
3978         if (!inventory[i].k_idx) return (-1);
3979
3980         /* Return the index */
3981         return (i);
3982 }
3983
3984
3985
3986 /*
3987  * Determine which equipment slot (if any) an item likes
3988  */
3989 s16b wield_slot(object_type *o_ptr)
3990 {
3991         /* Slot for equipment */
3992         switch (o_ptr->tval)
3993         {
3994                 case TV_DIGGING:
3995                 case TV_HAFTED:
3996                 case TV_POLEARM:
3997                 case TV_SWORD:
3998                 {
3999                         if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
4000                         if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
4001                         return (INVEN_LARM);
4002                 }
4003
4004                 case TV_CAPTURE:
4005                 case TV_CARD:
4006                 case TV_SHIELD:
4007                 {
4008                         if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
4009                         if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
4010                         return (INVEN_RARM);
4011                 }
4012
4013                 case TV_BOW:
4014                 {
4015                         return (INVEN_BOW);
4016                 }
4017
4018                 case TV_RING:
4019                 {
4020                         /* Use the right hand first */
4021                         if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
4022
4023                         /* Use the left hand for swapping (by default) */
4024                         return (INVEN_LEFT);
4025                 }
4026
4027                 case TV_AMULET:
4028                 case TV_WHISTLE:
4029                 {
4030                         return (INVEN_NECK);
4031                 }
4032
4033                 case TV_LITE:
4034                 {
4035                         return (INVEN_LITE);
4036                 }
4037
4038                 case TV_DRAG_ARMOR:
4039                 case TV_HARD_ARMOR:
4040                 case TV_SOFT_ARMOR:
4041                 {
4042                         return (INVEN_BODY);
4043                 }
4044
4045                 case TV_CLOAK:
4046                 {
4047                         return (INVEN_OUTER);
4048                 }
4049
4050                 case TV_CROWN:
4051                 case TV_HELM:
4052                 {
4053                         return (INVEN_HEAD);
4054                 }
4055
4056                 case TV_GLOVES:
4057                 {
4058                         return (INVEN_HANDS);
4059                 }
4060
4061                 case TV_BOOTS:
4062                 {
4063                         return (INVEN_FEET);
4064                 }
4065         }
4066
4067         /* No slot available */
4068         return (-1);
4069 }
4070
4071
4072 /*
4073  * Return a string mentioning how a given item is carried
4074  */
4075 cptr mention_use(int i)
4076 {
4077         cptr p;
4078
4079         /* Examine the location */
4080         switch (i)
4081         {
4082 #ifdef JP
4083 case INVEN_RARM: p = p_ptr->ryoute ? " Î¾¼ê" : (left_hander ? " º¸¼ê" : " ±¦¼ê"); break;
4084 #else
4085                 case INVEN_RARM: p = "Wielding"; break;
4086 #endif
4087
4088 #ifdef JP
4089 case INVEN_LARM:   p = (left_hander ? " ±¦¼ê" : " º¸¼ê"); break;
4090 #else
4091                 case INVEN_LARM:   p = "On arm"; break;
4092 #endif
4093
4094 #ifdef JP
4095 case INVEN_BOW:   p = "¼Í·âÍÑ"; break;
4096 #else
4097                 case INVEN_BOW:   p = "Shooting"; break;
4098 #endif
4099
4100 #ifdef JP
4101 case INVEN_LEFT:  p = (left_hander ? "±¦¼ê»Ø" : "º¸¼ê»Ø"); break;
4102 #else
4103                 case INVEN_LEFT:  p = "On left hand"; break;
4104 #endif
4105
4106 #ifdef JP
4107 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê»Ø" : "±¦¼ê»Ø"); break;
4108 #else
4109                 case INVEN_RIGHT: p = "On right hand"; break;
4110 #endif
4111
4112 #ifdef JP
4113 case INVEN_NECK:  p = "  ¼ó"; break;
4114 #else
4115                 case INVEN_NECK:  p = "Around neck"; break;
4116 #endif
4117
4118 #ifdef JP
4119 case INVEN_LITE:  p = " ¸÷¸»"; break;
4120 #else
4121                 case INVEN_LITE:  p = "Light source"; break;
4122 #endif
4123
4124 #ifdef JP
4125 case INVEN_BODY:  p = "  ÂÎ"; break;
4126 #else
4127                 case INVEN_BODY:  p = "On body"; break;
4128 #endif
4129
4130 #ifdef JP
4131 case INVEN_OUTER: p = "ÂΤξå"; break;
4132 #else
4133                 case INVEN_OUTER: p = "About body"; break;
4134 #endif
4135
4136 #ifdef JP
4137 case INVEN_HEAD:  p = "  Ƭ"; break;
4138 #else
4139                 case INVEN_HEAD:  p = "On head"; break;
4140 #endif
4141
4142 #ifdef JP
4143 case INVEN_HANDS: p = "  ¼ê"; break;
4144 #else
4145                 case INVEN_HANDS: p = "On hands"; break;
4146 #endif
4147
4148 #ifdef JP
4149 case INVEN_FEET:  p = "  ­"; break;
4150 #else
4151                 case INVEN_FEET:  p = "On feet"; break;
4152 #endif
4153
4154 #ifdef JP
4155 default:          p = "¥¶¥Ã¥¯"; break;
4156 #else
4157                 default:          p = "In pack"; break;
4158 #endif
4159
4160         }
4161
4162         /* Hack -- Heavy weapon */
4163         if (i == INVEN_RARM)
4164         {
4165                 if (p_ptr->heavy_wield[0])
4166                 {
4167 #ifdef JP
4168 p = "±¿ÈÂÃæ";
4169 #else
4170                         p = "Just lifting";
4171 #endif
4172
4173                 }
4174         }
4175
4176         /* Hack -- Heavy weapon */
4177         if (i == INVEN_LARM)
4178         {
4179                 if (p_ptr->heavy_wield[1])
4180                 {
4181 #ifdef JP
4182 p = "±¿ÈÂÃæ";
4183 #else
4184                         p = "Just lifting";
4185 #endif
4186
4187                 }
4188         }
4189
4190         /* Hack -- Heavy bow */
4191         if (i == INVEN_BOW)
4192         {
4193                 object_type *o_ptr;
4194                 o_ptr = &inventory[i];
4195                 if (adj_str_hold[p_ptr->stat_ind[A_STR]] < o_ptr->weight / 10)
4196                 {
4197 #ifdef JP
4198 p = "±¿ÈÂÃæ";
4199 #else
4200                         p = "Just holding";
4201 #endif
4202
4203                 }
4204         }
4205
4206         /* Return the result */
4207         return (p);
4208 }
4209
4210
4211 /*
4212  * Return a string describing how a given item is being worn.
4213  * Currently, only used for items in the equipment, not inventory.
4214  */
4215 cptr describe_use(int i)
4216 {
4217         cptr p;
4218
4219         switch (i)
4220         {
4221 #ifdef JP
4222 case INVEN_RARM: p = p_ptr->ryoute ? " Î¾¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : (left_hander ? " º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : " ±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë"); break;
4223 #else
4224                 case INVEN_RARM: p = "attacking monsters with"; break;
4225 #endif
4226
4227 #ifdef JP
4228 case INVEN_LARM:   p = (left_hander ? " ±¦¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë" : " º¸¼ê¤ËÁõÈ÷¤·¤Æ¤¤¤ë"); break;
4229 #else
4230                 case INVEN_LARM:   p = "wearing on your arm"; break;
4231 #endif
4232
4233 #ifdef JP
4234 case INVEN_BOW:   p = "¼Í·âÍѤËÁõÈ÷¤·¤Æ¤¤¤ë"; break;
4235 #else
4236                 case INVEN_BOW:   p = "shooting missiles with"; break;
4237 #endif
4238
4239 #ifdef JP
4240 case INVEN_LEFT:  p = (left_hander ? "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
4241 #else
4242                 case INVEN_LEFT:  p = "wearing on your left hand"; break;
4243 #endif
4244
4245 #ifdef JP
4246 case INVEN_RIGHT: p = (left_hander ? "º¸¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë" : "±¦¼ê¤Î»Ø¤Ë¤Ï¤á¤Æ¤¤¤ë"); break;
4247 #else
4248                 case INVEN_RIGHT: p = "wearing on your right hand"; break;
4249 #endif
4250
4251 #ifdef JP
4252 case INVEN_NECK:  p = "¼ó¤Ë¤«¤±¤Æ¤¤¤ë"; break;
4253 #else
4254                 case INVEN_NECK:  p = "wearing around your neck"; break;
4255 #endif
4256
4257 #ifdef JP
4258 case INVEN_LITE:  p = "¸÷¸»¤Ë¤·¤Æ¤¤¤ë"; break;
4259 #else
4260                 case INVEN_LITE:  p = "using to light the way"; break;
4261 #endif
4262
4263 #ifdef JP
4264 case INVEN_BODY:  p = "ÂΤËÃå¤Æ¤¤¤ë"; break;
4265 #else
4266                 case INVEN_BODY:  p = "wearing on your body"; break;
4267 #endif
4268
4269 #ifdef JP
4270 case INVEN_OUTER: p = "¿È¤Ë¤Þ¤È¤Ã¤Æ¤¤¤ë"; break;
4271 #else
4272                 case INVEN_OUTER: p = "wearing on your back"; break;
4273 #endif
4274
4275 #ifdef JP
4276 case INVEN_HEAD:  p = "Ƭ¤Ë¤«¤Ö¤Ã¤Æ¤¤¤ë"; break;
4277 #else
4278                 case INVEN_HEAD:  p = "wearing on your head"; break;
4279 #endif
4280
4281 #ifdef JP
4282 case INVEN_HANDS: p = "¼ê¤Ë¤Ä¤±¤Æ¤¤¤ë"; break;
4283 #else
4284                 case INVEN_HANDS: p = "wearing on your hands"; break;
4285 #endif
4286
4287 #ifdef JP
4288 case INVEN_FEET:  p = "­¤Ë¤Ï¤¤¤Æ¤¤¤ë"; break;
4289 #else
4290                 case INVEN_FEET:  p = "wearing on your feet"; break;
4291 #endif
4292
4293 #ifdef JP
4294 default:          p = "¥¶¥Ã¥¯¤ËÆþ¤Ã¤Æ¤¤¤ë"; break;
4295 #else
4296                 default:          p = "carrying in your pack"; break;
4297 #endif
4298
4299         }
4300
4301         /* Hack -- Heavy weapon */
4302         if (i == INVEN_RARM)
4303         {
4304                 object_type *o_ptr;
4305                 int hold = adj_str_hold[p_ptr->stat_ind[A_STR]];
4306
4307                 if (p_ptr->ryoute) hold *= 2;
4308                 o_ptr = &inventory[i];
4309                 if (hold < o_ptr->weight / 10)
4310                 {
4311 #ifdef JP
4312 p = "±¿ÈÂÃæ¤Î";
4313 #else
4314                         p = "just lifting";
4315 #endif
4316
4317                 }
4318         }
4319
4320         /* Hack -- Heavy bow */
4321         if (i == INVEN_BOW)
4322         {
4323                 object_type *o_ptr;
4324                 o_ptr = &inventory[i];
4325                 if (adj_str_hold[p_ptr->stat_ind[A_STR]] < o_ptr->weight / 10)
4326                 {
4327 #ifdef JP
4328 p = "»ý¤Ä¤À¤±¤ÇÀº°ìÇÕ¤Î";
4329 #else
4330                         p = "just holding";
4331 #endif
4332
4333                 }
4334         }
4335
4336         /* Return the result */
4337         return p;
4338 }
4339
4340
4341 /* Hack: Check if a spellbook is one of the realms we can use. -- TY */
4342
4343 bool check_book_realm(const byte book_tval, const byte book_sval)
4344 {
4345         if (book_tval < TV_LIFE_BOOK) return FALSE;
4346         if (p_ptr->pclass == CLASS_SORCERER)
4347         {
4348                 return is_magic(tval2realm(book_tval));
4349         }
4350         else if (p_ptr->pclass == CLASS_RED_MAGE)
4351         {
4352                 if (is_magic(tval2realm(book_tval)))
4353                         return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
4354         }
4355         return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
4356 }
4357
4358
4359 /*
4360  * Check an item against the item tester info
4361  */
4362 bool item_tester_okay(object_type *o_ptr)
4363 {
4364         /* Hack -- allow listing empty slots */
4365         if (item_tester_full) return (TRUE);
4366
4367         /* Require an item */
4368         if (!o_ptr->k_idx) return (FALSE);
4369
4370         /* Hack -- ignore "gold" */
4371         if (o_ptr->tval == TV_GOLD) return (FALSE);
4372
4373         /* Check the tval */
4374         if (item_tester_tval)
4375         {
4376                 /* Is it a spellbook? If so, we need a hack -- TY */
4377                 if ((item_tester_tval <= TV_DEATH_BOOK) &&
4378                         (item_tester_tval >= TV_LIFE_BOOK))
4379                         return check_book_realm(o_ptr->tval, o_ptr->sval);
4380                 else
4381                         if (item_tester_tval != o_ptr->tval) return (FALSE);
4382         }
4383
4384         /* Check the hook */
4385         if (item_tester_hook)
4386         {
4387                 if (!(*item_tester_hook)(o_ptr)) return (FALSE);
4388         }
4389
4390         /* Assume okay */
4391         return (TRUE);
4392 }
4393
4394
4395
4396
4397 /*
4398  * Choice window "shadow" of the "show_inven()" function
4399  */
4400 void display_inven(void)
4401 {
4402         register        int i, n, z = 0;
4403         object_type     *o_ptr;
4404         byte            attr = TERM_WHITE;
4405         char            tmp_val[80];
4406         char            o_name[MAX_NLEN];
4407         int             wid, hgt;
4408
4409         /* Get size */
4410         Term_get_size(&wid, &hgt);
4411
4412         /* Find the "final" slot */
4413         for (i = 0; i < INVEN_PACK; i++)
4414         {
4415                 o_ptr = &inventory[i];
4416
4417                 /* Skip non-objects */
4418                 if (!o_ptr->k_idx) continue;
4419
4420                 /* Track */
4421                 z = i + 1;
4422         }
4423
4424         /* Display the pack */
4425         for (i = 0; i < z; i++)
4426         {
4427                 /* Examine the item */
4428                 o_ptr = &inventory[i];
4429
4430                 /* Start with an empty "index" */
4431                 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
4432
4433                 /* Is this item "acceptable"? */
4434                 if (item_tester_okay(o_ptr))
4435                 {
4436                         /* Prepare an "index" */
4437                         tmp_val[0] = index_to_label(i);
4438
4439                         /* Bracket the "index" --(-- */
4440                         tmp_val[1] = ')';
4441                 }
4442
4443                 /* Display the index (or blank space) */
4444                 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
4445
4446                 /* Obtain an item description */
4447                 object_desc(o_name, o_ptr, TRUE, 3);
4448
4449                 /* Obtain the length of the description */
4450                 n = strlen(o_name);
4451
4452                 /* Get a color */
4453                 attr = tval_to_attr[o_ptr->tval % 128];
4454
4455                 /* Grey out charging items */
4456                 if (o_ptr->timeout)
4457                 {
4458                         attr = TERM_L_DARK;
4459                 }
4460
4461                 /* Display the entry itself */
4462                 Term_putstr(3, i, n, attr, o_name);
4463
4464                 /* Erase the rest of the line */
4465                 Term_erase(3+n, i, 255);
4466
4467                 /* Display the weight if needed */
4468                 if (show_weights && o_ptr->weight)
4469                 {
4470                         int wgt = o_ptr->weight * o_ptr->number;
4471 #ifdef JP
4472                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
4473 #else
4474                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4475 #endif
4476
4477                         prt(tmp_val, i, wid - 9);
4478                 }
4479         }
4480
4481         /* Erase the rest of the window */
4482         for (i = z; i < hgt; i++)
4483         {
4484                 /* Erase the line */
4485                 Term_erase(0, i, 255);
4486         }
4487 }
4488
4489
4490
4491 /*
4492  * Choice window "shadow" of the "show_equip()" function
4493  */
4494 void display_equip(void)
4495 {
4496         register        int i, n;
4497         object_type     *o_ptr;
4498         byte            attr = TERM_WHITE;
4499         char            tmp_val[80];
4500         char            o_name[MAX_NLEN];
4501         int             wid, hgt;
4502
4503         /* Get size */
4504         Term_get_size(&wid, &hgt);
4505
4506         /* Display the equipment */
4507         for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4508         {
4509                 /* Examine the item */
4510                 o_ptr = &inventory[i];
4511
4512                 /* Start with an empty "index" */
4513                 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
4514
4515                 /* Is this item "acceptable"? */
4516                 if (item_tester_okay(o_ptr))
4517                 {
4518                         /* Prepare an "index" */
4519                         tmp_val[0] = index_to_label(i);
4520
4521                         /* Bracket the "index" --(-- */
4522                         tmp_val[1] = ')';
4523                 }
4524
4525                 /* Display the index (or blank space) */
4526                 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
4527
4528                 /* Obtain an item description */
4529                 if ((i == INVEN_LARM) && p_ptr->ryoute)
4530                 {
4531 #ifdef JP
4532                         strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
4533 #else
4534                         strcpy(o_name, "(wielding with two-hands)");
4535 #endif
4536                         attr = 1;
4537                 }
4538                 else
4539                 {
4540                         object_desc(o_name, o_ptr, TRUE, 3);
4541                         attr = tval_to_attr[o_ptr->tval % 128];
4542                 }
4543
4544                 /* Obtain the length of the description */
4545                 n = strlen(o_name);
4546
4547                 /* Grey out charging items */
4548                 if (o_ptr->timeout)
4549                 {
4550                         attr = TERM_L_DARK;
4551                 }
4552
4553                 /* Display the entry itself */
4554                 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
4555
4556                 /* Erase the rest of the line */
4557                 Term_erase(3+n, i - INVEN_RARM, 255);
4558
4559                 /* Display the weight (if needed) */
4560                 if (show_weights && o_ptr->weight)
4561                 {
4562                         int wgt = o_ptr->weight * o_ptr->number;
4563 #ifdef JP
4564                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
4565 #else
4566                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4567 #endif
4568
4569                         prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
4570                 }
4571
4572                 /* Display the slot description (if needed) */
4573                 if (show_labels)
4574                 {
4575                         Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
4576                         prt(mention_use(i), i - INVEN_RARM, wid - 15);
4577                 }
4578         }
4579
4580         /* Erase the rest of the window */
4581         for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
4582         {
4583                 /* Clear that line */
4584                 Term_erase(0, i, 255);
4585         }
4586 }
4587
4588
4589
4590 /*
4591  * Find the "first" inventory object with the given "tag".
4592  *
4593  * A "tag" is a numeral "n" appearing as "@n" anywhere in the
4594  * inscription of an object.  Alphabetical characters don't work as a
4595  * tag in this form.
4596  *
4597  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
4598  * and "x" is the "current" command_cmd code.
4599  */
4600 static int get_tag(int *cp, char tag)
4601 {
4602         int i;
4603         cptr s;
4604
4605
4606         /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
4607
4608         /* Check every inventory object */
4609         for (i = 0; i < INVEN_PACK; ++i)
4610         {
4611                 object_type *o_ptr = &inventory[i];
4612
4613                 /* Skip non-objects */
4614                 if (!o_ptr->k_idx) continue;
4615
4616                 /* Skip empty inscriptions */
4617                 if (!o_ptr->inscription) continue;
4618
4619                 /* Skip non-choice */
4620                 if (!item_tester_okay(o_ptr)) continue;
4621
4622                 /* Find a '@' */
4623                 s = strchr(quark_str(o_ptr->inscription), '@');
4624
4625                 /* Process all tags */
4626                 while (s)
4627                 {
4628                         /* Check the special tags */
4629                         if ((s[1] == command_cmd) && (s[2] == tag))
4630                         {
4631                                 /* Save the actual inventory ID */
4632                                 *cp = i;
4633
4634                                 /* Success */
4635                                 return (TRUE);
4636                         }
4637
4638                         /* Find another '@' */
4639                         s = strchr(s + 1, '@');
4640                 }
4641         }
4642
4643
4644         /**** Find a tag in the form of {@#} (allows only numerals)  ***/
4645
4646         /* Don't allow {@#} with '#' being alphabet */
4647         if (tag < '0' || '9' < tag)
4648         {
4649                 /* No such tag */
4650                 return FALSE;
4651         }
4652
4653         /* Check every object */
4654         for (i = 0; i < INVEN_TOTAL; ++i)
4655         {
4656                 object_type *o_ptr = &inventory[i];
4657
4658                 /* Skip non-objects */
4659                 if (!o_ptr->k_idx) continue;
4660
4661                 /* Skip empty inscriptions */
4662                 if (!o_ptr->inscription) continue;
4663
4664                 /* Skip non-choice */
4665                 if (!item_tester_okay(o_ptr)) continue;
4666
4667                 /* Find a '@' */
4668                 s = strchr(quark_str(o_ptr->inscription), '@');
4669
4670                 /* Process all tags */
4671                 while (s)
4672                 {
4673                         /* Check the normal tags */
4674                         if (s[1] == tag)
4675                         {
4676                                 /* Save the actual inventory ID */
4677                                 *cp = i;
4678
4679                                 /* Success */
4680                                 return (TRUE);
4681                         }
4682
4683                         /* Find another '@' */
4684                         s = strchr(s + 1, '@');
4685                 }
4686         }
4687
4688         /* No such tag */
4689         return (FALSE);
4690 }
4691
4692
4693
4694 /*
4695  * Display the inventory.
4696  *
4697  * Hack -- do not display "trailing" empty slots
4698  */
4699 int show_inven(int target_item)
4700 {
4701         cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
4702         int             i, j, k, l, z = 0;
4703         int             col, cur_col, len;
4704         object_type     *o_ptr;
4705         char            o_name[MAX_NLEN];
4706         char            tmp_val[80];
4707         int             out_index[23];
4708         byte            out_color[23];
4709         char            out_desc[23][MAX_NLEN];
4710         int             target_item_label = 0;
4711         int             wid, hgt;
4712         char inven_spellbook_label[52+1];
4713
4714         /* See cmd5.c */
4715
4716         /* Starting column */
4717         col = command_gap;
4718
4719         /* Get size */
4720         Term_get_size(&wid, &hgt);
4721
4722         /* Default "max-length" */
4723         len = wid - col - 1;
4724
4725
4726         /* Find the "final" slot */
4727         for (i = 0; i < INVEN_PACK; i++)
4728         {
4729                 o_ptr = &inventory[i];
4730
4731                 /* Skip non-objects */
4732                 if (!o_ptr->k_idx) continue;
4733
4734                 /* Track */
4735                 z = i + 1;
4736         }
4737
4738         /*** Move around label characters with correspond tags ***/
4739
4740         /* Prepare normal labels */
4741         strcpy(inven_spellbook_label, alphabet_chars);
4742
4743         /* Move each label */
4744         for (i = 0; i < 52; i++)
4745         {
4746                 int index;
4747                 char c = alphabet_chars[i];
4748
4749                 /* Find a tag with this label */
4750                 if (get_tag(&index, c))
4751                 {
4752                         /* Delete the over writen label */
4753                         if (inven_spellbook_label[i] == c)
4754                                 inven_spellbook_label[i] = ' ';
4755
4756                         /* Move the label to the place of correspond tag */
4757                         inven_spellbook_label[index] = c;
4758                 }
4759         }
4760
4761         /* Display the inventory */
4762         for (k = 0, i = 0; i < z; i++)
4763         {
4764                 o_ptr = &inventory[i];
4765
4766                 /* Is this item acceptable? */
4767                 if (!item_tester_okay(o_ptr)) continue;
4768
4769                 /* Describe the object */
4770                 object_desc(o_name, o_ptr, TRUE, 3);
4771
4772                 /* Save the object index, color, and description */
4773                 out_index[k] = i;
4774                 out_color[k] = tval_to_attr[o_ptr->tval % 128];
4775
4776                 /* Grey out charging items */
4777                 if (o_ptr->timeout)
4778                 {
4779                         out_color[k] = TERM_L_DARK;
4780                 }
4781
4782                 (void)strcpy(out_desc[k], o_name);
4783
4784                 /* Find the predicted "line length" */
4785                 l = strlen(out_desc[k]) + 5;
4786
4787                 /* Be sure to account for the weight */
4788                 if (show_weights) l += 9;
4789
4790                 /* Account for icon if displayed */
4791                 if (show_item_graph)
4792                 {
4793                         l += 2;
4794                         if (use_bigtile) l++;
4795                 }
4796
4797                 /* Maintain the maximum length */
4798                 if (l > len) len = l;
4799
4800                 /* Advance to next "line" */
4801                 k++;
4802         }
4803
4804         /* Find the column to start in */
4805         col = (len > wid - 4) ? 0 : (wid - len - 1);
4806
4807         /* Output each entry */
4808         for (j = 0; j < k; j++)
4809         {
4810                 /* Get the index */
4811                 i = out_index[j];
4812
4813                 /* Get the item */
4814                 o_ptr = &inventory[i];
4815
4816                 /* Clear the line */
4817                 prt("", j + 1, col ? col - 2 : col);
4818
4819                 if (use_menu && target_item)
4820                 {
4821                         if (j == (target_item-1))
4822                         {
4823 #ifdef JP
4824                                 strcpy(tmp_val, "¡Õ");
4825 #else
4826                                 strcpy(tmp_val, "> ");
4827 #endif
4828                                 target_item_label = i;
4829                         }
4830                         else strcpy(tmp_val, "  ");
4831                 }
4832                 else if (i <= INVEN_PACK)
4833                 {
4834                         sprintf(tmp_val, "%c)", inven_spellbook_label[i]);
4835                 }
4836                 else
4837                 {
4838                         /* Prepare an index --(-- */
4839                         sprintf(tmp_val, "%c)", index_to_label(i));
4840                 }
4841
4842                 /* Clear the line with the (possibly indented) index */
4843                 put_str(tmp_val, j + 1, col);
4844
4845                 cur_col = col + 3;
4846
4847                 /* Display graphics for object, if desired */
4848                 if (show_item_graph)
4849                 {
4850                         byte  a = object_attr(o_ptr);
4851                         char c = object_char(o_ptr);
4852
4853 #ifdef AMIGA
4854                         if (a & 0x80) a |= 0x40;
4855 #endif
4856
4857                         Term_draw(cur_col, j + 1, a, c);
4858                         if (use_bigtile)
4859                         {
4860                                 cur_col++;
4861                                 if (a & 0x80)
4862                                         Term_draw(cur_col, j + 1, 255, -1);
4863                         }
4864                         cur_col += 2;
4865                 }
4866
4867
4868                 /* Display the entry itself */
4869                 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
4870
4871                 /* Display the weight if needed */
4872                 if (show_weights)
4873                 {
4874                         int wgt = o_ptr->weight * o_ptr->number;
4875 #ifdef JP
4876                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4877 #else
4878                         (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4879 #endif
4880
4881                         prt(tmp_val, j + 1, wid - 9);
4882                 }
4883         }
4884
4885         /* Make a "shadow" below the list (only if needed) */
4886         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4887
4888         /* Save the new column */
4889         command_gap = col;
4890
4891         return target_item_label;
4892 }
4893
4894
4895
4896 /*
4897  * Display the equipment.
4898  */
4899 int show_equip(int target_item)
4900 {
4901         int             i, j, k, l;
4902         int             col, cur_col, len;
4903         object_type     *o_ptr;
4904         char            tmp_val[80];
4905         char            o_name[MAX_NLEN];
4906         int             out_index[23];
4907         byte            out_color[23];
4908         char            out_desc[23][MAX_NLEN];
4909         int             target_item_label = 0;
4910         int             wid, hgt;
4911
4912
4913         /* Starting column */
4914         col = command_gap;
4915
4916         /* Get size */
4917         Term_get_size(&wid, &hgt);
4918
4919         /* Maximal length */
4920         len = wid - col - 1;
4921
4922
4923         /* Scan the equipment list */
4924         for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
4925         {
4926                 o_ptr = &inventory[i];
4927
4928                 /* Is this item acceptable? */
4929                 if (!item_tester_okay(o_ptr) && (!((i == INVEN_LARM) && p_ptr->ryoute) || item_tester_no_ryoute)) continue;
4930
4931                 /* Description */
4932                 object_desc(o_name, o_ptr, TRUE, 3);
4933
4934                 if ((i == INVEN_LARM) && p_ptr->ryoute)
4935                 {
4936 #ifdef JP
4937                         (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
4938 #else
4939                         (void)strcpy(out_desc[k],"(wielding with two-hands)");
4940 #endif
4941                         out_color[k] = 1;
4942                 }
4943                 else
4944                 {
4945                         (void)strcpy(out_desc[k], o_name);
4946                         out_color[k] = tval_to_attr[o_ptr->tval % 128];
4947                 }
4948
4949                 out_index[k] = i;
4950                 /* Grey out charging items */
4951                 if (o_ptr->timeout)
4952                 {
4953                         out_color[k] = TERM_L_DARK;
4954                 }
4955
4956                 /* Extract the maximal length (see below) */
4957 #ifdef JP
4958                 l = strlen(out_desc[k]) + (2 + 1);
4959 #else
4960                 l = strlen(out_desc[k]) + (2 + 3);
4961 #endif
4962
4963
4964                 /* Increase length for labels (if needed) */
4965 #ifdef JP
4966                 if (show_labels) l += (7 + 2);
4967 #else
4968                 if (show_labels) l += (14 + 2);
4969 #endif
4970
4971
4972                 /* Increase length for weight (if needed) */
4973                 if (show_weights) l += 9;
4974
4975                 if (show_item_graph) l += 2;
4976
4977                 /* Maintain the max-length */
4978                 if (l > len) len = l;
4979
4980                 /* Advance the entry */
4981                 k++;
4982         }
4983
4984         /* Hack -- Find a column to start in */
4985 #ifdef JP
4986         col = (len > wid - 6) ? 0 : (wid - len - 1);
4987 #else
4988         col = (len > wid - 4) ? 0 : (wid - len - 1);
4989 #endif
4990
4991
4992         /* Output each entry */
4993         for (j = 0; j < k; j++)
4994         {
4995                 /* Get the index */
4996                 i = out_index[j];
4997
4998                 /* Get the item */
4999                 o_ptr = &inventory[i];
5000
5001                 /* Clear the line */
5002                 prt("", j + 1, col ? col - 2 : col);
5003
5004                 if (use_menu && target_item)
5005                 {
5006                         if (j == (target_item-1))
5007                         {
5008 #ifdef JP
5009                                 strcpy(tmp_val, "¡Õ");
5010 #else
5011                                 strcpy(tmp_val, "> ");
5012 #endif
5013                                 target_item_label = i;
5014                         }
5015                         else strcpy(tmp_val, "  ");
5016                 }
5017                 else
5018                         /* Prepare an index --(-- */
5019                         sprintf(tmp_val, "%c)", index_to_label(i));
5020
5021                 /* Clear the line with the (possibly indented) index */
5022                 put_str(tmp_val, j+1, col);
5023
5024                 cur_col = col + 3;
5025
5026                 /* Display graphics for object, if desired */
5027                 if (show_item_graph)
5028                 {
5029                         byte a = object_attr(o_ptr);
5030                         char c = object_char(o_ptr);
5031
5032 #ifdef AMIGA
5033                         if (a & 0x80) a |= 0x40;
5034 #endif
5035
5036                         Term_draw(cur_col, j + 1, a, c);
5037                         if (use_bigtile)
5038                         {
5039                                 cur_col++;
5040                                 if (a & 0x80)
5041                                         Term_draw(cur_col, j + 1, 255, -1);
5042                         }
5043                         cur_col += 2;
5044                 }
5045
5046                 /* Use labels */
5047                 if (show_labels)
5048                 {
5049                         /* Mention the use */
5050 #ifdef JP
5051                         (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
5052 #else
5053                         (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
5054 #endif
5055
5056                         put_str(tmp_val, j+1, cur_col);
5057
5058                         /* Display the entry itself */
5059 #ifdef JP
5060                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
5061 #else
5062                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
5063 #endif
5064                 }
5065
5066                 /* No labels */
5067                 else
5068                 {
5069                         /* Display the entry itself */
5070                         c_put_str(out_color[j], out_desc[j], j+1, cur_col);
5071                 }
5072
5073                 /* Display the weight if needed */
5074                 if (show_weights)
5075                 {
5076                         int wgt = o_ptr->weight * o_ptr->number;
5077 #ifdef JP
5078                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
5079 #else
5080                         (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
5081 #endif
5082
5083                         prt(tmp_val, j + 1, wid - 9);
5084                 }
5085         }
5086
5087         /* Make a "shadow" below the list (only if needed) */
5088         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
5089
5090         /* Save the new column */
5091         command_gap = col;
5092
5093         return target_item_label;
5094 }
5095
5096
5097
5098
5099 /*
5100  * Flip "inven" and "equip" in any sub-windows
5101  */
5102 void toggle_inven_equip(void)
5103 {
5104         int j;
5105
5106         /* Scan windows */
5107         for (j = 0; j < 8; j++)
5108         {
5109                 /* Unused */
5110                 if (!angband_term[j]) continue;
5111
5112                 /* Flip inven to equip */
5113                 if (window_flag[j] & (PW_INVEN))
5114                 {
5115                         /* Flip flags */
5116                         window_flag[j] &= ~(PW_INVEN);
5117                         window_flag[j] |= (PW_EQUIP);
5118
5119                         /* Window stuff */
5120                         p_ptr->window |= (PW_EQUIP);
5121                 }
5122
5123                 /* Flip inven to equip */
5124                 else if (window_flag[j] & (PW_EQUIP))
5125                 {
5126                         /* Flip flags */
5127                         window_flag[j] &= ~(PW_EQUIP);
5128                         window_flag[j] |= (PW_INVEN);
5129
5130                         /* Window stuff */
5131                         p_ptr->window |= (PW_INVEN);
5132                 }
5133         }
5134 }
5135
5136
5137
5138 /*
5139  * Verify the choice of an item.
5140  *
5141  * The item can be negative to mean "item on floor".
5142  */
5143 static bool verify(cptr prompt, int item)
5144 {
5145         char        o_name[MAX_NLEN];
5146         char        out_val[MAX_NLEN+20];
5147         object_type *o_ptr;
5148
5149
5150         /* Inventory */
5151         if (item >= 0)
5152         {
5153                 o_ptr = &inventory[item];
5154         }
5155
5156         /* Floor */
5157         else
5158         {
5159                 o_ptr = &o_list[0 - item];
5160         }
5161
5162         /* Describe */
5163         object_desc(o_name, o_ptr, TRUE, 3);
5164
5165         /* Prompt */
5166 #ifdef JP
5167 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
5168 #else
5169         (void)sprintf(out_val, "%s %s? ", prompt, o_name);
5170 #endif
5171
5172
5173         /* Query */
5174         return (get_check(out_val));
5175 }
5176
5177
5178 /*
5179  * Hack -- allow user to "prevent" certain choices
5180  *
5181  * The item can be negative to mean "item on floor".
5182  */
5183 static bool get_item_allow(int item)
5184 {
5185         cptr s;
5186
5187         object_type *o_ptr;
5188
5189         /* Inventory */
5190         if (item >= 0)
5191         {
5192                 o_ptr = &inventory[item];
5193         }
5194
5195         /* Floor */
5196         else
5197         {
5198                 o_ptr = &o_list[0 - item];
5199         }
5200
5201         /* No inscription */
5202         if (!o_ptr->inscription) return (TRUE);
5203
5204         /* Find a '!' */
5205         s = strchr(quark_str(o_ptr->inscription), '!');
5206
5207         /* Process preventions */
5208         while (s)
5209         {
5210                 /* Check the "restriction" */
5211                 if ((s[1] == command_cmd) || (s[1] == '*'))
5212                 {
5213                         /* Verify the choice */
5214 #ifdef JP
5215 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
5216 #else
5217                         if (!verify("Really try", item)) return (FALSE);
5218 #endif
5219
5220                 }
5221
5222                 /* Find another '!' */
5223                 s = strchr(s + 1, '!');
5224         }
5225
5226         /* Allow it */
5227         return (TRUE);
5228 }
5229
5230
5231
5232 /*
5233  * Auxiliary function for "get_item()" -- test an index
5234  */
5235 static bool get_item_okay(int i)
5236 {
5237         /* Illegal items */
5238         if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
5239
5240         /* Verify the item */
5241         if (!item_tester_okay(&inventory[i])) return (FALSE);
5242
5243         /* Assume okay */
5244         return (TRUE);
5245 }
5246
5247
5248
5249 /*
5250  * Determine whether get_item() can get some item or not
5251  * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
5252  */
5253 bool can_get_item(void)
5254 {
5255         int j, floor_list[23], floor_num = 0;
5256
5257         for (j = 0; j < INVEN_TOTAL; j++)
5258                 if (item_tester_okay(&inventory[j]))
5259                         return TRUE;
5260
5261         floor_num = scan_floor(floor_list, py, px, 0x01);
5262         if (floor_num)
5263                 return TRUE;
5264
5265         return FALSE;
5266 }
5267
5268 /*
5269  * Let the user select an item, save its "index"
5270  *
5271  * Return TRUE only if an acceptable item was chosen by the user.
5272  *
5273  * The selected item must satisfy the "item_tester_hook()" function,
5274  * if that hook is set, and the "item_tester_tval", if that value is set.
5275  *
5276  * All "item_tester" restrictions are cleared before this function returns.
5277  *
5278  * The user is allowed to choose acceptable items from the equipment,
5279  * inventory, or floor, respectively, if the proper flag was given,
5280  * and there are any acceptable items in that location.
5281  *
5282  * The equipment or inventory are displayed (even if no acceptable
5283  * items are in that location) if the proper flag was given.
5284  *
5285  * If there are no acceptable items available anywhere, and "str" is
5286  * not NULL, then it will be used as the text of a warning message
5287  * before the function returns.
5288  *
5289  * Note that the user must press "-" to specify the item on the floor,
5290  * and there is no way to "examine" the item on the floor, while the
5291  * use of "capital" letters will "examine" an inventory/equipment item,
5292  * and prompt for its use.
5293  *
5294  * If a legal item is selected from the inventory, we save it in "cp"
5295  * directly (0 to 35), and return TRUE.
5296  *
5297  * If a legal item is selected from the floor, we save it in "cp" as
5298  * a negative (-1 to -511), and return TRUE.
5299  *
5300  * If no item is available, we do nothing to "cp", and we display a
5301  * warning message, using "str" if available, and return FALSE.
5302  *
5303  * If no item is selected, we do nothing to "cp", and return FALSE.
5304  *
5305  * Global "p_ptr->command_new" is used when viewing the inventory or equipment
5306  * to allow the user to enter a command while viewing those screens, and
5307  * also to induce "auto-enter" of stores, and other such stuff.
5308  *
5309  * Global "p_ptr->command_see" may be set before calling this function to start
5310  * out in "browse" mode.  It is cleared before this function returns.
5311  *
5312  * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
5313  * If it is TRUE then we are viewing inventory, else equipment.
5314  *
5315  * We always erase the prompt when we are done, leaving a blank line,
5316  * or a warning message, if appropriate, if no items are available.
5317  */
5318 bool get_item(int *cp, cptr pmt, cptr str, int mode)
5319 {
5320         s16b this_o_idx, next_o_idx = 0;
5321
5322         char which = ' ';
5323
5324         int j, k, i1, i2, e1, e2;
5325
5326         bool done, item;
5327
5328         bool oops = FALSE;
5329
5330         bool equip = FALSE;
5331         bool inven = FALSE;
5332         bool floor = FALSE;
5333
5334         bool allow_floor = FALSE;
5335
5336         bool toggle = FALSE;
5337
5338         char tmp_val[160];
5339         char out_val[160];
5340
5341         /* See cmd5.c */
5342         extern bool select_the_force;
5343
5344         int menu_line = (use_menu ? 1 : 0);
5345         int max_inven = 0;
5346         int max_equip = 0;
5347
5348 #ifdef ALLOW_EASY_FLOOR /* TNB */
5349
5350         if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
5351
5352 #endif /* ALLOW_EASY_FLOOR -- TNB */
5353
5354 #ifdef ALLOW_REPEAT
5355
5356         /* Get the item index */
5357         if (repeat_pull(cp))
5358         {
5359                 if (*cp == INVEN_FORCE) { /* the_force */
5360                     item_tester_tval = 0;
5361                     item_tester_hook = NULL;
5362                     return (TRUE);
5363                 } else
5364                 /* Floor item? */
5365                 if (*cp < 0)
5366                 {
5367                         object_type *o_ptr;
5368
5369                         /* Special index */
5370                         k = 0 - (*cp);
5371
5372                         /* Acquire object */
5373                         o_ptr = &o_list[k];
5374
5375                         /* Validate the item */
5376                         if (item_tester_okay(o_ptr))
5377                         {
5378                                 /* Forget the item_tester_tval restriction */
5379                                 item_tester_tval = 0;
5380
5381                                 /* Forget the item_tester_hook restriction */
5382                                 item_tester_hook = NULL;
5383
5384                                 /* Success */
5385                                 return (TRUE);
5386                         }
5387                 }
5388
5389                 /* Verify the item */
5390                 else if (get_item_okay(*cp))
5391                 {
5392                         /* Forget the item_tester_tval restriction */
5393                         item_tester_tval = 0;
5394
5395                         /* Forget the item_tester_hook restriction */
5396                         item_tester_hook = NULL;
5397
5398                         /* Success */
5399                         return (TRUE);
5400                 }
5401         }
5402
5403 #endif /* ALLOW_REPEAT */
5404
5405         /* Extract args */
5406         if (mode & (USE_EQUIP)) equip = TRUE;
5407         if (mode & (USE_INVEN)) inven = TRUE;
5408         if (mode & (USE_FLOOR)) floor = TRUE;
5409
5410
5411         /* Paranoia XXX XXX XXX */
5412         msg_print(NULL);
5413
5414
5415         /* Not done */
5416         done = FALSE;
5417
5418         /* No item selected */
5419         item = FALSE;
5420
5421
5422         /* Full inventory */
5423         i1 = 0;
5424         i2 = INVEN_PACK - 1;
5425
5426         /* Forbid inventory */
5427         if (!inven) i2 = -1;
5428         else if (use_menu)
5429         {
5430                 for (j = 0; j < INVEN_PACK; j++)
5431                         if (item_tester_okay(&inventory[j])) max_inven++;
5432         }
5433
5434         /* Restrict inventory indexes */
5435         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
5436         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
5437
5438
5439         /* Full equipment */
5440         e1 = INVEN_RARM;
5441         e2 = INVEN_TOTAL - 1;
5442
5443         /* Forbid equipment */
5444         if (!equip) e2 = -1;
5445         else if (use_menu)
5446         {
5447                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
5448                         if (item_tester_okay(&inventory[j])) max_equip++;
5449                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
5450         }
5451
5452         /* Restrict equipment indexes */
5453         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
5454         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
5455
5456
5457
5458         /* Restrict floor usage */
5459         if (floor)
5460         {
5461                 /* Scan all objects in the grid */
5462                 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5463                 {
5464                         object_type *o_ptr;
5465
5466                         /* Acquire object */
5467                         o_ptr = &o_list[this_o_idx];
5468
5469                         /* Acquire next object */
5470                         next_o_idx = o_ptr->next_o_idx;
5471
5472                         /* Accept the item on the floor if legal */
5473                         if (item_tester_okay(o_ptr)) allow_floor = TRUE;
5474                 }
5475         }
5476
5477         /* Require at least one legal choice */
5478         if (!allow_floor && (i1 > i2) && (e1 > e2))
5479         {
5480                 /* Cancel p_ptr->command_see */
5481                 command_see = FALSE;
5482
5483                 /* Oops */
5484                 oops = TRUE;
5485
5486                 /* Done */
5487                 done = TRUE;
5488
5489                 if (select_the_force) {
5490                     *cp = INVEN_FORCE;
5491                     item = TRUE;
5492                 }
5493         }
5494
5495         /* Analyze choices */
5496         else
5497         {
5498                 /* Hack -- Start on equipment if requested */
5499                 if (command_see && command_wrk && equip)
5500
5501                 {
5502                         command_wrk = TRUE;
5503                 }
5504
5505                 /* Use inventory if allowed */
5506                 else if (inven)
5507                 {
5508                         command_wrk = FALSE;
5509                 }
5510
5511                 /* Use equipment if allowed */
5512                 else if (equip)
5513                 {
5514                         command_wrk = TRUE;
5515                 }
5516
5517                 /* Use inventory for floor */
5518                 else
5519                 {
5520                         command_wrk = FALSE;
5521                 }
5522         }
5523
5524
5525         /*
5526          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
5527          */
5528         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
5529
5530         /* Hack -- start out in "display" mode */
5531         if (command_see)
5532         {
5533                 /* Save screen */
5534                 screen_save();
5535         }
5536
5537
5538         /* Repeat until done */
5539         while (!done)
5540         {
5541                 int get_item_label = 0;
5542
5543                 /* Show choices */
5544                 if (show_choices)
5545                 {
5546                         int ni = 0;
5547                         int ne = 0;
5548
5549                         /* Scan windows */
5550                         for (j = 0; j < 8; j++)
5551                         {
5552                                 /* Unused */
5553                                 if (!angband_term[j]) continue;
5554
5555                                 /* Count windows displaying inven */
5556                                 if (window_flag[j] & (PW_INVEN)) ni++;
5557
5558                                 /* Count windows displaying equip */
5559                                 if (window_flag[j] & (PW_EQUIP)) ne++;
5560                         }
5561
5562                         /* Toggle if needed */
5563                         if ((command_wrk && ni && !ne) ||
5564                             (!command_wrk && !ni && ne))
5565                         {
5566                                 /* Toggle */
5567                                 toggle_inven_equip();
5568
5569                                 /* Track toggles */
5570                                 toggle = !toggle;
5571                         }
5572
5573                         /* Update */
5574                         p_ptr->window |= (PW_INVEN | PW_EQUIP);
5575
5576                         /* Redraw windows */
5577                         window_stuff();
5578                 }
5579
5580                 /* Inventory screen */
5581                 if (!command_wrk)
5582                 {
5583                         /* Redraw if needed */
5584                         if (command_see) get_item_label = show_inven(menu_line);
5585                 }
5586
5587                 /* Equipment screen */
5588                 else
5589                 {
5590                         /* Redraw if needed */
5591                         if (command_see) get_item_label = show_equip(menu_line);
5592                 }
5593
5594                 /* Viewing inventory */
5595                 if (!command_wrk)
5596                 {
5597                         /* Begin the prompt */
5598 #ifdef JP
5599 sprintf(out_val, "»ý¤Áʪ:");
5600 #else
5601                         sprintf(out_val, "Inven:");
5602 #endif
5603
5604
5605                         /* Some legal items */
5606                         if ((i1 <= i2) && !use_menu)
5607                         {
5608                                 /* Build the prompt */
5609 #ifdef JP
5610 sprintf(tmp_val, "%c-%c,'(',')',",
5611 #else
5612                                 sprintf(tmp_val, " %c-%c,'(',')',",
5613 #endif
5614
5615                                         index_to_label(i1), index_to_label(i2));
5616
5617                                 /* Append */
5618                                 strcat(out_val, tmp_val);
5619                         }
5620
5621                         /* Indicate ability to "view" */
5622 #ifdef JP
5623 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5624 #else
5625                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
5626 #endif
5627
5628
5629                         /* Append */
5630 #ifdef JP
5631 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
5632 else if (select_the_force)
5633         strcat(out_val, " 'w'Îýµ¤½Ñ,");
5634 #else
5635 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
5636 else if (select_the_force)
5637         strcat(out_val, " w for the Force,");
5638 #endif
5639
5640                 }
5641
5642                 /* Viewing equipment */
5643                 else
5644                 {
5645                         /* Begin the prompt */
5646 #ifdef JP
5647 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5648 #else
5649                         sprintf(out_val, "Equip:");
5650 #endif
5651
5652
5653                         /* Some legal items */
5654                         if ((e1 <= e2) && !use_menu)
5655                         {
5656                                 /* Build the prompt */
5657 #ifdef JP
5658 sprintf(tmp_val, "%c-%c,'(',')',",
5659 #else
5660                                 sprintf(tmp_val, " %c-%c,'(',')',",
5661 #endif
5662
5663                                         index_to_label(e1), index_to_label(e2));
5664
5665                                 /* Append */
5666                                 strcat(out_val, tmp_val);
5667                         }
5668
5669                         /* Indicate ability to "view" */
5670 #ifdef JP
5671 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5672 #else
5673                         if (!command_see) strcat(out_val, " * to see,");
5674 #endif
5675
5676
5677                         /* Append */
5678 #ifdef JP
5679 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
5680 #else
5681 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
5682 #endif
5683
5684                 }
5685
5686                 /* Indicate legality of the "floor" item */
5687 #ifdef JP
5688 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
5689 #else
5690                 if (allow_floor) strcat(out_val, " - for floor,");
5691 #endif
5692
5693
5694                 /* Finish the prompt */
5695                 strcat(out_val, " ESC");
5696
5697                 /* Build the prompt */
5698                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5699
5700                 /* Show the prompt */
5701                 prt(tmp_val, 0, 0);
5702
5703
5704                 /* Get a key */
5705                 which = inkey();
5706
5707                 if (use_menu)
5708                 {
5709                 int max_line = (command_wrk ? max_equip : max_inven);
5710                 switch (which)
5711                 {
5712                         case ESCAPE:
5713                         case 'z':
5714                         case 'Z':
5715                         case '0':
5716                         {
5717                                 done = TRUE;
5718                                 break;
5719                         }
5720
5721                         case '8':
5722                         case 'k':
5723                         case 'K':
5724                         {
5725                                 menu_line += (max_line - 1);
5726                                 break;
5727                         }
5728
5729                         case '2':
5730                         case 'j':
5731                         case 'J':
5732                         {
5733                                 menu_line++;
5734                                 break;
5735                         }
5736
5737                         case '4':
5738                         case '6':
5739                         case 'h':
5740                         case 'H':
5741                         case 'l':
5742                         case 'L':
5743                         {
5744                                 /* Verify legality */
5745                                 if (!inven || !equip)
5746                                 {
5747                                         bell();
5748                                         break;
5749                                 }
5750
5751                                 /* Hack -- Fix screen */
5752                                 if (command_see)
5753                                 {
5754                                         /* Load screen */
5755                                         screen_load();
5756
5757                                         /* Save screen */
5758                                         screen_save();
5759                                 }
5760
5761                                 /* Switch inven/equip */
5762                                 command_wrk = !command_wrk;
5763                                 max_line = (command_wrk ? max_equip : max_inven);
5764                                 if (menu_line > max_line) menu_line = max_line;
5765
5766                                 /* Need to redraw */
5767                                 break;
5768                         }
5769
5770                         case 'x':
5771                         case 'X':
5772                         case '\r':
5773                         case '\n':
5774                         {
5775                                 if (command_wrk == USE_FLOOR)
5776                                 {
5777                                         /* Special index */
5778                                         (*cp) = -get_item_label;
5779                                 }
5780                                 else
5781                                 {
5782                                         /* Validate the item */
5783                                         if (!get_item_okay(get_item_label))
5784                                         {
5785                                                 bell();
5786                                                 break;
5787                                         }
5788
5789                                         /* Allow player to "refuse" certain actions */
5790                                         if (!get_item_allow(get_item_label))
5791                                         {
5792                                                 done = TRUE;
5793                                                 break;
5794                                         }
5795
5796                                         /* Accept that choice */
5797                                         (*cp) = get_item_label;
5798                                 }
5799
5800                                 item = TRUE;
5801                                 done = TRUE;
5802                                 break;
5803                         }
5804                         case 'w':
5805                         {
5806                                 if (select_the_force) {
5807                                         *cp = INVEN_FORCE;
5808                                         item = TRUE;
5809                                         done = TRUE;
5810                                         break;
5811                                 }
5812                         }
5813                 }
5814                 if (menu_line > max_line) menu_line -= max_line;
5815                 }
5816                 else
5817                 {
5818                 /* Parse it */
5819                 switch (which)
5820                 {
5821                         case ESCAPE:
5822                         {
5823                                 done = TRUE;
5824                                 break;
5825                         }
5826
5827                         case '*':
5828                         case '?':
5829                         case ' ':
5830                         {
5831                                 /* Hide the list */
5832                                 if (command_see)
5833                                 {
5834                                         /* Flip flag */
5835                                         command_see = FALSE;
5836
5837                                         /* Load screen */
5838                                         screen_load();
5839                                 }
5840
5841                                 /* Show the list */
5842                                 else
5843                                 {
5844                                         /* Save screen */
5845                                         screen_save();
5846
5847                                         /* Flip flag */
5848                                         command_see = TRUE;
5849                                 }
5850                                 break;
5851                         }
5852
5853                         case '/':
5854                         {
5855                                 /* Verify legality */
5856                                 if (!inven || !equip)
5857                                 {
5858                                         bell();
5859                                         break;
5860                                 }
5861
5862                                 /* Hack -- Fix screen */
5863                                 if (command_see)
5864                                 {
5865                                         /* Load screen */
5866                                         screen_load();
5867
5868                                         /* Save screen */
5869                                         screen_save();
5870                                 }
5871
5872                                 /* Switch inven/equip */
5873                                 command_wrk = !command_wrk;
5874
5875                                 /* Need to redraw */
5876                                 break;
5877                         }
5878
5879                         case '-':
5880                         {
5881                                 /* Use floor item */
5882                                 if (allow_floor)
5883                                 {
5884                                         /* Scan all objects in the grid */
5885                                         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5886                                         {
5887                                                 object_type *o_ptr;
5888
5889                                                 /* Acquire object */
5890                                                 o_ptr = &o_list[this_o_idx];
5891
5892                                                 /* Acquire next object */
5893                                                 next_o_idx = o_ptr->next_o_idx;
5894
5895                                                 /* Validate the item */
5896                                                 if (!item_tester_okay(o_ptr)) continue;
5897
5898                                                 /* Special index */
5899                                                 k = 0 - this_o_idx;
5900
5901                                                 /* Verify the item (if required) */
5902 #ifdef JP
5903 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
5904 #else
5905                                                 if (other_query_flag && !verify("Try", k)) continue;
5906 #endif
5907
5908
5909                                                 /* Allow player to "refuse" certain actions */
5910                                                 if (!get_item_allow(k)) continue;
5911
5912                                                 /* Accept that choice */
5913                                                 (*cp) = k;
5914                                                 item = TRUE;
5915                                                 done = TRUE;
5916                                                 break;
5917                                         }
5918
5919                                         /* Outer break */
5920                                         if (done) break;
5921                                 }
5922
5923                                 /* Oops */
5924                                 bell();
5925                                 break;
5926                         }
5927
5928                         case '0':
5929                         case '1': case '2': case '3':
5930                         case '4': case '5': case '6':
5931                         case '7': case '8': case '9':
5932                         {
5933                                 /* Look up the tag */
5934                                 if (!get_tag(&k, which))
5935                                 {
5936                                         bell();
5937                                         break;
5938                                 }
5939
5940                                 /* Hack -- Validate the item */
5941                                 if ((k < INVEN_RARM) ? !inven : !equip)
5942                                 {
5943                                         bell();
5944                                         break;
5945                                 }
5946
5947                                 /* Validate the item */
5948                                 if (!get_item_okay(k))
5949                                 {
5950                                         bell();
5951                                         break;
5952                                 }
5953
5954                                 /* Allow player to "refuse" certain actions */
5955                                 if (!get_item_allow(k))
5956                                 {
5957                                         done = TRUE;
5958                                         break;
5959                                 }
5960
5961                                 /* Accept that choice */
5962                                 (*cp) = k;
5963                                 item = TRUE;
5964                                 done = TRUE;
5965                                 break;
5966                         }
5967
5968 #if 0
5969                         case '\n':
5970                         case '\r':
5971                         {
5972                                 /* Choose "default" inventory item */
5973                                 if (!command_wrk)
5974                                 {
5975                                         k = ((i1 == i2) ? i1 : -1);
5976                                 }
5977
5978                                 /* Choose "default" equipment item */
5979                                 else
5980                                 {
5981                                         k = ((e1 == e2) ? e1 : -1);
5982                                 }
5983
5984                                 /* Validate the item */
5985                                 if (!get_item_okay(k))
5986                                 {
5987                                         bell();
5988                                         break;
5989                                 }
5990
5991                                 /* Allow player to "refuse" certain actions */
5992                                 if (!get_item_allow(k))
5993                                 {
5994                                         done = TRUE;
5995                                         break;
5996                                 }
5997
5998                                 /* Accept that choice */
5999                                 (*cp) = k;
6000                                 item = TRUE;
6001                                 done = TRUE;
6002                                 break;
6003                         }
6004 #endif
6005
6006                         case 'w':
6007                         {
6008                                 if (select_the_force) {
6009                                         *cp = INVEN_FORCE;
6010                                         item = TRUE;
6011                                         done = TRUE;
6012                                         break;
6013                                 }
6014
6015                                 /* Fall through */
6016                         }
6017
6018                         default:
6019                         {
6020                                 int ver;
6021                                 bool not_found = FALSE;
6022
6023                                 /* Look up the alphabetical tag */
6024                                 if (!get_tag(&k, which))
6025                                 {
6026                                         not_found = TRUE;
6027                                 }
6028
6029                                 /* Hack -- Validate the item */
6030                                 if ((k < INVEN_RARM) ? !inven : !equip)
6031                                 {
6032                                         not_found = TRUE;
6033                                 }
6034
6035                                 /* Validate the item */
6036                                 if (!get_item_okay(k))
6037                                 {
6038                                         not_found = TRUE;
6039                                 }
6040
6041                                 if (!not_found)
6042                                 {
6043                                         /* Accept that choice */
6044                                         (*cp) = k;
6045                                         item = TRUE;
6046                                         done = TRUE;
6047                                         break;
6048                                 }
6049
6050                                 /* Extract "query" setting */
6051                                 ver = isupper(which);
6052                                 which = tolower(which);
6053
6054                                 /* Convert letter to inventory index */
6055                                 if (!command_wrk)
6056                                 {
6057                                         if (which == '(') k = i1;
6058                                         else if (which == ')') k = i2;
6059                                         else k = label_to_inven(which);
6060                                 }
6061
6062                                 /* Convert letter to equipment index */
6063                                 else
6064                                 {
6065                                         if (which == '(') k = e1;
6066                                         else if (which == ')') k = e2;
6067                                         else k = label_to_equip(which);
6068                                 }
6069
6070                                 /* Validate the item */
6071                                 if (!get_item_okay(k))
6072                                 {
6073                                         bell();
6074                                         break;
6075                                 }
6076
6077                                 /* Verify the item */
6078 #ifdef JP
6079 if (ver && !verify("ËÜÅö¤Ë", k))
6080 #else
6081                                 if (ver && !verify("Try", k))
6082 #endif
6083
6084                                 {
6085                                         done = TRUE;
6086                                         break;
6087                                 }
6088
6089                                 /* Allow player to "refuse" certain actions */
6090                                 if (!get_item_allow(k))
6091                                 {
6092                                         done = TRUE;
6093                                         break;
6094                                 }
6095
6096                                 /* Accept that choice */
6097                                 (*cp) = k;
6098                                 item = TRUE;
6099                                 done = TRUE;
6100                                 break;
6101                         }
6102                 }
6103                 }
6104         }
6105
6106
6107         /* Fix the screen if necessary */
6108         if (command_see)
6109         {
6110                 /* Load screen */
6111                 screen_load();
6112
6113                 /* Hack -- Cancel "display" */
6114                 command_see = FALSE;
6115         }
6116
6117
6118         /* Forget the item_tester_tval restriction */
6119         item_tester_tval = 0;
6120
6121         item_tester_no_ryoute = FALSE;
6122
6123         /* Forget the item_tester_hook restriction */
6124         item_tester_hook = NULL;
6125
6126
6127         /* Clean up */
6128         if (show_choices)
6129         {
6130                 /* Toggle again if needed */
6131                 if (toggle) toggle_inven_equip();
6132
6133                 /* Update */
6134                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6135
6136                 /* Window stuff */
6137                 window_stuff();
6138         }
6139
6140
6141         /* Clear the prompt line */
6142         prt("", 0, 0);
6143
6144         /* Warning if needed */
6145         if (oops && str) msg_print(str);
6146
6147 #ifdef ALLOW_REPEAT
6148         if (item) repeat_push(*cp);
6149 #endif /* ALLOW_REPEAT */
6150
6151         /* Result */
6152         return (item);
6153 }
6154
6155
6156 #ifdef ALLOW_EASY_FLOOR
6157
6158 /*
6159  * scan_floor --
6160  *
6161  * Return a list of o_list[] indexes of items at the given cave
6162  * location. Valid flags are:
6163  *
6164  *              mode & 0x01 -- Item tester
6165  *              mode & 0x02 -- Marked items only
6166  *              mode & 0x04 -- Stop after first
6167  */
6168 int scan_floor(int *items, int y, int x, int mode)
6169 {
6170         int this_o_idx, next_o_idx;
6171
6172         int num = 0;
6173
6174         /* Sanity */
6175         if (!in_bounds(y, x)) return 0;
6176
6177         /* Scan all objects in the grid */
6178         for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
6179         {
6180                 object_type *o_ptr;
6181
6182                 /* Acquire object */
6183                 o_ptr = &o_list[this_o_idx];
6184
6185                 /* Acquire next object */
6186                 next_o_idx = o_ptr->next_o_idx;
6187
6188                 /* Item tester */
6189                 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
6190
6191                 /* Marked */
6192                 if ((mode & 0x02) && !o_ptr->marked) continue;
6193
6194                 /* Accept this item */
6195                 /* XXX Hack -- Enforce limit */
6196                 if (num < 23)
6197                         items[num] = this_o_idx;
6198
6199                 num++;
6200
6201                 /* Only one */
6202                 if (mode & 0x04) break;
6203         }
6204
6205         /* Result */
6206         return num;
6207 }
6208
6209 /*
6210  * Display a list of the items on the floor at the given location.
6211  */
6212 int show_floor(int target_item, int y, int x, int *min_width)
6213 {
6214         int i, j, k, l;
6215         int col, len;
6216
6217         object_type *o_ptr;
6218
6219         char o_name[MAX_NLEN];
6220
6221         char tmp_val[80];
6222
6223         int out_index[23];
6224         byte out_color[23];
6225         char out_desc[23][MAX_NLEN];
6226         int target_item_label = 0;
6227
6228         int floor_list[23], floor_num;
6229         int wid, hgt;
6230
6231         /* Get size */
6232         Term_get_size(&wid, &hgt);
6233
6234         /* Default length */
6235         len = MAX((*min_width), 20);
6236
6237
6238         /* Scan for objects in the grid, using item_tester_okay() */
6239         floor_num = scan_floor(floor_list, y, x, 0x01);
6240
6241         /* Display the inventory */
6242         for (k = 0, i = 0; i < floor_num && i < 23; i++)
6243         {
6244                 o_ptr = &o_list[floor_list[i]];
6245
6246                 /* Describe the object */
6247                 object_desc(o_name, o_ptr, TRUE, 3);
6248
6249                 /* Save the index */
6250                 out_index[k] = i;
6251
6252                 /* Acquire inventory color */
6253                 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
6254
6255                 /* Save the object description */
6256                 strcpy(out_desc[k], o_name);
6257
6258                 /* Find the predicted "line length" */
6259                 l = strlen(out_desc[k]) + 5;
6260
6261                 /* Be sure to account for the weight */
6262                 if (show_weights) l += 9;
6263
6264                 /* Maintain the maximum length */
6265                 if (l > len) len = l;
6266
6267                 /* Advance to next "line" */
6268                 k++;
6269         }
6270
6271         /* Save width */
6272         *min_width = len;
6273
6274         /* Find the column to start in */
6275         col = (len > wid - 4) ? 0 : (wid - len - 1);
6276
6277         /* Output each entry */
6278         for (j = 0; j < k; j++)
6279         {
6280                 /* Get the index */
6281                 i = floor_list[out_index[j]];
6282
6283                 /* Get the item */
6284                 o_ptr = &o_list[i];
6285
6286                 /* Clear the line */
6287                 prt("", j + 1, col ? col - 2 : col);
6288
6289                 if (use_menu && target_item)
6290                 {
6291                         if (j == (target_item-1))
6292                         {
6293 #ifdef JP
6294                                 strcpy(tmp_val, "¡Õ");
6295 #else
6296                                 strcpy(tmp_val, "> ");
6297 #endif
6298                                 target_item_label = i;
6299                         }
6300                         else strcpy(tmp_val, "   ");
6301                 }
6302                 else
6303                         /* Prepare an index --(-- */
6304                         sprintf(tmp_val, "%c)", index_to_label(j));
6305
6306                 /* Clear the line with the (possibly indented) index */
6307                 put_str(tmp_val, j + 1, col);
6308
6309                 /* Display the entry itself */
6310                 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
6311
6312                 /* Display the weight if needed */
6313                 if (show_weights)
6314                 {
6315                         int wgt = o_ptr->weight * o_ptr->number;
6316 #ifdef JP
6317                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
6318 #else
6319                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
6320 #endif
6321
6322                         prt(tmp_val, j + 1, wid - 9);
6323                 }
6324         }
6325
6326         /* Make a "shadow" below the list (only if needed) */
6327         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
6328
6329         return target_item_label;
6330 }
6331
6332 /*
6333  * This version of get_item() is called by get_item() when
6334  * the easy_floor is on.
6335  */
6336 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
6337 {
6338         char n1 = ' ', n2 = ' ', which = ' ';
6339
6340         int j, k, i1, i2, e1, e2;
6341
6342         bool done, item;
6343
6344         bool oops = FALSE;
6345
6346         bool equip = FALSE;
6347         bool inven = FALSE;
6348         bool floor = FALSE;
6349
6350         bool allow_equip = FALSE;
6351         bool allow_inven = FALSE;
6352         bool allow_floor = FALSE;
6353
6354         bool toggle = FALSE;
6355
6356         char tmp_val[160];
6357         char out_val[160];
6358
6359         int floor_num, floor_list[23], floor_top = 0;
6360         int min_width = 0;
6361
6362         extern bool select_the_force;
6363
6364         int menu_line = (use_menu ? 1 : 0);
6365         int max_inven = 0;
6366         int max_equip = 0;
6367
6368 #ifdef ALLOW_REPEAT
6369
6370         /* Get the item index */
6371         if (repeat_pull(cp))
6372         {
6373                 if (*cp == INVEN_FORCE) { /* the_force */
6374                     item_tester_tval = 0;
6375                     item_tester_hook = NULL;
6376                     return (TRUE);
6377                 } else
6378                 /* Floor item? */
6379                 if (*cp < 0)
6380                 {
6381                         object_type *o_ptr;
6382
6383                         /* Special index */
6384                         k = 0 - (*cp);
6385
6386                         /* Acquire object */
6387                         o_ptr = &o_list[k];
6388
6389                         /* Validate the item */
6390                         if (item_tester_okay(o_ptr))
6391                         {
6392                                 /* Forget the item_tester_tval restriction */
6393                                 item_tester_tval = 0;
6394
6395                                 /* Forget the item_tester_hook restriction */
6396                                 item_tester_hook = NULL;
6397
6398                                 /* Success */
6399                                 return (TRUE);
6400                         }
6401                 }
6402
6403                 /* Verify the item */
6404                 else if (get_item_okay(*cp))
6405                 {
6406                         /* Forget the item_tester_tval restriction */
6407                         item_tester_tval = 0;
6408
6409                         /* Forget the item_tester_hook restriction */
6410                         item_tester_hook = NULL;
6411
6412                         /* Success */
6413                         return (TRUE);
6414                 }
6415         }
6416
6417 #endif /* ALLOW_REPEAT */
6418
6419         /* Extract args */
6420         if (mode & (USE_EQUIP)) equip = TRUE;
6421         if (mode & (USE_INVEN)) inven = TRUE;
6422         if (mode & (USE_FLOOR)) floor = TRUE;
6423
6424
6425         /* Paranoia XXX XXX XXX */
6426         msg_print(NULL);
6427
6428
6429         /* Not done */
6430         done = FALSE;
6431
6432         /* No item selected */
6433         item = FALSE;
6434
6435
6436         /* Full inventory */
6437         i1 = 0;
6438         i2 = INVEN_PACK - 1;
6439
6440         /* Forbid inventory */
6441         if (!inven) i2 = -1;
6442         else if (use_menu)
6443         {
6444                 for (j = 0; j < INVEN_PACK; j++)
6445                         if (item_tester_okay(&inventory[j])) max_inven++;
6446         }
6447
6448         /* Restrict inventory indexes */
6449         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
6450         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
6451
6452
6453         /* Full equipment */
6454         e1 = INVEN_RARM;
6455         e2 = INVEN_TOTAL - 1;
6456
6457         /* Forbid equipment */
6458         if (!equip) e2 = -1;
6459         else if (use_menu)
6460         {
6461                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
6462                         if (item_tester_okay(&inventory[j])) max_equip++;
6463                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
6464         }
6465
6466         /* Restrict equipment indexes */
6467         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
6468         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
6469
6470
6471         /* Count "okay" floor items */
6472         floor_num = 0;
6473
6474         /* Restrict floor usage */
6475         if (floor)
6476         {
6477                 /* Scan all objects in the grid */
6478                 floor_num = scan_floor(floor_list, py, px, 0x01);
6479         }
6480
6481         /* Accept inventory */
6482         if (i1 <= i2) allow_inven = TRUE;
6483
6484         /* Accept equipment */
6485         if (e1 <= e2) allow_equip = TRUE;
6486
6487         /* Accept floor */
6488         if (floor_num) allow_floor = TRUE;
6489
6490         /* Require at least one legal choice */
6491         if (!allow_inven && !allow_equip && !allow_floor)
6492         {
6493                 /* Cancel p_ptr->command_see */
6494                 command_see = FALSE;
6495
6496                 /* Oops */
6497                 oops = TRUE;
6498
6499                 /* Done */
6500                 done = TRUE;
6501
6502                 if (select_the_force) {
6503                     *cp = INVEN_FORCE;
6504                     item = TRUE;
6505                 }
6506         }
6507
6508         /* Analyze choices */
6509         else
6510         {
6511                 /* Hack -- Start on equipment if requested */
6512                 if (command_see && (command_wrk == (USE_EQUIP))
6513                         && allow_equip)
6514                 {
6515                         command_wrk = (USE_EQUIP);
6516                 }
6517
6518                 /* Use inventory if allowed */
6519                 else if (allow_inven)
6520                 {
6521                         command_wrk = (USE_INVEN);
6522                 }
6523
6524                 /* Use equipment if allowed */
6525                 else if (allow_equip)
6526                 {
6527                         command_wrk = (USE_EQUIP);
6528                 }
6529
6530                 /* Use floor if allowed */
6531                 else if (allow_floor)
6532                 {
6533                         command_wrk = (USE_FLOOR);
6534                 }
6535         }
6536
6537         /*
6538          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
6539          */
6540         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
6541
6542         /* Hack -- start out in "display" mode */
6543         if (command_see)
6544         {
6545                 /* Save screen */
6546                 screen_save();
6547         }
6548
6549         /* Repeat until done */
6550         while (!done)
6551         {
6552                 int get_item_label = 0;
6553
6554                 /* Show choices */
6555                 if (show_choices)
6556                 {
6557                         int ni = 0;
6558                         int ne = 0;
6559
6560                         /* Scan windows */
6561                         for (j = 0; j < 8; j++)
6562                         {
6563                                 /* Unused */
6564                                 if (!angband_term[j]) continue;
6565
6566                                 /* Count windows displaying inven */
6567                                 if (window_flag[j] & (PW_INVEN)) ni++;
6568
6569                                 /* Count windows displaying equip */
6570                                 if (window_flag[j] & (PW_EQUIP)) ne++;
6571                         }
6572
6573                         /* Toggle if needed */
6574                         if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
6575                                 (command_wrk == (USE_INVEN) && !ni && ne))
6576                         {
6577                                 /* Toggle */
6578                                 toggle_inven_equip();
6579
6580                                 /* Track toggles */
6581                                 toggle = !toggle;
6582                         }
6583
6584                         /* Update */
6585                         p_ptr->window |= (PW_INVEN | PW_EQUIP);
6586
6587                         /* Redraw windows */
6588                         window_stuff();
6589                 }
6590
6591                 /* Inventory screen */
6592                 if (command_wrk == (USE_INVEN))
6593                 {
6594                         /* Extract the legal requests */
6595                         n1 = I2A(i1);
6596                         n2 = I2A(i2);
6597
6598                         /* Redraw if needed */
6599                         if (command_see) get_item_label = show_inven(menu_line);
6600                 }
6601
6602                 /* Equipment screen */
6603                 else if (command_wrk == (USE_EQUIP))
6604                 {
6605                         /* Extract the legal requests */
6606                         n1 = I2A(e1 - INVEN_RARM);
6607                         n2 = I2A(e2 - INVEN_RARM);
6608
6609                         /* Redraw if needed */
6610                         if (command_see) get_item_label = show_equip(menu_line);
6611                 }
6612
6613                 /* Floor screen */
6614                 else if (command_wrk == (USE_FLOOR))
6615                 {
6616                         j = floor_top;
6617                         k = MIN(floor_top + 23, floor_num) - 1;
6618
6619                         /* Extract the legal requests */
6620                         n1 = I2A(j - floor_top);
6621                         n2 = I2A(k - floor_top);
6622
6623                         /* Redraw if needed */
6624                         if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
6625                 }
6626
6627                 /* Viewing inventory */
6628                 if (command_wrk == (USE_INVEN))
6629                 {
6630                         /* Begin the prompt */
6631 #ifdef JP
6632 sprintf(out_val, "»ý¤Áʪ:");
6633 #else
6634                         sprintf(out_val, "Inven:");
6635 #endif
6636
6637                         if (!use_menu)
6638                         {
6639                                 /* Build the prompt */
6640 #ifdef JP
6641 sprintf(tmp_val, "%c-%c,'(',')',",
6642 #else
6643                                 sprintf(tmp_val, " %c-%c,'(',')',",
6644 #endif
6645
6646                                         index_to_label(i1), index_to_label(i2));
6647
6648                                 /* Append */
6649                                 strcat(out_val, tmp_val);
6650                         }
6651
6652                         /* Indicate ability to "view" */
6653 #ifdef JP
6654 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6655 #else
6656                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6657 #endif
6658
6659
6660                         /* Append */
6661 #ifdef JP
6662                         if (allow_equip)
6663                         {
6664                                 if (!use_menu)
6665                                         strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
6666                                 else if (allow_floor)
6667                                         strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
6668                                 else
6669                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6670                         }
6671                         else if (select_the_force)
6672                                 strcat(out_val, " 'w'Îýµ¤½Ñ,");
6673 #else
6674                         if (allow_equip)
6675                         {
6676                                 if (!use_menu)
6677                                         strcat(out_val, " / for Equip,");
6678                                 else if (allow_floor)
6679                                         strcat(out_val, " 6 for Equip,");
6680                                 else
6681                                         strcat(out_val, " 4 or 6 for Equip,");
6682                         }
6683                         else if (select_the_force)
6684                                 strcat(out_val, " w for the Force,");
6685 #endif
6686
6687                         /* Append */
6688                         if (allow_floor)
6689                         {
6690 #ifdef JP
6691                                 if (!use_menu)
6692                                         strcat(out_val, " '-'¾²¾å,");
6693                                 else if (allow_equip)
6694                                         strcat(out_val, " '4' ¾²¾å,");
6695                                 else
6696                                         strcat(out_val, " '4'or'6' ¾²¾å,");
6697 #else
6698                                 if (!use_menu)
6699                                         strcat(out_val, " - for floor,");
6700                                 else if (allow_equip)
6701                                         strcat(out_val, " 4 for floor,");
6702                                 else
6703                                         strcat(out_val, " 4 or 6 for floor,");
6704 #endif
6705                         }
6706
6707                 }
6708
6709                 /* Viewing equipment */
6710                 else if (command_wrk == (USE_EQUIP))
6711                 {
6712                         /* Begin the prompt */
6713 #ifdef JP
6714 sprintf(out_val, "ÁõÈ÷ÉÊ:");
6715 #else
6716                         sprintf(out_val, "Equip:");
6717 #endif
6718
6719
6720                         if (!use_menu)
6721                         {
6722                                 /* Build the prompt */
6723 #ifdef JP
6724 sprintf(tmp_val, "%c-%c,'(',')',",
6725 #else
6726                                 sprintf(tmp_val, " %c-%c,'(',')',",
6727 #endif
6728
6729                                         index_to_label(e1), index_to_label(e2));
6730
6731                                 /* Append */
6732                                 strcat(out_val, tmp_val);
6733                         }
6734
6735                         /* Indicate ability to "view" */
6736 #ifdef JP
6737 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6738 #else
6739                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6740 #endif
6741
6742
6743                         /* Append */
6744                         if (allow_inven)
6745                         {
6746 #ifdef JP
6747                                 if (!use_menu)
6748                                         strcat(out_val, " '/' »ý¤Áʪ,");
6749                                 else if (allow_floor)
6750                                         strcat(out_val, " '4' »ý¤Áʪ,");
6751                                 else
6752                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6753 #else
6754
6755                                 if (!use_menu)
6756                                         strcat(out_val, " / for Inven,");
6757                                 else if (allow_floor)
6758                                         strcat(out_val, " 4 for Inven,");
6759                                 else
6760                                         strcat(out_val, " 4 or 6 for Inven,");
6761 #endif
6762                         }
6763
6764                         /* Append */
6765                         if (allow_floor)
6766                         {
6767 #ifdef JP
6768                                 if (!use_menu)
6769                                         strcat(out_val, " '-'¾²¾å,");
6770                                 else if (allow_inven)
6771                                         strcat(out_val, " '6' ¾²¾å,");
6772                                 else
6773                                         strcat(out_val, " '4'or'6' ¾²¾å,");
6774 #else
6775                                 if (!use_menu)
6776                                         strcat(out_val, " - for floor,");
6777                                 else if (allow_inven)
6778                                         strcat(out_val, " 6 for floor,");
6779                                 else
6780                                         strcat(out_val, " 4 or 6 for floor,");
6781 #endif
6782                         }
6783                 }
6784
6785                 /* Viewing floor */
6786                 else if (command_wrk == (USE_FLOOR))
6787                 {
6788                         /* Begin the prompt */
6789 #ifdef JP
6790                         sprintf(out_val, "¾²¾å:");
6791 #else
6792                         sprintf(out_val, "Floor:");
6793 #endif
6794
6795
6796                         if (!use_menu)
6797                         {
6798                                 /* Build the prompt */
6799 #ifdef JP
6800 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
6801 #else
6802                                 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
6803 #endif
6804
6805
6806                                 /* Append */
6807                                 strcat(out_val, tmp_val);
6808                         }
6809
6810                         /* Indicate ability to "view" */
6811 #ifdef JP
6812 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6813 #else
6814                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6815 #endif
6816
6817
6818                         if (use_menu)
6819                         {
6820                                 if (allow_inven && allow_equip)
6821                                 {
6822 #ifdef JP
6823                                         strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
6824 #else
6825                                         strcat(out_val, " 4 for Equip, 6 for Inven,");
6826 #endif
6827
6828                                 }
6829                                 else if (allow_inven)
6830                                 {
6831 #ifdef JP
6832                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6833 #else
6834                                         strcat(out_val, " 4 or 6 for Inven,");
6835 #endif
6836
6837                                 }
6838                                 else if (allow_equip)
6839                                 {
6840 #ifdef JP
6841                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6842 #else
6843                                         strcat(out_val, " 4 or 6 for Equip,");
6844 #endif
6845
6846                                 }
6847                         }
6848                         /* Append */
6849                         else if (allow_inven)
6850                         {
6851 #ifdef JP
6852                                 strcat(out_val, " '/' »ý¤Áʪ,");
6853 #else
6854                                 strcat(out_val, " / for Inven,");
6855 #endif
6856
6857                         }
6858                         else if (allow_equip)
6859                         {
6860 #ifdef JP
6861                                 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
6862 #else
6863                                 strcat(out_val, " / for Equip,");
6864 #endif
6865
6866                         }
6867
6868                         /* Append */
6869                         if (command_see && !use_menu)
6870                         {
6871 #ifdef JP
6872                                 strcat(out_val, " Enter ¼¡,");
6873 #else
6874                                 strcat(out_val, " Enter for scroll down,");
6875 #endif
6876                         }
6877                 }
6878
6879                 /* Finish the prompt */
6880                 strcat(out_val, " ESC");
6881
6882                 /* Build the prompt */
6883                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
6884
6885                 /* Show the prompt */
6886                 prt(tmp_val, 0, 0);
6887
6888                 /* Get a key */
6889                 which = inkey();
6890
6891                 if (use_menu)
6892                 {
6893                 int max_line = 1;
6894                 if (command_wrk == USE_INVEN) max_line = max_inven;
6895                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6896                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6897                 switch (which)
6898                 {
6899                         case ESCAPE:
6900                         case 'z':
6901                         case 'Z':
6902                         case '0':
6903                         {
6904                                 done = TRUE;
6905                                 break;
6906                         }
6907
6908                         case '8':
6909                         case 'k':
6910                         case 'K':
6911                         {
6912                                 menu_line += (max_line - 1);
6913                                 break;
6914                         }
6915
6916                         case '2':
6917                         case 'j':
6918                         case 'J':
6919                         {
6920                                 menu_line++;
6921                                 break;
6922                         }
6923
6924                         case '4':
6925                         case 'h':
6926                         case 'H':
6927                         {
6928                                 /* Verify legality */
6929                                 if (command_wrk == (USE_INVEN))
6930                                 {
6931                                         if (allow_floor) command_wrk = USE_FLOOR;
6932                                         else if (allow_equip) command_wrk = USE_EQUIP;
6933                                         else
6934                                         {
6935                                                 bell();
6936                                                 break;
6937                                         }
6938                                 }
6939                                 else if (command_wrk == (USE_EQUIP))
6940                                 {
6941                                         if (allow_inven) command_wrk = USE_INVEN;
6942                                         else if (allow_floor) command_wrk = USE_FLOOR;
6943                                         else
6944                                         {
6945                                                 bell();
6946                                                 break;
6947                                         }
6948                                 }
6949                                 else if (command_wrk == (USE_FLOOR))
6950                                 {
6951                                         if (allow_equip) command_wrk = USE_EQUIP;
6952                                         else if (allow_inven) command_wrk = USE_INVEN;
6953                                         else
6954                                         {
6955                                                 bell();
6956                                                 break;
6957                                         }
6958                                 }
6959                                 else
6960                                 {
6961                                         bell();
6962                                         break;
6963                                 }
6964
6965                                 /* Hack -- Fix screen */
6966                                 if (command_see)
6967                                 {
6968                                         /* Load screen */
6969                                         screen_load();
6970
6971                                         /* Save screen */
6972                                         screen_save();
6973                                 }
6974
6975                                 /* Switch inven/equip */
6976                                 if (command_wrk == USE_INVEN) max_line = max_inven;
6977                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6978                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6979                                 if (menu_line > max_line) menu_line = max_line;
6980
6981                                 /* Need to redraw */
6982                                 break;
6983                         }
6984
6985                         case '6':
6986                         case 'l':
6987                         case 'L':
6988                         {
6989                                 /* Verify legality */
6990                                 if (command_wrk == (USE_INVEN))
6991                                 {
6992                                         if (allow_equip) command_wrk = USE_EQUIP;
6993                                         else if (allow_floor) command_wrk = USE_FLOOR;
6994                                         else
6995                                         {
6996                                                 bell();
6997                                                 break;
6998                                         }
6999                                 }
7000                                 else if (command_wrk == (USE_EQUIP))
7001                                 {
7002                                         if (allow_floor) command_wrk = USE_FLOOR;
7003                                         else if (allow_inven) command_wrk = USE_INVEN;
7004                                         else
7005                                         {
7006                                                 bell();
7007                                                 break;
7008                                         }
7009                                 }
7010                                 else if (command_wrk == (USE_FLOOR))
7011                                 {
7012                                         if (allow_inven) command_wrk = USE_INVEN;
7013                                         else if (allow_equip) command_wrk = USE_EQUIP;
7014                                         else
7015                                         {
7016                                                 bell();
7017                                                 break;
7018                                         }
7019                                 }
7020                                 else
7021                                 {
7022                                         bell();
7023                                         break;
7024                                 }
7025
7026                                 /* Hack -- Fix screen */
7027                                 if (command_see)
7028                                 {
7029                                         /* Load screen */
7030                                         screen_load();
7031
7032                                         /* Save screen */
7033                                         screen_save();
7034                                 }
7035
7036                                 /* Switch inven/equip */
7037                                 if (command_wrk == USE_INVEN) max_line = max_inven;
7038                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
7039                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
7040                                 if (menu_line > max_line) menu_line = max_line;
7041
7042                                 /* Need to redraw */
7043                                 break;
7044                         }
7045
7046                         case 'x':
7047                         case 'X':
7048                         case '\r':
7049                         case '\n':
7050                         {
7051                                 if (command_wrk == USE_FLOOR)
7052                                 {
7053                                         /* Special index */
7054                                         (*cp) = -get_item_label;
7055                                 }
7056                                 else
7057                                 {
7058                                         /* Validate the item */
7059                                         if (!get_item_okay(get_item_label))
7060                                         {
7061                                                 bell();
7062                                                 break;
7063                                         }
7064
7065                                         /* Allow player to "refuse" certain actions */
7066                                         if (!get_item_allow(get_item_label))
7067                                         {
7068                                                 done = TRUE;
7069                                                 break;
7070                                         }
7071
7072                                         /* Accept that choice */
7073                                         (*cp) = get_item_label;
7074                                 }
7075
7076                                 item = TRUE;
7077                                 done = TRUE;
7078                                 break;
7079                         }
7080                         case 'w':
7081                         {
7082                                 if (select_the_force) {
7083                                         *cp = INVEN_FORCE;
7084                                         item = TRUE;
7085                                         done = TRUE;
7086                                         break;
7087                                 }
7088                         }
7089                 }
7090                 if (menu_line > max_line) menu_line -= max_line;
7091                 }
7092                 else
7093                 {
7094                 /* Parse it */
7095                 switch (which)
7096                 {
7097                         case ESCAPE:
7098                         {
7099                                 done = TRUE;
7100                                 break;
7101                         }
7102
7103                         case '*':
7104                         case '?':
7105                         case ' ':
7106                         {
7107                                 /* Hide the list */
7108                                 if (command_see)
7109                                 {
7110                                         /* Flip flag */
7111                                         command_see = FALSE;
7112
7113                                         /* Load screen */
7114                                         screen_load();
7115                                 }
7116
7117                                 /* Show the list */
7118                                 else
7119                                 {
7120                                         /* Save screen */
7121                                         screen_save();
7122
7123                                         /* Flip flag */
7124                                         command_see = TRUE;
7125                                 }
7126                                 break;
7127                         }
7128
7129                         case '\n':
7130                         case '\r':
7131                         case '+':
7132                         {
7133                                 int i, o_idx;
7134                                 cave_type *c_ptr = &cave[py][px];
7135  
7136                                 if (command_wrk != (USE_FLOOR)) break;
7137
7138                                 /* Get the object being moved. */
7139                                 o_idx = c_ptr->o_idx;
7140  
7141                                 /* Only rotate a pile of two or more objects. */
7142                                 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
7143
7144                                 /* Remove the first object from the list. */
7145                                 excise_object_idx(o_idx);
7146         
7147                                 /* Find end of the list. */
7148                                 i = c_ptr->o_idx;
7149                                 while (o_list[i].next_o_idx)
7150                                         i = o_list[i].next_o_idx;
7151         
7152                                 /* Add after the last object. */
7153                                 o_list[i].next_o_idx = o_idx;
7154         
7155                                 /* Re-scan floor list */ 
7156                                 floor_num = scan_floor(floor_list, py, px, 0x01);
7157
7158                                 /* Hack -- Fix screen */
7159                                 if (command_see)
7160                                 {
7161                                         /* Load screen */
7162                                         screen_load();
7163
7164                                         /* Save screen */
7165                                         screen_save();
7166                                 }
7167
7168                                 break;
7169                         }
7170
7171                         case '/':
7172                         {
7173                                 if (command_wrk == (USE_INVEN))
7174                                 {
7175                                         if (!allow_equip)
7176                                         {
7177                                                 bell();
7178                                                 break;
7179                                         }
7180                                         command_wrk = (USE_EQUIP);
7181                                 }
7182                                 else if (command_wrk == (USE_EQUIP))
7183                                 {
7184                                         if (!allow_inven)
7185                                         {
7186                                                 bell();
7187                                                 break;
7188                                         }
7189                                         command_wrk = (USE_INVEN);
7190                                 }
7191                                 else if (command_wrk == (USE_FLOOR))
7192                                 {
7193                                         if (allow_inven)
7194                                         {
7195                                                 command_wrk = (USE_INVEN);
7196                                         }
7197                                         else if (allow_equip)
7198                                         {
7199                                                 command_wrk = (USE_EQUIP);
7200                                         }
7201                                         else
7202                                         {
7203                                                 bell();
7204                                                 break;
7205                                         }
7206                                 }
7207
7208                                 /* Hack -- Fix screen */
7209                                 if (command_see)
7210                                 {
7211                                         /* Load screen */
7212                                         screen_load();
7213
7214                                         /* Save screen */
7215                                         screen_save();
7216                                 }
7217
7218                                 /* Need to redraw */
7219                                 break;
7220                         }
7221
7222                         case '-':
7223                         {
7224                                 if (!allow_floor)
7225                                 {
7226                                         bell();
7227                                         break;
7228                                 }
7229
7230                                 /*
7231                                  * If we are already examining the floor, and there
7232                                  * is only one item, we will always select it.
7233                                  * If we aren't examining the floor and there is only
7234                                  * one item, we will select it if floor_query_flag
7235                                  * is FALSE.
7236                                  */
7237                                 if (floor_num == 1)
7238                                 {
7239                                         if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
7240                                         {
7241                                                 /* Special index */
7242                                                 k = 0 - floor_list[0];
7243
7244                                                 /* Allow player to "refuse" certain actions */
7245                                                 if (!get_item_allow(k))
7246                                                 {
7247                                                         done = TRUE;
7248                                                         break;
7249                                                 }
7250
7251                                                 /* Accept that choice */
7252                                                 (*cp) = k;
7253                                                 item = TRUE;
7254                                                 done = TRUE;
7255
7256                                                 break;
7257                                         }
7258                                 }
7259
7260                                 /* Hack -- Fix screen */
7261                                 if (command_see)
7262                                 {
7263                                         /* Load screen */
7264                                         screen_load();
7265
7266                                         /* Save screen */
7267                                         screen_save();
7268                                 }
7269
7270                                 command_wrk = (USE_FLOOR);
7271
7272                                 break;
7273                         }
7274
7275                         case '0':
7276                         case '1': case '2': case '3':
7277                         case '4': case '5': case '6':
7278                         case '7': case '8': case '9':
7279                         {
7280                                 /* Look up the tag */
7281                                 if (!get_tag(&k, which))
7282                                 {
7283                                         bell();
7284                                         break;
7285                                 }
7286
7287                                 /* Hack -- Validate the item */
7288                                 if ((k < INVEN_RARM) ? !inven : !equip)
7289                                 {
7290                                         bell();
7291                                         break;
7292                                 }
7293
7294                                 /* Validate the item */
7295                                 if (!get_item_okay(k))
7296                                 {
7297                                         bell();
7298                                         break;
7299                                 }
7300
7301                                 /* Allow player to "refuse" certain actions */
7302                                 if (!get_item_allow(k))
7303                                 {
7304                                         done = TRUE;
7305                                         break;
7306                                 }
7307
7308                                 /* Accept that choice */
7309                                 (*cp) = k;
7310                                 item = TRUE;
7311                                 done = TRUE;
7312                                 break;
7313                         }
7314
7315 #if 0
7316                         case '\n':
7317                         case '\r':
7318                         {
7319                                 /* Choose "default" inventory item */
7320                                 if (command_wrk == (USE_INVEN))
7321                                 {
7322                                         k = ((i1 == i2) ? i1 : -1);
7323                                 }
7324
7325                                 /* Choose "default" equipment item */
7326                                 else if (command_wrk == (USE_EQUIP))
7327                                 {
7328                                         k = ((e1 == e2) ? e1 : -1);
7329                                 }
7330
7331                                 /* Choose "default" floor item */
7332                                 else if (command_wrk == (USE_FLOOR))
7333                                 {
7334                                         if (floor_num == 1)
7335                                         {
7336                                                 /* Special index */
7337                                                 k = 0 - floor_list[0];
7338
7339                                                 /* Allow player to "refuse" certain actions */
7340                                                 if (!get_item_allow(k))
7341                                                 {
7342                                                         done = TRUE;
7343                                                         break;
7344                                                 }
7345
7346                                                 /* Accept that choice */
7347                                                 (*cp) = k;
7348                                                 item = TRUE;
7349                                                 done = TRUE;
7350                                         }
7351                                         break;
7352                                 }
7353
7354                                 /* Validate the item */
7355                                 if (!get_item_okay(k))
7356                                 {
7357                                         bell();
7358                                         break;
7359                                 }
7360
7361                                 /* Allow player to "refuse" certain actions */
7362                                 if (!get_item_allow(k))
7363                                 {
7364                                         done = TRUE;
7365                                         break;
7366                                 }
7367
7368                                 /* Accept that choice */
7369                                 (*cp) = k;
7370                                 item = TRUE;
7371                                 done = TRUE;
7372                                 break;
7373                         }
7374 #endif
7375
7376                         case 'w':
7377                         {
7378                                 if (select_the_force) {
7379                                         *cp = INVEN_FORCE;
7380                                         item = TRUE;
7381                                         done = TRUE;
7382                                         break;
7383                                 }
7384                         }
7385
7386                         default:
7387                         {
7388                                 int ver;
7389                                 bool not_found = FALSE;
7390
7391                                 /* Look up the alphabetical tag */
7392                                 if (!get_tag(&k, which))
7393                                 {
7394                                         not_found = TRUE;
7395                                 }
7396
7397                                 /* Hack -- Validate the item */
7398                                 if ((k < INVEN_RARM) ? !inven : !equip)
7399                                 {
7400                                         not_found = TRUE;
7401                                 }
7402
7403                                 /* Validate the item */
7404                                 if (!get_item_okay(k))
7405                                 {
7406                                         not_found = TRUE;
7407                                 }
7408
7409                                 if (!not_found)
7410                                 {
7411                                         /* Accept that choice */
7412                                         (*cp) = k;
7413                                         item = TRUE;
7414                                         done = TRUE;
7415                                         break;
7416                                 }
7417
7418                                 /* Extract "query" setting */
7419                                 ver = isupper(which);
7420                                 which = tolower(which);
7421
7422                                 /* Convert letter to inventory index */
7423                                 if (command_wrk == (USE_INVEN))
7424                                 {
7425                                         if (which == '(') k = i1;
7426                                         else if (which == ')') k = i2;
7427                                         else k = label_to_inven(which);
7428                                 }
7429
7430                                 /* Convert letter to equipment index */
7431                                 else if (command_wrk == (USE_EQUIP))
7432                                 {
7433                                         if (which == '(') k = e1;
7434                                         else if (which == ')') k = e2;
7435                                         else k = label_to_equip(which);
7436                                 }
7437
7438                                 /* Convert letter to floor index */
7439                                 else if (command_wrk == USE_FLOOR)
7440                                 {
7441                                         if (which == '(') k = 0;
7442                                         else if (which == ')') k = floor_num - 1;
7443                                         else k = islower(which) ? A2I(which) : -1;
7444                                         if (k < 0 || k >= floor_num || k >= 23)
7445                                         {
7446                                                 bell();
7447                                                 break;
7448                                         }
7449
7450                                         /* Special index */
7451                                         k = 0 - floor_list[k];
7452                                 }
7453
7454                                 /* Validate the item */
7455                                 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
7456                                 {
7457                                         bell();
7458                                         break;
7459                                 }
7460
7461                                 /* Verify the item */
7462 #ifdef JP
7463 if (ver && !verify("ËÜÅö¤Ë", k))
7464 #else
7465                                 if (ver && !verify("Try", k))
7466 #endif
7467
7468                                 {
7469                                         done = TRUE;
7470                                         break;
7471                                 }
7472
7473                                 /* Allow player to "refuse" certain actions */
7474                                 if (!get_item_allow(k))
7475                                 {
7476                                         done = TRUE;
7477                                         break;
7478                                 }
7479
7480                                 /* Accept that choice */
7481                                 (*cp) = k;
7482                                 item = TRUE;
7483                                 done = TRUE;
7484                                 break;
7485                         }
7486                 }
7487                 }
7488         }
7489
7490         /* Fix the screen if necessary */
7491         if (command_see)
7492         {
7493                 /* Load screen */
7494                 screen_load();
7495
7496                 /* Hack -- Cancel "display" */
7497                 command_see = FALSE;
7498         }
7499
7500
7501         /* Forget the item_tester_tval restriction */
7502         item_tester_tval = 0;
7503
7504         /* Forget the item_tester_hook restriction */
7505         item_tester_hook = NULL;
7506
7507
7508         /* Clean up */
7509         if (show_choices)
7510         {
7511                 /* Toggle again if needed */
7512                 if (toggle) toggle_inven_equip();
7513
7514                 /* Update */
7515                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
7516
7517                 /* Window stuff */
7518                 window_stuff();
7519         }
7520
7521
7522         /* Clear the prompt line */
7523         prt("", 0, 0);
7524
7525         /* Warning if needed */
7526         if (oops && str) msg_print(str);
7527
7528 #ifdef ALLOW_REPEAT
7529         if (item) repeat_push(*cp);
7530 #endif /* ALLOW_REPEAT */
7531
7532         /* Result */
7533         return (item);
7534 }
7535
7536
7537 static bool py_pickup_floor_aux(void)
7538 {
7539         s16b this_o_idx;
7540
7541         cptr q, s;
7542
7543         int item;
7544
7545         /* Restrict the choices */
7546         item_tester_hook = inven_carry_okay;
7547
7548         /* Get an object */
7549 #ifdef JP
7550         q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
7551         s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
7552 #else
7553         q = "Get which item? ";
7554         s = "You no longer have any room for the objects on the floor.";
7555 #endif
7556
7557         if (get_item(&item, q, s, (USE_FLOOR)))
7558         {
7559                 this_o_idx = 0 - item;
7560         }
7561         else
7562         {
7563                 return (FALSE);
7564         }
7565
7566         /* Pick up the object */
7567         py_pickup_aux(this_o_idx);
7568
7569         return (TRUE);
7570 }
7571
7572
7573 /*
7574  * Make the player carry everything in a grid
7575  *
7576  * If "pickup" is FALSE then only gold will be picked up
7577  *
7578  * This is called by py_pickup() when easy_floor is TRUE.
7579  */
7580 void py_pickup_floor(int pickup)
7581 {
7582         s16b this_o_idx, next_o_idx = 0;
7583
7584         char o_name[MAX_NLEN];
7585         object_type *o_ptr;
7586
7587         int floor_num = 0, floor_list[23], floor_o_idx = 0;
7588
7589         int can_pickup = 0;
7590
7591         /* Scan the pile of objects */
7592         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
7593         {
7594                 object_type *o_ptr;
7595
7596                 /* Access the object */
7597                 o_ptr = &o_list[this_o_idx];
7598
7599                 /* Describe the object */
7600                 object_desc(o_name, o_ptr, TRUE, 3);
7601
7602                 /* Access the next object */
7603                 next_o_idx = o_ptr->next_o_idx;
7604
7605                 /* Hack -- disturb */
7606                 disturb(0, 0);
7607
7608                 /* Pick up gold */
7609                 if (o_ptr->tval == TV_GOLD)
7610                 {
7611                         /* Message */
7612 #ifdef JP
7613                 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
7614                            (long)o_ptr->pval, o_name);
7615 #else
7616                         msg_format("You have found %ld gold pieces worth of %s.",
7617                                 (long) o_ptr->pval, o_name);
7618 #endif
7619
7620
7621                         /* Collect the gold */
7622                         p_ptr->au += o_ptr->pval;
7623
7624                         /* Redraw gold */
7625                         p_ptr->redraw |= (PR_GOLD);
7626
7627                         /* Window stuff */
7628                         p_ptr->window |= (PW_PLAYER);
7629
7630                         /* Delete the gold */
7631                         delete_object_idx(this_o_idx);
7632
7633                         /* Check the next object */
7634                         continue;
7635                 }
7636                 else if (o_ptr->marked & OM_NOMSG)
7637                 {
7638                         /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
7639                          * ignored. Otherwise, they are included in the prompt. */
7640                         o_ptr->marked &= ~(OM_NOMSG);
7641                         continue;
7642                 }
7643
7644                 /* Count non-gold objects that can be picked up. */
7645                 if (inven_carry_okay(o_ptr))
7646                 {
7647                         can_pickup++;
7648                 }
7649
7650                 /* Remember this object index */
7651                 if (floor_num < 23)
7652                         floor_list[floor_num] = this_o_idx;
7653
7654                 /* Count non-gold objects */
7655                 floor_num++;
7656
7657                 /* Remember this index */
7658                 floor_o_idx = this_o_idx;
7659         }
7660
7661         /* There are no non-gold objects */
7662         if (!floor_num)
7663                 return;
7664
7665         /* Mention the number of objects */
7666         if (!pickup)
7667         {
7668                 /* One object */
7669                 if (floor_num == 1)
7670                 {
7671                         /* Access the object */
7672                         o_ptr = &o_list[floor_o_idx];
7673
7674 #ifdef ALLOW_EASY_SENSE
7675
7676                         /* Option: Make object sensing easy */
7677                         if (easy_sense)
7678                         {
7679                                 /* Sense the object */
7680                                 (void) sense_object(o_ptr);
7681                         }
7682
7683 #endif /* ALLOW_EASY_SENSE */
7684
7685                         /* Describe the object */
7686                         object_desc(o_name, o_ptr, TRUE, 3);
7687
7688                         /* Message */
7689 #ifdef JP
7690                                 msg_format("%s¤¬¤¢¤ë¡£", o_name);
7691 #else
7692                         msg_format("You see %s.", o_name);
7693 #endif
7694
7695                 }
7696
7697                 /* Multiple objects */
7698                 else
7699                 {
7700                         /* Message */
7701 #ifdef JP
7702                         msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
7703 #else
7704                         msg_format("You see a pile of %d items.", floor_num);
7705 #endif
7706
7707                 }
7708
7709                 /* Done */
7710                 return;
7711         }
7712
7713         /* The player has no room for anything on the floor. */
7714         if (!can_pickup)
7715         {
7716                 /* One object */
7717                 if (floor_num == 1)
7718                 {
7719                         /* Access the object */
7720                         o_ptr = &o_list[floor_o_idx];
7721
7722 #ifdef ALLOW_EASY_SENSE
7723
7724                         /* Option: Make object sensing easy */
7725                         if (easy_sense)
7726                         {
7727                                 /* Sense the object */
7728                                 (void) sense_object(o_ptr);
7729                         }
7730
7731 #endif /* ALLOW_EASY_SENSE */
7732
7733                         /* Describe the object */
7734                         object_desc(o_name, o_ptr, TRUE, 3);
7735
7736                         /* Message */
7737 #ifdef JP
7738                                 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
7739 #else
7740                         msg_format("You have no room for %s.", o_name);
7741 #endif
7742
7743                 }
7744
7745                 /* Multiple objects */
7746                 else
7747                 {
7748                         /* Message */
7749 #ifdef JP
7750                         msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
7751 #else
7752                         msg_print("You have no room for any of the objects on the floor.");
7753 #endif
7754
7755                 }
7756
7757                 /* Done */
7758                 return;
7759         }
7760
7761         /* One object */
7762         if (floor_num == 1)
7763         {
7764                 /* Hack -- query every object */
7765                 if (carry_query_flag)
7766                 {
7767                         char out_val[MAX_NLEN+20];
7768
7769                         /* Access the object */
7770                         o_ptr = &o_list[floor_o_idx];
7771
7772 #ifdef ALLOW_EASY_SENSE
7773
7774                         /* Option: Make object sensing easy */
7775                         if (easy_sense)
7776                         {
7777                                 /* Sense the object */
7778                                 (void) sense_object(o_ptr);
7779                         }
7780
7781 #endif /* ALLOW_EASY_SENSE */
7782
7783                         /* Describe the object */
7784                         object_desc(o_name, o_ptr, TRUE, 3);
7785
7786                         /* Build a prompt */
7787 #ifdef JP
7788                         (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
7789 #else
7790                         (void) sprintf(out_val, "Pick up %s? ", o_name);
7791 #endif
7792
7793
7794                         /* Ask the user to confirm */
7795                         if (!get_check(out_val))
7796                         {
7797                                 /* Done */
7798                                 return;
7799                         }
7800                 }
7801
7802                 /* Access the object */
7803                 o_ptr = &o_list[floor_o_idx];
7804
7805 #ifdef ALLOW_EASY_SENSE
7806
7807                 /* Option: Make object sensing easy */
7808                 if (easy_sense)
7809                 {
7810                         /* Sense the object */
7811                         (void) sense_object(o_ptr);
7812                 }
7813
7814 #endif /* ALLOW_EASY_SENSE */
7815
7816                 /* Pick up the object */
7817                 py_pickup_aux(floor_o_idx);
7818         }
7819
7820         /* Allow the user to choose an object */
7821         else
7822         {
7823                 while (can_pickup--)
7824                 {
7825                         if (!py_pickup_floor_aux()) break;
7826                 }
7827         }
7828 }
7829
7830 #endif /* ALLOW_EASY_FLOOR */