OSDN Git Service

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