OSDN Git Service

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