OSDN Git Service

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