OSDN Git Service

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