OSDN Git Service

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