OSDN Git Service

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