OSDN Git Service

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