OSDN Git Service

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