OSDN Git Service

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