OSDN Git Service

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