OSDN Git Service

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