OSDN Git Service

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