OSDN Git Service

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