OSDN Git Service

[Refactor] #39970 Renamed core.c/h to system-variables.c/h
[hengband/hengband.git] / src / object1.c
1 /*!
2  * @file object1.c
3  * @brief オブジェクトの実装 / Object code, part 1
4  * @date 2014/01/10
5  * @author
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7  *\n
8  * This software may be copied and distributed for educational, research,\n
9  * and not for profit purposes provided that this copyright and statement\n
10  * are included in all such copies.  Other copyrights may also apply.\n
11  * 2014 Deskull rearranged comment for Doxygen.\n
12  */
13
14 #include "angband.h"
15 #include "core/system-variables.h"
16 #include "io/read-pref-file.h"
17 #include "util.h"
18
19 #include "artifact.h"
20 #include "floor.h"
21 #include "cmd-activate.h"
22 #include "object/object-kind.h"
23 #include "object-ego.h"
24 #include "object-flavor.h"
25 #include "object-hook.h"
26 #include "player-move.h"
27 #include "player-class.h"
28 #include "player-inventory.h"
29 #include "monster.h"
30 #include "files.h"
31 #include "gameterm.h"
32 #include "cmd-smith.h"
33 #include "snipe.h"
34 #include "view/display-main-window.h"
35
36 #if defined(MACH_O_CARBON)
37 #ifdef verify
38 #undef verify
39 #endif
40 #endif
41
42 /*!
43  * @brief オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists
44  * @return なし
45  * This involves resetting various things to their "default" state.\n
46  *\n
47  * If the "prefs" flag is TRUE, then we will also load the appropriate\n
48  * "user pref file" based on the current setting of the "use_graphics"\n
49  * flag.  This is useful for switching "graphics" on/off.\n
50  *\n
51  * The features, objects, and monsters, should all be encoded in the\n
52  * relevant "font.pref" and/or "graf.prf" files.  \n
53  *\n
54  * The "prefs" parameter is no longer meaningful.  \n
55  */
56 void reset_visuals(player_type *owner_ptr, void(*process_autopick_file_command)(char*))
57 {
58         for (int i = 0; i < max_f_idx; i++)
59         {
60                 feature_type *f_ptr = &f_info[i];
61                 for (int j = 0; j < F_LIT_MAX; j++)
62                 {
63                         f_ptr->x_attr[j] = f_ptr->d_attr[j];
64                         f_ptr->x_char[j] = f_ptr->d_char[j];
65                 }
66         }
67
68         for (int i = 0; i < max_k_idx; i++)
69         {
70                 object_kind *k_ptr = &k_info[i];
71                 k_ptr->x_attr = k_ptr->d_attr;
72                 k_ptr->x_char = k_ptr->d_char;
73         }
74
75         for (int i = 0; i < max_r_idx; i++)
76         {
77                 monster_race *r_ptr = &r_info[i];
78                 r_ptr->x_attr = r_ptr->d_attr;
79                 r_ptr->x_char = r_ptr->d_char;
80         }
81
82         char *pref_file = use_graphics ? "graf.prf" : "font.prf";
83         char *base_name = use_graphics ? "graf-%s.prf" : "font-%s.prf";
84         char buf[1024];
85         process_pref_file(owner_ptr, pref_file, process_autopick_file_command);
86         sprintf(buf, base_name, owner_ptr->base_name);
87         process_pref_file(owner_ptr, buf, process_autopick_file_command);
88 }
89
90
91 /*!
92  * @brief オブジェクトのフラグ類を配列に与える
93  * Obtain the "flags" for an item
94  * @param o_ptr フラグ取得元のオブジェクト構造体ポインタ
95  * @param flgs フラグ情報を受け取る配列
96  * @return なし
97  */
98 void object_flags(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
99 {
100         object_kind *k_ptr = &k_info[o_ptr->k_idx];
101
102         /* Base object */
103         for (int i = 0; i < TR_FLAG_SIZE; i++)
104         {
105                 flgs[i] = k_ptr->flags[i];
106         }
107
108         if (object_is_fixed_artifact(o_ptr))
109         {
110                 artifact_type *a_ptr = &a_info[o_ptr->name1];
111                 for (int i = 0; i < TR_FLAG_SIZE; i++)
112                 {
113                         flgs[i] = a_ptr->flags[i];
114                 }
115         }
116
117         if (object_is_ego(o_ptr))
118         {
119                 ego_item_type *e_ptr = &e_info[o_ptr->name2];
120                 for (int i = 0; i < TR_FLAG_SIZE; i++)
121                 {
122                         flgs[i] |= e_ptr->flags[i];
123                 }
124
125                 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
126                 {
127                         remove_flag(flgs, TR_SH_FIRE);
128                 }
129                 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
130                 {
131                         remove_flag(flgs, TR_INFRA);
132                 }
133                 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
134                 {
135                         remove_flag(flgs, TR_RES_BLIND);
136                         remove_flag(flgs, TR_SEE_INVIS);
137                 }
138         }
139
140         /* Random artifact ! */
141         for (int i = 0; i < TR_FLAG_SIZE; i++)
142         {
143                 flgs[i] |= o_ptr->art_flags[i];
144         }
145
146         if (object_is_smith(o_ptr))
147         {
148                 int add = o_ptr->xtra3 - 1;
149                 if (add < TR_FLAG_MAX)
150                 {
151                         add_flag(flgs, add);
152                 }
153                 else if (add == ESSENCE_TMP_RES_ACID)
154                 {
155                         add_flag(flgs, TR_RES_ACID);
156                         add_flag(flgs, TR_ACTIVATE);
157                 }
158                 else if (add == ESSENCE_TMP_RES_ELEC)
159                 {
160                         add_flag(flgs, TR_RES_ELEC);
161                         add_flag(flgs, TR_ACTIVATE);
162                 }
163                 else if (add == ESSENCE_TMP_RES_FIRE)
164                 {
165                         add_flag(flgs, TR_RES_FIRE);
166                         add_flag(flgs, TR_ACTIVATE);
167                 }
168                 else if (add == ESSENCE_TMP_RES_COLD)
169                 {
170                         add_flag(flgs, TR_RES_COLD);
171                         add_flag(flgs, TR_ACTIVATE);
172                 }
173                 else if (add == ESSENCE_SH_FIRE)
174                 {
175                         add_flag(flgs, TR_RES_FIRE);
176                         add_flag(flgs, TR_SH_FIRE);
177                 }
178                 else if (add == ESSENCE_SH_ELEC)
179                 {
180                         add_flag(flgs, TR_RES_ELEC);
181                         add_flag(flgs, TR_SH_ELEC);
182                 }
183                 else if (add == ESSENCE_SH_COLD)
184                 {
185                         add_flag(flgs, TR_RES_COLD);
186                         add_flag(flgs, TR_SH_COLD);
187                 }
188                 else if (add == ESSENCE_RESISTANCE)
189                 {
190                         add_flag(flgs, TR_RES_ACID);
191                         add_flag(flgs, TR_RES_ELEC);
192                         add_flag(flgs, TR_RES_FIRE);
193                         add_flag(flgs, TR_RES_COLD);
194                 }
195                 else if (add == TR_IMPACT)
196                 {
197                         add_flag(flgs, TR_ACTIVATE);
198                 }
199         }
200 }
201
202
203 /*!
204  * @brief オブジェクトの明示されているフラグ類を取得する
205  * Obtain the "flags" for an item which are known to the player
206  * @param o_ptr フラグ取得元のオブジェクト構造体ポインタ
207  * @param flgs フラグ情報を受け取る配列
208  * @return なし
209  */
210 void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
211 {
212         bool spoil = FALSE;
213         object_kind *k_ptr = &k_info[o_ptr->k_idx];
214         for (int i = 0; i < TR_FLAG_SIZE; i++)
215         {
216                 flgs[i] = 0;
217         }
218
219         if (!object_is_aware(o_ptr)) return;
220
221         /* Base object */
222         for (int i = 0; i < TR_FLAG_SIZE; i++)
223         {
224                 flgs[i] = k_ptr->flags[i];
225         }
226
227         if (!object_is_known(o_ptr)) return;
228
229         if (object_is_ego(o_ptr))
230         {
231                 ego_item_type *e_ptr = &e_info[o_ptr->name2];
232                 for (int i = 0; i < TR_FLAG_SIZE; i++)
233                 {
234                         flgs[i] |= e_ptr->flags[i];
235                 }
236
237                 if ((o_ptr->name2 == EGO_LITE_AURA_FIRE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
238                 {
239                         remove_flag(flgs, TR_SH_FIRE);
240                 }
241                 else if ((o_ptr->name2 == EGO_LITE_INFRA) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
242                 {
243                         remove_flag(flgs, TR_INFRA);
244                 }
245                 else if ((o_ptr->name2 == EGO_LITE_EYE) && !o_ptr->xtra4 && (o_ptr->sval <= SV_LITE_LANTERN))
246                 {
247                         remove_flag(flgs, TR_RES_BLIND);
248                         remove_flag(flgs, TR_SEE_INVIS);
249                 }
250         }
251
252         if (spoil || OBJECT_IS_FULL_KNOWN(o_ptr))
253         {
254                 if (object_is_fixed_artifact(o_ptr))
255                 {
256                         artifact_type *a_ptr = &a_info[o_ptr->name1];
257
258                         for (int i = 0; i < TR_FLAG_SIZE; i++)
259                         {
260                                 flgs[i] = a_ptr->flags[i];
261                         }
262                 }
263
264                 /* Random artifact ! */
265                 for (int i = 0; i < TR_FLAG_SIZE; i++)
266                 {
267                         flgs[i] |= o_ptr->art_flags[i];
268                 }
269         }
270
271         if (!object_is_smith(o_ptr)) return;
272
273         int add = o_ptr->xtra3 - 1;
274         if (add < TR_FLAG_MAX)
275         {
276                 add_flag(flgs, add);
277         }
278         else if (add == ESSENCE_TMP_RES_ACID)
279         {
280                 add_flag(flgs, TR_RES_ACID);
281         }
282         else if (add == ESSENCE_TMP_RES_ELEC)
283         {
284                 add_flag(flgs, TR_RES_ELEC);
285         }
286         else if (add == ESSENCE_TMP_RES_FIRE)
287         {
288                 add_flag(flgs, TR_RES_FIRE);
289         }
290         else if (add == ESSENCE_TMP_RES_COLD)
291         {
292                 add_flag(flgs, TR_RES_COLD);
293         }
294         else if (add == ESSENCE_SH_FIRE)
295         {
296                 add_flag(flgs, TR_RES_FIRE);
297                 add_flag(flgs, TR_SH_FIRE);
298         }
299         else if (add == ESSENCE_SH_ELEC)
300         {
301                 add_flag(flgs, TR_RES_ELEC);
302                 add_flag(flgs, TR_SH_ELEC);
303         }
304         else if (add == ESSENCE_SH_COLD)
305         {
306                 add_flag(flgs, TR_RES_COLD);
307                 add_flag(flgs, TR_SH_COLD);
308         }
309         else if (add == ESSENCE_RESISTANCE)
310         {
311                 add_flag(flgs, TR_RES_ACID);
312                 add_flag(flgs, TR_RES_ELEC);
313                 add_flag(flgs, TR_RES_FIRE);
314                 add_flag(flgs, TR_RES_COLD);
315         }
316 }
317
318
319 /*!
320  * @brief オブジェクトの発動効果名称を返す(サブルーチン/ブレス)
321  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
322  * @return concptr 発動名称を返す文字列ポインタ
323  */
324 static concptr item_activation_dragon_breath(object_type *o_ptr)
325 {
326         static char desc[256];
327         BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
328         int n = 0;
329
330         object_flags(o_ptr, flgs);
331         strcpy(desc, _("", "breath "));
332
333         for (int i = 0; dragonbreath_info[i].flag != 0; i++)
334         {
335                 if (have_flag(flgs, dragonbreath_info[i].flag))
336                 {
337                         if (n > 0) strcat(desc, _("、", ", "));
338
339                         strcat(desc, dragonbreath_info[i].name);
340                         n++;
341                 }
342         }
343
344         strcat(desc, _("のブレス(250)", ""));
345         return (desc);
346 }
347
348
349 /*!
350  * @brief オブジェクトの発動効果名称を返す(サブルーチン/汎用)
351  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
352  * @return concptr 発動名称を返す文字列ポインタ
353  */
354 static concptr item_activation_aux(object_type *o_ptr)
355 {
356         static char activation_detail[256];
357         char timeout[32];
358         const activation_type* const act_ptr = find_activation_info(o_ptr);
359
360         if (!act_ptr) return _("未定義", "something undefined");
361
362         concptr desc = act_ptr->desc;
363         switch (act_ptr->index) {
364         case ACT_BR_FIRE:
365                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
366                         desc = _("火炎のブレス (200) と火への耐性", "breath of fire (200) and resist fire");
367                 break;
368         case ACT_BR_COLD:
369                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
370                         desc = _("冷気のブレス (200) と冷気への耐性", "breath of cold (200) and resist cold");
371                 break;
372         case ACT_BR_DRAGON:
373                 desc = item_activation_dragon_breath(o_ptr);
374                 break;
375         case ACT_AGGRAVATE:
376                 if (o_ptr->name1 == ART_HYOUSIGI)
377                         desc = _("拍子木を打ちならす", "beat wooden clappers");
378                 break;
379         case ACT_RESIST_ACID:
380                 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID)) || (o_ptr->name2 == EGO_BRAND_ACID))
381                         desc = _("アシッド・ボール (100) と酸への耐性", "ball of acid (100) and resist acid");
382                 break;
383         case ACT_RESIST_FIRE:
384                 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) || (o_ptr->name2 == EGO_BRAND_FIRE))
385                         desc = _("ファイア・ボール (100) と火への耐性", "ball of fire (100) and resist fire");
386                 break;
387         case ACT_RESIST_COLD:
388                 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) || (o_ptr->name2 == EGO_BRAND_COLD))
389                         desc = _("アイス・ボール (100) と冷気への耐性", "ball of cold (100) and resist cold");
390                 break;
391         case ACT_RESIST_ELEC:
392                 if (((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC)) || (o_ptr->name2 == EGO_BRAND_ELEC))
393                         desc = _("サンダー・ボール (100) と電撃への耐性", "ball of elec (100) and resist elec");
394                 break;
395         case ACT_RESIST_POIS:
396                 if (o_ptr->name2 == EGO_BRAND_POIS)
397                         desc = _("悪臭雲 (100) と毒への耐性", "ball of poison (100) and resist elec");
398                 break;
399         }
400
401         /* Timeout description */
402         int constant = act_ptr->timeout.constant;
403         int dice = act_ptr->timeout.dice;
404         if (constant == 0 && dice == 0) {
405                 /* We can activate it every turn */
406                 strcpy(timeout, _("いつでも", "every turn"));
407         } else if (constant < 0) {
408                 /* Activations that have special timeout */
409                 switch (act_ptr->index) {
410                 case ACT_BR_FIRE:
411                         sprintf(timeout, _("%d ターン毎", "every %d turns"),
412                                 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250);
413                         break;
414                 case ACT_BR_COLD:
415                         sprintf(timeout, _("%d ターン毎", "every %d turns"),
416                                 ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250);
417                         break;
418                 case ACT_TERROR:
419                         strcpy(timeout, _("3*(レベル+10) ターン毎", "every 3 * (level+10) turns"));
420                         break;
421                 case ACT_MURAMASA:
422                         strcpy(timeout, _("確率50%で壊れる", "(destroyed 50%)"));
423                         break;
424                 default:
425                         strcpy(timeout, "undefined");
426                         break;
427                 }
428         } else {
429                 char constant_str[16], dice_str[16];
430                 sprintf(constant_str, "%d", constant);
431                 sprintf(dice_str, "d%d", dice);
432                 sprintf(timeout, _("%s%s%s ターン毎", "every %s%s%s turns"),
433                         (constant > 0) ? constant_str : "",
434                         (constant > 0 && dice > 0) ? "+" : "",
435                         (dice > 0) ? dice_str : "");
436         }
437
438         sprintf(activation_detail, _("%s : %s", "%s %s"), desc, timeout);
439         return activation_detail;
440 }
441
442
443 /*!
444  * @brief オブジェクトの発動効果名称を返す(メインルーチン) /
445  * Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation"
446  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
447  * @return concptr 発動名称を返す文字列ポインタ
448  */
449 concptr item_activation(object_type *o_ptr)
450 {
451         BIT_FLAGS flgs[TR_FLAG_SIZE];
452         object_flags(o_ptr, flgs);
453         if (!(have_flag(flgs, TR_ACTIVATE))) return (_("なし", "nothing"));
454
455         if (activation_index(o_ptr))
456         {
457                 return item_activation_aux(o_ptr);
458         }
459
460         if (o_ptr->tval == TV_WHISTLE)
461         {
462                 return _("ペット呼び寄せ : 100+d100ターン毎", "call pet every 100+d100 turns");
463         }
464
465         if (o_ptr->tval == TV_CAPTURE)
466         {
467                 return _("モンスターを捕える、又は解放する。", "captures or releases a monster.");
468         }
469
470         return _("何も起きない", "Nothing");
471 }
472
473
474 /*!
475  * @brief オブジェクトの*鑑定*内容を詳述して表示する /
476  * Describe a "fully identified" item
477  * @param player_ptr プレーヤーへの参照ポインタ
478  * @param o_ptr *鑑定*情報を取得する元のオブジェクト構造体参照ポインタ
479  * @param mode 表示オプション
480  * @return 特筆すべき情報が一つでもあった場合TRUE、一つもなく表示がキャンセルされた場合FALSEを返す。
481  */
482 bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode)
483 {
484         BIT_FLAGS flgs[TR_FLAG_SIZE];
485         char temp[70 * 20];
486         concptr info[128];
487         GAME_TEXT o_name[MAX_NLEN];
488         char desc[256];
489
490         int trivial_info = 0;
491         object_flags(o_ptr, flgs);
492
493         roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
494                 (k_text + k_info[o_ptr->k_idx].text),
495                 77 - 15, temp, sizeof(temp));
496
497         int i = 0;
498         for (int j = 0; temp[j]; j += 1 + strlen(&temp[j]))
499         {
500                 info[i] = &temp[j];
501                 i++;
502         }
503
504         if (object_is_equipment(o_ptr))
505         {
506                 trivial_info = i;
507         }
508
509         if (have_flag(flgs, TR_ACTIVATE))
510         {
511                 info[i++] = _("始動したときの効果...", "It can be activated for...");
512                 info[i++] = item_activation(o_ptr);
513                 info[i++] = _("...ただし装備していなければならない。", "...if it is being worn.");
514         }
515
516         if (o_ptr->tval == TV_FIGURINE)
517         {
518                 info[i++] = _("それは投げた時ペットに変化する。", "It will transform into a pet when thrown.");
519         }
520
521         if (o_ptr->name1 == ART_STONEMASK)
522         {
523                 info[i++] = _("それを装備した者は吸血鬼になる。", "It makes you turn into a vampire permanently.");
524         }
525
526         if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE))
527         {
528                 info[i++] = _("それは相手を一撃で倒すことがある。", "It will attempt to kill a monster instantly.");
529         }
530
531         if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE))
532         {
533                 info[i++] = _("それは自分自身に攻撃が返ってくることがある。", "It causes you to strike yourself sometimes.");
534                 info[i++] = _("それは無敵のバリアを切り裂く。", "It always penetrates invulnerability barriers.");
535         }
536
537         if (o_ptr->name2 == EGO_2WEAPON)
538         {
539                 info[i++] = _("それは二刀流での命中率を向上させる。", "It affects your ability to hit when you are wielding two weapons.");
540         }
541
542         if (have_flag(flgs, TR_EASY_SPELL))
543         {
544                 info[i++] = _("それは魔法の難易度を下げる。", "It affects your ability to cast spells.");
545         }
546
547         if (o_ptr->name2 == EGO_AMU_FOOL)
548         {
549                 info[i++] = _("それは魔法の難易度を上げる。", "It interferes with casting spells.");
550         }
551
552         if (o_ptr->name2 == EGO_RING_THROW)
553         {
554                 info[i++] = _("それは物を強く投げることを可能にする。", "It provides great strength when you throw an item.");
555         }
556
557         if (o_ptr->name2 == EGO_AMU_NAIVETY)
558         {
559                 info[i++] = _("それは魔法抵抗力を下げる。", "It decreases your magic resistance.");
560         }
561
562         if (o_ptr->tval == TV_STATUE)
563         {
564                 monster_race *r_ptr = &r_info[o_ptr->pval];
565                 if (o_ptr->pval == MON_BULLGATES)
566                         info[i++] = _("それは部屋に飾ると恥ずかしい。", "It is shameful.");
567                 else if ( r_ptr->flags2 & (RF2_ELDRITCH_HORROR))
568                         info[i++] = _("それは部屋に飾ると恐い。", "It is fearful.");
569                 else
570                         info[i++] = _("それは部屋に飾ると楽しい。", "It is cheerful.");
571         }
572         
573         if (o_ptr->name2 == EGO_LITE_DARKNESS) info[i++] = _("それは全く光らない。", "It provides no light.");
574         
575         POSITION rad = 0;
576         if (have_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 1;
577         if (have_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 2;
578         if (have_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS)  rad += 3;
579         if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
580         if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
581         if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
582         
583         if(o_ptr->name2 == EGO_LITE_SHINE) rad++;
584                 
585         if (have_flag(flgs, TR_LITE_FUEL) && o_ptr->name2 != EGO_LITE_DARKNESS)
586         {
587                 if(rad > 0) sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), (int)rad);   
588         }
589         else
590         {
591                 if(rad > 0) sprintf(desc, _("それは永遠なる明かり(半径 %d)を授ける。", "It provides light (radius %d) forever."), (int)rad);
592                 if(rad < 0) sprintf(desc, _("それは明かりの半径を狭める(半径に-%d)。", "It decreases radius of light source by %d."), (int)-rad);
593         }
594         
595         if(rad != 0) info[i++] = desc;
596                 
597         if (o_ptr->name2 == EGO_LITE_LONG)
598         {
599                 info[i++] = _("それは長いターン明かりを授ける。", "It provides light for much longer time.");
600         }
601
602         if (have_flag(flgs, TR_RIDING))
603         {
604                 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
605                         info[i++] = _("それは乗馬中は非常に使いやすい。", "It is made for use while riding.");
606                 else
607                 {
608                         info[i++] = _("それは乗馬中でも使いやすい。", "It is suitable for use while riding.");
609                         trivial_info++;
610                 }
611         }
612
613         if (have_flag(flgs, TR_STR))
614         {
615                 info[i++] = _("それは腕力に影響を及ぼす。", "It affects your strength.");
616         }
617
618         if (have_flag(flgs, TR_INT))
619         {
620                 info[i++] = _("それは知能に影響を及ぼす。", "It affects your intelligence.");
621         }
622
623         if (have_flag(flgs, TR_WIS))
624         {
625                 info[i++] = _("それは賢さに影響を及ぼす。", "It affects your wisdom.");
626         }
627
628         if (have_flag(flgs, TR_DEX))
629         {
630                 info[i++] = _("それは器用さに影響を及ぼす。", "It affects your dexterity.");
631         }
632
633         if (have_flag(flgs, TR_CON))
634         {
635                 info[i++] = _("それは耐久力に影響を及ぼす。", "It affects your constitution.");
636         }
637
638         if (have_flag(flgs, TR_CHR))
639         {
640                 info[i++] = _("それは魅力に影響を及ぼす。", "It affects your charisma.");
641         }
642
643         if (have_flag(flgs, TR_MAGIC_MASTERY))
644         {
645                 info[i++] = _("それは魔法道具使用能力に影響を及ぼす。", "It affects your ability to use magic devices.");
646         }
647
648         if (have_flag(flgs, TR_STEALTH))
649         {
650                 info[i++] = _("それは隠密行動能力に影響を及ぼす。", "It affects your stealth.");
651         }
652
653         if (have_flag(flgs, TR_SEARCH))
654         {
655                 info[i++] = _("それは探索能力に影響を及ぼす。", "It affects your searching.");
656         }
657
658         if (have_flag(flgs, TR_INFRA))
659         {
660                 info[i++] = _("それは赤外線視力に影響を及ぼす。", "It affects your infravision.");
661         }
662
663         if (have_flag(flgs, TR_TUNNEL))
664         {
665                 info[i++] = _("それは採掘能力に影響を及ぼす。", "It affects your ability to tunnel.");
666         }
667
668         if (have_flag(flgs, TR_SPEED))
669         {
670                 info[i++] = _("それはスピードに影響を及ぼす。", "It affects your speed.");
671         }
672
673         if (have_flag(flgs, TR_BLOWS))
674         {
675                 info[i++] = _("それは打撃回数に影響を及ぼす。", "It affects your attack speed.");
676         }
677
678         if (have_flag(flgs, TR_BRAND_ACID))
679         {
680                 info[i++] = _("それは酸によって大きなダメージを与える。", "It does extra damage from acid.");
681         }
682
683         if (have_flag(flgs, TR_BRAND_ELEC))
684         {
685                 info[i++] = _("それは電撃によって大きなダメージを与える。", "It does extra damage from electricity.");
686         }
687
688         if (have_flag(flgs, TR_BRAND_FIRE))
689         {
690                 info[i++] = _("それは火炎によって大きなダメージを与える。", "It does extra damage from fire.");
691         }
692
693         if (have_flag(flgs, TR_BRAND_COLD))
694         {
695                 info[i++] = _("それは冷気によって大きなダメージを与える。", "It does extra damage from frost.");
696         }
697
698         if (have_flag(flgs, TR_BRAND_POIS))
699         {
700                 info[i++] = _("それは敵を毒する。", "It poisons your foes.");
701         }
702
703         if (have_flag(flgs, TR_CHAOTIC))
704         {
705                 info[i++] = _("それはカオス的な効果を及ぼす。", "It produces chaotic effects.");
706         }
707
708         if (have_flag(flgs, TR_VAMPIRIC))
709         {
710                 info[i++] = _("それは敵から生命力を吸収する。", "It drains life from your foes.");
711         }
712
713         if (have_flag(flgs, TR_IMPACT))
714         {
715                 info[i++] = _("それは地震を起こすことができる。", "It can cause earthquakes.");
716         }
717
718         if (have_flag(flgs, TR_VORPAL))
719         {
720                 info[i++] = _("それは非常に切れ味が鋭く敵を切断することができる。", "It is very sharp and can cut your foes.");
721         }
722
723         if (have_flag(flgs, TR_KILL_DRAGON))
724         {
725                 info[i++] = _("それはドラゴンにとっての天敵である。", "It is a great bane of dragons.");
726         }
727         else if (have_flag(flgs, TR_SLAY_DRAGON))
728         {
729                 info[i++] = _("それはドラゴンに対して特に恐るべき力を発揮する。", "It is especially deadly against dragons.");
730         }
731
732         if (have_flag(flgs, TR_KILL_ORC))
733         {
734                 info[i++] = _("それはオークにとっての天敵である。", "It is a great bane of orcs.");
735         }
736
737         if (have_flag(flgs, TR_SLAY_ORC))
738         {
739                 info[i++] = _("それはオークに対して特に恐るべき力を発揮する。", "It is especially deadly against orcs.");
740         }
741
742         if (have_flag(flgs, TR_KILL_TROLL))
743         {
744                 info[i++] = _("それはトロルにとっての天敵である。", "It is a great bane of trolls.");
745         }
746
747         if (have_flag(flgs, TR_SLAY_TROLL))
748         {
749                 info[i++] = _("それはトロルに対して特に恐るべき力を発揮する。", "It is especially deadly against trolls.");
750         }
751
752         if (have_flag(flgs, TR_KILL_GIANT))
753         {
754                 info[i++] = _("それは巨人にとっての天敵である。", "It is a great bane of giants.");
755         }
756         else if (have_flag(flgs, TR_SLAY_GIANT))
757         {
758                 info[i++] = _("それは巨人に対して特に恐るべき力を発揮する。", "It is especially deadly against giants.");
759         }
760
761         if (have_flag(flgs, TR_KILL_DEMON))
762         {
763                 info[i++] = _("それはデーモンにとっての天敵である。", "It is a great bane of demons.");
764         }
765
766         if (have_flag(flgs, TR_SLAY_DEMON))
767         {
768                 info[i++] = _("それはデーモンに対して聖なる力を発揮する。", "It strikes at demons with holy wrath.");
769         }
770
771         if (have_flag(flgs, TR_KILL_UNDEAD))
772         {
773                 info[i++] = _("それはアンデッドにとっての天敵である。", "It is a great bane of undead.");
774         }
775
776         if (have_flag(flgs, TR_SLAY_UNDEAD))
777         {
778                 info[i++] = _("それはアンデッドに対して聖なる力を発揮する。", "It strikes at undead with holy wrath.");
779         }
780
781         if (have_flag(flgs, TR_KILL_EVIL))
782         {
783                 info[i++] = _("それは邪悪なる存在にとっての天敵である。", "It is a great bane of evil monsters.");
784         }
785
786         if (have_flag(flgs, TR_SLAY_EVIL))
787         {
788                 info[i++] = _("それは邪悪なる存在に対して聖なる力で攻撃する。", "It fights against evil with holy fury.");
789         }
790
791         if (have_flag(flgs, TR_KILL_ANIMAL))
792         {
793                 info[i++] = _("それは自然界の動物にとっての天敵である。", "It is a great bane of natural creatures.");
794         }
795
796         if (have_flag(flgs, TR_SLAY_ANIMAL))
797         {
798                 info[i++] = _("それは自然界の動物に対して特に恐るべき力を発揮する。", "It is especially deadly against natural creatures.");
799         }
800
801         if (have_flag(flgs, TR_KILL_HUMAN))
802         {
803                 info[i++] = _("それは人間にとっての天敵である。", "It is a great bane of humans.");
804         }
805
806         if (have_flag(flgs, TR_SLAY_HUMAN))
807         {
808                 info[i++] = _("それは人間に対して特に恐るべき力を発揮する。", "It is especially deadly against humans.");
809         }
810
811         if (have_flag(flgs, TR_FORCE_WEAPON))
812         {
813                 info[i++] = _("それは使用者の魔力を使って攻撃する。", "It powerfully strikes at a monster using your mana.");
814         }
815
816         if (have_flag(flgs, TR_DEC_MANA))
817         {
818                 info[i++] = _("それは魔力の消費を押さえる。", "It decreases your mana consumption.");
819         }
820
821         if (have_flag(flgs, TR_SUST_STR))
822         {
823                 info[i++] = _("それはあなたの腕力を維持する。", "It sustains your strength.");
824         }
825
826         if (have_flag(flgs, TR_SUST_INT))
827         {
828                 info[i++] = _("それはあなたの知能を維持する。", "It sustains your intelligence.");
829         }
830
831         if (have_flag(flgs, TR_SUST_WIS))
832         {
833                 info[i++] = _("それはあなたの賢さを維持する。", "It sustains your wisdom.");
834         }
835
836         if (have_flag(flgs, TR_SUST_DEX))
837         {
838                 info[i++] = _("それはあなたの器用さを維持する。", "It sustains your dexterity.");
839         }
840
841         if (have_flag(flgs, TR_SUST_CON))
842         {
843                 info[i++] = _("それはあなたの耐久力を維持する。", "It sustains your constitution.");
844         }
845
846         if (have_flag(flgs, TR_SUST_CHR))
847         {
848                 info[i++] = _("それはあなたの魅力を維持する。", "It sustains your charisma.");
849         }
850
851         if (have_flag(flgs, TR_IM_ACID))
852         {
853                 info[i++] = _("それは酸に対する完全な免疫を授ける。", "It provides immunity to acid.");
854         }
855
856         if (have_flag(flgs, TR_IM_ELEC))
857         {
858                 info[i++] = _("それは電撃に対する完全な免疫を授ける。", "It provides immunity to electricity.");
859         }
860
861         if (have_flag(flgs, TR_IM_FIRE))
862         {
863                 info[i++] = _("それは火に対する完全な免疫を授ける。", "It provides immunity to fire.");
864         }
865
866         if (have_flag(flgs, TR_IM_COLD))
867         {
868                 info[i++] = _("それは寒さに対する完全な免疫を授ける。", "It provides immunity to cold.");
869         }
870
871         if (have_flag(flgs, TR_THROW))
872         {
873                 info[i++] = _("それは敵に投げて大きなダメージを与えることができる。", "It is perfectly balanced for throwing.");
874         }
875
876         if (have_flag(flgs, TR_FREE_ACT))
877         {
878                 info[i++] = _("それは麻痺に対する完全な免疫を授ける。", "It provides immunity to paralysis.");
879         }
880
881         if (have_flag(flgs, TR_HOLD_EXP))
882         {
883                 info[i++] = _("それは経験値吸収に対する耐性を授ける。", "It provides resistance to experience draining.");
884         }
885
886         if (have_flag(flgs, TR_RES_FEAR))
887         {
888                 info[i++] = _("それは恐怖への完全な耐性を授ける。", "It makes you completely fearless.");
889         }
890
891         if (have_flag(flgs, TR_RES_ACID))
892         {
893                 info[i++] = _("それは酸への耐性を授ける。", "It provides resistance to acid.");
894         }
895
896         if (have_flag(flgs, TR_RES_ELEC))
897         {
898                 info[i++] = _("それは電撃への耐性を授ける。", "It provides resistance to electricity.");
899         }
900
901         if (have_flag(flgs, TR_RES_FIRE))
902         {
903                 info[i++] = _("それは火への耐性を授ける。", "It provides resistance to fire.");
904         }
905
906         if (have_flag(flgs, TR_RES_COLD))
907         {
908                 info[i++] = _("それは寒さへの耐性を授ける。", "It provides resistance to cold.");
909         }
910
911         if (have_flag(flgs, TR_RES_POIS))
912         {
913                 info[i++] = _("それは毒への耐性を授ける。", "It provides resistance to poison.");
914         }
915
916         if (have_flag(flgs, TR_RES_LITE))
917         {
918                 info[i++] = _("それは閃光への耐性を授ける。", "It provides resistance to light.");
919         }
920
921         if (have_flag(flgs, TR_RES_DARK))
922         {
923                 info[i++] = _("それは暗黒への耐性を授ける。", "It provides resistance to dark.");
924         }
925
926         if (have_flag(flgs, TR_RES_BLIND))
927         {
928                 info[i++] = _("それは盲目への耐性を授ける。", "It provides resistance to blindness.");
929         }
930
931         if (have_flag(flgs, TR_RES_CONF))
932         {
933                 info[i++] = _("それは混乱への耐性を授ける。", "It provides resistance to confusion.");
934         }
935
936         if (have_flag(flgs, TR_RES_SOUND))
937         {
938                 info[i++] = _("それは轟音への耐性を授ける。", "It provides resistance to sound.");
939         }
940
941         if (have_flag(flgs, TR_RES_SHARDS))
942         {
943                 info[i++] = _("それは破片への耐性を授ける。", "It provides resistance to shards.");
944         }
945
946         if (have_flag(flgs, TR_RES_NETHER))
947         {
948                 info[i++] = _("それは地獄への耐性を授ける。", "It provides resistance to nether.");
949         }
950
951         if (have_flag(flgs, TR_RES_NEXUS))
952         {
953                 info[i++] = _("それは因果混乱への耐性を授ける。", "It provides resistance to nexus.");
954         }
955
956         if (have_flag(flgs, TR_RES_CHAOS))
957         {
958                 info[i++] = _("それはカオスへの耐性を授ける。", "It provides resistance to chaos.");
959         }
960
961         if (have_flag(flgs, TR_RES_DISEN))
962         {
963                 info[i++] = _("それは劣化への耐性を授ける。", "It provides resistance to disenchantment.");
964         }
965
966         if (have_flag(flgs, TR_LEVITATION))
967         {
968                 info[i++] = _("それは宙に浮くことを可能にする。", "It allows you to levitate.");
969         }
970                 
971         if (have_flag(flgs, TR_SEE_INVIS))
972         {
973                 info[i++] = _("それは透明なモンスターを見ることを可能にする。", "It allows you to see invisible monsters.");
974         }
975
976         if (have_flag(flgs, TR_TELEPATHY))
977         {
978                 info[i++] = _("それはテレパシー能力を授ける。", "It gives telepathic powers.");
979         }
980
981         if (have_flag(flgs, TR_ESP_ANIMAL))
982         {
983                 info[i++] = _("それは自然界の生物を感知する。", "It senses natural creatures.");
984         }
985
986         if (have_flag(flgs, TR_ESP_UNDEAD))
987         {
988                 info[i++] = _("それはアンデッドを感知する。", "It senses undead.");
989         }
990
991         if (have_flag(flgs, TR_ESP_DEMON))
992         {
993                 info[i++] = _("それは悪魔を感知する。", "It senses demons.");
994         }
995
996         if (have_flag(flgs, TR_ESP_ORC))
997         {
998                 info[i++] = _("それはオークを感知する。", "It senses orcs.");
999         }
1000
1001         if (have_flag(flgs, TR_ESP_TROLL))
1002         {
1003                 info[i++] = _("それはトロルを感知する。", "It senses trolls.");
1004         }
1005
1006         if (have_flag(flgs, TR_ESP_GIANT))
1007         {
1008                 info[i++] = _("それは巨人を感知する。", "It senses giants.");
1009         }
1010
1011         if (have_flag(flgs, TR_ESP_DRAGON))
1012         {
1013                 info[i++] = _("それはドラゴンを感知する。", "It senses dragons.");
1014         }
1015
1016         if (have_flag(flgs, TR_ESP_HUMAN))
1017         {
1018                 info[i++] = _("それは人間を感知する。", "It senses humans.");
1019         }
1020
1021         if (have_flag(flgs, TR_ESP_EVIL))
1022         {
1023                 info[i++] = _("それは邪悪な存在を感知する。", "It senses evil creatures.");
1024         }
1025
1026         if (have_flag(flgs, TR_ESP_GOOD))
1027         {
1028                 info[i++] = _("それは善良な存在を感知する。", "It senses good creatures.");
1029         }
1030
1031         if (have_flag(flgs, TR_ESP_NONLIVING))
1032         {
1033                 info[i++] = _("それは活動する無生物体を感知する。", "It senses non-living creatures.");
1034         }
1035
1036         if (have_flag(flgs, TR_ESP_UNIQUE))
1037         {
1038                 info[i++] = _("それは特別な強敵を感知する。", "It senses unique monsters.");
1039         }
1040
1041         if (have_flag(flgs, TR_SLOW_DIGEST))
1042         {
1043                 info[i++] = _("それはあなたの新陳代謝を遅くする。", "It slows your metabolism.");
1044         }
1045
1046         if (have_flag(flgs, TR_REGEN))
1047         {
1048                 info[i++] = _("それは体力回復力を強化する。", "It speeds your regenerative powers.");
1049         }
1050
1051         if (have_flag(flgs, TR_WARNING))
1052         {
1053                 info[i++] = _("それは危険に対して警告を発する。", "It warns you of danger");
1054         }
1055
1056         if (have_flag(flgs, TR_REFLECT))
1057         {
1058                 info[i++] = _("それは矢の呪文を反射する。", "It reflects bolt spells.");
1059         }
1060
1061         if (have_flag(flgs, TR_SH_FIRE))
1062         {
1063                 info[i++] = _("それは炎のバリアを張る。", "It produces a fiery sheath.");
1064         }
1065
1066         if (have_flag(flgs, TR_SH_ELEC))
1067         {
1068                 info[i++] = _("それは電気のバリアを張る。", "It produces an electric sheath.");
1069         }
1070
1071         if (have_flag(flgs, TR_SH_COLD))
1072         {
1073                 info[i++] = _("それは冷気のバリアを張る。", "It produces a sheath of coldness.");
1074         }
1075
1076         if (have_flag(flgs, TR_NO_MAGIC))
1077         {
1078                 info[i++] = _("それは反魔法バリアを張る。", "It produces an anti-magic shell.");
1079         }
1080
1081         if (have_flag(flgs, TR_NO_TELE))
1082         {
1083                 info[i++] = _("それはテレポートを邪魔する。", "It prevents teleportation.");
1084         }
1085
1086         if (have_flag(flgs, TR_XTRA_MIGHT))
1087         {
1088                 info[i++] = _("それは矢/ボルト/弾をより強力に発射することができる。", "It fires missiles with extra might.");
1089         }
1090
1091         if (have_flag(flgs, TR_XTRA_SHOTS))
1092         {
1093                 info[i++] = _("それは矢/ボルト/弾を非常に早く発射することができる。", "It fires missiles excessively fast.");
1094         }
1095
1096         if (have_flag(flgs, TR_BLESSED))
1097         {
1098                 info[i++] = _("それは神に祝福されている。", "It has been blessed by the gods.");
1099         }
1100
1101         if (object_is_cursed(o_ptr))
1102         {
1103                 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
1104                 {
1105                         info[i++] = _("それは永遠の呪いがかけられている。", "It is permanently cursed.");
1106                 }
1107                 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
1108                 {
1109                         info[i++] = _("それは強力な呪いがかけられている。", "It is heavily cursed.");
1110                 }
1111                 else
1112                 {
1113                         info[i++] = _("それは呪われている。", "It is cursed.");
1114
1115                         /*
1116                          * It's a trivial infomation since there is
1117                          * fake inscription {cursed}
1118                          */
1119                         trivial_info++;
1120                 }
1121         }
1122
1123         if ((have_flag(flgs, TR_TY_CURSE)) || (o_ptr->curse_flags & TRC_TY_CURSE))
1124         {
1125                 info[i++] = _("それは太古の禍々しい怨念が宿っている。", "It carries an ancient foul curse.");
1126         }
1127
1128         if ((have_flag(flgs, TR_AGGRAVATE)) || (o_ptr->curse_flags & TRC_AGGRAVATE))
1129         {
1130                 info[i++] = _("それは付近のモンスターを怒らせる。", "It aggravates nearby creatures.");
1131         }
1132
1133         if ((have_flag(flgs, TR_DRAIN_EXP)) || (o_ptr->curse_flags & TRC_DRAIN_EXP))
1134         {
1135                 info[i++] = _("それは経験値を吸い取る。", "It drains experience.");
1136         }
1137
1138         if (o_ptr->curse_flags & TRC_SLOW_REGEN)
1139         {
1140                 info[i++] = _("それは回復力を弱める。", "It slows your regenerative powers.");
1141         }
1142
1143         if ((o_ptr->curse_flags & TRC_ADD_L_CURSE) || have_flag(flgs, TR_ADD_L_CURSE))
1144         {
1145                 info[i++] = _("それは弱い呪いを増やす。","It adds weak curses.");
1146         }
1147
1148         if ((o_ptr->curse_flags & TRC_ADD_H_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
1149         {
1150                 info[i++] = _("それは強力な呪いを増やす。","It adds heavy curses.");
1151         }
1152
1153         if ((have_flag(flgs, TR_CALL_ANIMAL)) || (o_ptr->curse_flags & TRC_CALL_ANIMAL))
1154         {
1155                 info[i++] = _("それは動物を呼び寄せる。", "It attracts animals.");
1156         }
1157
1158         if ((have_flag(flgs, TR_CALL_DEMON)) || (o_ptr->curse_flags & TRC_CALL_DEMON))
1159         {
1160                 info[i++] = _("それは悪魔を呼び寄せる。", "It attracts demons.");
1161         }
1162
1163         if ((have_flag(flgs, TR_CALL_DRAGON)) || (o_ptr->curse_flags & TRC_CALL_DRAGON))
1164         {
1165                 info[i++] = _("それはドラゴンを呼び寄せる。", "It attracts dragons.");
1166         }
1167
1168         if ((have_flag(flgs, TR_CALL_UNDEAD)) || (o_ptr->curse_flags & TRC_CALL_UNDEAD))
1169         {
1170                 info[i++] = _("それは死霊を呼び寄せる。", "It attracts undeads.");
1171         }
1172
1173         if ((have_flag(flgs, TR_COWARDICE)) ||  (o_ptr->curse_flags & TRC_COWARDICE))
1174         {
1175                 info[i++] = _("それは恐怖感を引き起こす。", "It makes you subject to cowardice.");
1176         }
1177
1178         if ((have_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT))
1179         {
1180                 info[i++] = _("それはランダムなテレポートを引き起こす。", "It induces random teleportation.");
1181         }
1182
1183         if ((have_flag(flgs, TR_LOW_MELEE)) || o_ptr->curse_flags & TRC_LOW_MELEE)
1184         {
1185                 info[i++] = _("それは攻撃を外しやすい。", "It causes you to miss blows.");
1186         }
1187
1188         if ((have_flag(flgs, TR_LOW_AC)) || (o_ptr->curse_flags & TRC_LOW_AC))
1189         {
1190                 info[i++] = _("それは攻撃を受けやすい。", "It helps your enemies' blows.");
1191         }
1192
1193         if ((have_flag(flgs, TR_LOW_MAGIC)) || (o_ptr->curse_flags & TRC_LOW_MAGIC))
1194         {
1195                 info[i++] = _("それは魔法を唱えにくくする。", "It encumbers you while spellcasting.");
1196         }
1197
1198         if ((have_flag(flgs, TR_FAST_DIGEST)) || (o_ptr->curse_flags & TRC_FAST_DIGEST))
1199         {
1200                 info[i++] = _("それはあなたの新陳代謝を速くする。", "It speeds your metabolism.");
1201         }
1202
1203         if ((have_flag(flgs, TR_DRAIN_HP)) || (o_ptr->curse_flags & TRC_DRAIN_HP))
1204         {
1205                 info[i++] = _("それはあなたの体力を吸い取る。", "It drains you.");
1206         }
1207
1208         if ((have_flag(flgs, TR_DRAIN_MANA)) || (o_ptr->curse_flags & TRC_DRAIN_MANA))
1209         {
1210                 info[i++] = _("それはあなたの魔力を吸い取る。", "It drains your mana.");
1211         }
1212
1213         if (mode & SCROBJ_FAKE_OBJECT)
1214         {
1215                 switch (o_ptr->tval)
1216                 {
1217                 case TV_RING:
1218                         switch (o_ptr->sval)
1219                         {
1220                         case SV_RING_LORDLY:
1221                                 info[i++] = _("それは幾つかのランダムな耐性を授ける。", "It provides some random resistances.");
1222                                 break;
1223                         case SV_RING_WARNING:
1224                                 info[i++] = _("それはひとつの低級なESPを授ける事がある。", "It may provide a low rank ESP.");
1225                                 break;
1226                         }
1227
1228                         break;
1229
1230                 case TV_AMULET:
1231                         switch (o_ptr->sval)
1232                         {
1233                         case SV_AMULET_RESISTANCE:
1234                                 info[i++] = _("それは毒への耐性を授ける事がある。", "It may provides resistance to poison.");
1235                                 info[i++] = _("それはランダムな耐性を授ける事がある。", "It may provide a random resistances.");
1236                                 break;
1237                         case SV_AMULET_THE_MAGI:
1238                                 info[i++] = _("それは最大で3つまでの低級なESPを授ける。", "It provides up to three low rank ESPs.");
1239                                 break;
1240                         }
1241
1242                         break;
1243                 }
1244         }
1245
1246         if (have_flag(flgs, TR_IGNORE_ACID) &&
1247             have_flag(flgs, TR_IGNORE_ELEC) &&
1248             have_flag(flgs, TR_IGNORE_FIRE) &&
1249             have_flag(flgs, TR_IGNORE_COLD))
1250         {
1251                 info[i++] = _("それは酸・電撃・火炎・冷気では傷つかない。", "It cannot be harmed by the elements.");
1252         }
1253         else
1254         {
1255                 if (have_flag(flgs, TR_IGNORE_ACID))
1256                 {
1257                         info[i++] = _("それは酸では傷つかない。", "It cannot be harmed by acid.");
1258                 }
1259
1260                 if (have_flag(flgs, TR_IGNORE_ELEC))
1261                 {
1262                         info[i++] = _("それは電撃では傷つかない。", "It cannot be harmed by electricity.");
1263                 }
1264
1265                 if (have_flag(flgs, TR_IGNORE_FIRE))
1266                 {
1267                         info[i++] = _("それは火炎では傷つかない。", "It cannot be harmed by fire.");
1268                 }
1269
1270                 if (have_flag(flgs, TR_IGNORE_COLD))
1271                 {
1272                         info[i++] = _("それは冷気では傷つかない。", "It cannot be harmed by cold.");
1273                 }
1274         }
1275
1276         if (mode & SCROBJ_FORCE_DETAIL) trivial_info = 0;
1277
1278         if (i <= trivial_info) return FALSE;
1279
1280         screen_save();
1281         int wid, hgt;
1282         Term_get_size(&wid, &hgt);
1283
1284         if (!(mode & SCROBJ_FAKE_OBJECT))
1285                 object_desc(player_ptr, o_name, o_ptr, 0);
1286         else
1287                 object_desc(player_ptr, o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
1288
1289         prt(o_name, 0, 0);
1290         for (int k = 1; k < hgt; k++)
1291         {
1292                 prt("", k, 13);
1293         }
1294
1295         if ((o_ptr->tval == TV_STATUE) && (o_ptr->sval == SV_PHOTO))
1296         {
1297                 monster_race *r_ptr = &r_info[o_ptr->pval];
1298                 int namelen = strlen(r_name + r_ptr->name);
1299                 prt(format("%s: '", r_name + r_ptr->name), 1, 15);
1300                 Term_queue_bigchar(18 + namelen, 1, r_ptr->x_attr, r_ptr->x_char, 0, 0);
1301                 prt("'", 1, (use_bigtile ? 20 : 19) + namelen);
1302         }
1303         else
1304         {
1305                 prt(_("     アイテムの能力:", "     Item Attributes:"), 1, 15);
1306         }
1307
1308         int k = 2;
1309         for (int j = 0; j < i; j++)
1310         {
1311                 prt(info[j], k++, 15);
1312                 if ((k == hgt - 2) && (j+1 < i))
1313                 {
1314                         prt(_("-- 続く --", "-- more --"), k, 15);
1315                         inkey();
1316                         for (; k > 2; k--) prt("", k, 15);
1317                 }
1318         }
1319
1320         prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 15);
1321         inkey();
1322         screen_load();
1323         return TRUE;
1324 }
1325
1326
1327 /*!
1328  * @brief オブジェクト選択時の選択アルファベットラベルを返す /
1329  * Convert an inventory index into a one character label
1330  * @param i プレイヤーの所持/装備オブジェクトID
1331  * @return 対応するアルファベット
1332  * @details Note that the label does NOT distinguish inven/equip.
1333  */
1334 char index_to_label(int i)
1335 {
1336         return (i < INVEN_RARM) ? (I2A(i)) : (I2A(i - INVEN_RARM));
1337 }
1338
1339
1340 /*!
1341  * @brief オブジェクトの該当装備部位IDを返す /
1342  * Determine which equipment slot (if any) an item likes
1343  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
1344  * @return 対応する装備部位ID
1345  */
1346 s16b wield_slot(player_type *owner_ptr, object_type *o_ptr)
1347 {
1348         switch (o_ptr->tval)
1349         {
1350                 case TV_DIGGING:
1351                 case TV_HAFTED:
1352                 case TV_POLEARM:
1353                 case TV_SWORD:
1354                 {
1355                         if (!owner_ptr->inventory_list[INVEN_RARM].k_idx) return (INVEN_RARM);
1356                         if (owner_ptr->inventory_list[INVEN_LARM].k_idx) return (INVEN_RARM);
1357                         return (INVEN_LARM);
1358                 }
1359                 case TV_CAPTURE:
1360                 case TV_CARD:
1361                 case TV_SHIELD:
1362                 {
1363                         if (!owner_ptr->inventory_list[INVEN_LARM].k_idx) return (INVEN_LARM);
1364                         if (owner_ptr->inventory_list[INVEN_RARM].k_idx) return (INVEN_LARM);
1365                         return (INVEN_RARM);
1366                 }
1367                 case TV_BOW:
1368                 {
1369                         return (INVEN_BOW);
1370                 }
1371                 case TV_RING:
1372                 {
1373                         if (!owner_ptr->inventory_list[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
1374
1375                         return (INVEN_LEFT);
1376                 }
1377                 case TV_AMULET:
1378                 case TV_WHISTLE:
1379                 {
1380                         return (INVEN_NECK);
1381                 }
1382                 case TV_LITE:
1383                 {
1384                         return (INVEN_LITE);
1385                 }
1386                 case TV_DRAG_ARMOR:
1387                 case TV_HARD_ARMOR:
1388                 case TV_SOFT_ARMOR:
1389                 {
1390                         return (INVEN_BODY);
1391                 }
1392                 case TV_CLOAK:
1393                 {
1394                         return (INVEN_OUTER);
1395                 }
1396                 case TV_CROWN:
1397                 case TV_HELM:
1398                 {
1399                         return (INVEN_HEAD);
1400                 }
1401                 case TV_GLOVES:
1402                 {
1403                         return (INVEN_HANDS);
1404                 }
1405                 case TV_BOOTS:
1406                 {
1407                         return (INVEN_FEET);
1408                 }
1409         }
1410
1411         return -1;
1412 }
1413
1414
1415 /*!
1416  * @brief tval/sval指定のベースアイテムがプレイヤーの使用可能な魔法書かどうかを返す /
1417  * Hack: Check if a spellbook is one of the realms we can use. -- TY
1418  * @param book_tval ベースアイテムのtval
1419  * @param book_sval ベースアイテムのsval
1420  * @return 使用可能な魔法書ならばTRUEを返す。
1421  */
1422 bool check_book_realm(player_type *owner_ptr, const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VALUE book_sval)
1423 {
1424         if (book_tval < TV_LIFE_BOOK) return FALSE;
1425         if (owner_ptr->pclass == CLASS_SORCERER)
1426         {
1427                 return is_magic(tval2realm(book_tval));
1428         }
1429         else if (owner_ptr->pclass == CLASS_RED_MAGE)
1430         {
1431                 if (is_magic(tval2realm(book_tval)))
1432                         return ((book_tval == TV_ARCANE_BOOK) || (book_sval < 2));
1433         }
1434
1435         return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
1436 }