OSDN Git Service

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