OSDN Git Service

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