OSDN Git Service

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