OSDN Git Service

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