OSDN Git Service

[Refactor] #38997 monster_can_*()に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 player_ptr プレーヤーへの参照ポインタ
2121  * @param feat 地形ID
2122  * @param r_ptr モンスター種族構造体の参照ポインタ
2123  * @param mode オプション
2124  * @return 踏破可能ならばTRUEを返す
2125  */
2126 bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode)
2127 {
2128         feature_type *f_ptr = &f_info[feat];
2129
2130         if (have_flag(f_ptr->flags, FF_PATTERN))
2131         {
2132                 if (!(mode & CEM_RIDING))
2133                 {
2134                         if (!(r_ptr->flags7 & RF7_CAN_FLY)) return FALSE;
2135                 }
2136                 else
2137                 {
2138                         if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
2139                 }
2140         }
2141
2142         /* "CAN" flags */
2143         if (have_flag(f_ptr->flags, FF_CAN_FLY) && (r_ptr->flags7 & RF7_CAN_FLY)) return TRUE;
2144         if (have_flag(f_ptr->flags, FF_CAN_SWIM) && (r_ptr->flags7 & RF7_CAN_SWIM)) return TRUE;
2145         if (have_flag(f_ptr->flags, FF_CAN_PASS))
2146         {
2147                 if ((r_ptr->flags2 & RF2_PASS_WALL) && (!(mode & CEM_RIDING) || player_ptr->pass_wall)) return TRUE;
2148         }
2149
2150         if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
2151
2152         /* Some monsters can walk on mountains */
2153         if (have_flag(f_ptr->flags, FF_MOUNTAIN) && (r_ptr->flags8 & RF8_WILD_MOUNTAIN)) return TRUE;
2154
2155         /* Water */
2156         if (have_flag(f_ptr->flags, FF_WATER))
2157         {
2158                 if (!(r_ptr->flags7 & RF7_AQUATIC))
2159                 {
2160                         /* Deep water */
2161                         if (have_flag(f_ptr->flags, FF_DEEP)) return FALSE;
2162
2163                         /* Shallow water */
2164                         else if (r_ptr->flags2 & RF2_AURA_FIRE) return FALSE;
2165                 }
2166         }
2167
2168         /* Aquatic monster into non-water? */
2169         else if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
2170
2171         /* Lava */
2172         if (have_flag(f_ptr->flags, FF_LAVA))
2173         {
2174                 if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) return FALSE;
2175         }
2176
2177         /* Cold */
2178         if (have_flag(f_ptr->flags, FF_COLD_PUDDLE))
2179         {
2180                 if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)) return FALSE;
2181         }
2182
2183         /* Elec */
2184         if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE))
2185         {
2186                 if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)) return FALSE;
2187         }
2188
2189         /* Acid */
2190         if (have_flag(f_ptr->flags, FF_ACID_PUDDLE))
2191         {
2192                 if (!(r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)) return FALSE;
2193         }
2194
2195         /* Poison */
2196         if (have_flag(f_ptr->flags, FF_POISON_PUDDLE))
2197         {
2198                 if (!(r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)) return FALSE;
2199         }
2200
2201         return TRUE;
2202 }
2203
2204
2205 /*!
2206  * @brief 指定された座標の地形をモンスターが踏破できるかどうかを返す
2207  * Strictly check if monster can enter the grid
2208  * @param player_ptr プレーヤーへの参照ポインタ
2209  * @param y 地形のY座標
2210  * @param x 地形のX座標
2211  * @param r_ptr モンスター種族構造体の参照ポインタ
2212  * @param mode オプション
2213  * @return 踏破可能ならばTRUEを返す
2214  */
2215 bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
2216 {
2217         grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
2218         if (player_bold(player_ptr, y, x)) return FALSE;
2219         if (g_ptr->m_idx) return FALSE;
2220
2221         return monster_can_cross_terrain(player_ptr, g_ptr->feat, r_ptr, mode);
2222 }
2223
2224
2225 /*!
2226  * @brief モンスターの属性の基づいた敵対関係の有無を返す(サブルーチン)
2227  * Check if this monster has "hostile" alignment (aux)
2228  * @param sub_align1 モンスター1のサブフラグ
2229  * @param sub_align2 モンスター2のサブフラグ
2230  * @return 敵対関係にあるならばTRUEを返す
2231  */
2232 static bool check_hostile_align(byte sub_align1, byte sub_align2)
2233 {
2234         if (sub_align1 != sub_align2)
2235         {
2236                 if (((sub_align1 & SUB_ALIGN_EVIL) && (sub_align2 & SUB_ALIGN_GOOD)) ||
2237                         ((sub_align1 & SUB_ALIGN_GOOD) && (sub_align2 & SUB_ALIGN_EVIL)))
2238                         return TRUE;
2239         }
2240
2241         return FALSE;
2242 }
2243
2244
2245 /*!
2246  * @brief モンスターの属性の基づいた敵対関係の有無を返す
2247  * Check if two monsters are enemies
2248  * @param m_ptr モンスター1の構造体参照ポインタ
2249  * @param n_ptr モンスター2の構造体参照ポインタ
2250  * @return 敵対関係にあるならばTRUEを返す
2251  */
2252 bool are_enemies(monster_type *m_ptr, monster_type *n_ptr)
2253 {
2254         monster_race *r_ptr = &r_info[m_ptr->r_idx];
2255         monster_race *s_ptr = &r_info[n_ptr->r_idx];
2256
2257         if (p_ptr->phase_out)
2258         {
2259                 if (is_pet(m_ptr) || is_pet(n_ptr)) return FALSE;
2260                 return TRUE;
2261         }
2262
2263         if ((r_ptr->flags8 & (RF8_WILD_TOWN | RF8_WILD_ALL))
2264                 && (s_ptr->flags8 & (RF8_WILD_TOWN | RF8_WILD_ALL)))
2265         {
2266                 if (!is_pet(m_ptr) && !is_pet(n_ptr)) return FALSE;
2267         }
2268
2269         /* Friendly vs. opposite aligned normal or pet */
2270         if (check_hostile_align(m_ptr->sub_align, n_ptr->sub_align))
2271         {
2272                 if (!(m_ptr->mflag2 & MFLAG2_CHAMELEON) || !(n_ptr->mflag2 & MFLAG2_CHAMELEON)) return TRUE;
2273         }
2274
2275         /* Hostile vs. non-hostile */
2276         if (is_hostile(m_ptr) != is_hostile(n_ptr))
2277         {
2278                 return TRUE;
2279         }
2280
2281         return FALSE;
2282 }
2283
2284
2285 /*!
2286  * @brief モンスターがプレイヤーに対して敵意を抱くかどうかを返す
2287  * Check if this monster race has "hostile" alignment
2288  * @param m_ptr モンスター情報構造体の参照ポインタ
2289  * @param pa_good プレイヤーの善傾向値
2290  * @param pa_evil プレイヤーの悪傾向値
2291  * @param r_ptr モンスター種族情報の構造体参照ポインタ
2292  * @return プレイヤーに敵意を持つならばTRUEを返す
2293  * @details
2294  * If user is player, m_ptr == NULL.
2295  */
2296 bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr)
2297 {
2298         byte sub_align1 = SUB_ALIGN_NEUTRAL;
2299         byte sub_align2 = SUB_ALIGN_NEUTRAL;
2300
2301         if (m_ptr) /* For a monster */
2302         {
2303                 sub_align1 = m_ptr->sub_align;
2304         }
2305         else /* For player */
2306         {
2307                 if (p_ptr->align >= pa_good) sub_align1 |= SUB_ALIGN_GOOD;
2308                 if (p_ptr->align <= pa_evil) sub_align1 |= SUB_ALIGN_EVIL;
2309         }
2310
2311         /* Racial alignment flags */
2312         if (r_ptr->flags3 & RF3_EVIL) sub_align2 |= SUB_ALIGN_EVIL;
2313         if (r_ptr->flags3 & RF3_GOOD) sub_align2 |= SUB_ALIGN_GOOD;
2314
2315         if (check_hostile_align(sub_align1, sub_align2)) return TRUE;
2316
2317         return FALSE;
2318 }
2319
2320
2321 /*!
2322  * @brief モンスターを倒した際の財宝svalを返す
2323  * @param r_idx 倒したモンスターの種族ID
2324  * @return 財宝のsval
2325  * @details
2326  * Hack -- Return the "automatic coin type" of a monster race
2327  * Used to allocate proper treasure when "Creeping coins" die
2328  * Note the use of actual "monster names"
2329  */
2330 static OBJECT_SUBTYPE_VALUE get_coin_type(MONRACE_IDX r_idx)
2331 {
2332         switch (r_idx)
2333         {
2334         case MON_COPPER_COINS: return 2;
2335         case MON_SILVER_COINS: return 5;
2336         case MON_GOLD_COINS: return 10;
2337         case MON_MITHRIL_COINS:
2338         case MON_MITHRIL_GOLEM: return 16;
2339         case MON_ADAMANT_COINS: return 17;
2340         }
2341
2342         return 0;
2343 }
2344
2345
2346 /*!
2347  * @brief モンスターが死亡した時の処理 /
2348  * Handle the "death" of a monster.
2349  * @param m_idx 死亡したモンスターのID
2350  * @param drop_item TRUEならばモンスターのドロップ処理を行う
2351  * @return 撃破されたモンスターの述語
2352  * @details
2353  * <pre>
2354  * Disperse treasures centered at the monster location based on the
2355  * various flags contained in the monster flags fields.
2356  * Check for "Quest" completion when a quest monster is killed.
2357  * Note that only the player can induce "monster_death()" on Uniques.
2358  * Thus (for now) all Quest monsters should be Uniques.
2359  * Note that monsters can now carry objects, and when a monster dies,
2360  * it drops all of its objects, which may disappear in crowded rooms.
2361  * </pre>
2362  */
2363 void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item)
2364 {
2365         floor_type *floor_ptr = player_ptr->current_floor_ptr;
2366         monster_type *m_ptr = &floor_ptr->m_list[m_idx];
2367         monster_race *r_ptr = &r_info[m_ptr->r_idx];
2368
2369         bool do_gold = (!(r_ptr->flags1 & RF1_ONLY_ITEM));
2370         bool do_item = (!(r_ptr->flags1 & RF1_ONLY_GOLD));
2371         bool cloned = (m_ptr->smart & SM_CLONED) ? TRUE : FALSE;
2372         int force_coin = get_coin_type(m_ptr->r_idx);
2373
2374         bool drop_chosen_item = drop_item && !cloned && !floor_ptr->inside_arena && !player_ptr->phase_out && !is_pet(m_ptr);
2375
2376         /* The caster is dead? */
2377         if (current_world_ptr->timewalk_m_idx && current_world_ptr->timewalk_m_idx == m_idx)
2378                 current_world_ptr->timewalk_m_idx = 0;
2379
2380         /* Notice changes in view */
2381         if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
2382         {
2383                 player_ptr->update |= (PU_MON_LITE);
2384         }
2385
2386         POSITION y = m_ptr->fy;
2387         POSITION x = m_ptr->fx;
2388
2389         if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
2390         {
2391                 GAME_TEXT m_name[MAX_NLEN];
2392
2393                 monster_desc(player_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
2394                 exe_write_diary(player_ptr, DIARY_NAMED_PET, 3, m_name);
2395         }
2396
2397         for (int i = 0; i < 4; i++)
2398         {
2399                 if (r_ptr->blow[i].method != RBM_EXPLODE) continue;
2400
2401                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2402                 EFFECT_ID typ = mbe_info[r_ptr->blow[i].effect].explode_type;
2403                 DICE_NUMBER d_dice = r_ptr->blow[i].d_dice;
2404                 DICE_SID d_side = r_ptr->blow[i].d_side;
2405                 HIT_POINT damage = damroll(d_dice, d_side);
2406
2407                 project(player_ptr, m_idx, 3, y, x, damage, typ, flg, -1);
2408                 break;
2409         }
2410
2411         if (m_ptr->mflag2 & MFLAG2_CHAMELEON)
2412         {
2413                 choose_new_monster(player_ptr, m_idx, TRUE, MON_CHAMELEON);
2414                 r_ptr = &r_info[m_ptr->r_idx];
2415         }
2416
2417         check_quest_completion(player_ptr, m_ptr);
2418
2419         /* Handle the possibility of player vanquishing arena combatant -KMW- */
2420         object_type forge;
2421         object_type *q_ptr;
2422         if (floor_ptr->inside_arena && !is_pet(m_ptr))
2423         {
2424                 player_ptr->exit_bldg = TRUE;
2425
2426                 if (player_ptr->arena_number > MAX_ARENA_MONS)
2427                 {
2428                         msg_print(_("素晴らしい!君こそ真の勝利者だ。", "You are a Genuine Champion!"));
2429                 }
2430                 else
2431                 {
2432                         msg_print(_("勝利!チャンピオンへの道を進んでいる。", "Victorious! You're on your way to becoming Champion."));
2433                 }
2434
2435                 if (arena_info[player_ptr->arena_number].tval)
2436                 {
2437                         q_ptr = &forge;
2438
2439                         /* Prepare to make a prize */
2440                         object_prep(q_ptr, lookup_kind(arena_info[player_ptr->arena_number].tval, arena_info[player_ptr->arena_number].sval));
2441                         apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2442                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2443                 }
2444
2445                 if (player_ptr->arena_number > MAX_ARENA_MONS) player_ptr->arena_number++;
2446                 player_ptr->arena_number++;
2447                 if (record_arena)
2448                 {
2449                         GAME_TEXT m_name[MAX_NLEN];
2450
2451                         monster_desc(player_ptr, m_name, m_ptr, MD_WRONGDOER_NAME);
2452
2453                         exe_write_diary(player_ptr, DIARY_ARENA, player_ptr->arena_number, m_name);
2454                 }
2455         }
2456         
2457         if (m_idx == player_ptr->riding)
2458         {
2459                 if (rakuba(player_ptr, -1, FALSE))
2460                 {
2461                         msg_print(_("地面に落とされた。", "You have fallen from your riding pet."));
2462                 }
2463         }
2464
2465         bool is_drop_corpse = one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4);
2466         is_drop_corpse &= (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON));
2467         is_drop_corpse &= !(floor_ptr->inside_arena || player_ptr->phase_out || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)));
2468         if (is_drop_corpse)
2469         {
2470                 /* Assume skeleton */
2471                 bool corpse = FALSE;
2472
2473                 /*
2474                  * We cannot drop a skeleton? Note, if we are in this check,
2475                  * we *know* we can drop at least a corpse or a skeleton
2476                  */
2477                 if (!(r_ptr->flags9 & RF9_DROP_SKELETON))
2478                         corpse = TRUE;
2479                 else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 & RF1_UNIQUE))
2480                         corpse = TRUE;
2481
2482                 /* Else, a corpse is more likely unless we did a "lot" of damage */
2483                 else if (r_ptr->flags9 & RF9_DROP_CORPSE)
2484                 {
2485                         /* Lots of damage in one blow */
2486                         if ((0 - ((m_ptr->maxhp) / 4)) > m_ptr->hp)
2487                         {
2488                                 if (one_in_(5)) corpse = TRUE;
2489                         }
2490                         else
2491                         {
2492                                 if (!one_in_(5)) corpse = TRUE;
2493                         }
2494                 }
2495
2496                 q_ptr = &forge;
2497                 object_prep(q_ptr, lookup_kind(TV_CORPSE, (corpse ? SV_CORPSE : SV_SKELETON)));
2498                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2499                 q_ptr->pval = m_ptr->r_idx;
2500                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2501         }
2502
2503         /* Drop objects being carried */
2504         monster_drop_carried_objects(player_ptr, m_ptr);
2505
2506         u32b mo_mode = 0L;
2507         if (r_ptr->flags1 & RF1_DROP_GOOD) mo_mode |= AM_GOOD;
2508         if (r_ptr->flags1 & RF1_DROP_GREAT) mo_mode |= AM_GREAT;
2509
2510         switch (m_ptr->r_idx)
2511         {
2512         case MON_PINK_HORROR:
2513         {
2514                 /* Pink horrors are replaced with 2 Blue horrors */
2515                 if (floor_ptr->inside_arena || player_ptr->phase_out) break;
2516
2517                 bool notice = FALSE;
2518                 for (int i = 0; i < 2; i++)
2519                 {
2520                         POSITION wy = y, wx = x;
2521                         bool pet = is_pet(m_ptr);
2522                         BIT_FLAGS mode = 0L;
2523
2524                         if (pet) mode |= PM_FORCE_PET;
2525
2526                         if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode))
2527                         {
2528                                 if (player_can_see_bold(player_ptr, wy, wx)) notice = TRUE;
2529                         }
2530                 }
2531
2532                 if (notice) msg_print(_("ピンク・ホラーは分裂した!", "The Pink horror divides!"));
2533
2534                 break;
2535         }
2536
2537         case MON_BLOODLETTER:
2538         {
2539                 /* Bloodletters of Khorne may drop a blade of chaos */
2540                 if (!drop_chosen_item || (randint1(100) >= 15)) break;
2541
2542                 q_ptr = &forge;
2543
2544                 /* Prepare to make a Blade of Chaos */
2545                 object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BLADE_OF_CHAOS));
2546
2547                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART | mo_mode);
2548                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2549                 break;
2550         }
2551
2552         case MON_RAAL:
2553         {
2554                 if (!drop_chosen_item || (floor_ptr->dun_level <= 9)) break;
2555
2556                 q_ptr = &forge;
2557                 object_wipe(q_ptr);
2558
2559                 /* Activate restriction */
2560                 if ((floor_ptr->dun_level > 49) && one_in_(5))
2561                         get_obj_num_hook = kind_is_good_book;
2562                 else
2563                         get_obj_num_hook = kind_is_book;
2564
2565                 /* Make a book */
2566                 make_object(player_ptr, q_ptr, mo_mode);
2567                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2568                 break;
2569         }
2570
2571         case MON_DAWN:
2572         {
2573                 /*
2574                  * Mega^3-hack: killing a 'Warrior of the Dawn' is likely to
2575                  * spawn another in the fallen one's place!
2576                  */
2577                 if (floor_ptr->inside_arena || player_ptr->phase_out) break;
2578                 if (one_in_(7)) break;
2579
2580                 POSITION wy = y, wx = x;
2581                 int attempts = 100;
2582                 bool pet = is_pet(m_ptr);
2583                 do
2584                 {
2585                         scatter(player_ptr, &wy, &wx, y, x, 20, 0);
2586                 } while (!(in_bounds(floor_ptr, wy, wx) && cave_empty_bold2(floor_ptr, wy, wx)) && --attempts);
2587
2588                 if (attempts <= 0) break;
2589
2590                 BIT_FLAGS mode = 0L;
2591                 if (pet) mode |= PM_FORCE_PET;
2592
2593                 if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode))
2594                 {
2595                         if (player_can_see_bold(player_ptr, wy, wx))
2596                                 msg_print(_("新たな戦士が現れた!", "A new warrior steps forth!"));
2597                 }
2598
2599                 break;
2600         }
2601
2602         /* One more ultra-hack: An Unmaker goes out with a big bang! */
2603         case MON_UNMAKER:
2604         {
2605                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2606                 (void)project(player_ptr, m_idx, 6, y, x, 100, GF_CHAOS, flg, -1);
2607                 break;
2608         }
2609
2610         case MON_UNICORN_ORD:
2611         case MON_MORGOTH:
2612         case MON_ONE_RING:
2613         {
2614                 /* Reward for "lazy" player */
2615                 if (player_ptr->pseikaku != SEIKAKU_NAMAKE) break;
2616                 if (!drop_chosen_item) break;
2617
2618                 ARTIFACT_IDX a_idx = 0;
2619                 artifact_type *a_ptr = NULL;
2620                 do
2621                 {
2622                         switch (randint0(3))
2623                         {
2624                         case 0:
2625                                 a_idx = ART_NAMAKE_HAMMER;
2626                                 break;
2627                         case 1:
2628                                 a_idx = ART_NAMAKE_BOW;
2629                                 break;
2630                         case 2:
2631                                 a_idx = ART_NAMAKE_ARMOR;
2632                                 break;
2633                         }
2634
2635                         a_ptr = &a_info[a_idx];
2636                 } while (a_ptr->cur_num);
2637
2638                 if (create_named_art(player_ptr, a_idx, y, x))
2639                 {
2640                         a_ptr->cur_num = 1;
2641
2642                         /* Hack -- Memorize location of artifact in saved floors */
2643                         if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2644                 }
2645                 else if (!preserve_mode) a_ptr->cur_num = 1;
2646
2647                 break;
2648         }
2649
2650         case MON_SERPENT:
2651         {
2652                 if (!drop_chosen_item) break;
2653                 q_ptr = &forge;
2654
2655                 /* Mega-Hack -- Prepare to make "Grond" */
2656                 object_prep(q_ptr, lookup_kind(TV_HAFTED, SV_GROND));
2657
2658                 /* Mega-Hack -- Mark this item as "Grond" */
2659                 q_ptr->name1 = ART_GROND;
2660
2661                 /* Mega-Hack -- Actually create "Grond" */
2662                 apply_magic(player_ptr, q_ptr, -1, AM_GOOD | AM_GREAT);
2663                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2664                 q_ptr = &forge;
2665
2666                 /* Mega-Hack -- Prepare to make "Chaos" */
2667                 object_prep(q_ptr, lookup_kind(TV_CROWN, SV_CHAOS));
2668
2669                 /* Mega-Hack -- Mark this item as "Chaos" */
2670                 q_ptr->name1 = ART_CHAOS;
2671
2672                 /* Mega-Hack -- Actually create "Chaos" */
2673                 apply_magic(player_ptr, q_ptr, -1, AM_GOOD | AM_GREAT);
2674                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2675                 break;
2676         }
2677
2678         case MON_B_DEATH_SWORD:
2679         {
2680                 if (!drop_chosen_item) break;
2681
2682                 q_ptr = &forge;
2683                 object_prep(q_ptr, lookup_kind(TV_SWORD, randint1(2)));
2684                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2685                 break;
2686         }
2687
2688         case MON_A_GOLD:
2689         case MON_A_SILVER:
2690         {
2691                 bool is_drop_can = drop_chosen_item;
2692                 bool is_silver = m_ptr->r_idx == MON_A_SILVER;
2693                 is_silver &= r_ptr->r_akills % 5 == 0;
2694                 is_drop_can &= (m_ptr->r_idx == MON_A_GOLD) || is_silver;
2695                 if (!is_drop_can) break;
2696
2697                 q_ptr = &forge;
2698                 object_prep(q_ptr, lookup_kind(TV_CHEST, SV_CHEST_KANDUME));
2699                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART);
2700                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2701                 break;
2702         }
2703
2704         case MON_ROLENTO:
2705         {
2706                 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2707                 (void)project(player_ptr, m_idx, 3, y, x, damroll(20, 10), GF_FIRE, flg, -1);
2708                 break;
2709         }
2710
2711         default:
2712         {
2713                 if (!drop_chosen_item) break;
2714
2715                 switch (r_ptr->d_char)
2716                 {
2717                 case '(':
2718                 {
2719                         if (floor_ptr->dun_level <= 0) break;
2720
2721                         q_ptr = &forge;
2722                         object_wipe(q_ptr);
2723
2724                         /* Activate restriction */
2725                         get_obj_num_hook = kind_is_cloak;
2726
2727                         /* Make a cloak */
2728                         make_object(player_ptr, q_ptr, mo_mode);
2729                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2730                         break;
2731                 }
2732
2733                 case '/':
2734                 {
2735                         if (floor_ptr->dun_level <= 4) break;
2736
2737                         q_ptr = &forge;
2738                         object_wipe(q_ptr);
2739
2740                         /* Activate restriction */
2741                         get_obj_num_hook = kind_is_polearm;
2742
2743                         /* Make a poleweapon */
2744                         make_object(player_ptr, q_ptr, mo_mode);
2745                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2746                         break;
2747                 }
2748
2749                 case '[':
2750                 {
2751                         if (floor_ptr->dun_level <= 19) break;
2752
2753                         q_ptr = &forge;
2754                         object_wipe(q_ptr);
2755
2756                         /* Activate restriction */
2757                         get_obj_num_hook = kind_is_armor;
2758
2759                         /* Make a hard armor */
2760                         make_object(player_ptr, q_ptr, mo_mode);
2761                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2762                         break;
2763                 }
2764
2765                 case '\\':
2766                 {
2767                         if (floor_ptr->dun_level <= 4) break;
2768                         q_ptr = &forge;
2769                         object_wipe(q_ptr);
2770
2771                         /* Activate restriction */
2772                         get_obj_num_hook = kind_is_hafted;
2773
2774                         /* Make a hafted weapon */
2775                         make_object(player_ptr, q_ptr, mo_mode);
2776                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2777
2778                         break;
2779                 }
2780
2781                 case '|':
2782                 {
2783                         if (m_ptr->r_idx == MON_STORMBRINGER) break;
2784                         q_ptr = &forge;
2785                         object_wipe(q_ptr);
2786
2787                         /* Activate restriction */
2788                         get_obj_num_hook = kind_is_sword;
2789
2790                         /* Make a sword */
2791                         make_object(player_ptr, q_ptr, mo_mode);
2792                         (void)drop_near(player_ptr, q_ptr, -1, y, x);
2793                         break;
2794                 }
2795                 }
2796         }
2797         }
2798
2799         /* Mega-Hack -- drop fixed items */
2800         if (drop_chosen_item)
2801         {
2802                 ARTIFACT_IDX a_idx = 0;
2803                 PERCENTAGE chance = 0;
2804
2805                 for (int i = 0; i < 4; i++)
2806                 {
2807                         if (!r_ptr->artifact_id[i]) break;
2808                         a_idx = r_ptr->artifact_id[i];
2809                         chance = r_ptr->artifact_percent[i];
2810                 }
2811
2812                 if ((a_idx > 0) && ((randint0(100) < chance) || current_world_ptr->wizard))
2813                 {
2814                         artifact_type *a_ptr = &a_info[a_idx];
2815
2816                         if (!a_ptr->cur_num)
2817                         {
2818                                 if (create_named_art(player_ptr, a_idx, y, x))
2819                                 {
2820                                         a_ptr->cur_num = 1;
2821
2822                                         /* Hack -- Memorize location of artifact in saved floors */
2823                                         if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2824                                 }
2825                                 else if (!preserve_mode) a_ptr->cur_num = 1;
2826                         }
2827                 }
2828
2829                 if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[player_ptr->dungeon_idx].final_guardian == m_ptr->r_idx))
2830                 {
2831                         KIND_OBJECT_IDX k_idx = d_info[player_ptr->dungeon_idx].final_object ? d_info[player_ptr->dungeon_idx].final_object
2832                                 : lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
2833
2834                         if (d_info[player_ptr->dungeon_idx].final_artifact)
2835                         {
2836                                 a_idx = d_info[player_ptr->dungeon_idx].final_artifact;
2837                                 artifact_type *a_ptr = &a_info[a_idx];
2838
2839                                 if (!a_ptr->cur_num)
2840                                 {
2841                                         if (create_named_art(player_ptr, a_idx, y, x))
2842                                         {
2843                                                 a_ptr->cur_num = 1;
2844
2845                                                 /* Hack -- Memorize location of artifact in saved floors */
2846                                                 if (current_world_ptr->character_dungeon) a_ptr->floor_id = player_ptr->floor_id;
2847                                         }
2848                                         else if (!preserve_mode) a_ptr->cur_num = 1;
2849
2850                                         /* Prevent rewarding both artifact and "default" object */
2851                                         if (!d_info[player_ptr->dungeon_idx].final_object) k_idx = 0;
2852                                 }
2853                         }
2854
2855                         if (k_idx)
2856                         {
2857                                 q_ptr = &forge;
2858
2859                                 /* Prepare to make a reward */
2860                                 object_prep(q_ptr, k_idx);
2861
2862                                 apply_magic(player_ptr, q_ptr, floor_ptr->object_level, AM_NO_FIXED_ART | AM_GOOD);
2863                                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2864                         }
2865
2866                         msg_format(_("あなたは%sを制覇した!", "You have conquered %s!"), d_name + d_info[player_ptr->dungeon_idx].name);
2867                 }
2868         }
2869
2870         /* Determine how much we can drop */
2871         int number = 0;
2872         if ((r_ptr->flags1 & RF1_DROP_60) && (randint0(100) < 60)) number++;
2873         if ((r_ptr->flags1 & RF1_DROP_90) && (randint0(100) < 90)) number++;
2874         if (r_ptr->flags1 & RF1_DROP_1D2) number += damroll(1, 2);
2875         if (r_ptr->flags1 & RF1_DROP_2D2) number += damroll(2, 2);
2876         if (r_ptr->flags1 & RF1_DROP_3D2) number += damroll(3, 2);
2877         if (r_ptr->flags1 & RF1_DROP_4D2) number += damroll(4, 2);
2878
2879         if (cloned && !(r_ptr->flags1 & RF1_UNIQUE))
2880                 number = 0; /* Clones drop no stuff unless Cloning Pits */
2881
2882         if (is_pet(m_ptr) || player_ptr->phase_out || floor_ptr->inside_arena)
2883                 number = 0; /* Pets drop no stuff */
2884         if (!drop_item && (r_ptr->d_char != '$')) number = 0;
2885
2886         if ((r_ptr->flags2 & (RF2_MULTIPLY)) && (r_ptr->r_akills > 1024))
2887                 number = 0; /* Limit of Multiply monster drop */
2888
2889         /* Hack -- handle creeping coins */
2890         coin_type = force_coin;
2891
2892         /* Average dungeon and monster levels */
2893         floor_ptr->object_level = (floor_ptr->dun_level + r_ptr->level) / 2;
2894
2895         /* Drop some objects */
2896         int dump_item = 0;
2897         int dump_gold = 0;
2898         for (int i = 0; i < number; i++)
2899         {
2900                 q_ptr = &forge;
2901                 object_wipe(q_ptr);
2902
2903                 if (do_gold && (!do_item || (randint0(100) < 50)))
2904                 {
2905                         if (!make_gold(floor_ptr, q_ptr)) continue;
2906                         dump_gold++;
2907                 }
2908                 else
2909                 {
2910                         if (!make_object(player_ptr, q_ptr, mo_mode)) continue;
2911                         dump_item++;
2912                 }
2913
2914                 (void)drop_near(player_ptr, q_ptr, -1, y, x);
2915         }
2916
2917         /* Reset the object level */
2918         floor_ptr->object_level = floor_ptr->base_level;
2919
2920         /* Reset "coin" type */
2921         coin_type = 0;
2922
2923         /* Take note of any dropped treasure */
2924         bool visible = ((m_ptr->ml && !player_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE));
2925         if (visible && (dump_item || dump_gold))
2926         {
2927                 /* Take notes on treasure */
2928                 lore_treasure(player_ptr, m_idx, dump_item, dump_gold);
2929         }
2930
2931         /* Only process "Quest Monsters" */
2932         if (!(r_ptr->flags1 & RF1_QUESTOR)) return;
2933         if (player_ptr->phase_out) return;
2934
2935         /* Winner? */
2936         if ((m_ptr->r_idx != MON_SERPENT) || cloned) return;
2937
2938         current_world_ptr->total_winner = TRUE;
2939         player_ptr->redraw |= (PR_TITLE);
2940         play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_FINAL_QUEST_CLEAR);
2941         exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("見事に変愚蛮怒の勝利者となった!", "become *WINNER* of Hengband finely!"));
2942         admire_from_patron(player_ptr);
2943         msg_print(_("*** おめでとう ***", "*** CONGRATULATIONS ***"));
2944         msg_print(_("あなたはゲームをコンプリートしました。", "You have won the game!"));
2945         msg_print(_("準備が整ったら引退(自殺コマンド)しても結構です。", "You may retire (commit suicide) when you are ready."));
2946 }
2947
2948
2949 /*!
2950  * @brief モンスターを撃破した際の述語メッセージを返す /
2951  * Return monster death string
2952  * @param r_ptr 撃破されたモンスターの種族情報を持つ構造体の参照ポインタ
2953  * @return 撃破されたモンスターの述語
2954  */
2955 concptr extract_note_dies(MONRACE_IDX r_idx)
2956 {
2957         monster_race *r_ptr = &r_info[r_idx];
2958         if (monster_living(r_idx)) return _("は死んだ。", " dies.");
2959
2960         for (int i = 0; i < 4; i++)
2961         {
2962                 if (r_ptr->blow[i].method == RBM_EXPLODE)
2963                 {
2964                         return _("は爆発して粉々になった。", " explodes into tiny shreds.");
2965                 }
2966         }
2967
2968         return _("を倒した。", " is destroyed.");
2969 }
2970
2971
2972 /*
2973  * Monster health description
2974  */
2975 concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode)
2976 {
2977         bool living = monster_living(m_ptr->ap_r_idx);
2978         int perc = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
2979
2980         concptr desc;
2981         if (m_ptr->hp >= m_ptr->maxhp)
2982         {
2983                 desc = living ? _("無傷", "unhurt") : _("無ダメージ", "undamaged");
2984         }
2985         else if (perc >= 60)
2986         {
2987                 desc = living ? _("軽傷", "somewhat wounded") : _("小ダメージ", "somewhat damaged");
2988         }
2989         else if (perc >= 25)
2990         {
2991                 desc = living ? _("負傷", "wounded") : _("中ダメージ", "damaged");
2992         }
2993         else if (perc >= 10)
2994         {
2995                 desc = living ? _("重傷", "badly wounded") : _("大ダメージ", "badly damaged");
2996         }
2997         else
2998         {
2999                 desc = living ? _("半死半生", "almost dead") : _("倒れかけ", "almost destroyed");
3000         }
3001
3002         concptr attitude;
3003         if (!(mode & 0x01))
3004         {
3005                 attitude = "";
3006         }
3007         else if (is_pet(m_ptr))
3008         {
3009                 attitude = _(", ペット", ", pet");
3010         }
3011         else if (is_friendly(m_ptr))
3012         {
3013                 attitude = _(", 友好的", ", friendly");
3014         }
3015         else
3016         {
3017                 attitude = _("", "");
3018         }
3019
3020         concptr clone = (m_ptr->smart & SM_CLONED) ? ", clone" : "";
3021         monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
3022         if (ap_r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE))
3023         {
3024                 return format(_("レベル%d, %s%s%s", "Level %d, %s%s%s"), ap_r_ptr->level, desc, attitude, clone);
3025         }
3026
3027         return format(_("レベル???, %s%s%s", "Level ???, %s%s%s"), desc, attitude, clone);
3028 }
3029
3030
3031 bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr)
3032 {
3033         return m_ptr->ml && !player_ptr->image && (m_ptr->ap_r_idx == m_ptr->r_idx);
3034 }