OSDN Git Service

Merge branch 'For2.2.2-Refactoring' into For2.2.2-Fix-Hourier
[hengband/hengband.git] / src / monster1.c
1 /*!
2  * @file monster1.c
3  * @brief モンスター情報の記述 / describe monsters (using monster memory)
4  * @date 2013/12/11
5  * @author
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7  * This software may be copied and distributed for educational, research,
8  * and not for profit purposes provided that this copyright and statement
9  * are included in all such copies.  Other copyrights may also apply.
10  * 2014 Deskull rearranged comment for Doxygen.
11  */
12
13 #include "angband.h"
14 #include "util.h"
15 #include "main/music-definitions-table.h"
16 #include "gameterm.h"
17
18 #include "io/write-diary.h"
19 #include "cmd/cmd-dump.h"
20 #include "market/building.h"
21 #include "cmd-pet.h"
22 #include "floor.h"
23 #include "object/object-kind-hook.h"
24 #include "player-personality.h"
25 #include "monster.h"
26 #include "monster-spell.h"
27 #include "monsterrace-hook.h"
28 #include "spells-summon.h"
29 #include "patron.h"
30 #include "quest.h"
31 #include "artifact.h"
32 #include "avatar.h"
33 #include "wild.h"
34 #include "dungeon.h"
35 #include "world.h"
36 #include "melee.h"
37 #include "japanese.h"
38 #include "view/display-main-window.h"
39 #include "player-class.h"
40 #include "english.h"
41 #include "market/arena-info-table.h"
42 #include "spell/process-effect.h"
43
44  /*
45   * Pronoun arrays, by gender.
46   */
47 static concptr wd_he[3] =
48 #ifdef JP
49 { "それ", "彼", "彼女" };
50 #else
51 { "it", "he", "she" };
52 #endif
53
54 static concptr wd_his[3] =
55 #ifdef JP
56 { "それの", "彼の", "彼女の" };
57 #else
58 { "its", "his", "her" };
59 #endif
60
61 /*!
62  * 英語の複数系記述用マクロ / Pluralizer.  Args(count, singular, plural)
63  */
64 #define plural(c,s,p) \
65     (((c) == 1) ? (s) : (p))
66
67 /*
68  * Prepare hook for c_roff(). It will be changed for spoiler generation in wizard1.c.
69  */
70 void(*hook_c_roff)(TERM_COLOR attr, concptr str) = c_roff;
71
72 /*!
73   * @brief モンスターのAC情報を得ることができるかを返す / Determine if the "armor" is known
74   * @param r_idx モンスターの種族ID
75   * @return 敵のACを知る条件が満たされているならTRUEを返す
76   * @details
77   * The higher the level, the fewer kills needed.
78   */
79 static bool know_armour(MONRACE_IDX r_idx)
80 {
81         monster_race *r_ptr = &r_info[r_idx];
82         DEPTH level = r_ptr->level;
83         MONSTER_NUMBER kills = r_ptr->r_tkills;
84
85         bool known = (r_ptr->r_cast_spell == MAX_UCHAR) ? TRUE : FALSE;
86
87         if (cheat_know || known) return TRUE;
88         if (kills > 304 / (4 + level)) return TRUE;
89         if (!(r_ptr->flags1 & RF1_UNIQUE)) return FALSE;
90         if (kills > 304 / (38 + (5 * level) / 4)) return TRUE;
91         return FALSE;
92 }
93
94
95 /*!
96  * @brief モンスターの打撃威力を知ることができるかどうかを返す
97  * Determine if the "damage" of the given attack is known
98  * @param r_idx モンスターの種族ID
99  * @param i 確認したい攻撃手番
100  * @return 敵のダメージダイスを知る条件が満たされているならTRUEを返す
101  * @details
102  * <pre>
103  * the higher the level of the monster, the fewer the attacks you need,
104  * the more damage an attack does, the more attacks you need
105  * </pre>
106  */
107 static bool know_damage(MONRACE_IDX r_idx, int i)
108 {
109         monster_race *r_ptr = &r_info[r_idx];
110         DEPTH level = r_ptr->level;
111         s32b a = r_ptr->r_blows[i];
112
113         s32b d1 = r_ptr->blow[i].d_dice;
114         s32b d2 = r_ptr->blow[i].d_side;
115         s32b d = d1 * d2;
116
117         if (d >= ((4 + level)*MAX_UCHAR) / 80) d = ((4 + level)*MAX_UCHAR - 1) / 80;
118         if ((4 + level) * a > 80 * d) return TRUE;
119         if (!(r_ptr->flags1 & RF1_UNIQUE)) return FALSE;
120         if ((4 + level) * (2 * a) > 80 * d) return TRUE;
121
122         return FALSE;
123 }
124
125
126 /*!
127  * @brief モンスターの思い出メッセージをあらかじめ指定された関数ポインタに基づき出力する
128  * @param str 出力文字列
129  * @return なし
130  */
131 static void hooked_roff(concptr str)
132 {
133         hook_c_roff(TERM_WHITE, str);
134 }
135
136
137 /*!
138 * @brief ダイス目を文字列に変換する
139 * @param base_damage 固定値
140 * @param dice_num ダイス数
141 * @param dice_side ダイス面
142 * @param dice_mult ダイス倍率
143 * @param dice_div ダイス除数
144 * @param msg 文字列を格納するポインタ
145 * @return なし
146 */
147 void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg)
148 {
149         char base[80] = "", dice[80] = "", mult[80] = "";
150
151         if (dice_num == 0)
152         {
153                 sprintf(msg, "%d", base_damage);
154                 return;
155         }
156
157         if (base_damage != 0)
158                 sprintf(base, "%d+", base_damage);
159
160         if (dice_num == 1)
161                 sprintf(dice, "d%d", dice_side);
162         else
163                 sprintf(dice, "%dd%d", dice_num, dice_side);
164
165         if (dice_mult != 1 || dice_div != 1)
166         {
167                 if (dice_div == 1)
168                         sprintf(mult, "*%d", dice_mult);
169                 else
170                         sprintf(mult, "*(%d/%d)", dice_mult, dice_div);
171         }
172
173         sprintf(msg, "%s%s%s", base, dice, mult);
174 }
175
176
177 /*!
178 * @brief 文字列にモンスターの攻撃力を加える
179 * @param r_idx モンスターの種族ID
180 * @param SPELL_NUM 呪文番号
181 * @param msg 表示する文字列
182 * @param tmp 返すメッセージを格納する配列
183 * @return なし
184 */
185 void set_damage(player_type *player_ptr, MONRACE_IDX r_idx, int SPELL_NUM, char* msg, char* tmp)
186 {
187         int base_damage = monspell_race_damage(player_ptr, SPELL_NUM, r_idx, BASE_DAM);
188         int dice_num = monspell_race_damage(player_ptr, SPELL_NUM, r_idx, DICE_NUM);
189         int dice_side = monspell_race_damage(player_ptr, SPELL_NUM, r_idx, DICE_SIDE);
190         int dice_mult = monspell_race_damage(player_ptr, SPELL_NUM, r_idx, DICE_MULT);
191         int dice_div = monspell_race_damage(player_ptr, SPELL_NUM, r_idx, DICE_DIV);
192         char dmg_str[80], dice_str[80];
193         dice_to_string(base_damage, dice_num, dice_side, dice_mult, dice_div, dmg_str);
194         sprintf(dice_str, "(%s)", dmg_str);
195
196         if (know_armour(r_idx))
197                 sprintf(tmp, msg, dice_str);
198         else
199                 sprintf(tmp, msg, "");
200 }
201
202
203 /*!
204  * @brief モンスターの思い出情報を表示する
205  * Hack -- display monster information using "hooked_roff()"
206  * @param r_idx モンスターの種族ID
207  * @param mode 表示オプション
208  * @return なし
209  * @details
210  * This function should only be called with the cursor placed at the
211  * left edge of the screen, on a cleared line, in which the recall is
212  * to take place.  One extra blank line is left after the recall.
213  */
214 static void roff_aux(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode)
215 {
216 #ifdef JP
217         char jverb_buf[64];
218 #else
219         bool sin = FALSE;
220 #endif
221
222         bool nightmare = ironman_nightmare && !(mode & 0x02);
223         monster_race *r_ptr = &r_info[r_idx];
224         SPEED speed = nightmare ? r_ptr->speed + 5 : r_ptr->speed;
225
226         /* Obtain a copy of the "known" number of drops */
227         ITEM_NUMBER drop_gold = r_ptr->r_drop_gold;
228         ITEM_NUMBER drop_item = r_ptr->r_drop_item;
229
230         /* Obtain a copy of the "known" flags */
231         BIT_FLAGS flags1 = (r_ptr->flags1 & r_ptr->r_flags1);
232         BIT_FLAGS flags2 = (r_ptr->flags2 & r_ptr->r_flags2);
233         BIT_FLAGS flags3 = (r_ptr->flags3 & r_ptr->r_flags3);
234         BIT_FLAGS flags4 = (r_ptr->flags4 & r_ptr->r_flags4);
235         BIT_FLAGS a_ability_flags1 = (r_ptr->a_ability_flags1 & r_ptr->r_flags5);
236         BIT_FLAGS a_ability_flags2 = (r_ptr->a_ability_flags2 & r_ptr->r_flags6);
237         BIT_FLAGS flags7 = (r_ptr->flags7 & r_ptr->flags7);
238         BIT_FLAGS flagsr = (r_ptr->flagsr & r_ptr->r_flagsr);
239
240         bool reinforce = FALSE;
241         for (int n = 0; n < A_MAX; n++)
242         {
243                 if (r_ptr->reinforce_id[n] > 0) reinforce = TRUE;
244         }
245
246         bool know_everything = FALSE;
247         if (cheat_know || (mode & 0x01))
248         {
249                 know_everything = TRUE;
250         }
251
252         if (know_everything)
253         {
254                 drop_gold = drop_item =
255                         (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) +
256                         ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) +
257                                 ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) +
258                                 ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) +
259                                 ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) +
260                                 ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
261
262                 if (r_ptr->flags1 & RF1_ONLY_GOLD) drop_item = 0;
263                 if (r_ptr->flags1 & RF1_ONLY_ITEM) drop_gold = 0;
264
265                 flags1 = r_ptr->flags1;
266                 flags2 = r_ptr->flags2;
267                 flags3 = r_ptr->flags3;
268                 flags4 = r_ptr->flags4;
269                 a_ability_flags1 = r_ptr->a_ability_flags1;
270                 a_ability_flags2 = r_ptr->a_ability_flags2;
271                 flagsr = r_ptr->flagsr;
272         }
273
274         int msex = 0;
275         if (r_ptr->flags1 & RF1_FEMALE) msex = 2;
276         else if (r_ptr->flags1 & RF1_MALE) msex = 1;
277
278         if (r_ptr->flags1 & RF1_UNIQUE)  flags1 |= (RF1_UNIQUE);
279         if (r_ptr->flags1 & RF1_QUESTOR) flags1 |= (RF1_QUESTOR);
280         if (r_ptr->flags1 & RF1_MALE)    flags1 |= (RF1_MALE);
281         if (r_ptr->flags1 & RF1_FEMALE)  flags1 |= (RF1_FEMALE);
282
283         if (r_ptr->flags1 & RF1_FRIENDS) flags1 |= (RF1_FRIENDS);
284         if (r_ptr->flags1 & RF1_ESCORT)  flags1 |= (RF1_ESCORT);
285         if (r_ptr->flags1 & RF1_ESCORTS) flags1 |= (RF1_ESCORTS);
286
287         if (r_ptr->r_tkills || know_everything)
288         {
289                 if (r_ptr->flags3 & RF3_ORC)      flags3 |= (RF3_ORC);
290                 if (r_ptr->flags3 & RF3_TROLL)    flags3 |= (RF3_TROLL);
291                 if (r_ptr->flags3 & RF3_GIANT)    flags3 |= (RF3_GIANT);
292                 if (r_ptr->flags3 & RF3_DRAGON)   flags3 |= (RF3_DRAGON);
293                 if (r_ptr->flags3 & RF3_DEMON)    flags3 |= (RF3_DEMON);
294                 if (r_ptr->flags3 & RF3_UNDEAD)   flags3 |= (RF3_UNDEAD);
295                 if (r_ptr->flags3 & RF3_EVIL)     flags3 |= (RF3_EVIL);
296                 if (r_ptr->flags3 & RF3_GOOD)     flags3 |= (RF3_GOOD);
297                 if (r_ptr->flags3 & RF3_ANIMAL)   flags3 |= (RF3_ANIMAL);
298                 if (r_ptr->flags3 & RF3_AMBERITE) flags3 |= (RF3_AMBERITE);
299                 if (r_ptr->flags2 & RF2_HUMAN)    flags2 |= (RF2_HUMAN);
300                 if (r_ptr->flags2 & RF2_QUANTUM)  flags2 |= (RF2_QUANTUM);
301
302                 if (r_ptr->flags1 & RF1_FORCE_DEPTH) flags1 |= (RF1_FORCE_DEPTH);
303                 if (r_ptr->flags1 & RF1_FORCE_MAXHP) flags1 |= (RF1_FORCE_MAXHP);
304         }
305
306         if (!(mode & 0x02))
307         {
308                 if (flags1 & RF1_UNIQUE)
309                 {
310                         bool dead = (r_ptr->max_num == 0) ? TRUE : FALSE;
311                         if (r_ptr->r_deaths)
312                         {
313                                 hooked_roff(format(_("%^sはあなたの先祖を %d 人葬っている", "%^s has slain %d of your ancestors"),
314                                         wd_he[msex], r_ptr->r_deaths));
315
316                                 if (dead)
317                                 {
318                                         hooked_roff(
319                                                 _(format("が、すでに仇討ちは果たしている!"),
320                                                         format(", but you have avenged %s!  ", plural(r_ptr->r_deaths, "him", "them"))));
321                                 }
322                                 else
323                                 {
324                                         hooked_roff(
325                                                 _(format("のに、まだ仇討ちを果たしていない。"),
326                                                         format(", who %s unavenged.  ", plural(r_ptr->r_deaths, "remains", "remain"))));
327                                 }
328
329                                 hooked_roff("\n");
330                         }
331                         else if (dead)
332                         {
333                                 hooked_roff(_("あなたはこの仇敵をすでに葬り去っている。", "You have slain this foe.  "));
334                                 hooked_roff("\n");
335                         }
336                 }
337                 else if (r_ptr->r_deaths)
338                 {
339                         hooked_roff(
340                                 _(format("このモンスターはあなたの先祖を %d 人葬っている", r_ptr->r_deaths),
341                                         format("%d of your ancestors %s been killed by this creature, ", r_ptr->r_deaths, plural(r_ptr->r_deaths, "has", "have"))));
342
343                         if (r_ptr->r_pkills)
344                         {
345                                 hooked_roff(format(
346                                         _("が、あなたはこのモンスターを少なくとも %d 体は倒している。",
347                                                 "and you have exterminated at least %d of the creatures.  "), r_ptr->r_pkills));
348                         }
349                         else if (r_ptr->r_tkills)
350                         {
351                                 hooked_roff(format(
352                                         _("が、あなたの先祖はこのモンスターを少なくとも %d 体は倒している。",
353                                                 "and your ancestors have exterminated at least %d of the creatures.  "), r_ptr->r_tkills));
354                         }
355                         else
356                         {
357                                 hooked_roff(format(
358                                         _("が、まだ%sを倒したことはない。",
359                                                 "and %s is not ever known to have been defeated.  "), wd_he[msex]));
360                         }
361
362                         hooked_roff("\n");
363                 }
364                 else
365                 {
366                         if (r_ptr->r_pkills)
367                         {
368                                 hooked_roff(format(
369                                         _("あなたはこのモンスターを少なくとも %d 体は殺している。",
370                                                 "You have killed at least %d of these creatures.  "), r_ptr->r_pkills));
371                         }
372                         else if (r_ptr->r_tkills)
373                         {
374                                 hooked_roff(format(
375                                         _("あなたの先祖はこのモンスターを少なくとも %d 体は殺している。",
376                                                 "Your ancestors have killed at least %d of these creatures.  "), r_ptr->r_tkills));
377                         }
378                         else
379                         {
380                                 hooked_roff(_("このモンスターを倒したことはない。", "No battles to the death are recalled.  "));
381                         }
382
383                         hooked_roff("\n");
384                 }
385         }
386
387         concptr tmp = r_text + r_ptr->text;
388         if (tmp[0])
389         {
390                 hooked_roff(tmp);
391                 hooked_roff("\n");
392         }
393
394         if (r_idx == MON_KAGE)
395         {
396                 hooked_roff("\n");
397                 return;
398         }
399
400         bool old = FALSE;
401         if (r_ptr->level == 0)
402         {
403                 hooked_roff(format(_("%^sは町に住み", "%^s lives in the town"), wd_he[msex]));
404                 old = TRUE;
405         }
406         else if (r_ptr->r_tkills || know_everything)
407         {
408                 if (depth_in_feet)
409                 {
410                         hooked_roff(format(
411                                 _("%^sは通常地下 %d フィートで出現し", "%^s is normally found at depths of %d feet"),
412                                 wd_he[msex], r_ptr->level * 50));
413                 }
414                 else
415                 {
416                         hooked_roff(format(
417                                 _("%^sは通常地下 %d 階で出現し", "%^s is normally found on dungeon level %d"),
418                                 wd_he[msex], r_ptr->level));
419                 }
420
421                 old = TRUE;
422         }
423
424         if (r_idx == MON_CHAMELEON)
425         {
426                 hooked_roff(_("、他のモンスターに化ける。", "and can take the shape of other monster."));
427                 return;
428         }
429         
430         if (old)
431         {
432                 hooked_roff(_("、", ", and "));
433         }
434         else
435         {
436                 hooked_roff(format(_("%^sは", "%^s "), wd_he[msex]));
437                 old = TRUE;
438         }
439
440 #ifdef JP
441 #else
442         hooked_roff("moves");
443 #endif
444
445         if ((flags1 & RF1_RAND_50) || (flags1 & RF1_RAND_25))
446         {
447                 if ((flags1 & RF1_RAND_50) && (flags1 & RF1_RAND_25))
448                 {
449                         hooked_roff(_("かなり", " extremely"));
450                 }
451                 else if (flags1 & RF1_RAND_50)
452                 {
453                         hooked_roff(_("幾分", " somewhat"));
454                 }
455                 else if (flags1 & RF1_RAND_25)
456                 {
457                         hooked_roff(_("少々", " a bit"));
458                 }
459
460                 hooked_roff(_("不規則に", " erratically"));
461                 if (speed != 110) hooked_roff(_("、かつ", ", and"));
462         }
463
464         if (speed > 110)
465         {
466                 if (speed >= 150) hook_c_roff(TERM_VIOLET, _("信じ難いほど素早く", " incredibly quickly"));
467                 else if (speed >= 145) hook_c_roff(TERM_RED, _("音速並に素早く", " sonic-boomingly quickly"));
468                 else if (speed >= 140) hook_c_roff(TERM_RED, _("悪夢的に素早く", " nightmare quickly"));
469                 else if (speed >= 135) hook_c_roff(TERM_ORANGE, _("猛烈に素早く", " extremely quickly"));
470                 else if (speed >= 130) hook_c_roff(TERM_ORANGE, _("非常に素早く", " very quickly"));
471                 else if (speed >= 125) hook_c_roff(TERM_UMBER, _("かなり素早く", " fairly quickly"));
472                 else if (speed >= 120) hook_c_roff(TERM_UMBER, _("素早く", " quickly"));
473                 else if (speed >= 115) hook_c_roff(TERM_L_UMBER, _("やや素早く", " somewhat quickly"));
474                 else hook_c_roff(TERM_L_WHITE, _("わずかに素早く", " slightly quickly"));
475         }
476         else if (speed < 110)
477         {
478                 if (speed < 90) hook_c_roff(TERM_GREEN, _("信じ難いほどゆっくりと", " incredibly slowly"));
479                 else if (speed < 95) hook_c_roff(TERM_L_GREEN, _("非常にゆっくりと", " very slowly"));
480                 else if (speed < 100) hook_c_roff(TERM_BLUE, _("かなりゆっくりと", " fairly slowly"));
481                 else if (speed < 105) hook_c_roff(TERM_L_BLUE, _("ややゆっくりと", " somewhat slowly"));
482                 else hook_c_roff(TERM_L_WHITE, _("わずかにゆっくりと", " slightly slowly"));
483         }
484         else
485         {
486                 hooked_roff(_("普通の速さで", " at normal speed"));
487         }
488
489 #ifdef JP
490         hooked_roff("動いている");
491 #endif
492
493         if (flags1 & RF1_NEVER_MOVE)
494         {
495                 if (old)
496                 {
497                         hooked_roff(_("、しかし", ", but "));
498                 }
499                 else
500                 {
501                         hooked_roff(format(_("%^sは", "%^s "), wd_he[msex]));
502                         old = TRUE;
503                 }
504
505                 hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders"));
506         }
507
508         if (old)
509         {
510                 hooked_roff(_("。", ".  "));
511                 old = FALSE;
512         }
513
514         if (r_ptr->r_tkills || know_everything)
515         {
516 #ifdef JP
517                 hooked_roff("この");
518 #else
519                 if (flags1 & RF1_UNIQUE)
520                 {
521                         hooked_roff("Killing this");
522                 }
523                 else
524                 {
525                         hooked_roff("A kill of this");
526                 }
527 #endif
528
529                 if (flags2 & RF2_ELDRITCH_HORROR) hook_c_roff(TERM_VIOLET, _("狂気を誘う", " sanity-blasting"));
530                 if (flags3 & RF3_ANIMAL)          hook_c_roff(TERM_L_GREEN, _("自然界の", " natural"));
531                 if (flags3 & RF3_EVIL)            hook_c_roff(TERM_L_DARK, _("邪悪なる", " evil"));
532                 if (flags3 & RF3_GOOD)            hook_c_roff(TERM_YELLOW, _("善良な", " good"));
533                 if (flags3 & RF3_UNDEAD)          hook_c_roff(TERM_VIOLET, _("アンデッドの", " undead"));
534                 if (flags3 & RF3_AMBERITE)        hook_c_roff(TERM_VIOLET, _("アンバーの王族の", " Amberite"));
535
536                 if ((flags3 & (RF3_DRAGON | RF3_DEMON | RF3_GIANT | RF3_TROLL | RF3_ORC | RF3_ANGEL)) || (flags2 & (RF2_QUANTUM | RF2_HUMAN)))
537                 {
538                         if (flags3 & RF3_DRAGON)   hook_c_roff(TERM_ORANGE, _("ドラゴン", " dragon"));
539                         if (flags3 & RF3_DEMON)    hook_c_roff(TERM_VIOLET, _("デーモン", " demon"));
540                         if (flags3 & RF3_GIANT)    hook_c_roff(TERM_L_UMBER, _("巨人", " giant"));
541                         if (flags3 & RF3_TROLL)    hook_c_roff(TERM_BLUE, _("トロル", " troll"));
542                         if (flags3 & RF3_ORC)      hook_c_roff(TERM_UMBER, _("オーク", " orc"));
543                         if (flags2 & RF2_HUMAN)    hook_c_roff(TERM_L_WHITE, _("人間", " human"));
544                         if (flags2 & RF2_QUANTUM)  hook_c_roff(TERM_VIOLET, _("量子生物", " quantum creature"));
545                         if (flags3 & RF3_ANGEL)    hook_c_roff(TERM_YELLOW, _("天使", " angel"));
546                 }
547                 else
548                 {
549                         hooked_roff(_("モンスター", " creature"));
550                 }
551
552 #ifdef JP
553                 hooked_roff("を倒すことは");
554 #endif
555                 long exp_integer = (long)r_ptr->mexp * r_ptr->level / (player_ptr->max_plv + 2) * 3 / 2;
556                 long exp_decimal = ((((long)r_ptr->mexp * r_ptr->level % (player_ptr->max_plv + 2) * 3 / 2) *
557                         (long)1000 / (player_ptr->max_plv + 2) + 5) / 10);
558
559 #ifdef JP
560                 hooked_roff(format(" %d レベルのキャラクタにとって 約%ld.%02ld ポイントの経験となる。", player_ptr->lev, (long)exp_integer, (long)exp_decimal));
561 #else
562                 hooked_roff(format(" is worth about %ld.%02ld point%s",
563                         (long)exp_integer, (long)exp_decimal, ((exp_integer == 1) && (exp_decimal == 0)) ? "" : "s"));
564
565                 char *ordinal;
566                 ordinal = "th";
567                 exp_integer = player_ptr->lev % 10;
568                 if ((player_ptr->lev / 10) != 1)
569                 {
570                         if (exp_integer == 1) ordinal = "st";
571                         else if (exp_integer == 2) ordinal = "nd";
572                         else if (exp_integer == 3) ordinal = "rd";
573                 }
574
575                 char *vowel;
576                 vowel = "";
577                 exp_integer = player_ptr->lev;
578                 if ((exp_integer == 8) || (exp_integer == 11) || (exp_integer == 18)) vowel = "n";
579
580                 hooked_roff(format(" for a%s %lu%s level character.  ", vowel, (long)exp_integer, ordinal));
581 #endif
582         }
583
584         if ((flags2 & RF2_AURA_FIRE) && (flags2 & RF2_AURA_ELEC) && (flags3 & RF3_AURA_COLD))
585         {
586                 hook_c_roff(TERM_VIOLET, format(
587                         _("%^sは炎と氷とスパークに包まれている。", "%^s is surrounded by flames, ice and electricity.  "), wd_he[msex]));
588         }
589         else if ((flags2 & RF2_AURA_FIRE) && (flags2 & RF2_AURA_ELEC))
590         {
591                 hook_c_roff(TERM_L_RED, format(
592                         _("%^sは炎とスパークに包まれている。", "%^s is surrounded by flames and electricity.  "), wd_he[msex]));
593         }
594         else if ((flags2 & RF2_AURA_FIRE) && (flags3 & RF3_AURA_COLD))
595         {
596                 hook_c_roff(TERM_BLUE, format(
597                         _("%^sは炎と氷に包まれている。", "%^s is surrounded by flames and ice.  "), wd_he[msex]));
598         }
599         else if ((flags3 & RF3_AURA_COLD) && (flags2 & RF2_AURA_ELEC))
600         {
601                 hook_c_roff(TERM_L_GREEN, format(
602                         _("%^sは氷とスパークに包まれている。", "%^s is surrounded by ice and electricity.  "), wd_he[msex]));
603         }
604         else if (flags2 & RF2_AURA_FIRE)
605         {
606                 hook_c_roff(TERM_RED, format(
607                         _("%^sは炎に包まれている。", "%^s is surrounded by flames.  "), wd_he[msex]));
608         }
609         else if (flags3 & RF3_AURA_COLD)
610         {
611                 hook_c_roff(TERM_BLUE, format(
612                         _("%^sは氷に包まれている。", "%^s is surrounded by ice.  "), wd_he[msex]));
613         }
614         else if (flags2 & RF2_AURA_ELEC)
615         {
616                 hook_c_roff(TERM_L_BLUE, format(
617                         _("%^sはスパークに包まれている。", "%^s is surrounded by electricity.  "), wd_he[msex]));
618         }
619
620         if (flags2 & RF2_REFLECTING)
621                 hooked_roff(format(_("%^sは矢の呪文を跳ね返す。", "%^s reflects bolt spells.  "), wd_he[msex]));
622
623         if ((flags1 & RF1_ESCORT) || (flags1 & RF1_ESCORTS) || reinforce)
624         {
625                 hooked_roff(format(
626                         _("%^sは通常護衛を伴って現れる。", "%^s usually appears with escorts.  "), wd_he[msex]));
627
628                 if (reinforce)
629                 {
630                         hooked_roff(_("護衛の構成は", "These escorts"));
631                         if ((flags1 & RF1_ESCORT) || (flags1 & RF1_ESCORTS))
632                         {
633                                 hooked_roff(_("少なくとも", " at the least"));
634                         }
635 #ifdef JP
636 #else
637                         hooked_roff(" contain ");
638 #endif                  
639                         for (int n = 0; n < A_MAX; n++)
640                         {
641                                 bool is_reinforced = r_ptr->reinforce_id[n] > 0;
642                                 is_reinforced &= r_ptr->reinforce_dd[n];
643                                 is_reinforced &= r_ptr->reinforce_ds[n];
644                                 if (!is_reinforced) continue;
645
646                                 monster_race *rf_ptr = &r_info[r_ptr->reinforce_id[n]];
647                                 if (rf_ptr->flags1 & RF1_UNIQUE)
648                                 {
649                                         hooked_roff(format(_("、%s", ", %s"), r_name + rf_ptr->name));
650                                         continue;
651                                 }
652
653 #ifdef JP
654                                 hooked_roff(format("、 %dd%d 体の%s", r_ptr->reinforce_dd[n], r_ptr->reinforce_ds[n], r_name + rf_ptr->name));
655 #else
656                                 bool plural = (r_ptr->reinforce_dd[n] * r_ptr->reinforce_ds[n] > 1);
657                                 GAME_TEXT name[MAX_NLEN];
658                                 strcpy(name, r_name + rf_ptr->name);
659                                 if (plural) plural_aux(name);
660                                 hooked_roff(format(",%dd%d %s", r_ptr->reinforce_dd[n], r_ptr->reinforce_ds[n], name));
661 #endif
662                         }
663
664                         hooked_roff(_("で成り立っている。", "."));
665                 }
666         }
667
668         else if (flags1 & RF1_FRIENDS)
669         {
670                 hooked_roff(format(_("%^sは通常集団で現れる。", "%^s usually appears in groups.  "), wd_he[msex]));
671         }
672
673         int vn = 0;
674         byte color[96];
675         concptr vp[96];
676         char tmp_msg[96][96];
677         if (flags4 & RF4_SHRIEK)
678         {
679                 vp[vn] = _("悲鳴で助けを求める", "shriek for help");
680                 color[vn++] = TERM_L_WHITE;
681         }
682
683         if (flags4 & RF4_ROCKET)
684         {
685                 set_damage(player_ptr, r_idx, (MS_ROCKET), _("ロケット%sを発射する", "shoot a rocket%s"), tmp_msg[vn]);
686                 vp[vn] = tmp_msg[vn];
687                 color[vn++] = TERM_UMBER;
688         }
689
690         if (flags4 & RF4_SHOOT)
691         {
692                 for (int m = 0; m < 4; m++)
693                 {
694                         if (r_ptr->blow[m].method != RBM_SHOOT) continue;
695
696                         if (know_armour(r_idx))
697                                 sprintf(tmp_msg[vn], _("威力 %dd%d の射撃をする", "fire an arrow (Power:%dd%d)"), r_ptr->blow[m].d_side, r_ptr->blow[m].d_dice);
698                         else
699                                 sprintf(tmp_msg[vn], _("射撃をする", "fire an arrow"));
700                         vp[vn] = tmp_msg[vn]; color[vn++] = TERM_UMBER;
701                         break;
702                 }
703         }
704
705         if (a_ability_flags2 & (RF6_SPECIAL))
706         {
707                 vp[vn] = _("特別な行動をする", "do something");
708                 color[vn++] = TERM_VIOLET;
709         }
710
711         if (vn > 0)
712         {
713                 hooked_roff(format(_("%^sは", "%^s"), wd_he[msex]));
714                 for (int n = 0; n < vn; n++)
715                 {
716 #ifdef JP
717                         if (n != vn - 1)
718                         {
719                                 jverb(vp[n], jverb_buf, JVERB_OR);
720                                 hook_c_roff(color[n], jverb_buf);
721                                 hook_c_roff(color[n], "り");
722                                 hooked_roff("、");
723                         }
724                         else hook_c_roff(color[n], vp[n]);
725 #else
726                         if (n == 0) hooked_roff(" may ");
727                         else if (n < vn - 1) hooked_roff(", ");
728                         else hooked_roff(" or ");
729
730                         hook_c_roff(color[n], vp[n]);
731 #endif
732                 }
733
734                 hooked_roff(_("ことがある。", ".  "));
735         }
736
737         vn = 0;
738         if (flags4 & (RF4_BR_ACID))
739         {
740                 set_damage(player_ptr, r_idx, (MS_BR_ACID), _("酸%s", "acid%s"), tmp_msg[vn]);
741                 vp[vn] = tmp_msg[vn];
742                 color[vn++] = TERM_GREEN;
743         }
744
745         if (flags4 & (RF4_BR_ELEC))
746         {
747                 set_damage(player_ptr, r_idx, (MS_BR_ELEC), _("稲妻%s", "lightning%s"), tmp_msg[vn]);
748                 vp[vn] = tmp_msg[vn];
749                 color[vn++] = TERM_BLUE;
750         }
751
752         if (flags4 & (RF4_BR_FIRE))
753         {
754                 set_damage(player_ptr, r_idx, (MS_BR_FIRE), _("火炎%s", "fire%s"), tmp_msg[vn]);
755                 vp[vn] = tmp_msg[vn];
756                 color[vn++] = TERM_RED;
757         }
758
759         if (flags4 & (RF4_BR_COLD))
760         {
761                 set_damage(player_ptr, r_idx, (MS_BR_COLD), _("冷気%s", "frost%s"), tmp_msg[vn]);
762                 vp[vn] = tmp_msg[vn];
763                 color[vn++] = TERM_L_WHITE;
764         }
765
766         if (flags4 & (RF4_BR_POIS))
767         {
768                 set_damage(player_ptr, r_idx, (MS_BR_POIS), _("毒%s", "poison%s"), tmp_msg[vn]);
769                 vp[vn] = tmp_msg[vn];
770                 color[vn++] = TERM_L_GREEN;
771         }
772
773         if (flags4 & (RF4_BR_NETH))
774         {
775                 set_damage(player_ptr, r_idx, (MS_BR_NETHER), _("地獄%s", "nether%s"), tmp_msg[vn]);
776                 vp[vn] = tmp_msg[vn];
777                 color[vn++] = TERM_L_DARK;
778         }
779
780         if (flags4 & (RF4_BR_LITE))
781         {
782                 set_damage(player_ptr, r_idx, (MS_BR_LITE), _("閃光%s", "light%s"), tmp_msg[vn]);
783                 vp[vn] = tmp_msg[vn];
784                 color[vn++] = TERM_YELLOW;
785         }
786
787         if (flags4 & (RF4_BR_DARK))
788         {
789                 set_damage(player_ptr, r_idx, (MS_BR_DARK), _("暗黒%s", "darkness%s"), tmp_msg[vn]);
790                 vp[vn] = tmp_msg[vn];
791                 color[vn++] = TERM_L_DARK;
792         }
793
794         if (flags4 & (RF4_BR_CONF))
795         {
796                 set_damage(player_ptr, r_idx, (MS_BR_CONF), _("混乱%s", "confusion%s"), tmp_msg[vn]);
797                 vp[vn] = tmp_msg[vn];
798                 color[vn++] = TERM_L_UMBER;
799         }
800
801         if (flags4 & (RF4_BR_SOUN))
802         {
803                 set_damage(player_ptr, r_idx, (MS_BR_SOUND), _("轟音%s", "sound%s"), tmp_msg[vn]);
804                 vp[vn] = tmp_msg[vn];
805                 color[vn++] = TERM_ORANGE;
806         }
807
808         if (flags4 & (RF4_BR_CHAO))
809         {
810                 set_damage(player_ptr, r_idx, (MS_BR_CHAOS), _("カオス%s", "chaos%s"), tmp_msg[vn]);
811                 vp[vn] = tmp_msg[vn];
812                 color[vn++] = TERM_VIOLET;
813         }
814
815         if (flags4 & (RF4_BR_DISE))
816         {
817                 set_damage(player_ptr, r_idx, (MS_BR_DISEN), _("劣化%s", "disenchantment%s"), tmp_msg[vn]);
818                 vp[vn] = tmp_msg[vn];
819                 color[vn++] = TERM_VIOLET;
820         }
821
822         if (flags4 & (RF4_BR_NEXU))
823         {
824                 set_damage(player_ptr, r_idx, (MS_BR_NEXUS), _("因果混乱%s", "nexus%s"), tmp_msg[vn]);
825                 vp[vn] = tmp_msg[vn];
826                 color[vn++] = TERM_VIOLET;
827         }
828
829         if (flags4 & (RF4_BR_TIME))
830         {
831                 set_damage(player_ptr, r_idx, (MS_BR_TIME), _("時間逆転%s", "time%s"), tmp_msg[vn]);
832                 vp[vn] = tmp_msg[vn];
833                 color[vn++] = TERM_L_BLUE;
834         }
835
836         if (flags4 & (RF4_BR_INER))
837         {
838                 set_damage(player_ptr, r_idx, (MS_BR_INERTIA), _("遅鈍%s", "inertia%s"), tmp_msg[vn]);
839                 vp[vn] = tmp_msg[vn];
840                 color[vn++] = TERM_SLATE;
841         }
842
843         if (flags4 & (RF4_BR_GRAV))
844         {
845                 set_damage(player_ptr, r_idx, (MS_BR_GRAVITY), _("重力%s", "gravity%s"), tmp_msg[vn]);
846                 vp[vn] = tmp_msg[vn];
847                 color[vn++] = TERM_SLATE;
848         }
849
850         if (flags4 & (RF4_BR_SHAR))
851         {
852                 set_damage(player_ptr, r_idx, (MS_BR_SHARDS), _("破片%s", "shards%s"), tmp_msg[vn]);
853                 vp[vn] = tmp_msg[vn];
854                 color[vn++] = TERM_L_UMBER;
855         }
856
857         if (flags4 & (RF4_BR_PLAS))
858         {
859                 set_damage(player_ptr, r_idx, (MS_BR_PLASMA), _("プラズマ%s", "plasma%s"), tmp_msg[vn]);
860                 vp[vn] = tmp_msg[vn];
861                 color[vn++] = TERM_L_RED;
862         }
863
864         if (flags4 & (RF4_BR_WALL))
865         {
866                 set_damage(player_ptr, r_idx, (MS_BR_FORCE), _("フォース%s", "force%s"), tmp_msg[vn]);
867                 vp[vn] = tmp_msg[vn];
868                 color[vn++] = TERM_UMBER;
869         }
870
871         if (flags4 & (RF4_BR_MANA))
872         {
873                 set_damage(player_ptr, r_idx, (MS_BR_MANA), _("魔力%s", "mana%s"), tmp_msg[vn]);
874                 vp[vn] = tmp_msg[vn];
875                 color[vn++] = TERM_L_BLUE;
876         }
877
878         if (flags4 & (RF4_BR_NUKE))
879         {
880                 set_damage(player_ptr, r_idx, (MS_BR_NUKE), _("放射性廃棄物%s", "toxic waste%s"), tmp_msg[vn]);
881                 vp[vn] = tmp_msg[vn];
882                 color[vn++] = TERM_L_GREEN;
883         }
884
885         if (flags4 & (RF4_BR_DISI))
886         {
887                 set_damage(player_ptr, r_idx, (MS_BR_DISI), _("分解%s", "disintegration%s"), tmp_msg[vn]);
888                 vp[vn] = tmp_msg[vn];
889                 color[vn++] = TERM_SLATE;
890         }
891
892         bool breath = FALSE;
893         if (vn > 0)
894         {
895                 breath = TRUE;
896                 hooked_roff(format(_("%^sは", "%^s"), wd_he[msex]));
897                 for (int n = 0; n < vn; n++)
898                 {
899 #ifdef JP
900                         if (n != 0) hooked_roff("や");
901 #else
902                         if (n == 0) hooked_roff(" may breathe ");
903                         else if (n < vn - 1) hooked_roff(", ");
904                         else hooked_roff(" or ");
905 #endif
906                         hook_c_roff(color[n], vp[n]);
907                 }
908
909 #ifdef JP
910                 hooked_roff("のブレスを吐くことがある");
911 #endif
912         }
913
914         vn = 0;
915         if (a_ability_flags1 & (RF5_BA_ACID))
916         {
917                 set_damage(player_ptr, r_idx, (MS_BALL_ACID), _("アシッド・ボール%s", "produce acid balls%s"), tmp_msg[vn]);
918                 vp[vn] = tmp_msg[vn];
919                 color[vn++] = TERM_GREEN;
920         }
921
922         if (a_ability_flags1 & (RF5_BA_ELEC))
923         {
924                 set_damage(player_ptr, r_idx, (MS_BALL_ELEC), _("サンダー・ボール%s", "produce lightning balls%s"), tmp_msg[vn]);
925                 vp[vn] = tmp_msg[vn];
926                 color[vn++] = TERM_BLUE;
927         }
928
929         if (a_ability_flags1 & (RF5_BA_FIRE))
930         {
931                 set_damage(player_ptr, r_idx, (MS_BALL_FIRE), _("ファイア・ボール%s", "produce fire balls%s"), tmp_msg[vn]);
932                 vp[vn] = tmp_msg[vn];
933                 color[vn++] = TERM_RED;
934         }
935
936         if (a_ability_flags1 & (RF5_BA_COLD))
937         {
938                 set_damage(player_ptr, r_idx, (MS_BALL_COLD), _("アイス・ボール%s", "produce frost balls%s"), tmp_msg[vn]);
939                 vp[vn] = tmp_msg[vn];
940                 color[vn++] = TERM_L_WHITE;
941         }
942
943         if (a_ability_flags1 & (RF5_BA_POIS))
944         {
945                 set_damage(player_ptr, r_idx, (MS_BALL_POIS), _("悪臭雲%s", "produce poison balls%s"), tmp_msg[vn]);
946                 vp[vn] = tmp_msg[vn];
947                 color[vn++] = TERM_L_GREEN;
948         }
949
950         if (a_ability_flags1 & (RF5_BA_NETH))
951         {
952                 set_damage(player_ptr, r_idx, (MS_BALL_NETHER), _("地獄球%s", "produce nether balls%s"), tmp_msg[vn]);
953                 vp[vn] = tmp_msg[vn];
954                 color[vn++] = TERM_L_DARK;
955         }
956
957         if (a_ability_flags1 & (RF5_BA_WATE))
958         {
959                 set_damage(player_ptr, r_idx, (MS_BALL_WATER), _("ウォーター・ボール%s", "produce water balls%s"), tmp_msg[vn]);
960                 vp[vn] = tmp_msg[vn];
961                 color[vn++] = TERM_BLUE;
962         }
963
964         if (flags4 & (RF4_BA_NUKE))
965         {
966                 set_damage(player_ptr, r_idx, (MS_BALL_NUKE), _("放射能球%s", "produce balls of radiation%s"), tmp_msg[vn]);
967                 vp[vn] = tmp_msg[vn];
968                 color[vn++] = TERM_L_GREEN;
969         }
970
971         if (a_ability_flags1 & (RF5_BA_MANA))
972         {
973                 set_damage(player_ptr, r_idx, (MS_BALL_MANA), _("魔力の嵐%s", "invoke mana storms%s"), tmp_msg[vn]);
974                 vp[vn] = tmp_msg[vn];
975                 color[vn++] = TERM_L_BLUE;
976         }
977
978         if (a_ability_flags1 & (RF5_BA_DARK))
979         {
980                 set_damage(player_ptr, r_idx, (MS_BALL_DARK), _("暗黒の嵐%s", "invoke darkness storms%s"), tmp_msg[vn]);
981                 vp[vn] = tmp_msg[vn];
982                 color[vn++] = TERM_L_DARK;
983         }
984
985         if (a_ability_flags1 & (RF5_BA_LITE))
986         {
987                 set_damage(player_ptr, r_idx, (MS_STARBURST), _("スターバースト%s", "invoke starburst%s"), tmp_msg[vn]);
988                 vp[vn] = tmp_msg[vn];
989                 color[vn++] = TERM_YELLOW;
990         }
991
992         if (flags4 & (RF4_BA_CHAO))
993         {
994                 set_damage(player_ptr, r_idx, (MS_BALL_CHAOS), _("純ログルス%s", "invoke raw Logrus%s"), tmp_msg[vn]);
995                 vp[vn] = tmp_msg[vn];
996                 color[vn++] = TERM_VIOLET;
997         }
998
999         if (a_ability_flags2 & (RF6_HAND_DOOM))
1000         {
1001                 vp[vn] = _("破滅の手(40%-60%)", "invoke the Hand of Doom(40%-60%)");
1002                 color[vn++] = TERM_VIOLET;
1003         }
1004
1005         if (a_ability_flags2 & (RF6_PSY_SPEAR))
1006         {
1007                 set_damage(player_ptr, r_idx, (MS_PSY_SPEAR), _("光の剣%s", "psycho-spear%s"), tmp_msg[vn]);
1008                 vp[vn] = tmp_msg[vn];
1009                 color[vn++] = TERM_YELLOW;
1010         }
1011
1012         if (a_ability_flags1 & (RF5_DRAIN_MANA))
1013         {
1014                 set_damage(player_ptr, r_idx, (MS_DRAIN_MANA), _("魔力吸収%s", "drain mana%s"), tmp_msg[vn]);
1015                 vp[vn] = tmp_msg[vn];
1016                 color[vn++] = TERM_SLATE;
1017         }
1018
1019         if (a_ability_flags1 & (RF5_MIND_BLAST))
1020         {
1021                 set_damage(player_ptr, r_idx, (MS_MIND_BLAST), _("精神攻撃%s", "cause mind blasting%s"), tmp_msg[vn]);
1022                 vp[vn] = tmp_msg[vn];
1023                 color[vn++] = TERM_L_RED;
1024         }
1025
1026         if (a_ability_flags1 & (RF5_BRAIN_SMASH))
1027         {
1028                 set_damage(player_ptr, r_idx, (MS_BRAIN_SMASH), _("脳攻撃%s", "cause brain smashing%s"), tmp_msg[vn]);
1029                 vp[vn] = tmp_msg[vn];
1030                 color[vn++] = TERM_RED;
1031         }
1032
1033         if (a_ability_flags1 & (RF5_CAUSE_1))
1034         {
1035                 set_damage(player_ptr, r_idx, (MS_CAUSE_1),
1036                         _("軽傷+呪い%s", "cause light wounds and cursing%s"), tmp_msg[vn]);
1037                 vp[vn] = tmp_msg[vn];
1038                 color[vn++] = TERM_L_WHITE;
1039         }
1040
1041         if (a_ability_flags1 & (RF5_CAUSE_2))
1042         {
1043                 set_damage(player_ptr, r_idx, (MS_CAUSE_2),
1044                         _("重傷+呪い%s", "cause serious wounds and cursing%s"), tmp_msg[vn]);
1045                 vp[vn] = tmp_msg[vn];
1046                 color[vn++] = TERM_L_WHITE;
1047         }
1048
1049         if (a_ability_flags1 & (RF5_CAUSE_3))
1050         {
1051                 set_damage(player_ptr, r_idx, (MS_CAUSE_3),
1052                         _("致命傷+呪い%s", "cause critical wounds and cursing%s"), tmp_msg[vn]);
1053                 vp[vn] = tmp_msg[vn];
1054                 color[vn++] = TERM_L_WHITE;
1055         }
1056
1057         if (a_ability_flags1 & (RF5_CAUSE_4))
1058         {
1059                 set_damage(player_ptr, r_idx, (MS_CAUSE_4),
1060                         _("秘孔を突く%s", "cause mortal wounds%s"), tmp_msg[vn]);
1061                 vp[vn] = tmp_msg[vn];
1062                 color[vn++] = TERM_L_WHITE;
1063         }
1064
1065         if (a_ability_flags1 & (RF5_BO_ACID))
1066         {
1067                 set_damage(player_ptr, r_idx, (MS_BOLT_ACID), _("アシッド・ボルト%s", "produce acid bolts%s"), tmp_msg[vn]);
1068                 vp[vn] = tmp_msg[vn];
1069                 color[vn++] = TERM_GREEN;
1070         }
1071
1072         if (a_ability_flags1 & (RF5_BO_ELEC))
1073         {
1074                 set_damage(player_ptr, r_idx, (MS_BOLT_ELEC), _("サンダー・ボルト%s", "produce lightning bolts%s"), tmp_msg[vn]);
1075                 vp[vn] = tmp_msg[vn];
1076                 color[vn++] = TERM_BLUE;
1077         }
1078
1079         if (a_ability_flags1 & (RF5_BO_FIRE))
1080         {
1081                 set_damage(player_ptr, r_idx, (MS_BOLT_FIRE), _("ファイア・ボルト%s", "produce fire bolts%s"), tmp_msg[vn]);
1082                 vp[vn] = tmp_msg[vn];
1083                 color[vn++] = TERM_RED;
1084         }
1085
1086         if (a_ability_flags1 & (RF5_BO_COLD))
1087         {
1088                 set_damage(player_ptr, r_idx, (MS_BOLT_COLD), _("アイス・ボルト%s", "produce frost bolts%s"), tmp_msg[vn]);
1089                 vp[vn] = tmp_msg[vn];
1090                 color[vn++] = TERM_L_WHITE;
1091         }
1092
1093         if (a_ability_flags1 & (RF5_BO_NETH))
1094         {
1095                 set_damage(player_ptr, r_idx, (MS_BOLT_NETHER), _("地獄の矢%s", "produce nether bolts%s"), tmp_msg[vn]);
1096                 vp[vn] = tmp_msg[vn];
1097                 color[vn++] = TERM_L_DARK;
1098         }
1099
1100         if (a_ability_flags1 & (RF5_BO_WATE))
1101         {
1102                 set_damage(player_ptr, r_idx, (MS_BOLT_WATER), _("ウォーター・ボルト%s", "produce water bolts%s"), tmp_msg[vn]);
1103                 vp[vn] = tmp_msg[vn];
1104                 color[vn++] = TERM_BLUE;
1105         }
1106
1107         if (a_ability_flags1 & (RF5_BO_MANA))
1108         {
1109                 set_damage(player_ptr, r_idx, (MS_BOLT_MANA), _("魔力の矢%s", "produce mana bolts%s"), tmp_msg[vn]);
1110                 vp[vn] = tmp_msg[vn];
1111                 color[vn++] = TERM_L_BLUE;
1112         }
1113
1114         if (a_ability_flags1 & (RF5_BO_PLAS))
1115         {
1116                 set_damage(player_ptr, r_idx, (MS_BOLT_PLASMA), _("プラズマ・ボルト%s", "produce plasma bolts%s"), tmp_msg[vn]);
1117                 vp[vn] = tmp_msg[vn];
1118                 color[vn++] = TERM_L_RED;
1119         }
1120
1121         if (a_ability_flags1 & (RF5_BO_ICEE))
1122         {
1123                 set_damage(player_ptr, r_idx, (MS_BOLT_ICE), _("極寒の矢%s", "produce ice bolts%s"), tmp_msg[vn]);
1124                 vp[vn] = tmp_msg[vn];
1125                 color[vn++] = TERM_WHITE;
1126         }
1127
1128         if (a_ability_flags1 & (RF5_MISSILE))
1129         {
1130                 set_damage(player_ptr, r_idx, (MS_MAGIC_MISSILE), _("マジックミサイル%s", "produce magic missiles%s"), tmp_msg[vn]);
1131                 vp[vn] = tmp_msg[vn];
1132                 color[vn++] = TERM_SLATE;
1133         }
1134
1135         if (a_ability_flags1 & (RF5_SCARE)) { vp[vn] = _("恐怖", "terrify"); color[vn++] = TERM_SLATE; }
1136         if (a_ability_flags1 & (RF5_BLIND)) { vp[vn] = _("目くらまし", "blind"); color[vn++] = TERM_L_DARK; }
1137         if (a_ability_flags1 & (RF5_CONF)) { vp[vn] = _("混乱", "confuse"); color[vn++] = TERM_L_UMBER; }
1138         if (a_ability_flags1 & (RF5_SLOW)) { vp[vn] = _("減速", "slow"); color[vn++] = TERM_UMBER; }
1139         if (a_ability_flags1 & (RF5_HOLD)) { vp[vn] = _("麻痺", "paralyze"); color[vn++] = TERM_RED; }
1140         if (a_ability_flags2 & (RF6_HASTE)) { vp[vn] = _("加速", "haste-self"); color[vn++] = TERM_L_GREEN; }
1141         if (a_ability_flags2 & (RF6_HEAL)) { vp[vn] = _("治癒", "heal-self"); color[vn++] = TERM_WHITE; }
1142         if (a_ability_flags2 & (RF6_INVULNER)) { vp[vn] = _("無敵化", "make invulnerable"); color[vn++] = TERM_WHITE; }
1143         if (flags4 & RF4_DISPEL) { vp[vn] = _("魔力消去", "dispel-magic"); color[vn++] = TERM_L_WHITE; }
1144         if (a_ability_flags2 & (RF6_BLINK)) { vp[vn] = _("ショートテレポート", "blink-self"); color[vn++] = TERM_UMBER; }
1145         if (a_ability_flags2 & (RF6_TPORT)) { vp[vn] = _("テレポート", "teleport-self"); color[vn++] = TERM_ORANGE; }
1146         if (a_ability_flags2 & (RF6_WORLD)) { vp[vn] = _("時を止める", "stop the time"); color[vn++] = TERM_L_BLUE; }
1147         if (a_ability_flags2 & (RF6_TELE_TO)) { vp[vn] = _("テレポートバック", "teleport to"); color[vn++] = TERM_L_UMBER; }
1148         if (a_ability_flags2 & (RF6_TELE_AWAY)) { vp[vn] = _("テレポートアウェイ", "teleport away"); color[vn++] = TERM_UMBER; }
1149         if (a_ability_flags2 & (RF6_TELE_LEVEL)) { vp[vn] = _("テレポート・レベル", "teleport level"); color[vn++] = TERM_ORANGE; }
1150
1151         if (a_ability_flags2 & (RF6_DARKNESS))
1152         {
1153                 if ((player_ptr->pclass != CLASS_NINJA) || (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) || (r_ptr->flags7 & RF7_DARK_MASK))
1154                 {
1155                         vp[vn] = _("暗闇", "create darkness");
1156                         color[vn++] = TERM_L_DARK;
1157                 }
1158                 else
1159                 {
1160                         vp[vn] = _("閃光", "create light");
1161                         color[vn++] = TERM_YELLOW;
1162                 }
1163         }
1164
1165         if (a_ability_flags2 & (RF6_TRAPS)) { vp[vn] = _("トラップ", "create traps"); color[vn++] = TERM_BLUE; }
1166         if (a_ability_flags2 & (RF6_FORGET)) { vp[vn] = _("記憶消去", "cause amnesia"); color[vn++] = TERM_BLUE; }
1167         if (a_ability_flags2 & (RF6_RAISE_DEAD)) { vp[vn] = _("死者復活", "raise dead"); color[vn++] = TERM_RED; }
1168         if (a_ability_flags2 & (RF6_S_MONSTER)) { vp[vn] = _("モンスター一体召喚", "summon a monster"); color[vn++] = TERM_SLATE; }
1169         if (a_ability_flags2 & (RF6_S_MONSTERS)) { vp[vn] = _("モンスター複数召喚", "summon monsters"); color[vn++] = TERM_L_WHITE; }
1170         if (a_ability_flags2 & (RF6_S_KIN)) { vp[vn] = _("救援召喚", "summon aid"); color[vn++] = TERM_ORANGE; }
1171         if (a_ability_flags2 & (RF6_S_ANT)) { vp[vn] = _("アリ召喚", "summon ants"); color[vn++] = TERM_RED; }
1172         if (a_ability_flags2 & (RF6_S_SPIDER)) { vp[vn] = _("クモ召喚", "summon spiders"); color[vn++] = TERM_L_DARK; }
1173         if (a_ability_flags2 & (RF6_S_HOUND)) { vp[vn] = _("ハウンド召喚", "summon hounds"); color[vn++] = TERM_L_UMBER; }
1174         if (a_ability_flags2 & (RF6_S_HYDRA)) { vp[vn] = _("ヒドラ召喚", "summon hydras"); color[vn++] = TERM_L_GREEN; }
1175         if (a_ability_flags2 & (RF6_S_ANGEL)) { vp[vn] = _("天使一体召喚", "summon an angel"); color[vn++] = TERM_YELLOW; }
1176         if (a_ability_flags2 & (RF6_S_DEMON)) { vp[vn] = _("デーモン一体召喚", "summon a demon"); color[vn++] = TERM_L_RED; }
1177         if (a_ability_flags2 & (RF6_S_UNDEAD)) { vp[vn] = _("アンデッド一体召喚", "summon an undead"); color[vn++] = TERM_L_DARK; }
1178         if (a_ability_flags2 & (RF6_S_DRAGON)) { vp[vn] = _("ドラゴン一体召喚", "summon a dragon"); color[vn++] = TERM_ORANGE; }
1179         if (a_ability_flags2 & (RF6_S_HI_UNDEAD)) { vp[vn] = _("強力なアンデッド召喚", "summon Greater Undead"); color[vn++] = TERM_L_DARK; }
1180         if (a_ability_flags2 & (RF6_S_HI_DRAGON)) { vp[vn] = _("古代ドラゴン召喚", "summon Ancient Dragons"); color[vn++] = TERM_ORANGE; }
1181         if (a_ability_flags2 & (RF6_S_CYBER)) { vp[vn] = _("サイバーデーモン召喚", "summon Cyberdemons"); color[vn++] = TERM_UMBER; }
1182         if (a_ability_flags2 & (RF6_S_AMBERITES)) { vp[vn] = _("アンバーの王族召喚", "summon Lords of Amber"); color[vn++] = TERM_VIOLET; }
1183         if (a_ability_flags2 & (RF6_S_UNIQUE)) { vp[vn] = _("ユニーク・モンスター召喚", "summon Unique Monsters"); color[vn++] = TERM_VIOLET; }
1184
1185         bool magic = FALSE;
1186         if (vn)
1187         {
1188                 magic = TRUE;
1189                 if (breath)
1190                 {
1191                         hooked_roff(_("、なおかつ", ", and is also"));
1192                 }
1193                 else
1194                 {
1195                         hooked_roff(format(_("%^sは", "%^s is"), wd_he[msex]));
1196                 }
1197
1198 #ifdef JP
1199                 if (flags2 & (RF2_SMART)) hook_c_roff(TERM_YELLOW, "的確に");
1200                 hooked_roff("魔法を使うことができ、");
1201 #else
1202                 hooked_roff(" magical, casting spells");
1203                 if (flags2 & RF2_SMART) hook_c_roff(TERM_YELLOW, " intelligently");
1204 #endif
1205
1206                 for (int n = 0; n < vn; n++)
1207                 {
1208 #ifdef JP
1209                         if (n != 0) hooked_roff("、");
1210 #else
1211                         if (n == 0) hooked_roff(" which ");
1212                         else if (n < vn - 1) hooked_roff(", ");
1213                         else hooked_roff(" or ");
1214 #endif
1215                         hook_c_roff(color[n], vp[n]);
1216                 }
1217
1218 #ifdef JP
1219                 hooked_roff("の呪文を唱えることがある");
1220 #endif
1221         }
1222
1223         if (breath || magic)
1224         {
1225                 int m = r_ptr->r_cast_spell;
1226                 int n = r_ptr->freq_spell;
1227                 if (m > 100 || know_everything)
1228                 {
1229                         hooked_roff(format(
1230                                 _("(確率:1/%d)", "; 1 time in %d"), 100 / n));
1231                 }
1232                 else if (m)
1233                 {
1234                         n = ((n + 9) / 10) * 10;
1235                         hooked_roff(format(
1236                                 _("(確率:約1/%d)", "; about 1 time in %d"), 100 / n));
1237                 }
1238
1239                 hooked_roff(_("。", ".  "));
1240         }
1241
1242         if (know_everything || know_armour(r_idx))
1243         {
1244                 hooked_roff(format(
1245                         _("%^sは AC%d の防御力と", "%^s has an armor rating of %d"),
1246                         wd_he[msex], r_ptr->ac));
1247
1248                 if ((flags1 & RF1_FORCE_MAXHP) || (r_ptr->hside == 1))
1249                 {
1250                         u32b hp = r_ptr->hdice * (nightmare ? 2 : 1) * r_ptr->hside;
1251                         hooked_roff(format(
1252                                 _(" %d の体力がある。", " and a life rating of %d.  "),
1253                                 (s16b)MIN(30000, hp)));
1254                 }
1255                 else
1256                 {
1257                         hooked_roff(format(
1258                                 _(" %dd%d の体力がある。", " and a life rating of %dd%d.  "),
1259                                 r_ptr->hdice * (nightmare ? 2 : 1), r_ptr->hside));
1260                 }
1261         }
1262
1263         vn = 0;
1264         if (flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) { vp[vn] = _("ダンジョンを照らす", "illuminate the dungeon");     color[vn++] = TERM_WHITE; }
1265         if (flags7 & (RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) { vp[vn] = _("ダンジョンを暗くする", "darken the dungeon");   color[vn++] = TERM_L_DARK; }
1266         if (flags2 & RF2_OPEN_DOOR) { vp[vn] = _("ドアを開ける", "open doors"); color[vn++] = TERM_WHITE; }
1267         if (flags2 & RF2_BASH_DOOR) { vp[vn] = _("ドアを打ち破る", "bash down doors"); color[vn++] = TERM_WHITE; }
1268         if (flags7 & RF7_CAN_FLY) { vp[vn] = _("空を飛ぶ", "fly"); color[vn++] = TERM_WHITE; }
1269         if (flags7 & RF7_CAN_SWIM) { vp[vn] = _("水を渡る", "swim"); color[vn++] = TERM_WHITE; }
1270         if (flags2 & RF2_PASS_WALL) { vp[vn] = _("壁をすり抜ける", "pass through walls"); color[vn++] = TERM_WHITE; }
1271         if (flags2 & RF2_KILL_WALL) { vp[vn] = _("壁を掘り進む", "bore through walls"); color[vn++] = TERM_WHITE; }
1272         if (flags2 & RF2_MOVE_BODY) { vp[vn] = _("弱いモンスターを押しのける", "push past weaker monsters"); color[vn++] = TERM_WHITE; }
1273         if (flags2 & RF2_KILL_BODY) { vp[vn] = _("弱いモンスターを倒す", "destroy weaker monsters"); color[vn++] = TERM_WHITE; }
1274         if (flags2 & RF2_TAKE_ITEM) { vp[vn] = _("アイテムを拾う", "pick up objects"); color[vn++] = TERM_WHITE; }
1275         if (flags2 & RF2_KILL_ITEM) { vp[vn] = _("アイテムを壊す", "destroy objects"); color[vn++] = TERM_WHITE; }
1276
1277         if (vn > 0)
1278         {
1279                 hooked_roff(format(_("%^sは", "%^s"), wd_he[msex]));
1280                 for (int n = 0; n < vn; n++)
1281                 {
1282 #ifdef JP
1283                         if (n != vn - 1)
1284                         {
1285                                 jverb(vp[n], jverb_buf, JVERB_AND);
1286                                 hook_c_roff(color[n], jverb_buf);
1287                                 hooked_roff("、");
1288                         }
1289                         else
1290                         {
1291                                 hook_c_roff(color[n], vp[n]);
1292                         }
1293 #else
1294                         if (n == 0) hooked_roff(" can ");
1295                         else if (n < vn - 1) hooked_roff(", ");
1296                         else hooked_roff(" and ");
1297
1298                         hook_c_roff(color[n], vp[n]);
1299 #endif
1300
1301                 }
1302
1303                 hooked_roff(_("ことができる。", ".  "));
1304         }
1305
1306         if (flags7 & RF7_AQUATIC)
1307         {
1308                 hooked_roff(format(_("%^sは水中に棲んでいる。", "%^s lives in water.  "), wd_he[msex]));
1309         }
1310
1311         if (flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
1312         {
1313                 hooked_roff(format(_("%^sは光っている。", "%^s is shining.  "), wd_he[msex]));
1314         }
1315
1316         if (flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2))
1317         {
1318                 hook_c_roff(TERM_L_DARK, format(_("%^sは暗黒に包まれている。", "%^s is surrounded by darkness.  "), wd_he[msex]));
1319         }
1320
1321         if (flags2 & RF2_INVISIBLE)
1322         {
1323                 hooked_roff(format(_("%^sは透明で目に見えない。", "%^s is invisible.  "), wd_he[msex]));
1324         }
1325
1326         if (flags2 & RF2_COLD_BLOOD)
1327         {
1328                 hooked_roff(format(_("%^sは冷血動物である。", "%^s is cold blooded.  "), wd_he[msex]));
1329         }
1330
1331         if (flags2 & RF2_EMPTY_MIND)
1332         {
1333                 hooked_roff(format(_("%^sはテレパシーでは感知できない。", "%^s is not detected by telepathy.  "), wd_he[msex]));
1334         }
1335         else if (flags2 & RF2_WEIRD_MIND)
1336         {
1337                 hooked_roff(format(_("%^sはまれにテレパシーで感知できる。", "%^s is rarely detected by telepathy.  "), wd_he[msex]));
1338         }
1339
1340         if (flags2 & RF2_MULTIPLY)
1341         {
1342                 hook_c_roff(TERM_L_UMBER, format(_("%^sは爆発的に増殖する。", "%^s breeds explosively.  "), wd_he[msex]));
1343         }
1344
1345         if (flags2 & RF2_REGENERATE)
1346         {
1347                 hook_c_roff(TERM_L_WHITE, format(_("%^sは素早く体力を回復する。", "%^s regenerates quickly.  "), wd_he[msex]));
1348         }
1349
1350         if (flags7 & RF7_RIDING)
1351         {
1352                 hook_c_roff(TERM_SLATE, format(_("%^sに乗ることができる。", "%^s is suitable for riding.  "), wd_he[msex]));
1353         }
1354
1355         vn = 0;
1356         if (flags3 & RF3_HURT_ROCK) { vp[vn] = _("岩を除去するもの", "rock remover"); color[vn++] = TERM_UMBER; }
1357         if (flags3 & RF3_HURT_LITE) { vp[vn] = _("明るい光", "bright light"); color[vn++] = TERM_YELLOW; }
1358         if (flags3 & RF3_HURT_FIRE) { vp[vn] = _("炎", "fire"); color[vn++] = TERM_RED; }
1359         if (flags3 & RF3_HURT_COLD) { vp[vn] = _("冷気", "cold"); color[vn++] = TERM_L_WHITE; }
1360
1361         if (vn > 0)
1362         {
1363                 hooked_roff(format(_("%^sには", "%^s"), wd_he[msex]));
1364
1365                 for (int n = 0; n < vn; n++)
1366                 {
1367 #ifdef JP
1368                         if (n != 0) hooked_roff("や");
1369 #else
1370                         if (n == 0) hooked_roff(" is hurt by ");
1371                         else if (n < vn - 1) hooked_roff(", ");
1372                         else hooked_roff(" and ");
1373 #endif
1374                         hook_c_roff(color[n], vp[n]);
1375                 }
1376
1377                 hooked_roff(_("でダメージを与えられる。", ".  "));
1378         }
1379
1380         vn = 0;
1381         if (flagsr & RFR_IM_ACID) { vp[vn] = _("酸", "acid"); color[vn++] = TERM_GREEN; }
1382         if (flagsr & RFR_IM_ELEC) { vp[vn] = _("稲妻", "lightning"); color[vn++] = TERM_BLUE; }
1383         if (flagsr & RFR_IM_FIRE) { vp[vn] = _("炎", "fire"); color[vn++] = TERM_RED; }
1384         if (flagsr & RFR_IM_COLD) { vp[vn] = _("冷気", "cold"); color[vn++] = TERM_L_WHITE; }
1385         if (flagsr & RFR_IM_POIS) { vp[vn] = _("毒", "poison"); color[vn++] = TERM_L_GREEN; }
1386
1387         if (flagsr & RFR_RES_LITE) { vp[vn] = _("閃光", "light"); color[vn++] = TERM_YELLOW; }
1388         if (flagsr & RFR_RES_DARK) { vp[vn] = _("暗黒", "dark"); color[vn++] = TERM_L_DARK; }
1389         if (flagsr & RFR_RES_NETH) { vp[vn] = _("地獄", "nether"); color[vn++] = TERM_L_DARK; }
1390         if (flagsr & RFR_RES_WATE) { vp[vn] = _("水", "water"); color[vn++] = TERM_BLUE; }
1391         if (flagsr & RFR_RES_PLAS) { vp[vn] = _("プラズマ", "plasma"); color[vn++] = TERM_L_RED; }
1392         if (flagsr & RFR_RES_SHAR) { vp[vn] = _("破片", "shards"); color[vn++] = TERM_L_UMBER; }
1393         if (flagsr & RFR_RES_SOUN) { vp[vn] = _("轟音", "sound"); color[vn++] = TERM_ORANGE; }
1394         if (flagsr & RFR_RES_CHAO) { vp[vn] = _("カオス", "chaos"); color[vn++] = TERM_VIOLET; }
1395         if (flagsr & RFR_RES_NEXU) { vp[vn] = _("因果混乱", "nexus"); color[vn++] = TERM_VIOLET; }
1396         if (flagsr & RFR_RES_DISE) { vp[vn] = _("劣化", "disenchantment"); color[vn++] = TERM_VIOLET; }
1397         if (flagsr & RFR_RES_WALL) { vp[vn] = _("フォース", "force"); color[vn++] = TERM_UMBER; }
1398         if (flagsr & RFR_RES_INER) { vp[vn] = _("遅鈍", "inertia"); color[vn++] = TERM_SLATE; }
1399         if (flagsr & RFR_RES_TIME) { vp[vn] = _("時間逆転", "time"); color[vn++] = TERM_L_BLUE; }
1400         if (flagsr & RFR_RES_GRAV) { vp[vn] = _("重力", "gravity"); color[vn++] = TERM_SLATE; }
1401         if (flagsr & RFR_RES_ALL) { vp[vn] = _("あらゆる攻撃", "all"); color[vn++] = TERM_YELLOW; }
1402         if ((flagsr & RFR_RES_TELE) && !(r_ptr->flags1 & RF1_UNIQUE)) { vp[vn] = _("テレポート", "teleportation"); color[vn++] = TERM_ORANGE; }
1403
1404         if (vn > 0)
1405         {
1406                 hooked_roff(format(_("%^sは", "%^s"), wd_he[msex]));
1407                 for (int n = 0; n < vn; n++)
1408                 {
1409 #ifdef JP
1410                         if (n != 0) hooked_roff("と");
1411 #else
1412                         if (n == 0) hooked_roff(" resists ");
1413                         else if (n < vn - 1) hooked_roff(", ");
1414                         else hooked_roff(" and ");
1415 #endif
1416                         hook_c_roff(color[n], vp[n]);
1417                 }
1418
1419                 hooked_roff(_("の耐性を持っている。", ".  "));
1420         }
1421
1422         if ((r_ptr->r_xtra1 & MR1_SINKA) || know_everything)
1423         {
1424                 if (r_ptr->next_r_idx)
1425                 {
1426                         hooked_roff(format(_("%^sは経験を積むと、", "%^s will evolve into "), wd_he[msex]));
1427                         hook_c_roff(TERM_YELLOW, format("%s", r_name + r_info[r_ptr->next_r_idx].name));
1428
1429                         hooked_roff(
1430                                 _(format("に進化する。"),
1431                                         format(" when %s gets enough experience.  ", wd_he[msex])));
1432                 }
1433                 else if (!(r_ptr->flags1 & RF1_UNIQUE))
1434                 {
1435                         hooked_roff(format(_("%sは進化しない。", "%s won't evolve.  "), wd_he[msex]));
1436                 }
1437         }
1438
1439         vn = 0;
1440         if (flags3 & RF3_NO_STUN) { vp[vn] = _("朦朧としない", "stunned"); color[vn++] = TERM_ORANGE; }
1441         if (flags3 & RF3_NO_FEAR) { vp[vn] = _("恐怖を感じない", "frightened"); color[vn++] = TERM_SLATE; }
1442         if (flags3 & RF3_NO_CONF) { vp[vn] = _("混乱しない", "confused"); color[vn++] = TERM_L_UMBER; }
1443         if (flags3 & RF3_NO_SLEEP) { vp[vn] = _("眠らされない", "slept"); color[vn++] = TERM_BLUE; }
1444         if ((flagsr & RFR_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) { vp[vn] = _("テレポートされない", "teleported"); color[vn++] = TERM_ORANGE; }
1445
1446         if (vn > 0)
1447         {
1448                 hooked_roff(format(_("%^sは", "%^s"), wd_he[msex]));
1449                 for (int n = 0; n < vn; n++)
1450                 {
1451 #ifdef JP
1452                         if (n != 0) hooked_roff("し、");
1453 #else
1454                         if (n == 0) hooked_roff(" cannot be ");
1455                         else if (n < vn - 1) hooked_roff(", ");
1456                         else hooked_roff(" or ");
1457 #endif
1458                         hook_c_roff(color[n], vp[n]);
1459                 }
1460
1461                 hooked_roff(_("。", ".  "));
1462         }
1463
1464         if ((((int)r_ptr->r_wake * (int)r_ptr->r_wake) > r_ptr->sleep) ||
1465                 (r_ptr->r_ignore == MAX_UCHAR) ||
1466                 (r_ptr->sleep == 0 && r_ptr->r_tkills >= 10) || know_everything)
1467         {
1468                 concptr act;
1469                 if (r_ptr->sleep > 200)
1470                 {
1471                         act = _("を無視しがちであるが", "prefers to ignore");
1472                 }
1473                 else if (r_ptr->sleep > 95)
1474                 {
1475                         act = _("に対してほとんど注意を払わないが", "pays very little attention to");
1476                 }
1477                 else if (r_ptr->sleep > 75)
1478                 {
1479                         act = _("に対してあまり注意を払わないが", "pays little attention to");
1480                 }
1481                 else if (r_ptr->sleep > 45)
1482                 {
1483                         act = _("を見過ごしがちであるが", "tends to overlook");
1484                 }
1485                 else if (r_ptr->sleep > 25)
1486                 {
1487                         act = _("をほんの少しは見ており", "takes quite a while to see");
1488                 }
1489                 else if (r_ptr->sleep > 10)
1490                 {
1491                         act = _("をしばらくは見ており", "takes a while to see");
1492                 }
1493                 else if (r_ptr->sleep > 5)
1494                 {
1495                         act = _("を幾分注意深く見ており", "is fairly observant of");
1496                 }
1497                 else if (r_ptr->sleep > 3)
1498                 {
1499                         act = _("を注意深く見ており", "is observant of");
1500                 }
1501                 else if (r_ptr->sleep > 1)
1502                 {
1503                         act = _("をかなり注意深く見ており", "is very observant of");
1504                 }
1505                 else if (r_ptr->sleep > 0)
1506                 {
1507                         act = _("を警戒しており", "is vigilant for");
1508                 }
1509                 else
1510                 {
1511                         act = _("をかなり警戒しており", "is ever vigilant for");
1512                 }
1513
1514                 hooked_roff(
1515                         _(format("%^sは侵入者%s、 %d フィート先から侵入者に気付くことがある。", wd_he[msex], act, 10 * r_ptr->aaf),
1516                                 format("%^s %s intruders, which %s may notice from %d feet.  ", wd_he[msex], act, wd_he[msex], 10 * r_ptr->aaf)));
1517         }
1518
1519         if (drop_gold || drop_item)
1520         {
1521                 hooked_roff(format(_("%^sは", "%^s may carry"), wd_he[msex]));
1522 #ifdef JP
1523 #else
1524                 sin = FALSE;
1525 #endif
1526
1527                 int n = MAX(drop_gold, drop_item);
1528                 if (n == 1)
1529                 {
1530                         hooked_roff(_("一つの", " a"));
1531 #ifdef JP
1532 #else
1533                         sin = TRUE;
1534 #endif
1535                 }
1536                 else if (n == 2)
1537                 {
1538                         hooked_roff(_("一つか二つの", " one or two"));
1539                 }
1540                 else
1541                 {
1542                         hooked_roff(format(_(" %d 個までの", " up to %d"), n));
1543                 }
1544
1545                 concptr p;
1546                 if (flags1 & RF1_DROP_GREAT)
1547                 {
1548                         p = _("特別な", " exceptional");
1549                 }
1550                 else if (flags1 & RF1_DROP_GOOD)
1551                 {
1552                         p = _("上質な", " good");
1553 #ifdef JP
1554 #else
1555                         sin = FALSE;
1556 #endif
1557                 }
1558                 else
1559                 {
1560                         p = NULL;
1561                 }
1562
1563                 if (drop_item)
1564                 {
1565 #ifdef JP
1566 #else
1567                         if (sin) hooked_roff("n");
1568                         sin = FALSE;
1569 #endif
1570                         if (p) hooked_roff(p);
1571                         hooked_roff(_("アイテム", " object"));
1572 #ifdef JP
1573 #else
1574                         if (n != 1) hooked_roff("s");
1575 #endif
1576                         p = _("や", " or");
1577                 }
1578
1579                 if (drop_gold)
1580                 {
1581 #ifdef JP
1582 #else
1583                         if (!p) sin = FALSE;
1584                         if (sin) hooked_roff("n");
1585                         sin = FALSE;
1586 #endif
1587                         if (p) hooked_roff(p);
1588                         hooked_roff(_("財宝", " treasure"));
1589 #ifdef JP
1590 #else
1591                         if (n != 1) hooked_roff("s");
1592 #endif
1593                 }
1594
1595                 hooked_roff(_("を持っていることがある。", ".  "));
1596         }
1597
1598         const int max_attack_numbers = 4;
1599         int count = 0;
1600         for (int m = 0; m < max_attack_numbers; m++)
1601         {
1602                 if (!r_ptr->blow[m].method) continue;
1603                 if (r_ptr->blow[m].method == RBM_SHOOT) continue;
1604
1605                 if (r_ptr->r_blows[m] || know_everything) count++;
1606         }
1607
1608         int attack_numbers = 0;
1609         for (int m = 0; m < max_attack_numbers; m++)
1610         {
1611                 if (!r_ptr->blow[m].method) continue;
1612                 if (r_ptr->blow[m].method == RBM_SHOOT) continue;
1613                 if (!r_ptr->r_blows[m] && !know_everything) continue;
1614
1615                 int method = r_ptr->blow[m].method;
1616                 int effect = r_ptr->blow[m].effect;
1617                 int d1 = r_ptr->blow[m].d_dice;
1618                 int d2 = r_ptr->blow[m].d_side;
1619
1620                 concptr p = NULL;
1621                 switch (method)
1622                 {
1623                 case RBM_HIT:           p = _("殴る", "hit"); break;
1624                 case RBM_TOUCH:         p = _("触る", "touch"); break;
1625                 case RBM_PUNCH:         p = _("パンチする", "punch"); break;
1626                 case RBM_KICK:          p = _("蹴る", "kick"); break;
1627                 case RBM_CLAW:          p = _("ひっかく", "claw"); break;
1628                 case RBM_BITE:          p = _("噛む", "bite"); break;
1629                 case RBM_STING:         p = _("刺す", "sting"); break;
1630                 case RBM_SLASH:         p = _("斬る", "slash"); break;
1631                 case RBM_BUTT:          p = _("角で突く", "butt"); break;
1632                 case RBM_CRUSH:         p = _("体当たりする", "crush"); break;
1633                 case RBM_ENGULF:        p = _("飲み込む", "engulf"); break;
1634                 case RBM_CHARGE:        p = _("請求書をよこす", "charge"); break;
1635                 case RBM_CRAWL:         p = _("体の上を這い回る", "crawl on you"); break;
1636                 case RBM_DROOL:         p = _("よだれをたらす", "drool on you"); break;
1637                 case RBM_SPIT:          p = _("つばを吐く", "spit"); break;
1638                 case RBM_EXPLODE:       p = _("爆発する", "explode"); break;
1639                 case RBM_GAZE:          p = _("にらむ", "gaze"); break;
1640                 case RBM_WAIL:          p = _("泣き叫ぶ", "wail"); break;
1641                 case RBM_SPORE:         p = _("胞子を飛ばす", "release spores"); break;
1642                 case RBM_XXX4:          break;
1643                 case RBM_BEG:           p = _("金をせがむ", "beg"); break;
1644                 case RBM_INSULT:        p = _("侮辱する", "insult"); break;
1645                 case RBM_MOAN:          p = _("うめく", "moan"); break;
1646                 case RBM_SHOW:          p = _("歌う", "sing"); break;
1647                 }
1648
1649                 concptr q = NULL;
1650                 switch (effect)
1651                 {
1652                 case RBE_SUPERHURT: q = _("強力に攻撃する", "slaughter"); break;
1653                 case RBE_HURT:          q = _("攻撃する", "attack"); break;
1654                 case RBE_POISON:        q = _("毒をくらわす", "poison"); break;
1655                 case RBE_UN_BONUS:      q = _("劣化させる", "disenchant"); break;
1656                 case RBE_UN_POWER:      q = _("充填魔力を吸収する", "drain charges"); break;
1657                 case RBE_EAT_GOLD:      q = _("金を盗む", "steal gold"); break;
1658                 case RBE_EAT_ITEM:      q = _("アイテムを盗む", "steal items"); break;
1659                 case RBE_EAT_FOOD:      q = _("あなたの食料を食べる", "eat your food"); break;
1660                 case RBE_EAT_LITE:      q = _("明かりを吸収する", "absorb light"); break;
1661                 case RBE_ACID:          q = _("酸を飛ばす", "shoot acid"); break;
1662                 case RBE_ELEC:          q = _("感電させる", "electrocute"); break;
1663                 case RBE_FIRE:          q = _("燃やす", "burn"); break;
1664                 case RBE_COLD:          q = _("凍らせる", "freeze"); break;
1665                 case RBE_BLIND:         q = _("盲目にする", "blind"); break;
1666                 case RBE_CONFUSE:       q = _("混乱させる", "confuse"); break;
1667                 case RBE_TERRIFY:       q = _("恐怖させる", "terrify"); break;
1668                 case RBE_PARALYZE:      q = _("麻痺させる", "paralyze"); break;
1669                 case RBE_LOSE_STR:      q = _("腕力を減少させる", "reduce strength"); break;
1670                 case RBE_LOSE_INT:      q = _("知能を減少させる", "reduce intelligence"); break;
1671                 case RBE_LOSE_WIS:      q = _("賢さを減少させる", "reduce wisdom"); break;
1672                 case RBE_LOSE_DEX:      q = _("器用さを減少させる", "reduce dexterity"); break;
1673                 case RBE_LOSE_CON:      q = _("耐久力を減少させる", "reduce constitution"); break;
1674                 case RBE_LOSE_CHR:      q = _("魅力を減少させる", "reduce charisma"); break;
1675                 case RBE_LOSE_ALL:      q = _("全ステータスを減少させる", "reduce all stats"); break;
1676                 case RBE_SHATTER:       q = _("粉砕する", "shatter"); break;
1677                 case RBE_EXP_10:        q = _("経験値を減少(10d6+)させる", "lower experience (by 10d6+)"); break;
1678                 case RBE_EXP_20:        q = _("経験値を減少(20d6+)させる", "lower experience (by 20d6+)"); break;
1679                 case RBE_EXP_40:        q = _("経験値を減少(40d6+)させる", "lower experience (by 40d6+)"); break;
1680                 case RBE_EXP_80:        q = _("経験値を減少(80d6+)させる", "lower experience (by 80d6+)"); break;
1681                 case RBE_DISEASE:       q = _("病気にする", "disease"); break;
1682                 case RBE_TIME:      q = _("時間を逆戻りさせる", "time"); break;
1683                 case RBE_DR_LIFE:   q = _("生命力を吸収する", "drain life"); break;
1684                 case RBE_DR_MANA:   q = _("魔力を奪う", "drain mana force"); break;
1685                 case RBE_INERTIA:   q = _("減速させる", "slow"); break;
1686                 case RBE_STUN:      q = _("朦朧とさせる", "stun"); break;
1687                 }
1688
1689 #ifdef JP
1690                 if (attack_numbers == 0)
1691                 {
1692                         hooked_roff(format("%^sは", wd_he[msex]));
1693                 }
1694
1695                 if (d1 && d2 && (know_everything || know_damage(r_idx, m)))
1696                 {
1697                         hooked_roff(format(" %dd%d ", d1, d2));
1698                         hooked_roff("のダメージで");
1699                 }
1700
1701                 if (!p) p = "何か奇妙なことをする";
1702
1703                 /* XXしてYYし/XXしてYYする/XXし/XXする */
1704                 if (q != NULL) jverb(p, jverb_buf, JVERB_TO);
1705                 else if (attack_numbers != count - 1) jverb(p, jverb_buf, JVERB_AND);
1706                 else strcpy(jverb_buf, p);
1707
1708                 hooked_roff(jverb_buf);
1709                 if (q)
1710                 {
1711                         if (attack_numbers != count - 1) jverb(q, jverb_buf, JVERB_AND);
1712                         else strcpy(jverb_buf, q);
1713                         hooked_roff(jverb_buf);
1714                 }
1715
1716                 if (attack_numbers != count - 1) hooked_roff("、");
1717 #else
1718                 if (attack_numbers == 0)
1719                 {
1720                         hooked_roff(format("%^s can ", wd_he[msex]));
1721                 }
1722                 else if (attack_numbers < count - 1)
1723                 {
1724                         hooked_roff(", ");
1725                 }
1726                 else
1727                 {
1728                         hooked_roff(", and ");
1729                 }
1730
1731                 if (!p) p = "do something weird";
1732                 hooked_roff(p);
1733                 if (q)
1734                 {
1735                         hooked_roff(" to ");
1736                         hooked_roff(q);
1737                         if (d1 && d2 && (know_everything || know_damage(r_idx, m)))
1738                         {
1739                                 hooked_roff(" with damage");
1740                                 hooked_roff(format(" %dd%d", d1, d2));
1741                         }
1742                 }
1743 #endif
1744
1745                 attack_numbers++;
1746         }
1747
1748         if (attack_numbers > 0)
1749         {
1750                 hooked_roff(_("。", ".  "));
1751         }
1752         else if (flags1 & RF1_NEVER_BLOW)
1753         {
1754                 hooked_roff(format(
1755                         _("%^sは物理的な攻撃方法を持たない。",
1756                                 "%^s has no physical attacks.  "), wd_he[msex]));
1757         }
1758         else
1759         {
1760                 hooked_roff(format(
1761                         _("%s攻撃については何も知らない。",
1762                                 "Nothing is known about %s attack.  "), wd_his[msex]));
1763         }
1764
1765         bool is_kingpin = (flags1 & RF1_QUESTOR) != 0;
1766         is_kingpin &= r_ptr->r_sights > 0;
1767         is_kingpin &= r_ptr->max_num > 0;
1768         is_kingpin &= (r_idx == MON_OBERON) || (r_idx == MON_SERPENT);
1769         if (is_kingpin)
1770         {
1771                 hook_c_roff(TERM_VIOLET,
1772                         _("あなたはこのモンスターを殺したいという強い欲望を感じている...",
1773                                 "You feel an intense desire to kill this monster...  "));
1774         }
1775         else if (flags7 & RF7_GUARDIAN)
1776         {
1777                 hook_c_roff(TERM_L_RED,
1778                         _("このモンスターはダンジョンの主である。",
1779                                 "This monster is the master of a dungeon."));
1780         }
1781
1782         hooked_roff("\n");
1783 }
1784
1785
1786 /*!
1787  * @brief モンスター情報のヘッダを記述する
1788  * Hack -- Display the "name" and "attr/chars" of a monster race
1789  * @param r_idx モンスターの種族ID
1790  * @return なし
1791  */
1792 void roff_top(MONRACE_IDX r_idx)
1793 {
1794         monster_race *r_ptr = &r_info[r_idx];
1795         char c1 = r_ptr->d_char;
1796         char c2 = r_ptr->x_char;
1797
1798         TERM_COLOR a1 = r_ptr->d_attr;
1799         TERM_COLOR a2 = r_ptr->x_attr;
1800
1801         Term_erase(0, 0, 255);
1802         Term_gotoxy(0, 0);
1803
1804 #ifdef JP
1805 #else
1806         if (!(r_ptr->flags1 & RF1_UNIQUE))
1807         {
1808                 Term_addstr(-1, TERM_WHITE, "The ");
1809         }
1810 #endif
1811
1812         Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
1813
1814         Term_addstr(-1, TERM_WHITE, " ('");
1815         Term_add_bigch(a1, c1);
1816         Term_addstr(-1, TERM_WHITE, "')");
1817
1818         Term_addstr(-1, TERM_WHITE, "/('");
1819         Term_add_bigch(a2, c2);
1820         Term_addstr(-1, TERM_WHITE, "'):");
1821
1822         if (!current_world_ptr->wizard) return;
1823
1824         char buf[16];
1825         sprintf(buf, "%d", r_idx);
1826         Term_addstr(-1, TERM_WHITE, " (");
1827         Term_addstr(-1, TERM_L_BLUE, buf);
1828         Term_addch(TERM_WHITE, ')');
1829 }
1830
1831
1832 /*!
1833  * @brief  モンスター情報の表示と共に画面を一時消去するサブルーチン /
1834  * Hack -- describe the given monster race at the top of the screen
1835  * @param r_idx モンスターの種族ID
1836  * @param mode 表示オプション
1837  * @return なし
1838  */
1839 void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode)
1840 {
1841         msg_erase();
1842         Term_erase(0, 1, 255);
1843         hook_c_roff = c_roff;
1844         roff_aux(player_ptr, r_idx, mode);
1845         roff_top(r_idx);
1846 }
1847
1848
1849 /*!
1850  * @brief モンスター情報の現在のウィンドウに表示する /
1851  * Hack -- describe the given monster race in the current "term" window
1852  * @param r_idx モンスターの種族ID
1853  * @return なし
1854  */
1855 void display_roff(player_type *player_ptr)
1856 {
1857         for (int y = 0; y < Term->hgt; y++)
1858         {
1859                 Term_erase(0, y, 255);
1860         }
1861
1862         Term_gotoxy(0, 1);
1863         hook_c_roff = c_roff;
1864         MONRACE_IDX r_idx = player_ptr->monster_race_idx;
1865         roff_aux(player_ptr, r_idx, 0);
1866         roff_top(r_idx);
1867 }
1868
1869
1870 /*!
1871  * @brief モンスター詳細情報を自動スポイラー向けに出力する /
1872  * Hack -- output description of the given monster race
1873  * @param r_idx モンスターの種族ID
1874  * @param roff_func 出力処理を行う関数ポインタ
1875  * @return なし
1876  */
1877 void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str))
1878 {
1879         hook_c_roff = roff_func;
1880         roff_aux(player_ptr, r_idx, 0x03);
1881 }
1882
1883
1884 /*!
1885  * @brief プレイヤーの現在の広域マップ座標から得た地勢を元にモンスターの生成条件関数を返す
1886  * @param player_ptr プレーヤーへの参照ポインタ
1887  * @return 地勢にあったモンスターの生成条件関数
1888  */
1889 monsterrace_hook_type get_monster_hook(player_type *player_ptr)
1890 {
1891         if ((player_ptr->current_floor_ptr->dun_level > 0) || (player_ptr->current_floor_ptr->inside_quest > 0))
1892                 return (monsterrace_hook_type)mon_hook_dungeon;
1893
1894         switch (wilderness[player_ptr->wilderness_y][player_ptr->wilderness_x].terrain)
1895         {
1896         case TERRAIN_TOWN:
1897                 return (monsterrace_hook_type)mon_hook_town;
1898         case TERRAIN_DEEP_WATER:
1899                 return (monsterrace_hook_type)mon_hook_ocean;
1900         case TERRAIN_SHALLOW_WATER:
1901         case TERRAIN_SWAMP:
1902                 return (monsterrace_hook_type)mon_hook_shore;
1903         case TERRAIN_DIRT:
1904         case TERRAIN_DESERT:
1905                 return (monsterrace_hook_type)mon_hook_waste;
1906         case TERRAIN_GRASS:
1907                 return (monsterrace_hook_type)mon_hook_grass;
1908         case TERRAIN_TREES:
1909                 return (monsterrace_hook_type)mon_hook_wood;
1910         case TERRAIN_SHALLOW_LAVA:
1911         case TERRAIN_DEEP_LAVA:
1912                 return (monsterrace_hook_type)mon_hook_volcano;
1913         case TERRAIN_MOUNTAIN:
1914                 return (monsterrace_hook_type)mon_hook_mountain;
1915         default:
1916                 return (monsterrace_hook_type)mon_hook_dungeon;
1917         }
1918 }
1919
1920
1921 /*!
1922  * @brief 指定された広域マップ座標の地勢を元にモンスターの生成条件関数を返す
1923  * @return 地勢にあったモンスターの生成条件関数
1924  */
1925 monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x)
1926 {
1927         feature_type *f_ptr = &f_info[player_ptr->current_floor_ptr->grid_array[y][x].feat];
1928         if (have_flag(f_ptr->flags, FF_WATER))
1929         {
1930                 if (have_flag(f_ptr->flags, FF_DEEP))
1931                 {
1932                         return (monsterrace_hook_type)mon_hook_deep_water;
1933                 }
1934                 else
1935                 {
1936                         return (monsterrace_hook_type)mon_hook_shallow_water;
1937                 }
1938         }
1939
1940         if (have_flag(f_ptr->flags, FF_LAVA))
1941         {
1942                 return (monsterrace_hook_type)mon_hook_lava;
1943         }
1944
1945         return (monsterrace_hook_type)mon_hook_floor;
1946 }
1947
1948
1949 /*!
1950  * @brief モンスターを友好的にする
1951  * @param m_ptr モンスター情報構造体の参照ポインタ
1952  * @return なし
1953  */
1954 void set_friendly(monster_type *m_ptr)
1955 {
1956         m_ptr->smart |= SM_FRIENDLY;
1957 }
1958
1959
1960 /*!
1961  * @brief モンスターをペットにする
1962  * @param player_type プレーヤーへの参照ポインタ
1963  * @param m_ptr モンスター情報構造体の参照ポインタ
1964  * @return なし
1965  */
1966 void set_pet(player_type *player_ptr, monster_type *m_ptr)
1967 {
1968         check_quest_completion(player_ptr, m_ptr);
1969         m_ptr->smart |= SM_PET;
1970         if (!(r_info[m_ptr->r_idx].flags3 & (RF3_EVIL | RF3_GOOD)))
1971                 m_ptr->sub_align = SUB_ALIGN_NEUTRAL;
1972 }
1973
1974
1975 /*!
1976  * @brief モンスターを敵に回す
1977  * Makes the monster hostile towards the player
1978  * @param m_ptr モンスター情報構造体の参照ポインタ
1979  * @return なし
1980  */
1981 void set_hostile(player_type *player_ptr, monster_type *m_ptr)
1982 {
1983         if (player_ptr->phase_out) return;
1984         m_ptr->smart &= ~SM_PET;
1985         m_ptr->smart &= ~SM_FRIENDLY;
1986 }
1987
1988
1989 /*!
1990  * @brief モンスターを怒らせる
1991  * Anger the monster
1992  * @param m_ptr モンスター情報構造体の参照ポインタ
1993  * @return なし
1994  */
1995 void anger_monster(player_type *player_ptr, monster_type *m_ptr)
1996 {
1997         if (player_ptr->phase_out) return;
1998         if (!is_friendly(m_ptr)) return;
1999
2000         GAME_TEXT m_name[MAX_NLEN];
2001
2002         monster_desc(player_ptr, m_name, m_ptr, 0);
2003         msg_format(_("%^sは怒った!", "%^s gets angry!"), m_name);
2004         set_hostile(player_ptr, m_ptr);
2005         chg_virtue(player_ptr, V_INDIVIDUALISM, 1);
2006         chg_virtue(player_ptr, V_HONOUR, -1);
2007         chg_virtue(player_ptr, V_JUSTICE, -1);
2008         chg_virtue(player_ptr, V_COMPASSION, -1);
2009 }
2010
2011
2012 /*!
2013  * @brief モンスターが地形を踏破できるかどうかを返す
2014  * Check if monster can cross terrain
2015  * @param player_ptr プレーヤーへの参照ポインタ
2016  * @param feat 地形ID
2017  * @param r_ptr モンスター種族構造体の参照ポインタ
2018  * @param mode オプション
2019  * @return 踏破可能ならばTRUEを返す
2020  */
2021 bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode)
2022 {
2023         feature_type *f_ptr = &f_info[feat];
2024
2025         if (have_flag(f_ptr->flags, FF_PATTERN))
2026         {
2027                 if (!(mode & CEM_RIDING))
2028                 {
2029                         if (!(r_ptr->flags7 & RF7_CAN_FLY)) return FALSE;
2030                 }
2031                 else
2032                 {
2033                         if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
2034                 }
2035         }
2036
2037         if (have_flag(f_ptr->flags, FF_CAN_FLY) && (r_ptr->flags7 & RF7_CAN_FLY)) return TRUE;
2038         if (have_flag(f_ptr->flags, FF_CAN_SWIM) && (r_ptr->flags7 & RF7_CAN_SWIM)) return TRUE;
2039         if (have_flag(f_ptr->flags, FF_CAN_PASS))
2040         {
2041                 if ((r_ptr->flags2 & RF2_PASS_WALL) && (!(mode & CEM_RIDING) || player_ptr->pass_wall)) return TRUE;
2042         }
2043
2044         if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
2045
2046         if (have_flag(f_ptr->flags, FF_MOUNTAIN) && (r_ptr->flags8 & RF8_WILD_MOUNTAIN)) return TRUE;
2047
2048         if (have_flag(f_ptr->flags, FF_WATER))
2049         {
2050                 if (!(r_ptr->flags7 & RF7_AQUATIC))
2051                 {
2052                         if (have_flag(f_ptr->flags, FF_DEEP)) return FALSE;
2053                         else if (r_ptr->flags2 & RF2_AURA_FIRE) return FALSE;
2054                 }
2055         }
2056         else if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
2057
2058         if (have_flag(f_ptr->flags, FF_LAVA))
2059         {
2060                 if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) return FALSE;
2061         }
2062
2063         if (have_flag(f_ptr->flags, FF_COLD_PUDDLE))
2064         {
2065                 if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)) return FALSE;
2066         }
2067
2068         if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE))
2069         {
2070                 if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)) return FALSE;
2071         }
2072
2073         if (have_flag(f_ptr->flags, FF_ACID_PUDDLE))
2074         {
2075                 if (!(r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)) return FALSE;
2076         }
2077
2078         if (have_flag(f_ptr->flags, FF_POISON_PUDDLE))
2079         {
2080                 if (!(r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)) return FALSE;
2081         }
2082
2083         return TRUE;
2084 }
2085
2086
2087 /*!
2088  * @brief 指定された座標の地形をモンスターが踏破できるかどうかを返す
2089  * Strictly check if monster can enter the grid
2090  * @param player_ptr プレーヤーへの参照ポインタ
2091  * @param y 地形のY座標
2092  * @param x 地形のX座標
2093  * @param r_ptr モンスター種族構造体の参照ポインタ
2094  * @param mode オプション
2095  * @return 踏破可能ならばTRUEを返す
2096  */
2097 bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
2098 {
2099         grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
2100         if (player_bold(player_ptr, y, x)) return FALSE;
2101         if (g_ptr->m_idx) return FALSE;
2102
2103         return monster_can_cross_terrain(player_ptr, g_ptr->feat, r_ptr, mode);
2104 }
2105
2106
2107 /*!
2108  * @brief モンスターの属性の基づいた敵対関係の有無を返す(サブルーチン)
2109  * Check if this monster has "hostile" alignment (aux)
2110  * @param sub_align1 モンスター1のサブフラグ
2111  * @param sub_align2 モンスター2のサブフラグ
2112  * @return 敵対関係にあるならばTRUEを返す
2113  */
2114 static bool check_hostile_align(byte sub_align1, byte sub_align2)
2115 {
2116         if (sub_align1 != sub_align2)
2117         {
2118                 if (((sub_align1 & SUB_ALIGN_EVIL) && (sub_align2 & SUB_ALIGN_GOOD)) ||
2119                         ((sub_align1 & SUB_ALIGN_GOOD) && (sub_align2 & SUB_ALIGN_EVIL)))
2120                         return TRUE;
2121         }
2122
2123         return FALSE;
2124 }
2125
2126
2127 /*!
2128  * @brief モンスターの属性の基づいた敵対関係の有無を返す
2129  * Check if two monsters are enemies
2130  * @param m_ptr モンスター1の構造体参照ポインタ
2131  * @param n_ptr モンスター2の構造体参照ポインタ
2132  * @return 敵対関係にあるならばTRUEを返す
2133  */
2134 bool are_enemies(player_type *player_ptr, monster_type *m_ptr, monster_type *n_ptr)
2135 {
2136         monster_race *r_ptr = &r_info[m_ptr->r_idx];
2137         monster_race *s_ptr = &r_info[n_ptr->r_idx];
2138
2139         if (player_ptr->phase_out)
2140         {
2141                 if (is_pet(m_ptr) || is_pet(n_ptr)) return FALSE;
2142                 return TRUE;
2143         }
2144
2145         if ((r_ptr->flags8 & (RF8_WILD_TOWN | RF8_WILD_ALL))
2146                 && (s_ptr->flags8 & (RF8_WILD_TOWN | RF8_WILD_ALL)))
2147         {
2148                 if (!is_pet(m_ptr) && !is_pet(n_ptr)) return FALSE;
2149         }
2150
2151         if (check_hostile_align(m_ptr->sub_align, n_ptr->sub_align))
2152         {
2153                 if (!(m_ptr->mflag2 & MFLAG2_CHAMELEON) || !(n_ptr->mflag2 & MFLAG2_CHAMELEON)) return TRUE;
2154         }
2155
2156         if (is_hostile(m_ptr) != is_hostile(n_ptr))
2157         {
2158                 return TRUE;
2159         }
2160
2161         return FALSE;
2162 }
2163
2164
2165 /*!
2166  * @brief モンスターがプレイヤーに対して敵意を抱くかどうかを返す
2167  * Check if this monster race has "hostile" alignment
2168  * @param player_ptr プレーヤーへの参照ポインタ
2169  * @param m_ptr モンスター情報構造体の参照ポインタ
2170  * @param pa_good プレイヤーの善傾向値
2171  * @param pa_evil プレイヤーの悪傾向値
2172  * @param r_ptr モンスター種族情報の構造体参照ポインタ
2173  * @return プレイヤーに敵意を持つならばTRUEを返す
2174  * @details
2175  * If user is player, m_ptr == NULL.
2176  */
2177 bool monster_has_hostile_align(player_type *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr)
2178 {
2179         byte sub_align1 = SUB_ALIGN_NEUTRAL;
2180         byte sub_align2 = SUB_ALIGN_NEUTRAL;
2181
2182         if (m_ptr) /* For a monster */
2183         {
2184                 sub_align1 = m_ptr->sub_align;
2185         }
2186         else /* For player */
2187         {
2188                 if (player_ptr->align >= pa_good) sub_align1 |= SUB_ALIGN_GOOD;
2189                 if (player_ptr->align <= pa_evil) sub_align1 |= SUB_ALIGN_EVIL;
2190         }
2191
2192         /* Racial alignment flags */
2193         if (r_ptr->flags3 & RF3_EVIL) sub_align2 |= SUB_ALIGN_EVIL;
2194         if (r_ptr->flags3 & RF3_GOOD) sub_align2 |= SUB_ALIGN_GOOD;
2195
2196         if (check_hostile_align(sub_align1, sub_align2)) return TRUE;
2197
2198         return FALSE;
2199 }
2200
2201
2202 /*!
2203  * @brief モンスターを倒した際の財宝svalを返す
2204  * @param r_idx 倒したモンスターの種族ID
2205  * @return 財宝のsval
2206  * @details
2207  * Hack -- Return the "automatic coin type" of a monster race
2208  * Used to allocate proper treasure when "Creeping coins" die
2209  * Note the use of actual "monster names"
2210  */
2211 static OBJECT_SUBTYPE_VALUE get_coin_type(MONRACE_IDX r_idx)
2212 {
2213         switch (r_idx)
2214         {
2215         case MON_COPPER_COINS: return 2;
2216         case MON_SILVER_COINS: return 5;
2217         case MON_GOLD_COINS: return 10;
2218         case MON_MITHRIL_COINS:
2219         case MON_MITHRIL_GOLEM: return 16;
2220         case MON_ADAMANT_COINS: return 17;
2221         }
2222
2223         return 0;
2224 }
2225
2226
2227 /*!
2228  * @brief モンスターが死亡した時の処理 /
2229  * Handle the "death" of a monster.
2230  * @param m_idx 死亡したモンスターのID
2231  * @param drop_item TRUEならばモンスターのドロップ処理を行う
2232  * @return 撃破されたモンスターの述語
2233  * @details
2234  * <pre>
2235  * Disperse treasures centered at the monster location based on the
2236  * various flags contained in the monster flags fields.
2237  * Check for "Quest" completion when a quest monster is killed.
2238  * Note that only the player can induce "monster_death()" on Uniques.
2239  * Thus (for now) all Quest monsters should be Uniques.
2240  * Note that monsters can now carry objects, and when a monster dies,
2241  * it drops all of its objects, which may disappear in crowded rooms.
2242  * </pre>
2243  */
2244 void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item)
2245 {
2246         floor_type *floor_ptr = player_ptr->current_floor_ptr;
2247         monster_type *m_ptr = &floor_ptr->m_list[m_idx];
2248         monster_race *r_ptr = &r_info[m_ptr->r_idx];
2249
2250         bool do_gold = (!(r_ptr->flags1 & RF1_ONLY_ITEM));
2251         bool do_item = (!(r_ptr->flags1 & RF1_ONLY_GOLD));
2252         bool cloned = (m_ptr->smart & SM_CLONED) ? TRUE : FALSE;
2253         int force_coin = get_coin_type(m_ptr->r_idx);
2254
2255         bool drop_chosen_item = drop_item && !cloned && !floor_ptr->inside_arena && !player_ptr->phase_out && !is_pet(m_ptr);
2256
2257         if (current_world_ptr->timewalk_m_idx && current_world_ptr->timewalk_m_idx == m_idx)
2258         {
2259                 current_world_ptr->timewalk_m_idx = 0;
2260         }
2261
2262         if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
2263         {
2264                 player_ptr->update |= (PU_MON_LITE);
2265         }
2266
2267         POSITION y = m_ptr->fy;
2268         POSITION x = m_ptr->fx;
2269
2270         if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
2271         {
2272                 GAME_TEXT m_name[MAX_NLEN];
2273
2274                 monster_desc(player_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
2275                 exe_write_diary(player_ptr, DIARY_NAMED_PET, 3, m_name);
2276         }
2277
2278         for (int i = 0; i < 4; i++)
2279         {
2280                 if (r_ptr->blow[i].method != RBM_EXPLODE) continue;
2281
2282                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2283                 EFFECT_ID typ = mbe_info[r_ptr->blow[i].effect].explode_type;
2284                 DICE_NUMBER d_dice = r_ptr->blow[i].d_dice;
2285                 DICE_SID d_side = r_ptr->blow[i].d_side;
2286                 HIT_POINT damage = damroll(d_dice, d_side);
2287
2288                 project(player_ptr, m_idx, 3, y, x, damage, typ, flg, -1);
2289                 break;
2290         }
2291
2292         if (m_ptr->mflag2 & MFLAG2_CHAMELEON)
2293         {
2294                 choose_new_monster(player_ptr, m_idx, TRUE, MON_CHAMELEON);
2295                 r_ptr = &r_info[m_ptr->r_idx];
2296         }
2297
2298         check_quest_completion(player_ptr, m_ptr);
2299
2300         object_type forge;
2301         object_type *q_ptr;
2302         if (floor_ptr->inside_arena && !is_pet(m_ptr))
2303         {
2304                 player_ptr->exit_bldg = TRUE;
2305                 if (player_ptr->arena_number > MAX_ARENA_MONS)
2306                 {
2307                         msg_print(_("素晴らしい!君こそ真の勝利者だ。", "You are a Genuine Champion!"));
2308                 }
2309                 else
2310                 {
2311                         msg_print(_("勝利!チャンピオンへの道を進んでいる。", "Victorious! You're on your way to becoming Champion."));
2312                 }
2313
2314                 if (arena_info[player_ptr->arena_number].tval)
2315                 {
2316                         q_ptr = &forge;
2317                         object_prep(q_ptr, lookup_kind(arena_info[player_ptr->arena_number].tval, arena_info[player_ptr->arena_number].sval));
2318                         apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2319                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2320                 }
2321
2322                 if (player_ptr->arena_number > MAX_ARENA_MONS) player_ptr->arena_number++;
2323                 player_ptr->arena_number++;
2324                 if (record_arena)
2325                 {
2326                         GAME_TEXT m_name[MAX_NLEN];
2327                         monster_desc(player_ptr, m_name, m_ptr, MD_WRONGDOER_NAME);
2328                         exe_write_diary(player_ptr, DIARY_ARENA, player_ptr->arena_number, m_name);
2329                 }
2330         }
2331         
2332         if (m_idx == player_ptr->riding && rakuba(player_ptr, -1, FALSE))
2333         {
2334                         msg_print(_("地面に落とされた。", "You have fallen from the pet you were riding."));
2335         }
2336
2337         bool is_drop_corpse = one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4);
2338         is_drop_corpse &= (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) != 0;
2339         is_drop_corpse &= !(floor_ptr->inside_arena || player_ptr->phase_out || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)));
2340         if (is_drop_corpse)
2341         {
2342                 bool corpse = FALSE;
2343
2344                 if (!(r_ptr->flags9 & RF9_DROP_SKELETON))
2345                         corpse = TRUE;
2346                 else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 & RF1_UNIQUE))
2347                         corpse = TRUE;
2348                 else if (r_ptr->flags9 & RF9_DROP_CORPSE)
2349                 {
2350                         if ((0 - ((m_ptr->maxhp) / 4)) > m_ptr->hp)
2351                         {
2352                                 if (one_in_(5)) corpse = TRUE;
2353                         }
2354                         else
2355                         {
2356                                 if (!one_in_(5)) corpse = TRUE;
2357                         }
2358                 }
2359
2360                 q_ptr = &forge;
2361                 object_prep(q_ptr, lookup_kind(TV_CORPSE, (corpse ? SV_CORPSE : SV_SKELETON)));
2362                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2363                 q_ptr->pval = m_ptr->r_idx;
2364                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2365         }
2366
2367         monster_drop_carried_objects(player_ptr, m_ptr);
2368
2369         u32b mo_mode = 0L;
2370         if (r_ptr->flags1 & RF1_DROP_GOOD) mo_mode |= AM_GOOD;
2371         if (r_ptr->flags1 & RF1_DROP_GREAT) mo_mode |= AM_GREAT;
2372
2373         switch (m_ptr->r_idx)
2374         {
2375         case MON_PINK_HORROR:
2376         {
2377                 if (floor_ptr->inside_arena || player_ptr->phase_out) break;
2378
2379                 bool notice = FALSE;
2380                 for (int i = 0; i < 2; i++)
2381                 {
2382                         POSITION wy = y, wx = x;
2383                         bool pet = is_pet(m_ptr);
2384                         BIT_FLAGS mode = 0L;
2385
2386                         if (pet)
2387                         {
2388                                 mode |= PM_FORCE_PET;
2389                         }
2390
2391                         if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode))
2392                         {
2393                                 if (player_can_see_bold(player_ptr, wy, wx)) notice = TRUE;
2394                         }
2395                 }
2396
2397                 if (notice)
2398                 {
2399                         msg_print(_("ピンク・ホラーは分裂した!", "The Pink horror divides!"));
2400                 }
2401
2402                 break;
2403         }
2404         case MON_BLOODLETTER:
2405         {
2406                 if (!drop_chosen_item || (randint1(100) >= 15)) break;
2407
2408                 q_ptr = &forge;
2409                 object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BLADE_OF_CHAOS));
2410                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART | mo_mode);
2411                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2412                 break;
2413         }
2414         case MON_RAAL:
2415         {
2416                 if (!drop_chosen_item || (floor_ptr->dun_level <= 9)) break;
2417
2418                 q_ptr = &forge;
2419                 object_wipe(q_ptr);
2420                 if ((floor_ptr->dun_level > 49) && one_in_(5))
2421                         get_obj_num_hook = kind_is_good_book;
2422                 else
2423                         get_obj_num_hook = kind_is_book;
2424
2425                 make_object(player_ptr, q_ptr, mo_mode);
2426                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2427                 break;
2428         }
2429         case MON_DAWN:
2430         {
2431                 if (floor_ptr->inside_arena || player_ptr->phase_out) break;
2432                 if (one_in_(7)) break;
2433
2434                 POSITION wy = y, wx = x;
2435                 int attempts = 100;
2436                 bool pet = is_pet(m_ptr);
2437                 do
2438                 {
2439                         scatter(player_ptr, &wy, &wx, y, x, 20, 0);
2440                 } while (!(in_bounds(floor_ptr, wy, wx) && is_cave_empty_bold2(player_ptr, wy, wx)) && --attempts);
2441
2442                 if (attempts <= 0) break;
2443
2444                 BIT_FLAGS mode = 0L;
2445                 if (pet) mode |= PM_FORCE_PET;
2446
2447                 if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode))
2448                 {
2449                         if (player_can_see_bold(player_ptr, wy, wx))
2450                                 msg_print(_("新たな戦士が現れた!", "A new warrior steps forth!"));
2451                 }
2452
2453                 break;
2454         }
2455         case MON_UNMAKER:
2456         {
2457                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2458                 (void)project(player_ptr, m_idx, 6, y, x, 100, GF_CHAOS, flg, -1);
2459                 break;
2460         }
2461         case MON_UNICORN_ORD:
2462         case MON_MORGOTH:
2463         case MON_ONE_RING:
2464         {
2465                 if (player_ptr->pseikaku != SEIKAKU_NAMAKE) break;
2466                 if (!drop_chosen_item) break;
2467
2468                 ARTIFACT_IDX a_idx = 0;
2469                 artifact_type *a_ptr = NULL;
2470                 do
2471                 {
2472                         switch (randint0(3))
2473                         {
2474                         case 0:
2475                                 a_idx = ART_NAMAKE_HAMMER;
2476                                 break;
2477                         case 1:
2478                                 a_idx = ART_NAMAKE_BOW;
2479                                 break;
2480                         case 2:
2481                                 a_idx = ART_NAMAKE_ARMOR;
2482                                 break;
2483                         }
2484
2485                         a_ptr = &a_info[a_idx];
2486                 } while (a_ptr->cur_num);
2487
2488                 if (create_named_art(player_ptr, a_idx, y, x))
2489                 {
2490                         a_ptr->cur_num = 1;
2491                         if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2492                 }
2493                 else if (!preserve_mode) a_ptr->cur_num = 1;
2494
2495                 break;
2496         }
2497         case MON_SERPENT:
2498         {
2499                 if (!drop_chosen_item) break;
2500
2501                 q_ptr = &forge;
2502                 object_prep(q_ptr, lookup_kind(TV_HAFTED, SV_GROND));
2503                 q_ptr->name1 = ART_GROND;
2504                 apply_magic(player_ptr, q_ptr, -1, AM_GOOD | AM_GREAT);
2505                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2506                 q_ptr = &forge;
2507                 object_prep(q_ptr, lookup_kind(TV_CROWN, SV_CHAOS));
2508                 q_ptr->name1 = ART_CHAOS;
2509                 apply_magic(player_ptr, q_ptr, -1, AM_GOOD | AM_GREAT);
2510                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2511                 break;
2512         }
2513         case MON_B_DEATH_SWORD:
2514         {
2515                 if (!drop_chosen_item) break;
2516
2517                 q_ptr = &forge;
2518                 object_prep(q_ptr, lookup_kind(TV_SWORD, randint1(2)));
2519                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2520                 break;
2521         }
2522         case MON_A_GOLD:
2523         case MON_A_SILVER:
2524         {
2525                 bool is_drop_can = drop_chosen_item;
2526                 bool is_silver = m_ptr->r_idx == MON_A_SILVER;
2527                 is_silver &= r_ptr->r_akills % 5 == 0;
2528                 is_drop_can &= (m_ptr->r_idx == MON_A_GOLD) || is_silver;
2529                 if (!is_drop_can) break;
2530
2531                 q_ptr = &forge;
2532                 object_prep(q_ptr, lookup_kind(TV_CHEST, SV_CHEST_KANDUME));
2533                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2534                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2535                 break;
2536         }
2537
2538         case MON_ROLENTO:
2539         {
2540                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2541                 (void)project(player_ptr, m_idx, 3, y, x, damroll(20, 10), GF_FIRE, flg, -1);
2542                 break;
2543         }
2544         default:
2545         {
2546                 if (!drop_chosen_item) break;
2547
2548                 switch (r_ptr->d_char)
2549                 {
2550                 case '(':
2551                 {
2552                         if (floor_ptr->dun_level <= 0) break;
2553
2554                         q_ptr = &forge;
2555                         object_wipe(q_ptr);
2556                         get_obj_num_hook = kind_is_cloak;
2557                         make_object(player_ptr, q_ptr, mo_mode);
2558                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2559                         break;
2560                 }
2561                 case '/':
2562                 {
2563                         if (floor_ptr->dun_level <= 4) break;
2564
2565                         q_ptr = &forge;
2566                         object_wipe(q_ptr);
2567                         get_obj_num_hook = kind_is_polearm;
2568                         make_object(player_ptr, q_ptr, mo_mode);
2569                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2570                         break;
2571                 }
2572                 case '[':
2573                 {
2574                         if (floor_ptr->dun_level <= 19) break;
2575
2576                         q_ptr = &forge;
2577                         object_wipe(q_ptr);
2578                         get_obj_num_hook = kind_is_armor;
2579                         make_object(player_ptr, q_ptr, mo_mode);
2580                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2581                         break;
2582                 }
2583                 case '\\':
2584                 {
2585                         if (floor_ptr->dun_level <= 4) break;
2586                         q_ptr = &forge;
2587                         object_wipe(q_ptr);
2588                         get_obj_num_hook = kind_is_hafted;
2589                         make_object(player_ptr, q_ptr, mo_mode);
2590                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2591                         break;
2592                 }
2593                 case '|':
2594                 {
2595                         if (m_ptr->r_idx == MON_STORMBRINGER) break;
2596
2597                         q_ptr = &forge;
2598                         object_wipe(q_ptr);
2599                         get_obj_num_hook = kind_is_sword;
2600                         make_object(player_ptr, q_ptr, mo_mode);
2601                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2602                         break;
2603                 }
2604                 }
2605         }
2606         }
2607
2608         if (drop_chosen_item)
2609         {
2610                 ARTIFACT_IDX a_idx = 0;
2611                 PERCENTAGE chance = 0;
2612                 for (int i = 0; i < 4; i++)
2613                 {
2614                         if (!r_ptr->artifact_id[i]) break;
2615                         a_idx = r_ptr->artifact_id[i];
2616                         chance = r_ptr->artifact_percent[i];
2617                         if (randint0(100) < chance || current_world_ptr->wizard)
2618                         {
2619                                 artifact_type *a_ptr = &a_info[a_idx];
2620                                 if (!a_ptr->cur_num)
2621                                 {
2622                                         if (create_named_art(player_ptr, a_idx, y, x))
2623                                         {
2624                                                 a_ptr->cur_num = 1;
2625                                                 if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2626                                         }
2627                                         else if (!preserve_mode)
2628                                         {
2629                                                 a_ptr->cur_num = 1;
2630                                         }
2631                                 }
2632                         }
2633                 }
2634
2635                 if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[player_ptr->dungeon_idx].final_guardian == m_ptr->r_idx))
2636                 {
2637                         KIND_OBJECT_IDX k_idx = d_info[player_ptr->dungeon_idx].final_object != 0
2638                                 ? d_info[player_ptr->dungeon_idx].final_object
2639                                 : lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
2640
2641                         if (d_info[player_ptr->dungeon_idx].final_artifact != 0)
2642                         {
2643                                 a_idx = d_info[player_ptr->dungeon_idx].final_artifact;
2644                                 artifact_type *a_ptr = &a_info[a_idx];
2645                                 if (!a_ptr->cur_num)
2646                                 {
2647                                         if (create_named_art(player_ptr, a_idx, y, x))
2648                                         {
2649                                                 a_ptr->cur_num = 1;
2650                                                 if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2651                                         }
2652                                         else if (!preserve_mode)
2653                                         {
2654                                                 a_ptr->cur_num = 1;
2655                                         }
2656
2657                                         if (!d_info[player_ptr->dungeon_idx].final_object) k_idx = 0;
2658                                 }
2659                         }
2660
2661                         if (k_idx != 0)
2662                         {
2663                                 q_ptr = &forge;
2664                                 object_prep(q_ptr, k_idx);
2665                                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART | AM_GOOD);
2666                                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2667                         }
2668
2669                         msg_format(_("あなたは%sを制覇した!", "You have conquered %s!"), d_name + d_info[player_ptr->dungeon_idx].name);
2670                 }
2671         }
2672
2673         int number = 0;
2674         if ((r_ptr->flags1 & RF1_DROP_60) && (randint0(100) < 60)) number++;
2675         if ((r_ptr->flags1 & RF1_DROP_90) && (randint0(100) < 90)) number++;
2676         if (r_ptr->flags1 & RF1_DROP_1D2) number += damroll(1, 2);
2677         if (r_ptr->flags1 & RF1_DROP_2D2) number += damroll(2, 2);
2678         if (r_ptr->flags1 & RF1_DROP_3D2) number += damroll(3, 2);
2679         if (r_ptr->flags1 & RF1_DROP_4D2) number += damroll(4, 2);
2680
2681         if (cloned && !(r_ptr->flags1 & RF1_UNIQUE))
2682                 number = 0;
2683
2684         if (is_pet(m_ptr) || player_ptr->phase_out || floor_ptr->inside_arena)
2685                 number = 0;
2686
2687         if (!drop_item && (r_ptr->d_char != '$'))
2688                 number = 0;
2689
2690         if ((r_ptr->flags2 & (RF2_MULTIPLY)) && (r_ptr->r_akills > 1024))
2691                 number = 0;
2692
2693         coin_type = force_coin;
2694         floor_ptr->object_level = (floor_ptr->dun_level + r_ptr->level) / 2;
2695
2696         int dump_item = 0;
2697         int dump_gold = 0;
2698         for (int i = 0; i < number; i++)
2699         {
2700                 q_ptr = &forge;
2701                 object_wipe(q_ptr);
2702
2703                 if (do_gold && (!do_item || (randint0(100) < 50)))
2704                 {
2705                         if (!make_gold(floor_ptr, q_ptr)) continue;
2706                         dump_gold++;
2707                 }
2708                 else
2709                 {
2710                         if (!make_object(player_ptr, q_ptr, mo_mode)) continue;
2711                         dump_item++;
2712                 }
2713
2714                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2715         }
2716
2717         floor_ptr->object_level = floor_ptr->base_level;
2718         coin_type = 0;
2719         bool visible = (m_ptr->ml && !player_ptr->image) || ((r_ptr->flags1 & RF1_UNIQUE) != 0);
2720         if (visible && (dump_item || dump_gold))
2721         {
2722                 lore_treasure(player_ptr, m_idx, dump_item, dump_gold);
2723         }
2724
2725         if (!(r_ptr->flags1 & RF1_QUESTOR)) return;
2726         if (player_ptr->phase_out) return;
2727         if ((m_ptr->r_idx != MON_SERPENT) || cloned) return;
2728
2729         current_world_ptr->total_winner = TRUE;
2730         player_ptr->redraw |= (PR_TITLE);
2731         play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_FINAL_QUEST_CLEAR);
2732         exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("見事に変愚蛮怒の勝利者となった!", "finally became *WINNER* of Hengband!"));
2733         admire_from_patron(player_ptr);
2734         msg_print(_("*** おめでとう ***", "*** CONGRATULATIONS ***"));
2735         msg_print(_("あなたはゲームをコンプリートしました。", "You have won the game!"));
2736         msg_print(_("準備が整ったら引退(自殺コマンド)しても結構です。", "You may retire (commit suicide) when you are ready."));
2737 }
2738
2739
2740 /*!
2741  * @brief モンスターを撃破した際の述語メッセージを返す /
2742  * Return monster death string
2743  * @param r_ptr 撃破されたモンスターの種族情報を持つ構造体の参照ポインタ
2744  * @return 撃破されたモンスターの述語
2745  */
2746 concptr extract_note_dies(MONRACE_IDX r_idx)
2747 {
2748         monster_race *r_ptr = &r_info[r_idx];
2749         if (monster_living(r_idx)) return _("は死んだ。", " dies.");
2750
2751         for (int i = 0; i < 4; i++)
2752         {
2753                 if (r_ptr->blow[i].method == RBM_EXPLODE)
2754                 {
2755                         return _("は爆発して粉々になった。", " explodes into tiny shreds.");
2756                 }
2757         }
2758
2759         return _("を倒した。", " is destroyed.");
2760 }
2761
2762
2763 /*
2764  * Monster health description
2765  */
2766 concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode)
2767 {
2768         bool living = monster_living(m_ptr->ap_r_idx);
2769         int perc = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
2770
2771         concptr desc;
2772         if (m_ptr->hp >= m_ptr->maxhp)
2773         {
2774                 desc = living ? _("無傷", "unhurt") : _("無ダメージ", "undamaged");
2775         }
2776         else if (perc >= 60)
2777         {
2778                 desc = living ? _("軽傷", "somewhat wounded") : _("小ダメージ", "somewhat damaged");
2779         }
2780         else if (perc >= 25)
2781         {
2782                 desc = living ? _("負傷", "wounded") : _("中ダメージ", "damaged");
2783         }
2784         else if (perc >= 10)
2785         {
2786                 desc = living ? _("重傷", "badly wounded") : _("大ダメージ", "badly damaged");
2787         }
2788         else
2789         {
2790                 desc = living ? _("半死半生", "almost dead") : _("倒れかけ", "almost destroyed");
2791         }
2792
2793         concptr attitude;
2794         if (!(mode & 0x01))
2795         {
2796                 attitude = "";
2797         }
2798         else if (is_pet(m_ptr))
2799         {
2800                 attitude = _(", ペット", ", pet");
2801         }
2802         else if (is_friendly(m_ptr))
2803         {
2804                 attitude = _(", 友好的", ", friendly");
2805         }
2806         else
2807         {
2808                 attitude = _("", "");
2809         }
2810
2811         concptr clone = (m_ptr->smart & SM_CLONED) ? ", clone" : "";
2812         monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
2813         if (ap_r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE))
2814         {
2815                 return format(_("レベル%d, %s%s%s", "Level %d, %s%s%s"), ap_r_ptr->level, desc, attitude, clone);
2816         }
2817
2818         return format(_("レベル???, %s%s%s", "Level ???, %s%s%s"), desc, attitude, clone);
2819 }
2820
2821
2822 bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr)
2823 {
2824         return m_ptr->ml && !player_ptr->image && (m_ptr->ap_r_idx == m_ptr->r_idx);
2825 }