OSDN Git Service

魔法の難易度を下げるEASY_SPELLをフラグ化した。同時に大賢者のアミュレットにEASY_SPELLフラグを追加した。
[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 (have_flag(flgs, TR_EASY_SPELL))
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                                 if (inven_spellbook_label[i] == c)
4604                                         inven_spellbook_label[i] = ' ';
4605                                 inven_spellbook_label[index] = c;
4606                         }
4607                 }
4608         }
4609
4610         /* Display the inventory */
4611         for (k = 0, i = 0; i < z; i++)
4612         {
4613                 o_ptr = &inventory[i];
4614
4615                 /* Is this item acceptable? */
4616                 if (!item_tester_okay(o_ptr)) continue;
4617
4618                 /* Describe the object */
4619                 object_desc(o_name, o_ptr, TRUE, 3);
4620
4621                 /* Hack -- enforce max length */
4622                 o_name[lim] = '\0';
4623
4624                 /* Save the object index, color, and description */
4625                 out_index[k] = i;
4626                 out_color[k] = tval_to_attr[o_ptr->tval % 128];
4627
4628                 /* Grey out charging items */
4629                 if (o_ptr->timeout)
4630                 {
4631                         out_color[k] = TERM_L_DARK;
4632                 }
4633
4634                 (void)strcpy(out_desc[k], o_name);
4635
4636                 /* Find the predicted "line length" */
4637                 l = strlen(out_desc[k]) + 5;
4638
4639                 /* Be sure to account for the weight */
4640                 if (show_weights) l += 9;
4641
4642                 /* Account for icon if displayed */
4643                 if (show_item_graph)
4644                 {
4645                         l += 2;
4646                         if (use_bigtile) l++;
4647                 }
4648
4649                 /* Maintain the maximum length */
4650                 if (l > len) len = l;
4651
4652                 /* Advance to next "line" */
4653                 k++;
4654         }
4655
4656         /* Find the column to start in */
4657         col = (len > wid - 4) ? 0 : (wid - len - 1);
4658
4659         /* Output each entry */
4660         for (j = 0; j < k; j++)
4661         {
4662                 /* Get the index */
4663                 i = out_index[j];
4664
4665                 /* Get the item */
4666                 o_ptr = &inventory[i];
4667
4668                 /* Clear the line */
4669                 prt("", j + 1, col ? col - 2 : col);
4670
4671                 if (use_menu && target_item)
4672                 {
4673                         if (j == (target_item-1))
4674                         {
4675 #ifdef JP
4676                                 strcpy(tmp_val, "¡Õ");
4677 #else
4678                                 strcpy(tmp_val, "> ");
4679 #endif
4680                                 target_item_label = i;
4681                         }
4682                         else strcpy(tmp_val, "  ");
4683                 }
4684                 else if (i <= INVEN_PACK && select_spellbook)
4685                 {
4686                         sprintf(tmp_val, "%c)", inven_spellbook_label[i]);
4687                 }
4688                 else
4689                 {
4690                         /* Prepare an index --(-- */
4691                         sprintf(tmp_val, "%c)", index_to_label(i));
4692                 }
4693
4694                 /* Clear the line with the (possibly indented) index */
4695                 put_str(tmp_val, j + 1, col);
4696
4697                 cur_col = col + 3;
4698
4699                 /* Display graphics for object, if desired */
4700                 if (show_item_graph)
4701                 {
4702                         byte  a = object_attr(o_ptr);
4703                         char c = object_char(o_ptr);
4704
4705 #ifdef AMIGA
4706                         if (a & 0x80) a |= 0x40;
4707 #endif
4708
4709                         Term_draw(cur_col, j + 1, a, c);
4710                         if (use_bigtile)
4711                         {
4712                                 cur_col++;
4713                                 if (a & 0x80)
4714                                         Term_draw(cur_col, j + 1, 255, -1);
4715                         }
4716                         cur_col += 2;
4717                 }
4718
4719
4720                 /* Display the entry itself */
4721                 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
4722
4723                 /* Display the weight if needed */
4724                 if (show_weights)
4725                 {
4726                         int wgt = o_ptr->weight * o_ptr->number;
4727 #ifdef JP
4728                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4729 #else
4730                         (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
4731 #endif
4732
4733                         put_str(tmp_val, j + 1, wid - 9);
4734                 }
4735         }
4736
4737         /* Make a "shadow" below the list (only if needed) */
4738         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4739
4740         /* Save the new column */
4741         command_gap = col;
4742
4743         return target_item_label;
4744 }
4745
4746
4747
4748 /*
4749  * Display the equipment.
4750  */
4751 int show_equip(int target_item)
4752 {
4753         int             i, j, k, l;
4754         int             col, cur_col, len, lim;
4755         object_type     *o_ptr;
4756         char            tmp_val[80];
4757         char            o_name[MAX_NLEN];
4758         int             out_index[23];
4759         byte            out_color[23];
4760         char            out_desc[23][MAX_NLEN];
4761         int             target_item_label = 0;
4762         int             wid, hgt;
4763
4764
4765         /* Starting column */
4766         col = command_gap;
4767
4768         /* Get size */
4769         Term_get_size(&wid, &hgt);
4770
4771         /* Maximal length */
4772         len = wid - col - 1;
4773
4774         /* Maximum space allowed for descriptions */
4775         lim = wid - 4;
4776
4777         /* Require space for labels (if needed) */
4778 #ifdef JP
4779         if (show_labels) lim -= (7 + 2);
4780 #else
4781         if (show_labels) lim -= (14 + 2);
4782 #endif
4783
4784
4785         /* Require space for weight (if needed) */
4786 #ifdef JP
4787         if (show_weights) lim -= 10;
4788 #else
4789         if (show_weights) lim -= 9;
4790 #endif
4791
4792
4793         if (show_item_graph) lim -= 2;
4794
4795         /* Scan the equipment list */
4796         for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
4797         {
4798                 o_ptr = &inventory[i];
4799
4800                 /* Is this item acceptable? */
4801                 if (!item_tester_okay(o_ptr) && (!((i == INVEN_LARM) && p_ptr->ryoute) || item_tester_no_ryoute)) continue;
4802
4803                 /* Description */
4804                 object_desc(o_name, o_ptr, TRUE, 3);
4805
4806                 /* Truncate the description */
4807                 o_name[lim] = 0;
4808
4809                 if ((i == INVEN_LARM) && p_ptr->ryoute)
4810                 {
4811 #ifdef JP
4812                         (void)strcpy(out_desc[k],"(Éð´ï¤òξ¼ê»ý¤Á)");
4813 #else
4814                         (void)strcpy(out_desc[k],"(wielding with two-hands)");
4815 #endif
4816                         out_color[k] = 1;
4817                 }
4818                 else
4819                 {
4820                         (void)strcpy(out_desc[k], o_name);
4821                         out_color[k] = tval_to_attr[o_ptr->tval % 128];
4822                 }
4823
4824                 out_index[k] = i;
4825                 /* Grey out charging items */
4826                 if (o_ptr->timeout)
4827                 {
4828                         out_color[k] = TERM_L_DARK;
4829                 }
4830
4831                 /* Extract the maximal length (see below) */
4832 #ifdef JP
4833                 l = strlen(out_desc[k]) + (2 + 1);
4834 #else
4835                 l = strlen(out_desc[k]) + (2 + 3);
4836 #endif
4837
4838
4839                 /* Increase length for labels (if needed) */
4840 #ifdef JP
4841                 if (show_labels) l += (7 + 2);
4842 #else
4843                 if (show_labels) l += (14 + 2);
4844 #endif
4845
4846
4847                 /* Increase length for weight (if needed) */
4848                 if (show_weights) l += 9;
4849
4850                 if (show_item_graph) l += 2;
4851
4852                 /* Maintain the max-length */
4853                 if (l > len) len = l;
4854
4855                 /* Advance the entry */
4856                 k++;
4857         }
4858
4859         /* Hack -- Find a column to start in */
4860 #ifdef JP
4861         col = (len > wid - 6) ? 0 : (wid - len - 1);
4862 #else
4863         col = (len > wid - 4) ? 0 : (wid - len - 1);
4864 #endif
4865
4866
4867         /* Output each entry */
4868         for (j = 0; j < k; j++)
4869         {
4870                 /* Get the index */
4871                 i = out_index[j];
4872
4873                 /* Get the item */
4874                 o_ptr = &inventory[i];
4875
4876                 /* Clear the line */
4877                 prt("", j + 1, col ? col - 2 : col);
4878
4879                 if (use_menu && target_item)
4880                 {
4881                         if (j == (target_item-1))
4882                         {
4883 #ifdef JP
4884                                 strcpy(tmp_val, "¡Õ");
4885 #else
4886                                 strcpy(tmp_val, "> ");
4887 #endif
4888                                 target_item_label = i;
4889                         }
4890                         else strcpy(tmp_val, "  ");
4891                 }
4892                 else
4893                         /* Prepare an index --(-- */
4894                         sprintf(tmp_val, "%c)", index_to_label(i));
4895
4896                 /* Clear the line with the (possibly indented) index */
4897                 put_str(tmp_val, j+1, col);
4898
4899                 cur_col = col + 3;
4900
4901                 /* Display graphics for object, if desired */
4902                 if (show_item_graph)
4903                 {
4904                         byte a = object_attr(o_ptr);
4905                         char c = object_char(o_ptr);
4906
4907 #ifdef AMIGA
4908                         if (a & 0x80) a |= 0x40;
4909 #endif
4910
4911                         Term_draw(cur_col, j + 1, a, c);
4912                         if (use_bigtile)
4913                         {
4914                                 cur_col++;
4915                                 if (a & 0x80)
4916                                         Term_draw(cur_col, j + 1, 255, -1);
4917                         }
4918                         cur_col += 2;
4919                 }
4920
4921                 /* Use labels */
4922                 if (show_labels)
4923                 {
4924                         /* Mention the use */
4925 #ifdef JP
4926                         (void)sprintf(tmp_val, "%-7s: ", mention_use(i));
4927 #else
4928                         (void)sprintf(tmp_val, "%-14s: ", mention_use(i));
4929 #endif
4930
4931                         put_str(tmp_val, j+1, cur_col);
4932
4933                         /* Display the entry itself */
4934 #ifdef JP
4935                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 9);
4936 #else
4937                         c_put_str(out_color[j], out_desc[j], j+1, cur_col + 16);
4938 #endif
4939                 }
4940
4941                 /* No labels */
4942                 else
4943                 {
4944                         /* Display the entry itself */
4945                         c_put_str(out_color[j], out_desc[j], j+1, cur_col);
4946                 }
4947
4948                 /* Display the weight if needed */
4949                 if (show_weights)
4950                 {
4951                         int wgt = o_ptr->weight * o_ptr->number;
4952 #ifdef JP
4953                         (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
4954 #else
4955                         (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
4956 #endif
4957
4958                         put_str(tmp_val, j+1, wid - 9);
4959                 }
4960         }
4961
4962         /* Make a "shadow" below the list (only if needed) */
4963         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
4964
4965         /* Save the new column */
4966         command_gap = col;
4967
4968         return target_item_label;
4969 }
4970
4971
4972
4973
4974 /*
4975  * Flip "inven" and "equip" in any sub-windows
4976  */
4977 void toggle_inven_equip(void)
4978 {
4979         int j;
4980
4981         /* Scan windows */
4982         for (j = 0; j < 8; j++)
4983         {
4984                 /* Unused */
4985                 if (!angband_term[j]) continue;
4986
4987                 /* Flip inven to equip */
4988                 if (window_flag[j] & (PW_INVEN))
4989                 {
4990                         /* Flip flags */
4991                         window_flag[j] &= ~(PW_INVEN);
4992                         window_flag[j] |= (PW_EQUIP);
4993
4994                         /* Window stuff */
4995                         p_ptr->window |= (PW_EQUIP);
4996                 }
4997
4998                 /* Flip inven to equip */
4999                 else if (window_flag[j] & (PW_EQUIP))
5000                 {
5001                         /* Flip flags */
5002                         window_flag[j] &= ~(PW_EQUIP);
5003                         window_flag[j] |= (PW_INVEN);
5004
5005                         /* Window stuff */
5006                         p_ptr->window |= (PW_INVEN);
5007                 }
5008         }
5009 }
5010
5011
5012
5013 /*
5014  * Verify the choice of an item.
5015  *
5016  * The item can be negative to mean "item on floor".
5017  */
5018 static bool verify(cptr prompt, int item)
5019 {
5020         char        o_name[MAX_NLEN];
5021         char        out_val[MAX_NLEN+20];
5022         object_type *o_ptr;
5023
5024
5025         /* Inventory */
5026         if (item >= 0)
5027         {
5028                 o_ptr = &inventory[item];
5029         }
5030
5031         /* Floor */
5032         else
5033         {
5034                 o_ptr = &o_list[0 - item];
5035         }
5036
5037         /* Describe */
5038         object_desc(o_name, o_ptr, TRUE, 3);
5039
5040         /* Prompt */
5041 #ifdef JP
5042 (void)sprintf(out_val, "%s%s¤Ç¤¹¤«? ", prompt, o_name);
5043 #else
5044         (void)sprintf(out_val, "%s %s? ", prompt, o_name);
5045 #endif
5046
5047
5048         /* Query */
5049         return (get_check(out_val));
5050 }
5051
5052
5053 /*
5054  * Hack -- allow user to "prevent" certain choices
5055  *
5056  * The item can be negative to mean "item on floor".
5057  */
5058 static bool get_item_allow(int item)
5059 {
5060         cptr s;
5061
5062         object_type *o_ptr;
5063
5064         /* Inventory */
5065         if (item >= 0)
5066         {
5067                 o_ptr = &inventory[item];
5068         }
5069
5070         /* Floor */
5071         else
5072         {
5073                 o_ptr = &o_list[0 - item];
5074         }
5075
5076         /* No inscription */
5077         if (!o_ptr->inscription) return (TRUE);
5078
5079         /* Find a '!' */
5080         s = strchr(quark_str(o_ptr->inscription), '!');
5081
5082         /* Process preventions */
5083         while (s)
5084         {
5085                 /* Check the "restriction" */
5086                 if ((s[1] == command_cmd) || (s[1] == '*'))
5087                 {
5088                         /* Verify the choice */
5089 #ifdef JP
5090 if (!verify("ËÜÅö¤Ë", item)) return (FALSE);
5091 #else
5092                         if (!verify("Really try", item)) return (FALSE);
5093 #endif
5094
5095                 }
5096
5097                 /* Find another '!' */
5098                 s = strchr(s + 1, '!');
5099         }
5100
5101         /* Allow it */
5102         return (TRUE);
5103 }
5104
5105
5106
5107 /*
5108  * Auxiliary function for "get_item()" -- test an index
5109  */
5110 static bool get_item_okay(int i)
5111 {
5112         /* Illegal items */
5113         if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
5114
5115         /* Verify the item */
5116         if (!item_tester_okay(&inventory[i])) return (FALSE);
5117
5118         /* Assume okay */
5119         return (TRUE);
5120 }
5121
5122
5123
5124 /*
5125  * Find the "first" inventory object with the given "tag".
5126  *
5127  * A "tag" is a char "n" appearing as "@n" anywhere in the
5128  * inscription of an object.
5129  *
5130  * Also, the tag "@xn" will work as well, where "n" is a tag-char,
5131  * and "x" is the "current" command_cmd code.
5132  */
5133 int get_tag(int *cp, char tag)
5134 {
5135         int i;
5136         cptr s;
5137
5138         /* Check every object */
5139         for (i = 0; i < INVEN_TOTAL; ++i)
5140         {
5141                 object_type *o_ptr = &inventory[i];
5142
5143                 /* Skip non-objects */
5144                 if (!o_ptr->k_idx) continue;
5145
5146                 /* Skip empty inscriptions */
5147                 if (!o_ptr->inscription) continue;
5148
5149                 /* Skip non-choice */
5150                 if (!item_tester_okay(o_ptr)) continue;
5151
5152                 /* Find a '@' */
5153                 s = strchr(quark_str(o_ptr->inscription), '@');
5154
5155                 /* Process all tags */
5156                 while (s)
5157                 {
5158                         /* Check the special tags */
5159                         if ((s[1] == command_cmd) && (s[2] == tag))
5160                         {
5161                                 /* Save the actual inventory ID */
5162                                 *cp = i;
5163
5164                                 /* Success */
5165                                 return (TRUE);
5166                         }
5167
5168                         /* Find another '@' */
5169                         s = strchr(s + 1, '@');
5170                 }
5171         }
5172
5173         /* Check every object */
5174         for (i = 0; i < INVEN_TOTAL; ++i)
5175         {
5176                 object_type *o_ptr = &inventory[i];
5177
5178                 /* Skip non-objects */
5179                 if (!o_ptr->k_idx) continue;
5180
5181                 /* Skip empty inscriptions */
5182                 if (!o_ptr->inscription) continue;
5183
5184                 /* Skip non-choice */
5185                 if (!item_tester_okay(o_ptr)) continue;
5186
5187                 /* Find a '@' */
5188                 s = strchr(quark_str(o_ptr->inscription), '@');
5189
5190                 /* Process all tags */
5191                 while (s)
5192                 {
5193                         /* Check the normal tags */
5194                         if (s[1] == tag && !((s[2] >= '0' && s[2] <= '9') || (s[2] >= 'a' && s[2] <= 'z') || (s[2] >= 'A' && s[2] <= 'Z')))
5195                 {
5196                                 /* Save the actual inventory ID */
5197                                 *cp = i;
5198
5199                                 /* Success */
5200                                 return (TRUE);
5201                         }
5202
5203                         /* Find another '@' */
5204                         s = strchr(s + 1, '@');
5205                 }
5206         }
5207
5208         /* No such tag */
5209         return (FALSE);
5210 }
5211
5212 /*
5213  * Determine whether get_item() can get some item or not
5214  * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
5215  */
5216 bool can_get_item(void)
5217 {
5218         int j, floor_list[23], floor_num = 0;
5219
5220         for (j = 0; j < INVEN_TOTAL; j++)
5221                 if (item_tester_okay(&inventory[j]))
5222                         return TRUE;
5223
5224         floor_num = scan_floor(floor_list, py, px, 0x01);
5225         if (floor_num)
5226                 return TRUE;
5227
5228         return FALSE;
5229 }
5230
5231 /*
5232  * Let the user select an item, save its "index"
5233  *
5234  * Return TRUE only if an acceptable item was chosen by the user.
5235  *
5236  * The selected item must satisfy the "item_tester_hook()" function,
5237  * if that hook is set, and the "item_tester_tval", if that value is set.
5238  *
5239  * All "item_tester" restrictions are cleared before this function returns.
5240  *
5241  * The user is allowed to choose acceptable items from the equipment,
5242  * inventory, or floor, respectively, if the proper flag was given,
5243  * and there are any acceptable items in that location.
5244  *
5245  * The equipment or inventory are displayed (even if no acceptable
5246  * items are in that location) if the proper flag was given.
5247  *
5248  * If there are no acceptable items available anywhere, and "str" is
5249  * not NULL, then it will be used as the text of a warning message
5250  * before the function returns.
5251  *
5252  * Note that the user must press "-" to specify the item on the floor,
5253  * and there is no way to "examine" the item on the floor, while the
5254  * use of "capital" letters will "examine" an inventory/equipment item,
5255  * and prompt for its use.
5256  *
5257  * If a legal item is selected from the inventory, we save it in "cp"
5258  * directly (0 to 35), and return TRUE.
5259  *
5260  * If a legal item is selected from the floor, we save it in "cp" as
5261  * a negative (-1 to -511), and return TRUE.
5262  *
5263  * If no item is available, we do nothing to "cp", and we display a
5264  * warning message, using "str" if available, and return FALSE.
5265  *
5266  * If no item is selected, we do nothing to "cp", and return FALSE.
5267  *
5268  * Global "p_ptr->command_new" is used when viewing the inventory or equipment
5269  * to allow the user to enter a command while viewing those screens, and
5270  * also to induce "auto-enter" of stores, and other such stuff.
5271  *
5272  * Global "p_ptr->command_see" may be set before calling this function to start
5273  * out in "browse" mode.  It is cleared before this function returns.
5274  *
5275  * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
5276  * If it is TRUE then we are viewing inventory, else equipment.
5277  *
5278  * We always erase the prompt when we are done, leaving a blank line,
5279  * or a warning message, if appropriate, if no items are available.
5280  */
5281 bool get_item(int *cp, cptr pmt, cptr str, int mode)
5282 {
5283         s16b this_o_idx, next_o_idx = 0;
5284
5285         char n1, n2, which = ' ';
5286
5287         int j, k, i1, i2, e1, e2;
5288
5289         bool done, item;
5290
5291         bool oops = FALSE;
5292
5293         bool equip = FALSE;
5294         bool inven = FALSE;
5295         bool floor = FALSE;
5296
5297         bool allow_floor = FALSE;
5298
5299         bool toggle = FALSE;
5300
5301         char tmp_val[160];
5302         char out_val[160];
5303
5304         /* See cmd5.c */
5305         extern bool select_spellbook;
5306         extern bool select_the_force;
5307
5308         int menu_line = (use_menu ? 1 : 0);
5309         int max_inven = 0;
5310         int max_equip = 0;
5311
5312 #ifdef ALLOW_EASY_FLOOR /* TNB */
5313
5314         if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
5315
5316 #endif /* ALLOW_EASY_FLOOR -- TNB */
5317
5318 #ifdef ALLOW_REPEAT
5319
5320         /* Get the item index */
5321         if (repeat_pull(cp))
5322         {
5323                 if (*cp == 1111) { /* the_force */
5324                     item_tester_tval = 0;
5325                     item_tester_hook = NULL;
5326                     return (TRUE);
5327                 } else
5328                 /* Floor item? */
5329                 if (*cp < 0)
5330                 {
5331                         object_type *o_ptr;
5332
5333                         /* Special index */
5334                         k = 0 - (*cp);
5335
5336                         /* Acquire object */
5337                         o_ptr = &o_list[k];
5338
5339                         /* Validate the item */
5340                         if (item_tester_okay(o_ptr))
5341                         {
5342                                 /* Forget the item_tester_tval restriction */
5343                                 item_tester_tval = 0;
5344
5345                                 /* Forget the item_tester_hook restriction */
5346                                 item_tester_hook = NULL;
5347
5348                                 /* Success */
5349                                 return (TRUE);
5350                         }
5351                 }
5352
5353                 /* Verify the item */
5354                 else if (get_item_okay(*cp))
5355                 {
5356                         /* Forget the item_tester_tval restriction */
5357                         item_tester_tval = 0;
5358
5359                         /* Forget the item_tester_hook restriction */
5360                         item_tester_hook = NULL;
5361
5362                         /* Success */
5363                         return (TRUE);
5364                 }
5365         }
5366
5367 #endif /* ALLOW_REPEAT */
5368
5369         /* Extract args */
5370         if (mode & (USE_EQUIP)) equip = TRUE;
5371         if (mode & (USE_INVEN)) inven = TRUE;
5372         if (mode & (USE_FLOOR)) floor = TRUE;
5373
5374
5375         /* Paranoia XXX XXX XXX */
5376         msg_print(NULL);
5377
5378
5379         /* Not done */
5380         done = FALSE;
5381
5382         /* No item selected */
5383         item = FALSE;
5384
5385
5386         /* Full inventory */
5387         i1 = 0;
5388         i2 = INVEN_PACK - 1;
5389
5390         /* Forbid inventory */
5391         if (!inven) i2 = -1;
5392         else if (use_menu)
5393         {
5394                 for (j = 0; j < INVEN_PACK; j++)
5395                         if (item_tester_okay(&inventory[j])) max_inven++;
5396         }
5397
5398         /* Restrict inventory indexes */
5399         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
5400         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
5401
5402
5403         /* Full equipment */
5404         e1 = INVEN_RARM;
5405         e2 = INVEN_TOTAL - 1;
5406
5407         /* Forbid equipment */
5408         if (!equip) e2 = -1;
5409         else if (use_menu)
5410         {
5411                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
5412                         if (item_tester_okay(&inventory[j])) max_equip++;
5413                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
5414         }
5415
5416         /* Restrict equipment indexes */
5417         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
5418         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
5419
5420
5421
5422         /* Restrict floor usage */
5423         if (floor)
5424         {
5425                 /* Scan all objects in the grid */
5426                 for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5427                 {
5428                         object_type *o_ptr;
5429
5430                         /* Acquire object */
5431                         o_ptr = &o_list[this_o_idx];
5432
5433                         /* Acquire next object */
5434                         next_o_idx = o_ptr->next_o_idx;
5435
5436                         /* Accept the item on the floor if legal */
5437                         if (item_tester_okay(o_ptr)) allow_floor = TRUE;
5438                 }
5439         }
5440
5441         /* Require at least one legal choice */
5442         if (!allow_floor && (i1 > i2) && (e1 > e2))
5443         {
5444                 /* Cancel p_ptr->command_see */
5445                 command_see = FALSE;
5446
5447                 /* Oops */
5448                 oops = TRUE;
5449
5450                 /* Done */
5451                 done = TRUE;
5452
5453                 if (select_the_force) {
5454                     *cp = 1111;
5455                     item = TRUE;
5456                 }
5457         }
5458
5459         /* Analyze choices */
5460         else
5461         {
5462                 /* Hack -- Start on equipment if requested */
5463                 if (command_see && command_wrk && equip)
5464
5465                 {
5466                         command_wrk = TRUE;
5467                 }
5468
5469                 /* Use inventory if allowed */
5470                 else if (inven)
5471                 {
5472                         command_wrk = FALSE;
5473                 }
5474
5475                 /* Use equipment if allowed */
5476                 else if (equip)
5477                 {
5478                         command_wrk = TRUE;
5479                 }
5480
5481                 /* Use inventory for floor */
5482                 else
5483                 {
5484                         command_wrk = FALSE;
5485                 }
5486         }
5487
5488
5489         /*
5490          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
5491          */
5492         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
5493
5494         /* Hack -- start out in "display" mode */
5495         if (command_see)
5496         {
5497                 /* Save screen */
5498                 screen_save();
5499         }
5500
5501
5502         /* Repeat until done */
5503         while (!done)
5504         {
5505                 int get_item_label = 0;
5506
5507                 /* Show choices */
5508                 if (show_choices)
5509                 {
5510                         int ni = 0;
5511                         int ne = 0;
5512
5513                         /* Scan windows */
5514                         for (j = 0; j < 8; j++)
5515                         {
5516                                 /* Unused */
5517                                 if (!angband_term[j]) continue;
5518
5519                                 /* Count windows displaying inven */
5520                                 if (window_flag[j] & (PW_INVEN)) ni++;
5521
5522                                 /* Count windows displaying equip */
5523                                 if (window_flag[j] & (PW_EQUIP)) ne++;
5524                         }
5525
5526                         /* Toggle if needed */
5527                         if ((command_wrk && ni && !ne) ||
5528                             (!command_wrk && !ni && ne))
5529                         {
5530                                 /* Toggle */
5531                                 toggle_inven_equip();
5532
5533                                 /* Track toggles */
5534                                 toggle = !toggle;
5535                         }
5536
5537                         /* Update */
5538                         p_ptr->window |= (PW_INVEN | PW_EQUIP);
5539
5540                         /* Redraw windows */
5541                         window_stuff();
5542                 }
5543
5544                 /* Inventory screen */
5545                 if (!command_wrk)
5546                 {
5547                         /* Extract the legal requests */
5548                         n1 = I2A(i1);
5549                         n2 = I2A(i2);
5550
5551                         /* Redraw if needed */
5552                         if (command_see) get_item_label = show_inven(menu_line);
5553                 }
5554
5555                 /* Equipment screen */
5556                 else
5557                 {
5558                         /* Extract the legal requests */
5559                         n1 = I2A(e1 - INVEN_RARM);
5560                         n2 = I2A(e2 - INVEN_RARM);
5561
5562                         /* Redraw if needed */
5563                         if (command_see) get_item_label = show_equip(menu_line);
5564                 }
5565
5566                 /* Viewing inventory */
5567                 if (!command_wrk)
5568                 {
5569                         /* Begin the prompt */
5570 #ifdef JP
5571 sprintf(out_val, "»ý¤Áʪ:");
5572 #else
5573                         sprintf(out_val, "Inven:");
5574 #endif
5575
5576
5577                         /* Some legal items */
5578                         if ((i1 <= i2) && !use_menu)
5579                         {
5580                                 /* Build the prompt */
5581 #ifdef JP
5582 sprintf(tmp_val, "%c-%c,'(',')',",
5583 #else
5584                                 sprintf(tmp_val, " %c-%c,'(',')',",
5585 #endif
5586
5587                                         index_to_label(i1), index_to_label(i2));
5588
5589                                 /* Append */
5590                                 strcat(out_val, tmp_val);
5591                         }
5592
5593                         /* Indicate ability to "view" */
5594 #ifdef JP
5595 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5596 #else
5597                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
5598 #endif
5599
5600
5601                         /* Append */
5602 #ifdef JP
5603 if (equip) strcat(out_val, format(" %s ÁõÈ÷ÉÊ,", use_menu ? "'4'or'6'" : "'/'"));
5604 else if (select_the_force)
5605         strcat(out_val, " 'w'Îýµ¤½Ñ,");
5606 #else
5607 if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
5608 else if (select_the_force)
5609         strcat(out_val, " w for the Force,");
5610 #endif
5611
5612                 }
5613
5614                 /* Viewing equipment */
5615                 else
5616                 {
5617                         /* Begin the prompt */
5618 #ifdef JP
5619 sprintf(out_val, "ÁõÈ÷ÉÊ:");
5620 #else
5621                         sprintf(out_val, "Equip:");
5622 #endif
5623
5624
5625                         /* Some legal items */
5626                         if ((e1 <= e2) && !use_menu)
5627                         {
5628                                 /* Build the prompt */
5629 #ifdef JP
5630 sprintf(tmp_val, "%c-%c,'(',')',",
5631 #else
5632                                 sprintf(tmp_val, " %c-%c,'(',')',",
5633 #endif
5634
5635                                         index_to_label(e1), index_to_label(e2));
5636
5637                                 /* Append */
5638                                 strcat(out_val, tmp_val);
5639                         }
5640
5641                         /* Indicate ability to "view" */
5642 #ifdef JP
5643 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
5644 #else
5645                         if (!command_see) strcat(out_val, " * to see,");
5646 #endif
5647
5648
5649                         /* Append */
5650 #ifdef JP
5651 if (inven) strcat(out_val, format(" %s »ý¤Áʪ,", use_menu ? "'4'or'6'" : "'/'"));
5652 #else
5653 if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
5654 #endif
5655
5656                 }
5657
5658                 /* Indicate legality of the "floor" item */
5659 #ifdef JP
5660 if (allow_floor) strcat(out_val, " '-'¾²¾å,");
5661 #else
5662                 if (allow_floor) strcat(out_val, " - for floor,");
5663 #endif
5664
5665
5666                 /* Finish the prompt */
5667                 strcat(out_val, " ESC");
5668
5669                 /* Build the prompt */
5670                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
5671
5672                 /* Show the prompt */
5673                 prt(tmp_val, 0, 0);
5674
5675
5676                 /* Get a key */
5677                 which = inkey();
5678
5679                 if (use_menu)
5680                 {
5681                 int max_line = (command_wrk ? max_equip : max_inven);
5682                 switch (which)
5683                 {
5684                         case ESCAPE:
5685                         case 'z':
5686                         case 'Z':
5687                         case '0':
5688                         {
5689                                 done = TRUE;
5690                                 break;
5691                         }
5692
5693                         case '8':
5694                         case 'k':
5695                         case 'K':
5696                         {
5697                                 menu_line += (max_line - 1);
5698                                 break;
5699                         }
5700
5701                         case '2':
5702                         case 'j':
5703                         case 'J':
5704                         {
5705                                 menu_line++;
5706                                 break;
5707                         }
5708
5709                         case '4':
5710                         case '6':
5711                         case 'h':
5712                         case 'H':
5713                         case 'l':
5714                         case 'L':
5715                         {
5716                                 /* Verify legality */
5717                                 if (!inven || !equip)
5718                                 {
5719                                         bell();
5720                                         break;
5721                                 }
5722
5723                                 /* Hack -- Fix screen */
5724                                 if (command_see)
5725                                 {
5726                                         /* Load screen */
5727                                         screen_load();
5728
5729                                         /* Save screen */
5730                                         screen_save();
5731                                 }
5732
5733                                 /* Switch inven/equip */
5734                                 command_wrk = !command_wrk;
5735                                 max_line = (command_wrk ? max_equip : max_inven);
5736                                 if (menu_line > max_line) menu_line = max_line;
5737
5738                                 /* Need to redraw */
5739                                 break;
5740                         }
5741
5742                         case 'x':
5743                         case 'X':
5744                         case '\r':
5745                         case '\n':
5746                         {
5747                                 if (command_wrk == USE_FLOOR)
5748                                 {
5749                                         /* Special index */
5750                                         (*cp) = -get_item_label;
5751                                 }
5752                                 else
5753                                 {
5754                                         /* Validate the item */
5755                                         if (!get_item_okay(get_item_label))
5756                                         {
5757                                                 bell();
5758                                                 break;
5759                                         }
5760
5761                                         /* Allow player to "refuse" certain actions */
5762                                         if (!get_item_allow(get_item_label))
5763                                         {
5764                                                 done = TRUE;
5765                                                 break;
5766                                         }
5767
5768                                         /* Accept that choice */
5769                                         (*cp) = get_item_label;
5770                                 }
5771
5772                                 item = TRUE;
5773                                 done = TRUE;
5774                                 break;
5775                         }
5776                         case 'w':
5777                         {
5778                                 if (select_the_force) {
5779                                         *cp = 1111;
5780                                         item = TRUE;
5781                                         done = TRUE;
5782                                         break;
5783                                 }
5784                         }
5785                 }
5786                 if (menu_line > max_line) menu_line -= max_line;
5787                 }
5788                 else
5789                 {
5790                 /* Parse it */
5791                 switch (which)
5792                 {
5793                         case ESCAPE:
5794                         {
5795                                 done = TRUE;
5796                                 break;
5797                         }
5798
5799                         case '*':
5800                         case '?':
5801                         case ' ':
5802                         {
5803                                 /* Hide the list */
5804                                 if (command_see)
5805                                 {
5806                                         /* Flip flag */
5807                                         command_see = FALSE;
5808
5809                                         /* Load screen */
5810                                         screen_load();
5811                                 }
5812
5813                                 /* Show the list */
5814                                 else
5815                                 {
5816                                         /* Save screen */
5817                                         screen_save();
5818
5819                                         /* Flip flag */
5820                                         command_see = TRUE;
5821                                 }
5822                                 break;
5823                         }
5824
5825                         case '/':
5826                         {
5827                                 /* Verify legality */
5828                                 if (!inven || !equip)
5829                                 {
5830                                         bell();
5831                                         break;
5832                                 }
5833
5834                                 /* Hack -- Fix screen */
5835                                 if (command_see)
5836                                 {
5837                                         /* Load screen */
5838                                         screen_load();
5839
5840                                         /* Save screen */
5841                                         screen_save();
5842                                 }
5843
5844                                 /* Switch inven/equip */
5845                                 command_wrk = !command_wrk;
5846
5847                                 /* Need to redraw */
5848                                 break;
5849                         }
5850
5851                         case '-':
5852                         {
5853                                 /* Use floor item */
5854                                 if (allow_floor)
5855                                 {
5856                                         /* Scan all objects in the grid */
5857                                         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
5858                                         {
5859                                                 object_type *o_ptr;
5860
5861                                                 /* Acquire object */
5862                                                 o_ptr = &o_list[this_o_idx];
5863
5864                                                 /* Acquire next object */
5865                                                 next_o_idx = o_ptr->next_o_idx;
5866
5867                                                 /* Validate the item */
5868                                                 if (!item_tester_okay(o_ptr)) continue;
5869
5870                                                 /* Special index */
5871                                                 k = 0 - this_o_idx;
5872
5873                                                 /* Verify the item (if required) */
5874 #ifdef JP
5875 if (other_query_flag && !verify("ËÜÅö¤Ë", k)) continue;
5876 #else
5877                                                 if (other_query_flag && !verify("Try", k)) continue;
5878 #endif
5879
5880
5881                                                 /* Allow player to "refuse" certain actions */
5882                                                 if (!get_item_allow(k)) continue;
5883
5884                                                 /* Accept that choice */
5885                                                 (*cp) = k;
5886                                                 item = TRUE;
5887                                                 done = TRUE;
5888                                                 break;
5889                                         }
5890
5891                                         /* Outer break */
5892                                         if (done) break;
5893                                 }
5894
5895                                 /* Oops */
5896                                 bell();
5897                                 break;
5898                         }
5899
5900                         case '0':
5901                         case '1': case '2': case '3':
5902                         case '4': case '5': case '6':
5903                         case '7': case '8': case '9':
5904                         {
5905                                 /* Look up the tag */
5906                                 if (!get_tag(&k, which))
5907                                 {
5908                                         bell();
5909                                         break;
5910                                 }
5911
5912                                 /* Hack -- Validate the item */
5913                                 if ((k < INVEN_RARM) ? !inven : !equip)
5914                                 {
5915                                         bell();
5916                                         break;
5917                                 }
5918
5919                                 /* Validate the item */
5920                                 if (!get_item_okay(k))
5921                                 {
5922                                         bell();
5923                                         break;
5924                                 }
5925
5926                                 /* Allow player to "refuse" certain actions */
5927                                 if (!get_item_allow(k))
5928                                 {
5929                                         done = TRUE;
5930                                         break;
5931                                 }
5932
5933                                 /* Accept that choice */
5934                                 (*cp) = k;
5935                                 item = TRUE;
5936                                 done = TRUE;
5937                                 break;
5938                         }
5939
5940 #if 0
5941                         case '\n':
5942                         case '\r':
5943 #endif
5944                         {
5945                                 /* Choose "default" inventory item */
5946                                 if (!command_wrk)
5947                                 {
5948                                         k = ((i1 == i2) ? i1 : -1);
5949                                 }
5950
5951                                 /* Choose "default" equipment item */
5952                                 else
5953                                 {
5954                                         k = ((e1 == e2) ? e1 : -1);
5955                                 }
5956
5957                                 /* Validate the item */
5958                                 if (!get_item_okay(k))
5959                                 {
5960                                         bell();
5961                                         break;
5962                                 }
5963
5964                                 /* Allow player to "refuse" certain actions */
5965                                 if (!get_item_allow(k))
5966                                 {
5967                                         done = TRUE;
5968                                         break;
5969                                 }
5970
5971                                 /* Accept that choice */
5972                                 (*cp) = k;
5973                                 item = TRUE;
5974                                 done = TRUE;
5975                                 break;
5976                         }
5977
5978                         case 'w':
5979                         {
5980                                 if (select_the_force) {
5981                                         *cp = 1111;
5982                                         item = TRUE;
5983                                         done = TRUE;
5984                                         break;
5985                                 }
5986                         }
5987
5988                         default:
5989                         {
5990                                 int ver;
5991                                 if(select_spellbook){
5992                                     bool not_found = FALSE;
5993                                     /* Look up the tag */
5994                                     if (!get_tag(&k, which))
5995                                     {
5996                                         not_found = TRUE;
5997                                     }
5998
5999                                     /* Hack -- Validate the item */
6000                                     if ((k < INVEN_RARM) ? !inven : !equip)
6001                                     {
6002                                         not_found = TRUE;
6003                                     }
6004
6005                                     /* Validate the item */
6006                                     if (!get_item_okay(k))
6007                                     {
6008                                         not_found = TRUE;
6009                                     }
6010
6011                                     if( !not_found ){
6012                                         /* Accept that choice */
6013                                         (*cp) = k;
6014                                         item = TRUE;
6015                                         done = TRUE;
6016                                         break;
6017                                     }
6018                                 }                               
6019
6020                                 /* Extract "query" setting */
6021                                 ver = isupper(which);
6022                                 which = tolower(which);
6023
6024                                 /* Convert letter to inventory index */
6025                                 if (!command_wrk)
6026                                 {
6027                                         if (which == '(') k = i1;
6028                                         else if (which == ')') k = i2;
6029                                         else k = label_to_inven(which);
6030                                 }
6031
6032                                 /* Convert letter to equipment index */
6033                                 else
6034                                 {
6035                                         if (which == '(') k = e1;
6036                                         else if (which == ')') k = e2;
6037                                         else k = label_to_equip(which);
6038                                 }
6039
6040                                 /* Validate the item */
6041                                 if (!get_item_okay(k))
6042                                 {
6043                                         bell();
6044                                         break;
6045                                 }
6046
6047                                 /* Verify the item */
6048 #ifdef JP
6049 if (ver && !verify("ËÜÅö¤Ë", k))
6050 #else
6051                                 if (ver && !verify("Try", k))
6052 #endif
6053
6054                                 {
6055                                         done = TRUE;
6056                                         break;
6057                                 }
6058
6059                                 /* Allow player to "refuse" certain actions */
6060                                 if (!get_item_allow(k))
6061                                 {
6062                                         done = TRUE;
6063                                         break;
6064                                 }
6065
6066                                 /* Accept that choice */
6067                                 (*cp) = k;
6068                                 item = TRUE;
6069                                 done = TRUE;
6070                                 break;
6071                         }
6072                 }
6073                 }
6074         }
6075
6076
6077         /* Fix the screen if necessary */
6078         if (command_see)
6079         {
6080                 /* Load screen */
6081                 screen_load();
6082
6083                 /* Hack -- Cancel "display" */
6084                 command_see = FALSE;
6085         }
6086
6087
6088         /* Forget the item_tester_tval restriction */
6089         item_tester_tval = 0;
6090
6091         item_tester_no_ryoute = FALSE;
6092
6093         /* Forget the item_tester_hook restriction */
6094         item_tester_hook = NULL;
6095
6096
6097         /* Clean up */
6098         if (show_choices)
6099         {
6100                 /* Toggle again if needed */
6101                 if (toggle) toggle_inven_equip();
6102
6103                 /* Update */
6104                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6105
6106                 /* Window stuff */
6107                 window_stuff();
6108         }
6109
6110
6111         /* Clear the prompt line */
6112         prt("", 0, 0);
6113
6114         /* Warning if needed */
6115         if (oops && str) msg_print(str);
6116
6117 #ifdef ALLOW_REPEAT
6118         if (item) repeat_push(*cp);
6119 #endif /* ALLOW_REPEAT */
6120
6121         /* Result */
6122         return (item);
6123 }
6124
6125
6126 #ifdef ALLOW_EASY_FLOOR
6127
6128 /*
6129  * scan_floor --
6130  *
6131  * Return a list of o_list[] indexes of items at the given cave
6132  * location. Valid flags are:
6133  *
6134  *              mode & 0x01 -- Item tester
6135  *              mode & 0x02 -- Marked items only
6136  *              mode & 0x04 -- Stop after first
6137  */
6138 int scan_floor(int *items, int y, int x, int mode)
6139 {
6140         int this_o_idx, next_o_idx;
6141
6142         int num = 0;
6143
6144         /* Sanity */
6145         if (!in_bounds(y, x)) return 0;
6146
6147         /* Scan all objects in the grid */
6148         for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
6149         {
6150                 object_type *o_ptr;
6151
6152                 /* Acquire object */
6153                 o_ptr = &o_list[this_o_idx];
6154
6155                 /* Acquire next object */
6156                 next_o_idx = o_ptr->next_o_idx;
6157
6158                 /* Item tester */
6159                 if ((mode & 0x01) && !item_tester_okay(o_ptr)) continue;
6160
6161                 /* Marked */
6162                 if ((mode & 0x02) && !o_ptr->marked) continue;
6163
6164                 /* Accept this item */
6165                 /* XXX Hack -- Enforce limit */
6166                 if (num < 23)
6167                         items[num] = this_o_idx;
6168
6169                 num++;
6170
6171                 /* Only one */
6172                 if (mode & 0x04) break;
6173         }
6174
6175         /* Result */
6176         return num;
6177 }
6178
6179 /*
6180  * Display a list of the items on the floor at the given location.
6181  */
6182 int show_floor(int target_item, int y, int x, int *min_width)
6183 {
6184         int i, j, k, l;
6185         int col, len, lim;
6186
6187         object_type *o_ptr;
6188
6189         char o_name[MAX_NLEN];
6190
6191         char tmp_val[80];
6192
6193         int out_index[23];
6194         byte out_color[23];
6195         char out_desc[23][MAX_NLEN];
6196         int target_item_label = 0;
6197
6198         int floor_list[23], floor_num;
6199         int wid, hgt;
6200
6201         /* Get size */
6202         Term_get_size(&wid, &hgt);
6203
6204         /* Default length */
6205         len = MAX((*min_width), 20);
6206
6207         /* Maximum space allowed for descriptions */
6208         lim = wid - 4;
6209
6210         /* Require space for weight (if needed) */
6211         if (show_weights) lim -= 9;
6212
6213         /* Scan for objects in the grid, using item_tester_okay() */
6214         floor_num = scan_floor(floor_list, y, x, 0x01);
6215
6216         /* Display the inventory */
6217         for (k = 0, i = 0; i < floor_num && i < 23; i++)
6218         {
6219                 o_ptr = &o_list[floor_list[i]];
6220
6221                 /* Describe the object */
6222                 object_desc(o_name, o_ptr, TRUE, 3);
6223
6224                 /* Hack -- enforce max length */
6225                 o_name[lim] = '\0';
6226
6227                 /* Save the index */
6228                 out_index[k] = i;
6229
6230                 /* Acquire inventory color */
6231                 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
6232
6233                 /* Save the object description */
6234                 strcpy(out_desc[k], o_name);
6235
6236                 /* Find the predicted "line length" */
6237                 l = strlen(out_desc[k]) + 5;
6238
6239                 /* Be sure to account for the weight */
6240                 if (show_weights) l += 9;
6241
6242                 /* Maintain the maximum length */
6243                 if (l > len) len = l;
6244
6245                 /* Advance to next "line" */
6246                 k++;
6247         }
6248
6249         /* Save width */
6250         *min_width = len;
6251
6252         /* Find the column to start in */
6253         col = (len > wid - 4) ? 0 : (wid - len - 1);
6254
6255         /* Output each entry */
6256         for (j = 0; j < k; j++)
6257         {
6258                 /* Get the index */
6259                 i = floor_list[out_index[j]];
6260
6261                 /* Get the item */
6262                 o_ptr = &o_list[i];
6263
6264                 /* Clear the line */
6265                 prt("", j + 1, col ? col - 2 : col);
6266
6267                 if (use_menu && target_item)
6268                 {
6269                         if (j == (target_item-1))
6270                         {
6271 #ifdef JP
6272                                 strcpy(tmp_val, "¡Õ");
6273 #else
6274                                 strcpy(tmp_val, "> ");
6275 #endif
6276                                 target_item_label = i;
6277                         }
6278                         else strcpy(tmp_val, "   ");
6279                 }
6280                 else
6281                         /* Prepare an index --(-- */
6282                         sprintf(tmp_val, "%c)", index_to_label(j));
6283
6284                 /* Clear the line with the (possibly indented) index */
6285                 put_str(tmp_val, j + 1, col);
6286
6287                 /* Display the entry itself */
6288                 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
6289
6290                 /* Display the weight if needed */
6291                 if (show_weights)
6292                 {
6293                         int wgt = o_ptr->weight * o_ptr->number;
6294 #ifdef JP
6295                         sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
6296 #else
6297                         sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
6298 #endif
6299
6300                         put_str(tmp_val, j + 1, wid - 9);
6301                 }
6302         }
6303
6304         /* Make a "shadow" below the list (only if needed) */
6305         if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
6306
6307         return target_item_label;
6308 }
6309
6310 /*
6311  * This version of get_item() is called by get_item() when
6312  * the easy_floor is on.
6313  */
6314 bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
6315 {
6316         char n1 = ' ', n2 = ' ', which = ' ';
6317
6318         int j, k, i1, i2, e1, e2;
6319
6320         bool done, item;
6321
6322         bool oops = FALSE;
6323
6324         bool equip = FALSE;
6325         bool inven = FALSE;
6326         bool floor = FALSE;
6327
6328         bool allow_equip = FALSE;
6329         bool allow_inven = FALSE;
6330         bool allow_floor = FALSE;
6331
6332         bool toggle = FALSE;
6333
6334         char tmp_val[160];
6335         char out_val[160];
6336
6337         int floor_num, floor_list[23], floor_top = 0;
6338         int min_width = 0;
6339
6340         extern bool select_spellbook;
6341         extern bool select_the_force;
6342
6343         int menu_line = (use_menu ? 1 : 0);
6344         int max_inven = 0;
6345         int max_equip = 0;
6346
6347 #ifdef ALLOW_REPEAT
6348
6349         /* Get the item index */
6350         if (repeat_pull(cp))
6351         {
6352                 if (*cp == 1111) { /* the_force */
6353                     item_tester_tval = 0;
6354                     item_tester_hook = NULL;
6355                     return (TRUE);
6356                 } else
6357                 /* Floor item? */
6358                 if (*cp < 0)
6359                 {
6360                         object_type *o_ptr;
6361
6362                         /* Special index */
6363                         k = 0 - (*cp);
6364
6365                         /* Acquire object */
6366                         o_ptr = &o_list[k];
6367
6368                         /* Validate the item */
6369                         if (item_tester_okay(o_ptr))
6370                         {
6371                                 /* Forget the item_tester_tval restriction */
6372                                 item_tester_tval = 0;
6373
6374                                 /* Forget the item_tester_hook restriction */
6375                                 item_tester_hook = NULL;
6376
6377                                 /* Success */
6378                                 return (TRUE);
6379                         }
6380                 }
6381
6382                 /* Verify the item */
6383                 else if (get_item_okay(*cp))
6384                 {
6385                         /* Forget the item_tester_tval restriction */
6386                         item_tester_tval = 0;
6387
6388                         /* Forget the item_tester_hook restriction */
6389                         item_tester_hook = NULL;
6390
6391                         /* Success */
6392                         return (TRUE);
6393                 }
6394         }
6395
6396 #endif /* ALLOW_REPEAT */
6397
6398         /* Extract args */
6399         if (mode & (USE_EQUIP)) equip = TRUE;
6400         if (mode & (USE_INVEN)) inven = TRUE;
6401         if (mode & (USE_FLOOR)) floor = TRUE;
6402
6403
6404         /* Paranoia XXX XXX XXX */
6405         msg_print(NULL);
6406
6407
6408         /* Not done */
6409         done = FALSE;
6410
6411         /* No item selected */
6412         item = FALSE;
6413
6414
6415         /* Full inventory */
6416         i1 = 0;
6417         i2 = INVEN_PACK - 1;
6418
6419         /* Forbid inventory */
6420         if (!inven) i2 = -1;
6421         else if (use_menu)
6422         {
6423                 for (j = 0; j < INVEN_PACK; j++)
6424                         if (item_tester_okay(&inventory[j])) max_inven++;
6425         }
6426
6427         /* Restrict inventory indexes */
6428         while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
6429         while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
6430
6431
6432         /* Full equipment */
6433         e1 = INVEN_RARM;
6434         e2 = INVEN_TOTAL - 1;
6435
6436         /* Forbid equipment */
6437         if (!equip) e2 = -1;
6438         else if (use_menu)
6439         {
6440                 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
6441                         if (item_tester_okay(&inventory[j])) max_equip++;
6442                 if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
6443         }
6444
6445         /* Restrict equipment indexes */
6446         while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
6447         while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
6448
6449
6450         /* Count "okay" floor items */
6451         floor_num = 0;
6452
6453         /* Restrict floor usage */
6454         if (floor)
6455         {
6456                 /* Scan all objects in the grid */
6457                 floor_num = scan_floor(floor_list, py, px, 0x01);
6458         }
6459
6460         /* Accept inventory */
6461         if (i1 <= i2) allow_inven = TRUE;
6462
6463         /* Accept equipment */
6464         if (e1 <= e2) allow_equip = TRUE;
6465
6466         /* Accept floor */
6467         if (floor_num) allow_floor = TRUE;
6468
6469         /* Require at least one legal choice */
6470         if (!allow_inven && !allow_equip && !allow_floor)
6471         {
6472                 /* Cancel p_ptr->command_see */
6473                 command_see = FALSE;
6474
6475                 /* Oops */
6476                 oops = TRUE;
6477
6478                 /* Done */
6479                 done = TRUE;
6480
6481                 if (select_the_force) {
6482                     *cp = 1111;
6483                     item = TRUE;
6484                 }
6485         }
6486
6487         /* Analyze choices */
6488         else
6489         {
6490                 /* Hack -- Start on equipment if requested */
6491                 if (command_see && (command_wrk == (USE_EQUIP))
6492                         && allow_equip)
6493                 {
6494                         command_wrk = (USE_EQUIP);
6495                 }
6496
6497                 /* Use inventory if allowed */
6498                 else if (allow_inven)
6499                 {
6500                         command_wrk = (USE_INVEN);
6501                 }
6502
6503                 /* Use equipment if allowed */
6504                 else if (allow_equip)
6505                 {
6506                         command_wrk = (USE_EQUIP);
6507                 }
6508
6509                 /* Use floor if allowed */
6510                 else if (allow_floor)
6511                 {
6512                         command_wrk = (USE_FLOOR);
6513                 }
6514         }
6515
6516         /*
6517          * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
6518          */
6519         if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
6520
6521         /* Hack -- start out in "display" mode */
6522         if (command_see)
6523         {
6524                 /* Save screen */
6525                 screen_save();
6526         }
6527
6528         /* Repeat until done */
6529         while (!done)
6530         {
6531                 int get_item_label = 0;
6532
6533                 /* Show choices */
6534                 if (show_choices)
6535                 {
6536                         int ni = 0;
6537                         int ne = 0;
6538
6539                         /* Scan windows */
6540                         for (j = 0; j < 8; j++)
6541                         {
6542                                 /* Unused */
6543                                 if (!angband_term[j]) continue;
6544
6545                                 /* Count windows displaying inven */
6546                                 if (window_flag[j] & (PW_INVEN)) ni++;
6547
6548                                 /* Count windows displaying equip */
6549                                 if (window_flag[j] & (PW_EQUIP)) ne++;
6550                         }
6551
6552                         /* Toggle if needed */
6553                         if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
6554                                 (command_wrk == (USE_INVEN) && !ni && ne))
6555                         {
6556                                 /* Toggle */
6557                                 toggle_inven_equip();
6558
6559                                 /* Track toggles */
6560                                 toggle = !toggle;
6561                         }
6562
6563                         /* Update */
6564                         p_ptr->window |= (PW_INVEN | PW_EQUIP);
6565
6566                         /* Redraw windows */
6567                         window_stuff();
6568                 }
6569
6570                 /* Inventory screen */
6571                 if (command_wrk == (USE_INVEN))
6572                 {
6573                         /* Extract the legal requests */
6574                         n1 = I2A(i1);
6575                         n2 = I2A(i2);
6576
6577                         /* Redraw if needed */
6578                         if (command_see) get_item_label = show_inven(menu_line);
6579                 }
6580
6581                 /* Equipment screen */
6582                 else if (command_wrk == (USE_EQUIP))
6583                 {
6584                         /* Extract the legal requests */
6585                         n1 = I2A(e1 - INVEN_RARM);
6586                         n2 = I2A(e2 - INVEN_RARM);
6587
6588                         /* Redraw if needed */
6589                         if (command_see) get_item_label = show_equip(menu_line);
6590                 }
6591
6592                 /* Floor screen */
6593                 else if (command_wrk == (USE_FLOOR))
6594                 {
6595                         j = floor_top;
6596                         k = MIN(floor_top + 23, floor_num) - 1;
6597
6598                         /* Extract the legal requests */
6599                         n1 = I2A(j - floor_top);
6600                         n2 = I2A(k - floor_top);
6601
6602                         /* Redraw if needed */
6603                         if (command_see) get_item_label = show_floor(menu_line, py, px, &min_width);
6604                 }
6605
6606                 /* Viewing inventory */
6607                 if (command_wrk == (USE_INVEN))
6608                 {
6609                         /* Begin the prompt */
6610 #ifdef JP
6611 sprintf(out_val, "»ý¤Áʪ:");
6612 #else
6613                         sprintf(out_val, "Inven:");
6614 #endif
6615
6616                         if (!use_menu)
6617                         {
6618                                 /* Build the prompt */
6619 #ifdef JP
6620 sprintf(tmp_val, "%c-%c,'(',')',",
6621 #else
6622                                 sprintf(tmp_val, " %c-%c,'(',')',",
6623 #endif
6624
6625                                         index_to_label(i1), index_to_label(i2));
6626
6627                                 /* Append */
6628                                 strcat(out_val, tmp_val);
6629                         }
6630
6631                         /* Indicate ability to "view" */
6632 #ifdef JP
6633 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6634 #else
6635                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6636 #endif
6637
6638
6639                         /* Append */
6640 #ifdef JP
6641                         if (allow_equip)
6642                         {
6643                                 if (!use_menu)
6644                                         strcat(out_val, " '/' ÁõÈ÷ÉÊ,");
6645                                 else if (allow_floor)
6646                                         strcat(out_val, " '6' ÁõÈ÷ÉÊ,");
6647                                 else
6648                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6649                         }
6650                         else if (select_the_force)
6651                                 strcat(out_val, " 'w'Îýµ¤½Ñ,");
6652 #else
6653                         if (allow_equip)
6654                         {
6655                                 if (!use_menu)
6656                                         strcat(out_val, " / for Equip,");
6657                                 else if (allow_floor)
6658                                         strcat(out_val, " 6 for Equip,");
6659                                 else
6660                                         strcat(out_val, " 4 or 6 for Equip,");
6661                         }
6662                         else if (select_the_force)
6663                                 strcat(out_val, " w for the Force,");
6664 #endif
6665
6666                         /* Append */
6667                         if (allow_floor)
6668                         {
6669 #ifdef JP
6670                                 if (!use_menu)
6671                                         strcat(out_val, " '-'¾²¾å,");
6672                                 else if (allow_equip)
6673                                         strcat(out_val, " '4' ¾²¾å,");
6674                                 else
6675                                         strcat(out_val, " '4'or'6' ¾²¾å,");
6676 #else
6677                                 if (!use_menu)
6678                                         strcat(out_val, " - for floor,");
6679                                 else if (allow_equip)
6680                                         strcat(out_val, " 4 for floor,");
6681                                 else
6682                                         strcat(out_val, " 4 or 6 for floor,");
6683 #endif
6684                         }
6685
6686                 }
6687
6688                 /* Viewing equipment */
6689                 else if (command_wrk == (USE_EQUIP))
6690                 {
6691                         /* Begin the prompt */
6692 #ifdef JP
6693 sprintf(out_val, "ÁõÈ÷ÉÊ:");
6694 #else
6695                         sprintf(out_val, "Equip:");
6696 #endif
6697
6698
6699                         if (!use_menu)
6700                         {
6701                                 /* Build the prompt */
6702 #ifdef JP
6703 sprintf(tmp_val, "%c-%c,'(',')',",
6704 #else
6705                                 sprintf(tmp_val, " %c-%c,'(',')',",
6706 #endif
6707
6708                                         index_to_label(e1), index_to_label(e2));
6709
6710                                 /* Append */
6711                                 strcat(out_val, tmp_val);
6712                         }
6713
6714                         /* Indicate ability to "view" */
6715 #ifdef JP
6716 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6717 #else
6718                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6719 #endif
6720
6721
6722                         /* Append */
6723                         if (allow_inven)
6724                         {
6725 #ifdef JP
6726                                 if (!use_menu)
6727                                         strcat(out_val, " '/' »ý¤Áʪ,");
6728                                 else if (allow_floor)
6729                                         strcat(out_val, " '4' »ý¤Áʪ,");
6730                                 else
6731                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6732 #else
6733
6734                                 if (!use_menu)
6735                                         strcat(out_val, " / for Inven,");
6736                                 else if (allow_floor)
6737                                         strcat(out_val, " 4 for Inven,");
6738                                 else
6739                                         strcat(out_val, " 4 or 6 for Inven,");
6740 #endif
6741                         }
6742
6743                         /* Append */
6744                         if (allow_floor)
6745                         {
6746 #ifdef JP
6747                                 if (!use_menu)
6748                                         strcat(out_val, " '-'¾²¾å,");
6749                                 else if (allow_inven)
6750                                         strcat(out_val, " '6' ¾²¾å,");
6751                                 else
6752                                         strcat(out_val, " '4'or'6' ¾²¾å,");
6753 #else
6754                                 if (!use_menu)
6755                                         strcat(out_val, " - for floor,");
6756                                 else if (allow_inven)
6757                                         strcat(out_val, " 6 for floor,");
6758                                 else
6759                                         strcat(out_val, " 4 or 6 for floor,");
6760 #endif
6761                         }
6762                 }
6763
6764                 /* Viewing floor */
6765                 else if (command_wrk == (USE_FLOOR))
6766                 {
6767                         /* Begin the prompt */
6768 #ifdef JP
6769                         sprintf(out_val, "¾²¾å:");
6770 #else
6771                         sprintf(out_val, "Floor:");
6772 #endif
6773
6774
6775                         if (!use_menu)
6776                         {
6777                                 /* Build the prompt */
6778 #ifdef JP
6779 sprintf(tmp_val, "%c-%c,'(',')',", n1, n2);
6780 #else
6781                                 sprintf(tmp_val, " %c-%c,'(',')',", n1, n2);
6782 #endif
6783
6784
6785                                 /* Append */
6786                                 strcat(out_val, tmp_val);
6787                         }
6788
6789                         /* Indicate ability to "view" */
6790 #ifdef JP
6791 if (!command_see && !use_menu) strcat(out_val, " '*'°ìÍ÷,");
6792 #else
6793                         if (!command_see && !use_menu) strcat(out_val, " * to see,");
6794 #endif
6795
6796
6797                         if (use_menu)
6798                         {
6799                                 if (allow_inven && allow_equip)
6800                                 {
6801 #ifdef JP
6802                                         strcat(out_val, " '4' ÁõÈ÷ÉÊ, '6' »ý¤Áʪ,");
6803 #else
6804                                         strcat(out_val, " 4 for Equip, 6 for Inven,");
6805 #endif
6806
6807                                 }
6808                                 else if (allow_inven)
6809                                 {
6810 #ifdef JP
6811                                         strcat(out_val, " '4'or'6' »ý¤Áʪ,");
6812 #else
6813                                         strcat(out_val, " 4 or 6 for Inven,");
6814 #endif
6815
6816                                 }
6817                                 else if (allow_equip)
6818                                 {
6819 #ifdef JP
6820                                         strcat(out_val, " '4'or'6' ÁõÈ÷ÉÊ,");
6821 #else
6822                                         strcat(out_val, " 4 or 6 for Equip,");
6823 #endif
6824
6825                                 }
6826                         }
6827                         /* Append */
6828                         else if (allow_inven)
6829                         {
6830 #ifdef JP
6831                                 strcat(out_val, " '/' »ý¤Áʪ,");
6832 #else
6833                                 strcat(out_val, " / for Inven,");
6834 #endif
6835
6836                         }
6837                         else if (allow_equip)
6838                         {
6839 #ifdef JP
6840                                 strcat(out_val, " '/'ÁõÈ÷ÉÊ,");
6841 #else
6842                                 strcat(out_val, " / for Equip,");
6843 #endif
6844
6845                         }
6846
6847                         /* Append */
6848                         if (command_see && !use_menu)
6849                         {
6850 #ifdef JP
6851                                 strcat(out_val, " Enter ¼¡,");
6852 #else
6853                                 strcat(out_val, " Enter for scroll down,");
6854 #endif
6855                         }
6856                 }
6857
6858                 /* Finish the prompt */
6859                 strcat(out_val, " ESC");
6860
6861                 /* Build the prompt */
6862                 sprintf(tmp_val, "(%s) %s", out_val, pmt);
6863
6864                 /* Show the prompt */
6865                 prt(tmp_val, 0, 0);
6866
6867                 /* Get a key */
6868                 which = inkey();
6869
6870                 if (use_menu)
6871                 {
6872                 int max_line = 1;
6873                 if (command_wrk == USE_INVEN) max_line = max_inven;
6874                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6875                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6876                 switch (which)
6877                 {
6878                         case ESCAPE:
6879                         case 'z':
6880                         case 'Z':
6881                         case '0':
6882                         {
6883                                 done = TRUE;
6884                                 break;
6885                         }
6886
6887                         case '8':
6888                         case 'k':
6889                         case 'K':
6890                         {
6891                                 menu_line += (max_line - 1);
6892                                 break;
6893                         }
6894
6895                         case '2':
6896                         case 'j':
6897                         case 'J':
6898                         {
6899                                 menu_line++;
6900                                 break;
6901                         }
6902
6903                         case '4':
6904                         case 'h':
6905                         case 'H':
6906                         {
6907                                 /* Verify legality */
6908                                 if (command_wrk == (USE_INVEN))
6909                                 {
6910                                         if (allow_floor) command_wrk = USE_FLOOR;
6911                                         else if (allow_equip) command_wrk = USE_EQUIP;
6912                                         else
6913                                         {
6914                                                 bell();
6915                                                 break;
6916                                         }
6917                                 }
6918                                 else if (command_wrk == (USE_EQUIP))
6919                                 {
6920                                         if (allow_inven) command_wrk = USE_INVEN;
6921                                         else if (allow_floor) command_wrk = USE_FLOOR;
6922                                         else
6923                                         {
6924                                                 bell();
6925                                                 break;
6926                                         }
6927                                 }
6928                                 else if (command_wrk == (USE_FLOOR))
6929                                 {
6930                                         if (allow_equip) command_wrk = USE_EQUIP;
6931                                         else if (allow_inven) command_wrk = USE_INVEN;
6932                                         else
6933                                         {
6934                                                 bell();
6935                                                 break;
6936                                         }
6937                                 }
6938                                 else
6939                                 {
6940                                         bell();
6941                                         break;
6942                                 }
6943
6944                                 /* Hack -- Fix screen */
6945                                 if (command_see)
6946                                 {
6947                                         /* Load screen */
6948                                         screen_load();
6949
6950                                         /* Save screen */
6951                                         screen_save();
6952                                 }
6953
6954                                 /* Switch inven/equip */
6955                                 if (command_wrk == USE_INVEN) max_line = max_inven;
6956                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
6957                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
6958                                 if (menu_line > max_line) menu_line = max_line;
6959
6960                                 /* Need to redraw */
6961                                 break;
6962                         }
6963
6964                         case '6':
6965                         case 'l':
6966                         case 'L':
6967                         {
6968                                 /* Verify legality */
6969                                 if (command_wrk == (USE_INVEN))
6970                                 {
6971                                         if (allow_equip) command_wrk = USE_EQUIP;
6972                                         else if (allow_floor) command_wrk = USE_FLOOR;
6973                                         else
6974                                         {
6975                                                 bell();
6976                                                 break;
6977                                         }
6978                                 }
6979                                 else if (command_wrk == (USE_EQUIP))
6980                                 {
6981                                         if (allow_floor) command_wrk = USE_FLOOR;
6982                                         else if (allow_inven) command_wrk = USE_INVEN;
6983                                         else
6984                                         {
6985                                                 bell();
6986                                                 break;
6987                                         }
6988                                 }
6989                                 else if (command_wrk == (USE_FLOOR))
6990                                 {
6991                                         if (allow_inven) command_wrk = USE_INVEN;
6992                                         else if (allow_equip) command_wrk = USE_EQUIP;
6993                                         else
6994                                         {
6995                                                 bell();
6996                                                 break;
6997                                         }
6998                                 }
6999                                 else
7000                                 {
7001                                         bell();
7002                                         break;
7003                                 }
7004
7005                                 /* Hack -- Fix screen */
7006                                 if (command_see)
7007                                 {
7008                                         /* Load screen */
7009                                         screen_load();
7010
7011                                         /* Save screen */
7012                                         screen_save();
7013                                 }
7014
7015                                 /* Switch inven/equip */
7016                                 if (command_wrk == USE_INVEN) max_line = max_inven;
7017                                 else if (command_wrk == USE_EQUIP) max_line = max_equip;
7018                                 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
7019                                 if (menu_line > max_line) menu_line = max_line;
7020
7021                                 /* Need to redraw */
7022                                 break;
7023                         }
7024
7025                         case 'x':
7026                         case 'X':
7027                         case '\r':
7028                         case '\n':
7029                         {
7030                                 if (command_wrk == USE_FLOOR)
7031                                 {
7032                                         /* Special index */
7033                                         (*cp) = -get_item_label;
7034                                 }
7035                                 else
7036                                 {
7037                                         /* Validate the item */
7038                                         if (!get_item_okay(get_item_label))
7039                                         {
7040                                                 bell();
7041                                                 break;
7042                                         }
7043
7044                                         /* Allow player to "refuse" certain actions */
7045                                         if (!get_item_allow(get_item_label))
7046                                         {
7047                                                 done = TRUE;
7048                                                 break;
7049                                         }
7050
7051                                         /* Accept that choice */
7052                                         (*cp) = get_item_label;
7053                                 }
7054
7055                                 item = TRUE;
7056                                 done = TRUE;
7057                                 break;
7058                         }
7059                         case 'w':
7060                         {
7061                                 if (select_the_force) {
7062                                         *cp = 1111;
7063                                         item = TRUE;
7064                                         done = TRUE;
7065                                         break;
7066                                 }
7067                         }
7068                 }
7069                 if (menu_line > max_line) menu_line -= max_line;
7070                 }
7071                 else
7072                 {
7073                 /* Parse it */
7074                 switch (which)
7075                 {
7076                         case ESCAPE:
7077                         {
7078                                 done = TRUE;
7079                                 break;
7080                         }
7081
7082                         case '*':
7083                         case '?':
7084                         case ' ':
7085                         {
7086                                 /* Hide the list */
7087                                 if (command_see)
7088                                 {
7089                                         /* Flip flag */
7090                                         command_see = FALSE;
7091
7092                                         /* Load screen */
7093                                         screen_load();
7094                                 }
7095
7096                                 /* Show the list */
7097                                 else
7098                                 {
7099                                         /* Save screen */
7100                                         screen_save();
7101
7102                                         /* Flip flag */
7103                                         command_see = TRUE;
7104                                 }
7105                                 break;
7106                         }
7107
7108                         case '\n':
7109                         case '\r':
7110                         case '+':
7111                         {
7112                                 int i, o_idx;
7113                                 cave_type *c_ptr = &cave[py][px];
7114  
7115                                 if (command_wrk != (USE_FLOOR)) break;
7116
7117                                 /* Get the object being moved. */
7118                                 o_idx = c_ptr->o_idx;
7119  
7120                                 /* Only rotate a pile of two or more objects. */
7121                                 if (!(o_idx && o_list[o_idx].next_o_idx)) break;
7122
7123                                 /* Remove the first object from the list. */
7124                                 excise_object_idx(o_idx);
7125         
7126                                 /* Find end of the list. */
7127                                 i = c_ptr->o_idx;
7128                                 while (o_list[i].next_o_idx)
7129                                         i = o_list[i].next_o_idx;
7130         
7131                                 /* Add after the last object. */
7132                                 o_list[i].next_o_idx = o_idx;
7133         
7134                                 /* Re-scan floor list */ 
7135                                 floor_num = scan_floor(floor_list, py, px, 0x01);
7136
7137                                 /* Hack -- Fix screen */
7138                                 if (command_see)
7139                                 {
7140                                         /* Load screen */
7141                                         screen_load();
7142
7143                                         /* Save screen */
7144                                         screen_save();
7145                                 }
7146
7147                                 break;
7148                         }
7149
7150                         case '/':
7151                         {
7152                                 if (command_wrk == (USE_INVEN))
7153                                 {
7154                                         if (!allow_equip)
7155                                         {
7156                                                 bell();
7157                                                 break;
7158                                         }
7159                                         command_wrk = (USE_EQUIP);
7160                                 }
7161                                 else if (command_wrk == (USE_EQUIP))
7162                                 {
7163                                         if (!allow_inven)
7164                                         {
7165                                                 bell();
7166                                                 break;
7167                                         }
7168                                         command_wrk = (USE_INVEN);
7169                                 }
7170                                 else if (command_wrk == (USE_FLOOR))
7171                                 {
7172                                         if (allow_inven)
7173                                         {
7174                                                 command_wrk = (USE_INVEN);
7175                                         }
7176                                         else if (allow_equip)
7177                                         {
7178                                                 command_wrk = (USE_EQUIP);
7179                                         }
7180                                         else
7181                                         {
7182                                                 bell();
7183                                                 break;
7184                                         }
7185                                 }
7186
7187                                 /* Hack -- Fix screen */
7188                                 if (command_see)
7189                                 {
7190                                         /* Load screen */
7191                                         screen_load();
7192
7193                                         /* Save screen */
7194                                         screen_save();
7195                                 }
7196
7197                                 /* Need to redraw */
7198                                 break;
7199                         }
7200
7201                         case '-':
7202                         {
7203                                 if (!allow_floor)
7204                                 {
7205                                         bell();
7206                                         break;
7207                                 }
7208
7209                                 /*
7210                                  * If we are already examining the floor, and there
7211                                  * is only one item, we will always select it.
7212                                  * If we aren't examining the floor and there is only
7213                                  * one item, we will select it if floor_query_flag
7214                                  * is FALSE.
7215                                  */
7216                                 if (floor_num == 1)
7217                                 {
7218                                         if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
7219                                         {
7220                                                 /* Special index */
7221                                                 k = 0 - floor_list[0];
7222
7223                                                 /* Allow player to "refuse" certain actions */
7224                                                 if (!get_item_allow(k))
7225                                                 {
7226                                                         done = TRUE;
7227                                                         break;
7228                                                 }
7229
7230                                                 /* Accept that choice */
7231                                                 (*cp) = k;
7232                                                 item = TRUE;
7233                                                 done = TRUE;
7234
7235                                                 break;
7236                                         }
7237                                 }
7238
7239                                 /* Hack -- Fix screen */
7240                                 if (command_see)
7241                                 {
7242                                         /* Load screen */
7243                                         screen_load();
7244
7245                                         /* Save screen */
7246                                         screen_save();
7247                                 }
7248
7249                                 command_wrk = (USE_FLOOR);
7250
7251                                 break;
7252                         }
7253
7254                         case '0':
7255                         case '1': case '2': case '3':
7256                         case '4': case '5': case '6':
7257                         case '7': case '8': case '9':
7258                         {
7259                                 /* Look up the tag */
7260                                 if (!get_tag(&k, which))
7261                                 {
7262                                         bell();
7263                                         break;
7264                                 }
7265
7266                                 /* Hack -- Validate the item */
7267                                 if ((k < INVEN_RARM) ? !inven : !equip)
7268                                 {
7269                                         bell();
7270                                         break;
7271                                 }
7272
7273                                 /* Validate the item */
7274                                 if (!get_item_okay(k))
7275                                 {
7276                                         bell();
7277                                         break;
7278                                 }
7279
7280                                 /* Allow player to "refuse" certain actions */
7281                                 if (!get_item_allow(k))
7282                                 {
7283                                         done = TRUE;
7284                                         break;
7285                                 }
7286
7287                                 /* Accept that choice */
7288                                 (*cp) = k;
7289                                 item = TRUE;
7290                                 done = TRUE;
7291                                 break;
7292                         }
7293
7294 #if 0
7295                         case '\n':
7296                         case '\r':
7297                         {
7298                                 /* Choose "default" inventory item */
7299                                 if (command_wrk == (USE_INVEN))
7300                                 {
7301                                         k = ((i1 == i2) ? i1 : -1);
7302                                 }
7303
7304                                 /* Choose "default" equipment item */
7305                                 else if (command_wrk == (USE_EQUIP))
7306                                 {
7307                                         k = ((e1 == e2) ? e1 : -1);
7308                                 }
7309
7310                                 /* Choose "default" floor item */
7311                                 else if (command_wrk == (USE_FLOOR))
7312                                 {
7313                                         if (floor_num == 1)
7314                                         {
7315                                                 /* Special index */
7316                                                 k = 0 - floor_list[0];
7317
7318                                                 /* Allow player to "refuse" certain actions */
7319                                                 if (!get_item_allow(k))
7320                                                 {
7321                                                         done = TRUE;
7322                                                         break;
7323                                                 }
7324
7325                                                 /* Accept that choice */
7326                                                 (*cp) = k;
7327                                                 item = TRUE;
7328                                                 done = TRUE;
7329                                         }
7330                                         break;
7331                                 }
7332
7333                                 /* Validate the item */
7334                                 if (!get_item_okay(k))
7335                                 {
7336                                         bell();
7337                                         break;
7338                                 }
7339
7340                                 /* Allow player to "refuse" certain actions */
7341                                 if (!get_item_allow(k))
7342                                 {
7343                                         done = TRUE;
7344                                         break;
7345                                 }
7346
7347                                 /* Accept that choice */
7348                                 (*cp) = k;
7349                                 item = TRUE;
7350                                 done = TRUE;
7351                                 break;
7352                         }
7353 #endif
7354
7355                         case 'w':
7356                         {
7357                                 if (select_the_force) {
7358                                         *cp = 1111;
7359                                         item = TRUE;
7360                                         done = TRUE;
7361                                         break;
7362                                 }
7363                         }
7364
7365                         default:
7366                         {
7367                                 int ver;
7368
7369                                 if(select_spellbook){
7370                                     bool not_found = FALSE;
7371                                     /* Look up the tag */
7372                                     if (!get_tag(&k, which))
7373                                     {
7374                                         not_found = TRUE;
7375                                     }
7376
7377                                     /* Hack -- Validate the item */
7378                                     if ((k < INVEN_RARM) ? !inven : !equip)
7379                                     {
7380                                         not_found = TRUE;
7381                                     }
7382
7383                                     /* Validate the item */
7384                                     if (!get_item_okay(k))
7385                                     {
7386                                         not_found = TRUE;
7387                                     }
7388
7389                                     if( !not_found ){
7390                                         /* Accept that choice */
7391                                         (*cp) = k;
7392                                         item = TRUE;
7393                                         done = TRUE;
7394                                         break;
7395                                     }
7396                                 }                               
7397
7398                                 /* Extract "query" setting */
7399                                 ver = isupper(which);
7400                                 which = tolower(which);
7401
7402                                 /* Convert letter to inventory index */
7403                                 if (command_wrk == (USE_INVEN))
7404                                 {
7405                                         if (which == '(') k = i1;
7406                                         else if (which == ')') k = i2;
7407                                         else k = label_to_inven(which);
7408                                 }
7409
7410                                 /* Convert letter to equipment index */
7411                                 else if (command_wrk == (USE_EQUIP))
7412                                 {
7413                                         if (which == '(') k = e1;
7414                                         else if (which == ')') k = e2;
7415                                         else k = label_to_equip(which);
7416                                 }
7417
7418                                 /* Convert letter to floor index */
7419                                 else if (command_wrk == USE_FLOOR)
7420                                 {
7421                                         if (which == '(') k = 0;
7422                                         else if (which == ')') k = floor_num - 1;
7423                                         else k = islower(which) ? A2I(which) : -1;
7424                                         if (k < 0 || k >= floor_num || k >= 23)
7425                                         {
7426                                                 bell();
7427                                                 break;
7428                                         }
7429
7430                                         /* Special index */
7431                                         k = 0 - floor_list[k];
7432                                 }
7433
7434                                 /* Validate the item */
7435                                 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
7436                                 {
7437                                         bell();
7438                                         break;
7439                                 }
7440
7441                                 /* Verify the item */
7442 #ifdef JP
7443 if (ver && !verify("ËÜÅö¤Ë", k))
7444 #else
7445                                 if (ver && !verify("Try", k))
7446 #endif
7447
7448                                 {
7449                                         done = TRUE;
7450                                         break;
7451                                 }
7452
7453                                 /* Allow player to "refuse" certain actions */
7454                                 if (!get_item_allow(k))
7455                                 {
7456                                         done = TRUE;
7457                                         break;
7458                                 }
7459
7460                                 /* Accept that choice */
7461                                 (*cp) = k;
7462                                 item = TRUE;
7463                                 done = TRUE;
7464                                 break;
7465                         }
7466                 }
7467                 }
7468         }
7469
7470         /* Fix the screen if necessary */
7471         if (command_see)
7472         {
7473                 /* Load screen */
7474                 screen_load();
7475
7476                 /* Hack -- Cancel "display" */
7477                 command_see = FALSE;
7478         }
7479
7480
7481         /* Forget the item_tester_tval restriction */
7482         item_tester_tval = 0;
7483
7484         /* Forget the item_tester_hook restriction */
7485         item_tester_hook = NULL;
7486
7487
7488         /* Clean up */
7489         if (show_choices)
7490         {
7491                 /* Toggle again if needed */
7492                 if (toggle) toggle_inven_equip();
7493
7494                 /* Update */
7495                 p_ptr->window |= (PW_INVEN | PW_EQUIP);
7496
7497                 /* Window stuff */
7498                 window_stuff();
7499         }
7500
7501
7502         /* Clear the prompt line */
7503         prt("", 0, 0);
7504
7505         /* Warning if needed */
7506         if (oops && str) msg_print(str);
7507
7508 #ifdef ALLOW_REPEAT
7509         if (item) repeat_push(*cp);
7510 #endif /* ALLOW_REPEAT */
7511
7512         /* Result */
7513         return (item);
7514 }
7515
7516
7517 static bool py_pickup_floor_aux(void)
7518 {
7519         s16b this_o_idx;
7520
7521         object_type *o_ptr;
7522
7523         cptr q, s;
7524
7525         int item;
7526
7527         /* Restrict the choices */
7528         item_tester_hook = inven_carry_okay;
7529
7530         /* Get an object */
7531 #ifdef JP
7532         q = "¤É¤ì¤ò½¦¤¤¤Þ¤¹¤«¡©";
7533         s = "¤â¤¦¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£";
7534 #else
7535         q = "Get which item? ";
7536         s = "You no longer have any room for the objects on the floor.";
7537 #endif
7538
7539         if (get_item(&item, q, s, (USE_FLOOR)))
7540         {
7541                 this_o_idx = 0 - item;
7542         }
7543         else
7544         {
7545                 return (FALSE);
7546         }
7547
7548         /* Access the object */
7549         o_ptr = &o_list[this_o_idx];
7550
7551         /* Pick up the object */
7552         py_pickup_aux(this_o_idx);
7553
7554         return (TRUE);
7555 }
7556
7557
7558 /*
7559  * Make the player carry everything in a grid
7560  *
7561  * If "pickup" is FALSE then only gold will be picked up
7562  *
7563  * This is called by py_pickup() when easy_floor is TRUE.
7564  */
7565 void py_pickup_floor(int pickup)
7566 {
7567         s16b this_o_idx, next_o_idx = 0;
7568
7569         char o_name[MAX_NLEN];
7570         object_type *o_ptr;
7571
7572         int floor_num = 0, floor_list[23], floor_o_idx = 0;
7573
7574         int can_pickup = 0;
7575
7576         /* Scan the pile of objects */
7577         for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
7578         {
7579                 object_type *o_ptr;
7580
7581                 /* Access the object */
7582                 o_ptr = &o_list[this_o_idx];
7583
7584                 /* Describe the object */
7585                 object_desc(o_name, o_ptr, TRUE, 3);
7586
7587                 /* Access the next object */
7588                 next_o_idx = o_ptr->next_o_idx;
7589
7590                 /* Hack -- disturb */
7591                 disturb(0, 0);
7592
7593                 /* Pick up gold */
7594                 if (o_ptr->tval == TV_GOLD)
7595                 {
7596                         /* Message */
7597 #ifdef JP
7598                 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
7599                            (long)o_ptr->pval, o_name);
7600 #else
7601                         msg_format("You have found %ld gold pieces worth of %s.",
7602                                 (long) o_ptr->pval, o_name);
7603 #endif
7604
7605
7606                         /* Collect the gold */
7607                         p_ptr->au += o_ptr->pval;
7608
7609                         /* Redraw gold */
7610                         p_ptr->redraw |= (PR_GOLD);
7611
7612                         /* Window stuff */
7613                         p_ptr->window |= (PW_PLAYER);
7614
7615                         /* Delete the gold */
7616                         delete_object_idx(this_o_idx);
7617
7618                         /* Check the next object */
7619                         continue;
7620                 }
7621                 else if (o_ptr->marked & OM_NOMSG)
7622                 {
7623                         /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
7624                          * ignored. Otherwise, they are included in the prompt. */
7625                         o_ptr->marked &= ~(OM_NOMSG);
7626                         continue;
7627                 }
7628
7629                 /* Count non-gold objects that can be picked up. */
7630                 if (inven_carry_okay(o_ptr))
7631                 {
7632                         can_pickup++;
7633                 }
7634
7635                 /* Remember this object index */
7636                 if (floor_num < 23)
7637                         floor_list[floor_num] = this_o_idx;
7638
7639                 /* Count non-gold objects */
7640                 floor_num++;
7641
7642                 /* Remember this index */
7643                 floor_o_idx = this_o_idx;
7644         }
7645
7646         /* There are no non-gold objects */
7647         if (!floor_num)
7648                 return;
7649
7650         /* Mention the number of objects */
7651         if (!pickup)
7652         {
7653                 /* One object */
7654                 if (floor_num == 1)
7655                 {
7656                         /* Access the object */
7657                         o_ptr = &o_list[floor_o_idx];
7658
7659 #ifdef ALLOW_EASY_SENSE
7660
7661                         /* Option: Make object sensing easy */
7662                         if (easy_sense)
7663                         {
7664                                 /* Sense the object */
7665                                 (void) sense_object(o_ptr);
7666                         }
7667
7668 #endif /* ALLOW_EASY_SENSE */
7669
7670                         /* Describe the object */
7671                         object_desc(o_name, o_ptr, TRUE, 3);
7672
7673                         /* Message */
7674 #ifdef JP
7675                                 msg_format("%s¤¬¤¢¤ë¡£", o_name);
7676 #else
7677                         msg_format("You see %s.", o_name);
7678 #endif
7679
7680                 }
7681
7682                 /* Multiple objects */
7683                 else
7684                 {
7685                         /* Message */
7686 #ifdef JP
7687                         msg_format("%d ¸Ä¤Î¥¢¥¤¥Æ¥à¤Î»³¤¬¤¢¤ë¡£", floor_num);
7688 #else
7689                         msg_format("You see a pile of %d items.", floor_num);
7690 #endif
7691
7692                 }
7693
7694                 /* Done */
7695                 return;
7696         }
7697
7698         /* The player has no room for anything on the floor. */
7699         if (!can_pickup)
7700         {
7701                 /* One object */
7702                 if (floor_num == 1)
7703                 {
7704                         /* Access the object */
7705                         o_ptr = &o_list[floor_o_idx];
7706
7707 #ifdef ALLOW_EASY_SENSE
7708
7709                         /* Option: Make object sensing easy */
7710                         if (easy_sense)
7711                         {
7712                                 /* Sense the object */
7713                                 (void) sense_object(o_ptr);
7714                         }
7715
7716 #endif /* ALLOW_EASY_SENSE */
7717
7718                         /* Describe the object */
7719                         object_desc(o_name, o_ptr, TRUE, 3);
7720
7721                         /* Message */
7722 #ifdef JP
7723                                 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
7724 #else
7725                         msg_format("You have no room for %s.", o_name);
7726 #endif
7727
7728                 }
7729
7730                 /* Multiple objects */
7731                 else
7732                 {
7733                         /* Message */
7734 #ifdef JP
7735                         msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
7736 #else
7737                         msg_print("You have no room for any of the objects on the floor.");
7738 #endif
7739
7740                 }
7741
7742                 /* Done */
7743                 return;
7744         }
7745
7746         /* One object */
7747         if (floor_num == 1)
7748         {
7749                 /* Hack -- query every object */
7750                 if (carry_query_flag)
7751                 {
7752                         char out_val[MAX_NLEN+20];
7753
7754                         /* Access the object */
7755                         o_ptr = &o_list[floor_o_idx];
7756
7757 #ifdef ALLOW_EASY_SENSE
7758
7759                         /* Option: Make object sensing easy */
7760                         if (easy_sense)
7761                         {
7762                                 /* Sense the object */
7763                                 (void) sense_object(o_ptr);
7764                         }
7765
7766 #endif /* ALLOW_EASY_SENSE */
7767
7768                         /* Describe the object */
7769                         object_desc(o_name, o_ptr, TRUE, 3);
7770
7771                         /* Build a prompt */
7772 #ifdef JP
7773                         (void) sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
7774 #else
7775                         (void) sprintf(out_val, "Pick up %s? ", o_name);
7776 #endif
7777
7778
7779                         /* Ask the user to confirm */
7780                         if (!get_check(out_val))
7781                         {
7782                                 /* Done */
7783                                 return;
7784                         }
7785                 }
7786
7787                 /* Access the object */
7788                 o_ptr = &o_list[floor_o_idx];
7789
7790 #ifdef ALLOW_EASY_SENSE
7791
7792                 /* Option: Make object sensing easy */
7793                 if (easy_sense)
7794                 {
7795                         /* Sense the object */
7796                         (void) sense_object(o_ptr);
7797                 }
7798
7799 #endif /* ALLOW_EASY_SENSE */
7800
7801                 /* Pick up the object */
7802                 py_pickup_aux(floor_o_idx);
7803         }
7804
7805         /* Allow the user to choose an object */
7806         else
7807         {
7808                 while (can_pickup--)
7809                 {
7810                         if (!py_pickup_floor_aux()) break;
7811                 }
7812         }
7813 }
7814
7815 #endif /* ALLOW_EASY_FLOOR */