OSDN Git Service

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