OSDN Git Service

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