OSDN Git Service

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