OSDN Git Service

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