OSDN Git Service

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