OSDN Git Service

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