OSDN Git Service

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