OSDN Git Service

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