OSDN Git Service

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