OSDN Git Service

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