OSDN Git Service

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