OSDN Git Service

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