OSDN Git Service

BCC++ 5.5.1で警告封じオプション -w- を外した場合のコンパイル警告の除去.
[hengband/hengband.git] / src / monster1.c
index 2b2e166..c491d07 100644 (file)
@@ -1,15 +1,15 @@
 /* File: monster1.c */
 
-/* Purpose: describe monsters (using monster memory) */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Christopher J. Stuart
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: describe monsters (using monster memory) */
+
 #include "angband.h"
 
 
@@ -134,14 +134,15 @@ static void roff_aux(int r_idx, int mode)
        monster_race    *r_ptr = &r_info[r_idx];
 
        bool            old = FALSE;
-       bool            sin = FALSE;
 
        int             m, n, r;
 
        cptr            p, q;
 
 #ifdef JP
-        char            jverb_buf[64];
+       char            jverb_buf[64];
+#else
+       bool            sin = FALSE;
 #endif
        int             msex = 0;
 
@@ -179,7 +180,7 @@ static void roff_aux(int r_idx, int mode)
        flags6 = (r_ptr->flags6 & r_ptr->r_flags6);
        flags7 = (r_ptr->flags7 & r_ptr->flags7);
 
-       /* cheat_know or reserch_mon() */
+       /* cheat_know or research_mon() */
        if (cheat_know || (mode & 0x01))
                know_everything = TRUE;
 
@@ -267,11 +268,12 @@ static void roff_aux(int r_idx, int mode)
                        /* Killed ancestors */
 #ifdef JP
                        hooked_roff(format("%^s¤Ï¤¢¤Ê¤¿¤ÎÀèÁĤò %d ¿ÍÁò¤Ã¤Æ¤¤¤ë",
+                                          wd_he[msex], r_ptr->r_deaths));
 #else
                        hooked_roff(format("%^s has slain %d of your ancestors",
+                                          wd_he[msex], r_ptr->r_deaths));
 #endif
 
-                                   wd_he[msex], r_ptr->r_deaths));
 
                        /* But we've also killed it */
                        if (dead)
@@ -280,7 +282,7 @@ static void roff_aux(int r_idx, int mode)
                                hooked_roff(format("¤¬¡¢¤¹¤Ç¤ËµØƤ¤Á¤Ï²Ì¤¿¤·¤Æ¤¤¤ë¡ª"));
 #else
                                hooked_roff(format(", but you have avenged %s!  ",
-                                           plural(r_ptr->r_deaths, "him", "them")));
+                                           plural(r_ptr->r_deaths, "him", "them")));
 #endif
 
                        }
@@ -292,10 +294,13 @@ static void roff_aux(int r_idx, int mode)
                                hooked_roff(format("¤Î¤Ë¡¢¤Þ¤ÀµØƤ¤Á¤ò²Ì¤¿¤·¤Æ¤¤¤Ê¤¤¡£"));
 #else
                                hooked_roff(format(", who %s unavenged.  ",
-                                           plural(r_ptr->r_deaths, "remains", "remain")));
+                                           plural(r_ptr->r_deaths, "remains", "remain")));
 #endif
 
                        }
+
+                       /* Start a new line */
+                       hooked_roff("\n");
                }
 
                /* Dead unique who never hurt us */
@@ -307,6 +312,8 @@ static void roff_aux(int r_idx, int mode)
                        hooked_roff("You have slain this foe.  ");
 #endif
 
+                       /* Start a new line */
+                       hooked_roff("\n");
                }
        }
 
@@ -316,10 +323,10 @@ static void roff_aux(int r_idx, int mode)
                /* Dead ancestors */
 #ifdef JP
                hooked_roff(format("¤³¤Î¥â¥ó¥¹¥¿¡¼¤Ï¤¢¤Ê¤¿¤ÎÀèÁĤò %d ¿ÍÁò¤Ã¤Æ¤¤¤ë",
-                           r_ptr->r_deaths ));
+                           r_ptr->r_deaths ));
 #else
                hooked_roff(format("%d of your ancestors %s been killed by this creature, ",
-                           r_ptr->r_deaths, plural(r_ptr->r_deaths, "has", "have")));
+                           r_ptr->r_deaths, plural(r_ptr->r_deaths, "has", "have")));
 #endif
 
 
@@ -327,12 +334,11 @@ static void roff_aux(int r_idx, int mode)
                if (r_ptr->r_pkills)
                {
 #ifdef JP
-                       hooked_roff(format("¤¬¡¢¤¢¤Ê¤¿¤Ï¤³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤÏÅݤ·¤Æ¤¤¤ë¡£",
+                       hooked_roff(format("¤¬¡¢¤¢¤Ê¤¿¤Ï¤³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤÏÅݤ·¤Æ¤¤¤ë¡£", r_ptr->r_pkills));
 #else
-                       hooked_roff(format("and you have exterminated at least %d of the creatures.  ",
+                       hooked_roff(format("and you have exterminated at least %d of the creatures.  ", r_ptr->r_pkills));
 #endif
 
-                                   r_ptr->r_pkills));
                }
 
                /* Some kills past lives */
@@ -340,10 +346,10 @@ static void roff_aux(int r_idx, int mode)
                {
 #ifdef JP
                        hooked_roff(format("¤¬¡¢%s¤Ï¤³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤÏÅݤ·¤Æ¤¤¤ë¡£",
-                                   "¤¢¤Ê¤¿¤ÎÀèÁÄ", r_ptr->r_tkills));
+                                   "¤¢¤Ê¤¿¤ÎÀèÁÄ", r_ptr->r_tkills));
 #else
                        hooked_roff(format("and %s have exterminated at least %d of the creatures.  ",
-                                   "your ancestors", r_ptr->r_tkills));
+                                   "your ancestors", r_ptr->r_tkills));
 #endif
 
                }
@@ -352,13 +358,15 @@ static void roff_aux(int r_idx, int mode)
                else
                {
 #ifdef JP
-                       hooked_roff(format("¤¬¡¢¤Þ¤À%s¤òÅݤ·¤¿¤³¤È¤Ï¤Ê¤¤¡£",
+                       hooked_roff(format("¤¬¡¢¤Þ¤À%s¤òÅݤ·¤¿¤³¤È¤Ï¤Ê¤¤¡£", wd_he[msex]));
 #else
-                       hooked_roff(format("and %s is not ever known to have been defeated.  ",
+                       hooked_roff(format("and %s is not ever known to have been defeated.  ", wd_he[msex]));
 #endif
 
-                                   wd_he[msex]));
                }
+
+               /* Start a new line */
+               hooked_roff("\n");
        }
 
        /* Normal monsters */
@@ -368,24 +376,22 @@ static void roff_aux(int r_idx, int mode)
                if (r_ptr->r_pkills)
                {
 #ifdef JP
-                       hooked_roff(format("¤¢¤Ê¤¿¤Ï¤³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤϻ¦¤·¤Æ¤¤¤ë¡£",
+                       hooked_roff(format("¤¢¤Ê¤¿¤Ï¤³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤϻ¦¤·¤Æ¤¤¤ë¡£", r_ptr->r_pkills));
 #else
-                       hooked_roff(format("You have killed at least %d of these creatures.  ",
+                       hooked_roff(format("You have killed at least %d of these creatures.  ", r_ptr->r_pkills));
 #endif
 
-                                   r_ptr->r_pkills));
                }
 
                /* Killed some last life */
                else if (r_ptr->r_tkills)
                {
 #ifdef JP
-                       hooked_roff(format("¤¢¤Ê¤¿¤ÎÀèÁĤϤ³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤϻ¦¤·¤Æ¤¤¤ë¡£",
+                       hooked_roff(format("¤¢¤Ê¤¿¤ÎÀèÁĤϤ³¤Î¥â¥ó¥¹¥¿¡¼¤ò¾¯¤Ê¤¯¤È¤â %d ÂΤϻ¦¤·¤Æ¤¤¤ë¡£", r_ptr->r_tkills));
 #else
-                       hooked_roff(format("Your ancestors have killed at least %d of these creatures.  ",
+                       hooked_roff(format("Your ancestors have killed at least %d of these creatures.  ", r_ptr->r_tkills));
 #endif
 
-                                   r_ptr->r_tkills));
                }
 
                /* Killed none */
@@ -396,13 +402,13 @@ static void roff_aux(int r_idx, int mode)
 #else
                        hooked_roff("No battles to the death are recalled.  ");
 #endif
-
                }
-       }
 
+               /* Start a new line */
+               hooked_roff("\n");
+       }
 
        /* Descriptions */
-       if (1)
        {
                char buf[2048];
 
@@ -412,9 +418,9 @@ static void roff_aux(int r_idx, int mode)
 
                /* Build the filename */
 #ifdef JP
-path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
+path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "r_info_j.raw");
 #else
-               path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info.raw");
+               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "r_info.raw");
 #endif
 
 
@@ -451,11 +457,14 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
 
 #endif
 
-               /* Dump it */
-               hooked_roff(buf);
-#ifndef JP
-               hooked_roff("  ");
-#endif
+               if (buf[0])
+               {
+                       /* Dump it */
+                       hooked_roff(buf);
+
+                       /* Start a new line */
+                       hooked_roff("\n");
+               }
        }
 
        if (r_idx == MON_KAGE)
@@ -490,7 +499,7 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
                        hooked_roff(format("%^s is normally found at depths of %d feet",
 #endif
 
-                                   wd_he[msex], r_ptr->level * 50));
+                                   wd_he[msex], r_ptr->level * 50));
                }
                else
                {
@@ -500,7 +509,7 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
                        hooked_roff(format("%^s is normally found on dungeon level %d",
 #endif
 
-                                   wd_he[msex], r_ptr->level));
+                                   wd_he[msex], r_ptr->level));
                }
                old = TRUE;
        }
@@ -602,12 +611,12 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
                        else if (speed < 120) hook_c_roff(TERM_L_UMBER, "¤ä¤ä");
                        hook_c_roff(TERM_L_RED, "ÁÇÁ᤯");
 #else
-                       if (speed > 139) hook_c_roff(TERM_RED, "incredibly ");
-                       else if (speed > 134) hook_c_roff(TERM_ORANGE, "extremely ");
-                       else if (speed > 129) hook_c_roff(TERM_ORANGE, "very ");
-                       else if (speed > 124) hook_c_roff(TERM_UMBER, "fairly ");
-                       else if (speed < 120) hook_c_roff(TERM_L_UMBER, "somewhat ");
-                       hook_c_roff(TERM_L_RED, "quickly");
+                       if (speed > 139) hook_c_roff(TERM_RED, " incredibly");
+                       else if (speed > 134) hook_c_roff(TERM_ORANGE, " extremely");
+                       else if (speed > 129) hook_c_roff(TERM_ORANGE, " very");
+                       else if (speed > 124) hook_c_roff(TERM_UMBER, " fairly");
+                       else if (speed < 120) hook_c_roff(TERM_L_UMBER, " somewhat");
+                       hook_c_roff(TERM_L_RED, " quickly");
 #endif
 
                }
@@ -620,11 +629,11 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
                        else if (speed > 104) hook_c_roff(TERM_GREEN, "¤ä¤ä");
                        hook_c_roff(TERM_L_BLUE, "¤æ¤Ã¤¯¤ê¤È");
 #else
-                       if (speed < 90) hook_c_roff(TERM_L_GREEN, "incredibly ");
-                       else if (speed < 95) hook_c_roff(TERM_BLUE, "very ");
-                       else if (speed < 100) hook_c_roff(TERM_BLUE, "fairly ");
-                       else if (speed > 104) hook_c_roff(TERM_GREEN, "somewhat ");
-                       hook_c_roff(TERM_L_BLUE, "slowly");
+                       if (speed < 90) hook_c_roff(TERM_L_GREEN, " incredibly");
+                       else if (speed < 95) hook_c_roff(TERM_BLUE, " very");
+                       else if (speed < 100) hook_c_roff(TERM_BLUE, " fairly");
+                       else if (speed > 104) hook_c_roff(TERM_GREEN, " somewhat");
+                       hook_c_roff(TERM_L_BLUE, " slowly");
 #endif
 
                }
@@ -710,36 +719,36 @@ path_build(buf, 1024, ANGBAND_DIR_DATA, "r_info_j.raw");
 #ifdef JP
 if (flags2 & RF2_ELDRITCH_HORROR) hook_c_roff(TERM_VIOLET, "¶¸µ¤¤òͶ¤¦");/*nuke me*/
 #else
-               if (flags2 & RF2_ELDRITCH_HORROR) hooked_roff(" sanity-blasting");
+               if (flags2 & RF2_ELDRITCH_HORROR) hook_c_roff(TERM_VIOLET, " sanity-blasting");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_ANIMAL)          hook_c_roff(TERM_L_GREEN, "¼«Á³³¦¤Î");
 #else
-               if (flags3 & RF3_ANIMAL)          hooked_roff(" natural");
+               if (flags3 & RF3_ANIMAL)          hook_c_roff(TERM_L_GREEN, " natural");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_EVIL)            hook_c_roff(TERM_L_DARK, "¼Ù°­¤Ê¤ë");
 #else
-               if (flags3 & RF3_EVIL)            hooked_roff(" evil");
+               if (flags3 & RF3_EVIL)            hook_c_roff(TERM_L_DARK, " evil");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_GOOD)            hook_c_roff(TERM_YELLOW, "Á±ÎɤÊ");
 #else
-               if (flags3 & RF3_GOOD)            hooked_roff(" good");
+               if (flags3 & RF3_GOOD)            hook_c_roff(TERM_YELLOW, " good");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_UNDEAD)          hook_c_roff(TERM_VIOLET, "¥¢¥ó¥Ç¥Ã¥É¤Î");
 #else
-               if (flags3 & RF3_UNDEAD)          hooked_roff(" undead");
+               if (flags3 & RF3_UNDEAD)          hook_c_roff(TERM_VIOLET, " undead");
 #endif
 #ifdef JP
 if (flags3 & RF3_AMBERITE)        hook_c_roff(TERM_VIOLET, "¥¢¥ó¥Ð¡¼¤Î²¦Â²¤Î");
 #else
-               if (flags3 & RF3_AMBERITE)        hooked_roff(" Amberite");
+               if (flags3 & RF3_AMBERITE)        hook_c_roff(TERM_VIOLET, " Amberite");
 #endif
 
 
@@ -749,43 +758,43 @@ if (flags3 & RF3_AMBERITE)        hook_c_roff(TERM_VIOLET, "
 #ifdef JP
      if (flags3 & RF3_DRAGON)   hook_c_roff(TERM_ORANGE, "¥É¥é¥´¥ó");
 #else
-                    if (flags3 & RF3_DRAGON)   hooked_roff(" dragon");
+                    if (flags3 & RF3_DRAGON)   hook_c_roff(TERM_ORANGE, " dragon");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_DEMON)    hook_c_roff(TERM_VIOLET, "¥Ç¡¼¥â¥ó");
 #else
-               if (flags3 & RF3_DEMON)    hooked_roff(" demon");
+               if (flags3 & RF3_DEMON)    hook_c_roff(TERM_VIOLET, " demon");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_GIANT)    hook_c_roff(TERM_L_UMBER, "¥¸¥ã¥¤¥¢¥ó¥È");
 #else
-               if (flags3 & RF3_GIANT)    hooked_roff(" giant");
+               if (flags3 & RF3_GIANT)    hook_c_roff(TERM_L_UMBER, " giant");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_TROLL)    hook_c_roff(TERM_BLUE, "¥È¥í¥ë");
 #else
-               if (flags3 & RF3_TROLL)    hooked_roff(" troll");
+               if (flags3 & RF3_TROLL)    hook_c_roff(TERM_BLUE, " troll");
 #endif
 
 #ifdef JP
 if (flags3 & RF3_ORC)      hook_c_roff(TERM_UMBER, "¥ª¡¼¥¯");
 #else
-               if (flags3 & RF3_ORC)      hooked_roff(" orc");
+               if (flags3 & RF3_ORC)      hook_c_roff(TERM_UMBER, " orc");
 #endif
 
 #ifdef JP
 if (flags2 & RF2_HUMAN) hook_c_roff(TERM_L_WHITE, "¿Í´Ö");
 #else
-               if (flags2 & RF2_HUMAN) hooked_roff(" Human");
+               if (flags2 & RF2_HUMAN) hook_c_roff(TERM_L_WHITE, " Human");
 #endif
 
 #ifdef JP
 if (flags2 & RF2_QUANTUM)  hook_c_roff(TERM_VIOLET, "ÎÌ»ÒÀ¸Êª");
 #else
-               if (flags2 & RF2_QUANTUM)  hooked_roff(" quantum creature");
+               if (flags2 & RF2_QUANTUM)  hook_c_roff(TERM_VIOLET, " quantum creature");
 #endif
 
        }
@@ -800,7 +809,6 @@ else                            hooked_roff("
                hooked_roff("¤òÅݤ¹¤³¤È¤Ï");
 #endif
                /* Group some variables */
-               if (TRUE)
                {
                        long i, j;
 
@@ -813,7 +821,7 @@ else                            hooked_roff("
                               (long)1000 / (p_ptr->max_plv+2) + 5) / 10);
 
                        hooked_roff(format(" Ìó%ld.%02ld ¥Ý¥¤¥ó¥È¤Î·Ð¸³¤È¤Ê¤ë¡£",
-                               (long)i, (long)j ));
+                               (long)i, (long)j ));
 #else
                        /* calculate the integer exp part */
                        i = (long)r_ptr->mexp * r_ptr->level / (p_ptr->max_plv+2);
@@ -825,8 +833,8 @@ else                            hooked_roff("
 
                        /* Mention the experience */
                        hooked_roff(format(" is worth about %ld.%02ld point%s",
-                                   (long)i, (long)j,
-                                   (((i == 1) && (j == 0)) ? "" : "s")));
+                                   (long)i, (long)j,
+                                   (((i == 1) && (j == 0)) ? "" : "s")));
 
                        /* Take account of annoying English */
                        p = "th";
@@ -843,7 +851,7 @@ else                            hooked_roff("
 
                        /* Mention the dependance on the player's level */
                        hooked_roff(format(" for a%s %lu%s level character.  ",
-                                   q, (long)i, p));
+                                   q, (long)i, p));
 #endif
 
                }
@@ -854,7 +862,7 @@ else                            hooked_roff("
 #ifdef JP
 hook_c_roff(TERM_VIOLET, format("%^s¤Ï±ê¤Èɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
+               hook_c_roff(TERM_VIOLET, format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
 #endif
 
        }
@@ -863,7 +871,7 @@ hook_c_roff(TERM_VIOLET, format("%^s
 #ifdef JP
 hook_c_roff(TERM_L_RED, format("%^s¤Ï±ê¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
+               hook_c_roff(TERM_L_RED, format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
 #endif
 
        }
@@ -872,7 +880,7 @@ hook_c_roff(TERM_L_RED, format("%^s
 #ifdef JP
 hook_c_roff(TERM_BLUE, format("%^s¤Ï±ê¤Èɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
+               hook_c_roff(TERM_BLUE, format("%^s is surrounded by flames and electricity.  ", wd_he[msex]));
 #endif
 
        }
@@ -881,7 +889,7 @@ hook_c_roff(TERM_BLUE, format("%^s
 #ifdef JP
 hook_c_roff(TERM_L_GREEN, format("%^s¤Ïɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by ice and electricity.  ", wd_he[msex]));
+               hook_c_roff(TERM_L_GREEN, format("%^s is surrounded by ice and electricity.  ", wd_he[msex]));
 #endif
 
        }
@@ -890,7 +898,7 @@ hook_c_roff(TERM_L_GREEN, format("%^s
 #ifdef JP
 hook_c_roff(TERM_RED, format("%^s¤Ï±ê¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by flames.  ", wd_he[msex]));
+               hook_c_roff(TERM_RED, format("%^s is surrounded by flames.  ", wd_he[msex]));
 #endif
 
        }
@@ -899,7 +907,7 @@ hook_c_roff(TERM_RED, format("%^s
 #ifdef JP
 hook_c_roff(TERM_BLUE, format("%^s¤Ïɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by ice.  ", wd_he[msex]));
+               hook_c_roff(TERM_BLUE, format("%^s is surrounded by ice.  ", wd_he[msex]));
 #endif
 
        }
@@ -908,7 +916,7 @@ hook_c_roff(TERM_BLUE, format("%^s
 #ifdef JP
 hook_c_roff(TERM_L_BLUE, format("%^s¤Ï¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
 #else
-               hooked_roff(format("%^s is surrounded by electricity.  ", wd_he[msex]));
+               hook_c_roff(TERM_L_BLUE, format("%^s is surrounded by electricity.  ", wd_he[msex]));
 #endif
 
        }
@@ -932,7 +940,7 @@ hooked_roff(format("%^s
                hooked_roff(format("%^s usually appears with escorts.  ",
 #endif
 
-                           wd_he[msex]));
+                           wd_he[msex]));
        }
 
        /* Describe friends */
@@ -944,7 +952,7 @@ hooked_roff(format("%^s
                hooked_roff(format("%^s usually appears in groups.  ",
 #endif
 
-                           wd_he[msex]));
+                           wd_he[msex]));
        }
 
 
@@ -1002,7 +1010,7 @@ hooked_roff(format("%^s
                        else hooked_roff(" or ");
 
                        /* Dump */
-                       hooked_roff(vp[n]);
+                       hook_c_roff(color[n], vp[n]);
 #endif
 
                }
@@ -1419,7 +1427,7 @@ if (flags6 & (RF6_HEAL))            {vp[vn] = "
 #endif
 
 #ifdef JP
-        if (flags6 & (RF6_INVULNER))        {vp[vn] = "̵Ũ²½";color[vn++] = TERM_WHITE;}
+       if (flags6 & (RF6_INVULNER))        {vp[vn] = "̵Ũ²½";color[vn++] = TERM_WHITE;}
 #else
        if (flags6 & (RF6_INVULNER))        {vp[vn] = "make invulnerable";color[vn++] = TERM_WHITE;}
 #endif
@@ -1624,7 +1632,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                hooked_roff(" magical, casting spells");
 
                /* Adverb */
-               if (flags2 & RF2_SMART) hooked_roff(" intelligently");
+               if (flags2 & RF2_SMART) hook_c_roff(TERM_YELLOW, " intelligently");
 #endif
 
 
@@ -1645,7 +1653,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                        hook_c_roff(color[n], vp[n]);
                }
 #ifdef JP
-                hooked_roff("¤Î¼öʸ¤ò¾§¤¨¤ë¤³¤È¤¬¤¢¤ë");
+               hooked_roff("¤Î¼öʸ¤ò¾§¤¨¤ë¤³¤È¤¬¤¢¤ë");
 #endif
        }
 
@@ -1654,10 +1662,10 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
        if (breath || magic)
        {
                /* Total casting */
-               m = r_ptr->r_cast_inate + r_ptr->r_cast_spell;
+               m = r_ptr->r_cast_spell;
 
                /* Average frequency */
-               n = (r_ptr->freq_inate + r_ptr->freq_spell) / 2;
+               n = r_ptr->freq_spell;
 
                /* Describe the spell frequency */
                if (m > 100 || know_everything)
@@ -1701,7 +1709,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                hooked_roff(format("%^s has an armor rating of %d",
 #endif
 
-                           wd_he[msex], r_ptr->ac));
+                           wd_he[msex], r_ptr->ac));
 
                /* Maximized hitpoints */
                if (flags1 & RF1_FORCE_MAXHP)
@@ -1712,7 +1720,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                        hooked_roff(format(" and a life rating of %d.  ",
 #endif
 
-                                   r_ptr->hdice * r_ptr->hside));
+                                   r_ptr->hdice * r_ptr->hside));
                }
 
                /* Variable hitpoints */
@@ -1724,7 +1732,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                        hooked_roff(format(" and a life rating of %dd%d.  ",
 #endif
 
-                                   r_ptr->hdice, r_ptr->hside));
+                                   r_ptr->hdice, r_ptr->hside));
                }
        }
 
@@ -2282,7 +2290,7 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
 
        /* Do we know how aware it is? */
        if ((((int)r_ptr->r_wake * (int)r_ptr->r_wake) > r_ptr->sleep) ||
-                 (r_ptr->r_ignore == MAX_UCHAR) ||
+                 (r_ptr->r_ignore == MAX_UCHAR) ||
            (r_ptr->sleep == 0 && r_ptr->r_tkills >= 10) || know_everything)
        {
                cptr act;
@@ -2392,7 +2400,7 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
                     wd_he[msex], act, 10 * r_ptr->aaf));
 #else
                hooked_roff(format("%^s %s intruders, which %s may notice from %d feet.  ",
-                           wd_he[msex], act, wd_he[msex], 10 * r_ptr->aaf));
+                           wd_he[msex], act, wd_he[msex], 10 * r_ptr->aaf));
 #endif
 
        }
@@ -2401,14 +2409,14 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
        /* Drops gold and/or items */
        if (drop_gold || drop_item)
        {
-               /* No "n" needed */
-               sin = FALSE;
-
                /* Intro */
 #ifdef JP
                hooked_roff(format("%^s¤Ï", wd_he[msex]));
 #else
                hooked_roff(format("%^s may carry", wd_he[msex]));
+
+               /* No "n" needed */
+               sin = FALSE;
 #endif
 
 
@@ -2422,9 +2430,8 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
                        hooked_roff("°ì¤Ä¤Î");
 #else
                        hooked_roff(" a");
-#endif
-
                        sin = TRUE;
+#endif
                }
 
                /* Two drops */
@@ -2468,9 +2475,8 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
                        p = "¾å¼Á¤Ê";
 #else
                        p = " good";
-#endif
-
                        sin = FALSE;
+#endif
                }
 
                /* Okay */
@@ -2486,8 +2492,8 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
                        /* Handle singular "an" */
 #ifndef JP
                        if (sin) hooked_roff("n");
-#endif
                        sin = FALSE;
+#endif
 
                        /* Dump "object(s)" */
                        if (p) hooked_roff(p);
@@ -2511,14 +2517,14 @@ if ((flags3 & RF3_RES_TELE) && (r_ptr->flags1 & RF1_UNIQUE)) {vp[vn] = "
                /* Treasures */
                if (drop_gold)
                {
+#ifndef JP
                        /* Cancel prefix */
                        if (!p) sin = FALSE;
 
                        /* Handle singular "an" */
-#ifndef JP
                        if (sin) hooked_roff("n");
-#endif
                        sin = FALSE;
+#endif
 
                        /* Dump "treasure(s)" */
                        if (p) hooked_roff(p);
@@ -2922,11 +2928,11 @@ case RBE_DR_MANA:  q = "
 
 
 #ifdef JP
-                if ( r == 0 ) hooked_roff( format("%^s¤Ï", wd_he[msex]) );
+               if ( r == 0 ) hooked_roff( format("%^s¤Ï", wd_he[msex]) );
 
                /***¼ã´³É½¸½¤òÊѹ¹ ita ***/
 
-                        /* Describe damage (if known) */
+                       /* Describe damage (if known) */
                if (d1 && d2 && (know_everything || know_damage(r_idx, m)))
                  {
                    
@@ -3091,16 +3097,13 @@ void roff_top(int r_idx)
        /* Reset the cursor */
        Term_gotoxy(0, 0);
 
+#ifndef JP
        /* A title (use "The" for non-uniques) */
-#ifdef JP
-        if (0)
-#else
        if (!(r_ptr->flags1 & RF1_UNIQUE))
-#endif
-
        {
                Term_addstr(-1, TERM_WHITE, "The ");
        }
+#endif
 
        /* Dump the name */
        Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
@@ -3222,12 +3225,12 @@ bool monster_dungeon(int r_idx)
        if (!(r_ptr->flags8 & RF8_WILD_ONLY))
                return TRUE;
        else
-        {
-                dungeon_info_type *d_ptr = &d_info[dungeon_type];
-                if ((d_ptr->mflags8 & RF8_WILD_MOUNTAIN) &&
-                    (r_ptr->flags8 & RF8_WILD_ONLY)) return TRUE;
+       {
+               dungeon_info_type *d_ptr = &d_info[dungeon_type];
+               if ((d_ptr->mflags8 & RF8_WILD_MOUNTAIN) &&
+                   (r_ptr->flags8 & RF8_WILD_MOUNTAIN)) return TRUE;
                return FALSE;
-        }
+       }
 }
 
 
@@ -3523,6 +3526,99 @@ bool monster_can_cross_terrain(byte feat, monster_race *r_ptr)
 
 
 /*
+ * Strictly check if monster can enter the grid
+ */
+bool monster_can_enter(int y, int x, monster_race *r_ptr)
+{
+       cave_type *c_ptr = &cave[y][x];
+       byte feat = c_ptr->feat;
+
+       /* Player or other monster */
+       if ((y == py) && (x == px)) return FALSE;
+       if (c_ptr->m_idx) return FALSE;
+
+       /* Permanent wall */
+       if ((c_ptr->feat >= FEAT_PERM_EXTRA) &&
+           (c_ptr->feat <= FEAT_PERM_SOLID))
+               return FALSE;
+
+       /* Can fly over the Pattern */
+       if ((c_ptr->feat >= FEAT_PATTERN_START) &&
+           (c_ptr->feat <= FEAT_PATTERN_XTRA2))
+       {
+           if (!(r_ptr->flags7 & RF7_CAN_FLY))
+                   return FALSE;
+           else
+                   return TRUE;
+       }
+
+       /* Can fly over mountain on the surface */
+       if (feat == FEAT_MOUNTAIN)
+       {
+           if (!dun_level && 
+               ((r_ptr->flags7 & RF7_CAN_FLY) ||
+                (r_ptr->flags8 & RF8_WILD_MOUNTAIN)))
+                   return TRUE;
+           else
+                   return FALSE;
+       }
+
+       /* Cannot enter wall without pass wall ability */
+       if (!cave_floor_grid(c_ptr) && !(r_ptr->flags2 & RF2_PASS_WALL))
+               return FALSE;
+
+       /* Pit */
+       if (feat == FEAT_DARK_PIT)
+       {
+               if (r_ptr->flags7 & RF7_CAN_FLY)
+                       return TRUE;
+               else
+                       return FALSE;
+       }
+       /* Deep water */
+       if (feat == FEAT_DEEP_WATER)
+       {
+               if ((r_ptr->flags7 & RF7_AQUATIC) ||
+                   (r_ptr->flags7 & RF7_CAN_FLY) ||
+                   (r_ptr->flags7 & RF7_CAN_SWIM))
+                       return TRUE;
+               else
+                       return FALSE;
+       }
+       /* Shallow water */
+       else if (feat == FEAT_SHAL_WATER)
+       {
+               if (!(r_ptr->flags2 & RF2_AURA_FIRE) ||
+                   (r_ptr->flags7 & RF7_AQUATIC) ||
+                   (r_ptr->flags7 & RF7_CAN_FLY) ||
+                   (r_ptr->flags7 & RF7_CAN_SWIM))
+                       return TRUE;
+               else
+                       return FALSE;
+       }
+       /* Aquatic monster */
+       else if ((r_ptr->flags7 & RF7_AQUATIC) &&
+                   !(r_ptr->flags7 & RF7_CAN_FLY))
+       {
+               return FALSE;
+       }
+       /* Lava */
+       else if ((feat == FEAT_SHAL_LAVA) ||
+           (feat == FEAT_DEEP_LAVA))
+       {
+               if ((r_ptr->flags3 & RF3_IM_FIRE) ||
+                   (r_ptr->flags7 & RF7_CAN_FLY))
+                       return TRUE;
+               else
+                       return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+
+/*
  * Check if two monsters are enemies
  */
 bool are_enemies(monster_type *m_ptr, monster_type *n_ptr)