OSDN Git Service

This commit was manufactured by cvs2svn to create tag
[hengbandforosx/hengbandosx.git] / src / spells2.c
index a1545c5..e2b71e5 100644 (file)
@@ -1,16 +1,17 @@
 /* File: spells2.c */
 
-/* Purpose: Spell code (part 2) */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * 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: Spell code (part 2) */
+
 #include "angband.h"
+#include "grid.h"
 
 
 /*
@@ -34,7 +35,7 @@ void self_knowledge(void)
        char v_string [8] [128];
        char s_string [6] [128];
 
-       u32b f1 = 0L, f2 = 0L, f3 = 0L;
+       u32b flgs[TR_FLAG_SIZE];
 
        object_type *o_ptr;
 
@@ -43,17 +44,18 @@ void self_knowledge(void)
 
        cptr info[220];
 
-       cptr disp_align;
-
        int plev = p_ptr->lev;
 
        int percent;
 
+       for (j = 0; j < TR_FLAG_SIZE; j++)
+               flgs[j] = 0L;
+
        p_ptr->knowledge |= (KNOW_STAT | KNOW_HPRATE);
 
        strcpy(Dummy, "");
 
-       percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
+       percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
                (2 * p_ptr->hitdie +
                ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
 
@@ -73,7 +75,7 @@ sprintf(Dummy, "
        /* Acquire item flags from equipment */
        for (k = INVEN_RARM; k < INVEN_TOTAL; k++)
        {
-               u32b t1, t2, t3;
+               u32b tflgs[TR_FLAG_SIZE];
 
                o_ptr = &inventory[k];
 
@@ -81,12 +83,11 @@ sprintf(Dummy, "
                if (!o_ptr->k_idx) continue;
 
                /* Extract the flags */
-               object_flags(o_ptr, &t1, &t2, &t3);
+               object_flags(o_ptr, tflgs);
 
                /* Extract flags */
-               f1 |= t1;
-               f2 |= t2;
-               f3 |= t3;
+               for (j = 0; j < TR_FLAG_SIZE; j++)
+                       flgs[j] |= tflgs[j];
        }
 
 #ifdef JP
@@ -108,23 +109,9 @@ sprintf(Dummy, "
        info[i++] = "";
 
 #ifdef JP
-       if (p_ptr->align > 150) disp_align = "ÂçÁ±";
-       else if (p_ptr->align > 50) disp_align = "ÃæÁ±";
-       else if (p_ptr->align > 10) disp_align = "¾®Á±";
-       else if (p_ptr->align > -11) disp_align = "ÃæΩ";
-       else if (p_ptr->align > -51) disp_align = "¾®°­";
-       else if (p_ptr->align > -151) disp_align = "Ãæ°­";
-       else disp_align = "Âç°­";
-       sprintf(Dummy, "¸½ºß¤Î°À­ : %s(%ld)", disp_align, p_ptr->align);
-#else
-       if (p_ptr->align > 150) disp_align = "lawful";
-       else if (p_ptr->align > 50) disp_align = "good";
-       else if (p_ptr->align > 10) disp_align = "nutral good";
-       else if (p_ptr->align > -11) disp_align = "nutral";
-       else if (p_ptr->align > -51) disp_align = "nutral evil";
-       else if (p_ptr->align > -151) disp_align = "evil";
-       else disp_align = "chaotic";
-       sprintf(Dummy, "Your alighnment : %s(%ld)", disp_align, p_ptr->align);
+       sprintf(Dummy, "¸½ºß¤Î°À­ : %s(%ld)", your_alignment(), p_ptr->align);
+#else
+       sprintf(Dummy, "Your alighnment : %s(%ld)", your_alignment(), p_ptr->align);
 #endif
        strcpy(buf[1], Dummy);
        info[i++] = buf[1];
@@ -614,7 +601,7 @@ info[i++] = "
                        }
                        break;
                case CLASS_PRIEST:
-                       if (p_ptr->realm1 == REALM_LIFE)
+                       if (is_good_realm(p_ptr->realm1))
                        {
                                if (plev > 34)
                                {
@@ -658,7 +645,7 @@ info[i++] = "
                        }
                        break;
                case CLASS_PALADIN:
-                       if (p_ptr->realm1 == REALM_LIFE)
+                       if (is_good_realm(p_ptr->realm1))
                        {
                                if (plev > 29)
                                {
@@ -762,7 +749,7 @@ info[i++] = "
                        break;
                case CLASS_BEASTMASTER:
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï1ɤ¤ÎÀ¸Ì¿¤Î¤¢¤ë¥â¥ó¥¹¥¿¡¼¤ò»ÙÇÛ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(¥ì¥Ù¥ë/4 MP)";
+info[i++] = "¤¢¤Ê¤¿¤Ï1ÂΤÎÀ¸Ì¿¤Î¤¢¤ë¥â¥ó¥¹¥¿¡¼¤ò»ÙÇÛ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(¥ì¥Ù¥ë/4 MP)";
 #else
                        info[i++] = "You can dominate a monster (cost level/4).";
 #endif
@@ -827,14 +814,6 @@ info[i++] = "
                        }
                        break;
                case CLASS_BERSERKER:
-                       if (plev > 4)
-                       {
-#ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¼«Ê¬¤Ç¶õÊ¢¤òËþ¤¿¤¹¤³¤È¤¬¤Ç¤­¤ë¡£";
-#else
-                               info[i++] = "You can satisfy hunger.";
-#endif
-                       }
                        if (plev > 9)
                        {
 #ifdef JP
@@ -857,7 +836,7 @@ info[i++] = "
 #endif
                        break;
                case CLASS_NINJA:
-                       if (plev > 7)
+                       if (plev > 19)
                        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÁÇÁ᤯°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
@@ -1690,8 +1669,7 @@ info[i++] = "
 #endif
 
                }
-               if (((p_ptr->muta3 & MUT3_VULN_ELEM) || (p_ptr->special_defense & KATA_KOUKIJIN))
-                   && !(p_ptr->immune_acid && p_ptr->immune_elec && p_ptr->immune_fire && p_ptr->immune_cold))
+               if (p_ptr->muta3 & MUT3_VULN_ELEM)
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¸µÁǤι¶·â¤Ë¼å¤¤¡£";
@@ -1790,7 +1768,16 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->aggravate)
+       if (p_ptr->cursed & TRC_TY_CURSE)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¼Ù°­¤Ê±åÇ°¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You carry an ancient foul curse.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_AGGRAVATE)
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¥â¥ó¥¹¥¿¡¼¤òÅܤ餻¤Æ¤¤¤ë¡£";
@@ -1799,7 +1786,79 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->teleport)
+       if (p_ptr->cursed & TRC_DRAIN_EXP)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï·Ð¸³ÃͤòµÛ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You are drained.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_SLOW_REGEN)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Î²óÉüÎϤÏÈó¾ï¤ËÃÙ¤¤¡£";
+#else
+               info[i++] = "You regenerate slowly.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_ADD_L_CURSE)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Î¼å¤¤¼ö¤¤¤ÏÁý¤¨¤ë¡£"; /* »ÃÄêŪ -- henkma */
+#else
+               info[i++] = "Your weak curses multiply.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_ADD_H_CURSE)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Î¶¯¤¤¼ö¤¤¤ÏÁý¤¨¤ë¡£"; /* »ÃÄêŪ -- henkma */
+#else
+               info[i++] = "Your heavy curses multiply.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_CALL_ANIMAL)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ïưʪ¤ËÁÀ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You attract animals.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_CALL_DEMON)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï°­Ëâ¤ËÁÀ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You attract demons.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_CALL_DRAGON)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤ËÁÀ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You attract dragons.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_COWARDICE)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï»þ¡¹²²É¤ˤʤ롣";
+#else
+               info[i++] = "You are subject to cowardice.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_TELEPORT)
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î°ÌÃ֤ϤҤ¸¤ç¤¦¤ËÉÔ°ÂÄê¤À¡£";
@@ -1808,7 +1867,61 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->blessed)
+       if (p_ptr->cursed & TRC_LOW_MELEE)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
+#else
+               info[i++] = "Your weapon causes you to miss blows.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_LOW_AC)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
+#else
+               info[i++] = "You are subject to be hit.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_LOW_MAGIC)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏËâË¡¤ò¼ºÇÔ¤·¤ä¤¹¤¤¡£";
+#else
+               info[i++] = "You are subject to fail spellcasting.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_FAST_DIGEST)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¤¹¤°¤ªÊ¢¤¬¤Ø¤ë¡£";
+#else
+               info[i++] = "You have a good appetite.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_DRAIN_HP)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏÂÎÎϤòµÛ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You are drained.";
+#endif
+
+       }
+       if (p_ptr->cursed & TRC_DRAIN_MANA)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏËâÎϤòµÛ¤ï¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You brain is drained.";
+#endif
+
+       }
+       if (IS_BLESSED())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¸øÀµ¤µ¤ò´¶¤¸¤Æ¤¤¤ë¡£";
@@ -1817,7 +1930,7 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->hero)
+       if (IS_HERO())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¥Ò¡¼¥í¡¼µ¤Ê¬¤À¡£";
@@ -1853,7 +1966,7 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->invuln)
+       if (IS_INVULN())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¸½ºß½ý¤Ä¤«¤Ê¤¤¡£";
@@ -1885,7 +1998,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤Ï²Ð±ê¤Ëʤ¤ï¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You can strike enemy with flame.";
+               info[i++] = "You can strike the enemy with flame.";
 #endif
 
        }
@@ -1894,7 +2007,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÎ䵤¤Ëʤ¤ï¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You can strike enemy with cold.";
+               info[i++] = "You can strike the enemy with cold.";
 #endif
 
        }
@@ -1903,7 +2016,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤Ï»À¤Ëʤ¤ï¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You can strike enemy with acid.";
+               info[i++] = "You can strike the enemy with acid.";
 #endif
 
        }
@@ -1912,7 +2025,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÅÅ·â¤Ëʤ¤ï¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You can strike enemy with electoric shock.";
+               info[i++] = "You can strike the enemy with electoric shock.";
 #endif
 
        }
@@ -1921,25 +2034,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÆǤËʤ¤ï¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You can strike enemy with poison.";
-#endif
-
-       }
-       if (p_ptr->special_attack & ATTACK_CONFUSE)
-       {
-#ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë¡£";
-#else
-               info[i++] = "Your hands are glowing dull red.";
-#endif
-
-       }
-       if (p_ptr->special_attack & ATTACK_CONFUSE)
-       {
-#ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë¡£";
-#else
-               info[i++] = "Your hands are glowing dull red.";
+               info[i++] = "You can strike the enemy with poison.";
 #endif
 
        }
@@ -1971,6 +2066,15 @@ info[i++] = "
 #endif
 
        }
+       if (p_ptr->alter_reality)
+       {
+#ifdef JP
+               info[i++] = "¤¢¤Ê¤¿¤Ï¤¹¤°¤Ë¤³¤ÎÀ¤³¦¤òÎ¥¤ì¤ë¤À¤í¤¦¡£";
+#else
+               info[i++] = "You will soon be altered.";
+#endif
+
+       }
        if (p_ptr->see_infra)
        {
 #ifdef JP
@@ -2028,12 +2132,120 @@ info[i++] = "
        if (p_ptr->telepathy)
        {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏĶǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¥Æ¥ì¥Ñ¥·¡¼Ç½ÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
 #else
                info[i++] = "You have ESP.";
 #endif
 
        }
+       if (p_ptr->esp_animal)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¼«Á³³¦¤ÎÀ¸Êª¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense natural creatures.";
+#endif
+
+       }
+       if (p_ptr->esp_undead)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¥¢¥ó¥Ç¥Ã¥É¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense undead.";
+#endif
+
+       }
+       if (p_ptr->esp_demon)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï°­Ëâ¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense demons.";
+#endif
+
+       }
+       if (p_ptr->esp_orc)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¥ª¡¼¥¯¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense orcs.";
+#endif
+
+       }
+       if (p_ptr->esp_troll)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¥È¥í¥ë¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense trolls.";
+#endif
+
+       }
+       if (p_ptr->esp_giant)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ïµð¿Í¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense giants.";
+#endif
+
+       }
+       if (p_ptr->esp_dragon)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¥É¥é¥´¥ó¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense dragons.";
+#endif
+
+       }
+       if (p_ptr->esp_human)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¿Í´Ö¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense humans.";
+#endif
+
+       }
+       if (p_ptr->esp_evil)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï¼Ù°­¤ÊÀ¸¤­Êª¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense evil creatures.";
+#endif
+
+       }
+       if (p_ptr->esp_good)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏÁ±ÎɤÊÀ¸¤­Êª¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense good creatures.";
+#endif
+
+       }
+       if (p_ptr->esp_nonliving)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤Ï³èÆ°¤¹¤ë̵À¸ÊªÂΤθºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense non-living creatures.";
+#endif
+
+       }
+       if (p_ptr->esp_unique)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏÆÃÊ̤ʶ¯Å¨¤Î¸ºß¤ò´¶¤¸¤ëǽÎϤò»ý¤Ã¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You sense unique monsters.";
+#endif
+
+       }
        if (p_ptr->hold_life)
        {
 #ifdef JP
@@ -2075,7 +2287,25 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥ª¡¼¥é¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£";
 #else
-               info[i++] = "You are surrounded with a coldly aura.";
+               info[i++] = "You are surrounded with an aura of coldness.";
+#endif
+
+       }
+       if (p_ptr->tim_sh_holy)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏÀ»¤Ê¤ë¥ª¡¼¥é¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You are surrounded with a holy aura.";
+#endif
+
+       }
+       if (p_ptr->tim_sh_touki)
+       {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÏÆ®µ¤¤Î¥ª¡¼¥é¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£";
+#else
+               info[i++] = "You are surrounded with a energy aura.";
 #endif
 
        }
@@ -2111,7 +2341,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¹ÔÆ°¤ÎÁ°¤Ë´í¸±¤ò»¡ÃΤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
 #else
-               info[i++] = "You will be warn before dangerous action.";
+               info[i++] = "You will be warned before dangerous actions.";
 #endif
 
        }
@@ -2120,7 +2350,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¾¯¤Ê¤¤¾ÃÈñËâÎϤÇËâË¡¤ò¾§¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
 #else
-               info[i++] = "You can cast spell with fewer mana.";
+               info[i++] = "You can cast spells with fewer mana points.";
 #endif
 
        }
@@ -2138,7 +2368,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï¹â¤¤¼ºÇÔΨ¤ÇËâË¡¤ò¾§¤¨¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤¡£";
 #else
-               info[i++] = "Fail rate of your magic is incresed.";
+               info[i++] = "Fail rate of your magic is increased.";
 #endif
 
        }
@@ -2161,7 +2391,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_acid) && (p_ptr->oppose_acid))
+       else if (p_ptr->resist_acid && IS_OPPOSE_ACID())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï»À¤Ø¤Î¶¯ÎϤÊÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2170,7 +2400,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_acid) || (p_ptr->oppose_acid))
+       else if (p_ptr->resist_acid || IS_OPPOSE_ACID())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï»À¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2189,7 +2419,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_elec) && (p_ptr->oppose_elec))
+       else if (p_ptr->resist_elec && IS_OPPOSE_ELEC())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÅÅ·â¤Ø¤Î¶¯ÎϤÊÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2198,7 +2428,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_elec) || (p_ptr->oppose_elec))
+       else if (p_ptr->resist_elec || IS_OPPOSE_ELEC())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÅÅ·â¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2227,7 +2457,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_fire) && (p_ptr->oppose_fire))
+       else if (p_ptr->resist_fire && IS_OPPOSE_FIRE())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï²Ð¤Ø¤Î¶¯ÎϤÊÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2236,7 +2466,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_fire) || (p_ptr->oppose_fire))
+       else if (p_ptr->resist_fire || IS_OPPOSE_FIRE())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï²Ð¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2265,7 +2495,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_cold) && (p_ptr->oppose_cold))
+       else if (p_ptr->resist_cold && IS_OPPOSE_COLD())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÎ䵤¤Ø¤Î¶¯ÎϤÊÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2274,7 +2504,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_cold) || (p_ptr->oppose_cold))
+       else if (p_ptr->resist_cold || IS_OPPOSE_COLD())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÎ䵤¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2284,7 +2514,7 @@ info[i++] = "
 
        }
 
-       if ((p_ptr->resist_pois) && (p_ptr->oppose_pois))
+       if (p_ptr->resist_pois && IS_OPPOSE_POIS())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÆǤؤζ¯ÎϤÊÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2293,7 +2523,7 @@ info[i++] = "
 #endif
 
        }
-       else if ((p_ptr->resist_pois) || (p_ptr->oppose_pois))
+       else if (p_ptr->resist_pois || IS_OPPOSE_POIS())
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÏÆǤؤÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
@@ -2497,7 +2727,7 @@ info[i++] = "
 
        }
 
-       if (f1 & (TR1_STR))
+       if (have_flag(flgs, TR_STR))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÏÓÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2506,7 +2736,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_INT))
+       if (have_flag(flgs, TR_INT))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÃÎǽ¤ÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2515,7 +2745,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_WIS))
+       if (have_flag(flgs, TR_WIS))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¸­¤µ¤ÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2524,7 +2754,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_DEX))
+       if (have_flag(flgs, TR_DEX))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î´ïÍѤµ¤ÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2533,7 +2763,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_CON))
+       if (have_flag(flgs, TR_CON))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÂѵ×ÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2542,7 +2772,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_CHR))
+       if (have_flag(flgs, TR_CHR))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÌ¥ÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2552,7 +2782,7 @@ info[i++] = "
 
        }
 
-       if (f1 & (TR1_STEALTH))
+       if (have_flag(flgs, TR_STEALTH))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î±£Ì©¹ÔưǽÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2561,7 +2791,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_SEARCH))
+       if (have_flag(flgs, TR_SEARCH))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Îõº÷ǽÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2570,7 +2800,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_INFRA))
+       if (have_flag(flgs, TR_INFRA))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÀÖ³°Àþ»ëÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2579,7 +2809,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_TUNNEL))
+       if (have_flag(flgs, TR_TUNNEL))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎºÎ·¡Ç½ÎϤÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2588,7 +2818,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_SPEED))
+       if (have_flag(flgs, TR_SPEED))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¥¹¥Ô¡¼¥É¤ÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2597,7 +2827,7 @@ info[i++] = "
 #endif
 
        }
-       if (f1 & (TR1_BLOWS))
+       if (have_flag(flgs, TR_BLOWS))
        {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Î¹¶·â®ÅÙ¤ÏÁõÈ÷¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2615,7 +2845,7 @@ info[i++] = "
        if (o_ptr->k_idx)
        {
                /* Indicate Blessing */
-               if (f3 & (TR3_BLESSED))
+               if (have_flag(flgs, TR_BLESSED))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¿À¤Î½ËÊ¡¤ò¼õ¤±¤Æ¤¤¤ë¡£";
@@ -2625,7 +2855,7 @@ info[i++] = "
 
                }
 
-               if (f1 & (TR1_CHAOTIC))
+               if (have_flag(flgs, TR_CHAOTIC))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥í¥°¥ë¥¹¤Îħ¤Î°À­¤ò¤â¤Ä¡£";
@@ -2636,7 +2866,7 @@ info[i++] = "
                }
 
                /* Hack */
-               if (f1 & (TR1_IMPACT))
+               if (have_flag(flgs, TR_IMPACT))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏÂÇ·â¤ÇÃϿ̤òȯÀ¸¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£";
@@ -2646,7 +2876,7 @@ info[i++] = "
 
                }
 
-               if (f1 & (TR1_VORPAL))
+               if (have_flag(flgs, TR_VORPAL))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏÈó¾ï¤Ë±Ô¤¤¡£";
@@ -2656,7 +2886,7 @@ info[i++] = "
 
                }
 
-               if (f1 & (TR1_VAMPIRIC))
+               if (have_flag(flgs, TR_VAMPIRIC))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤«¤éÀ¸Ì¿ÎϤòµÛ¼ý¤¹¤ë¡£";
@@ -2667,7 +2897,7 @@ info[i++] = "
                }
 
                /* Special "Attack Bonuses" */
-               if (f1 & (TR1_BRAND_ACID))
+               if (have_flag(flgs, TR_BRAND_ACID))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤òÍϤ«¤¹¡£";
@@ -2676,7 +2906,7 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_BRAND_ELEC))
+               if (have_flag(flgs, TR_BRAND_ELEC))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤ò´¶ÅŤµ¤»¤ë¡£";
@@ -2685,7 +2915,7 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_BRAND_FIRE))
+               if (have_flag(flgs, TR_BRAND_FIRE))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤òdz¤ä¤¹¡£";
@@ -2694,7 +2924,7 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_BRAND_COLD))
+               if (have_flag(flgs, TR_BRAND_COLD))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤òÅà¤é¤»¤ë¡£";
@@ -2703,7 +2933,7 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_BRAND_POIS))
+               if (have_flag(flgs, TR_BRAND_POIS))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏŨ¤òÆǤǿ¯¤¹¡£";
@@ -2714,7 +2944,16 @@ info[i++] = "
                }
 
                /* Special "slay" flags */
-               if (f1 & (TR1_SLAY_ANIMAL))
+               if (have_flag(flgs, TR_KILL_ANIMAL))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ïưʪ¤ÎŷŨ¤Ç¤¢¤ë¡£";
+#else
+                       info[i++] = "Your weapon is a great bane of animals.";
+#endif
+
+               }
+               else if (have_flag(flgs, TR_SLAY_ANIMAL))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ïưʪ¤ËÂФ·¤Æ¶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
@@ -2723,7 +2962,16 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_SLAY_EVIL))
+               if (have_flag(flgs, TR_KILL_EVIL))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¼Ù°­¤Ê¤ë¸ºß¤ÎŷŨ¤Ç¤¢¤ë¡£";
+#else
+                       info[i++] = "Your weapon is a great bane of evil.";
+#endif
+
+               }
+               else if (have_flag(flgs, TR_SLAY_EVIL))
                {
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¼Ù°­¤Ê¤ë¸ºß¤ËÂФ·¤Æ¶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
@@ -2732,86 +2980,149 @@ info[i++] = "
 #endif
 
                }
-               if (f1 & (TR1_SLAY_UNDEAD))
+               if (have_flag(flgs, TR_KILL_HUMAN))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤Æ¿ÀÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¿Í´Ö¤ÎŷŨ¤Ç¤¢¤ë¡£";
 #else
-                       info[i++] = "Your weapon strikes at undead with holy wrath.";
+                       info[i++] = "Your weapon is a great bane of humans.";
 #endif
 
                }
-               if (f1 & (TR1_SLAY_DEMON))
+               else if (have_flag(flgs, TR_SLAY_HUMAN))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤Æ¿ÀÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¿Í´Ö¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
 #else
-                       info[i++] = "Your weapon strikes at demons with holy wrath.";
+                       info[i++] = "Your weapon is especially deadly against humans.";
 #endif
 
                }
-               if (f1 & (TR1_SLAY_ORC))
+               if (have_flag(flgs, TR_KILL_UNDEAD))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¢¥ó¥Ç¥Ã¥É¤ÎŷŨ¤Ç¤¢¤ë¡£";
 #else
-                       info[i++] = "Your weapon is especially deadly against orcs.";
+                       info[i++] = "Your weapon is a great bane of undead.";
 #endif
 
                }
-               if (f1 & (TR1_SLAY_TROLL))
+               else if (have_flag(flgs, TR_SLAY_UNDEAD))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¢¥ó¥Ç¥Ã¥É¤ËÂФ·¤Æ¿ÀÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
 #else
-                       info[i++] = "Your weapon is especially deadly against trolls.";
+                       info[i++] = "Your weapon strikes at undead with holy wrath.";
 #endif
 
                }
-               if (f1 & (TR1_SLAY_GIANT))
+               if (have_flag(flgs, TR_KILL_DEMON))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥Ç¡¼¥â¥ó¤ÎŷŨ¤Ç¤¢¤ë¡£";
 #else
-                       info[i++] = "Your weapon is especially deadly against giants.";
+                       info[i++] = "Your weapon is a great bane of demons.";
 #endif
 
                }
-               /* Special "kill" flags */
-               if (f1 & (TR1_KILL_DRAGON))
+               else if (have_flag(flgs, TR_SLAY_DEMON))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥É¥é¥´¥ó¤ÎŷŨ¤Ç¤¢¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥Ç¡¼¥â¥ó¤ËÂФ·¤Æ¿ÀÀ»¤Ê¤ëÎϤòȯ´ø¤¹¤ë¡£";
 #else
-                       info[i++] = "Your weapon is a great bane of dragons.";
+                       info[i++] = "Your weapon strikes at demons with holy wrath.";
 #endif
 
                }
-               else if (f1 & (TR1_SLAY_DRAGON))
+               if (have_flag(flgs, TR_KILL_ORC))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥ª¡¼¥¯¤ÎŷŨ¤Ç¤¢¤ë¡£";
 #else
-                       info[i++] = "Your weapon is especially deadly against dragons.";
+                       info[i++] = "Your weapon is a great bane of orcs.";
 #endif
 
                }
-
-               if (f1 & (TR1_FORCE_WEPON))
+               else if (have_flag(flgs, TR_SLAY_ORC))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏMP¤ò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥ª¡¼¥¯¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
 #else
-                       info[i++] = "Your weapon causes greate damages using your MP.";
+                       info[i++] = "Your weapon is especially deadly against orcs.";
 #endif
 
                }
-               if (f2 & (TR2_THROW))
+               if (have_flag(flgs, TR_KILL_TROLL))
                {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏÅꤲ¤ä¤¹¤¤¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥È¥í¥ë¤ÎŷŨ¤Ç¤¢¤ë¡£";
 #else
-                       info[i++] = "Your weapon can be thrown well.";
+                       info[i++] = "Your weapon is a great bane of trolls.";
+#endif
+
+               }
+               else if (have_flag(flgs, TR_SLAY_TROLL))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥È¥í¥ë¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+#else
+                       info[i++] = "Your weapon is especially deadly against trolls.";
+#endif
+
+               }
+               if (have_flag(flgs, TR_KILL_GIANT))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ÎŷŨ¤Ç¤¢¤ë¡£";
+#else
+                       info[i++] = "Your weapon is a great bane of giants.";
+#endif
+
+               }
+               else if (have_flag(flgs, TR_SLAY_GIANT))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥¸¥ã¥¤¥¢¥ó¥È¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+#else
+                       info[i++] = "Your weapon is especially deadly against giants.";
+#endif
+
+               }
+               /* Special "kill" flags */
+               if (have_flag(flgs, TR_KILL_DRAGON))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥É¥é¥´¥ó¤ÎŷŨ¤Ç¤¢¤ë¡£";
+#else
+                       info[i++] = "Your weapon is a great bane of dragons.";
+#endif
+
+               }
+               else if (have_flag(flgs, TR_SLAY_DRAGON))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤Ï¥É¥é¥´¥ó¤ËÂФ·¤ÆÆä˶¯¤¤ÎϤòȯ´ø¤¹¤ë¡£";
+#else
+                       info[i++] = "Your weapon is especially deadly against dragons.";
+#endif
+
+               }
+
+               if (have_flag(flgs, TR_FORCE_WEAPON))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏMP¤ò»È¤Ã¤Æ¹¶·â¤¹¤ë¡£";
+#else
+                       info[i++] = "Your weapon causes greate damages using your MP.";
+#endif
+
+               }
+               if (have_flag(flgs, TR_THROW))
+               {
+#ifdef JP
+info[i++] = "¤¢¤Ê¤¿¤ÎÉð´ï¤ÏÅꤲ¤ä¤¹¤¤¡£";
+#else
+                       info[i++] = "Your weapon can be thrown well.";
 #endif
                }
        }
@@ -3067,9 +3378,19 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->word_recall);
 #ifdef JP
-info[i++] = "¤Î¸åµ¢´Ô¤Î¾Û¤òȯư¤¹¤ë¡£";
+               info[i++] = "¤³¤Î¸åµ¢´Ô¤Î¾Û¤òȯư¤¹¤ë¡£";
+#else
+               info[i++] = "You are waiting to be recalled";
+#endif
+
+       }
+       if (p_ptr->alter_reality)
+       {
+               info2[i]  = report_magics_aux(p_ptr->alter_reality);
+#ifdef JP
+               info[i++] = "¤³¤Î¸å¸½¼ÂÊÑÍƤ¬È¯Æ°¤¹¤ë¡£";
 #else
-               info[i++] = "You waiting to be recalled";
+               info[i++] = "You waiting to be altered";
 #endif
 
        }
@@ -3182,7 +3503,7 @@ prt("[
 /*
  * Detect all traps on current panel
  */
-bool detect_traps(int range)
+bool detect_traps(int range, bool known)
 {
        int             x, y;
        bool            detect = FALSE;
@@ -3196,16 +3517,22 @@ bool detect_traps(int range)
        {
                for (x = 1; x <= cur_wid - 1; x++)
                {
-                       if (distance(py, px, y, x) > range) continue;
+                       int dist = distance(py, px, y, x);
+                       if (dist > range) continue;
 
                        /* Access the grid */
                        c_ptr = &cave[y][x];
 
-                       /* Detect invisible traps */
-                       if (c_ptr->info & CAVE_TRAP)
+                       /* Mark as detected */
+                       if (dist <= range && known)
                        {
-                               /* Pick a trap */
-                               pick_trap(y, x);
+                               if (dist <= range - 1)
+                                       c_ptr->info |= (CAVE_IN_DETECT);
+
+                               c_ptr->info &= ~(CAVE_UNSAFE);
+
+                               /* Redraw */
+                               lite_spot(y, x);
                        }
 
                        /* Detect traps */
@@ -3214,8 +3541,16 @@ bool detect_traps(int range)
                                /* Hack -- Memorize */
                                c_ptr->info |= (CAVE_MARK);
 
-                               /* Redraw */
-                               lite_spot(y, x);
+                               if (c_ptr->mimic)
+                               {
+                                       /* Disclose a hidden trap */
+                                       disclose_grid(y, x);
+                               }
+                               else
+                               {
+                                       /* Redraw */
+                                       lite_spot(y, x);
+                               }
 
                                /* Obvious */
                                detect = TRUE;
@@ -3223,6 +3558,8 @@ bool detect_traps(int range)
                }
        }
 
+       if (known) p_ptr->dtrap = TRUE;
+
        if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT)) detect = FALSE;
 
        /* Describe */
@@ -3265,10 +3602,10 @@ bool detect_doors(int range)
                        c_ptr = &cave[y][x];
 
                        /* Detect secret doors */
-                       if (c_ptr->feat == FEAT_SECRET)
+                       if (is_hidden_door(c_ptr))
                        {
                                /* Pick a door */
-                               place_closed_door(y, x);
+                               disclose_grid(y, x);
                        }
 
                        /* Detect doors */
@@ -3334,7 +3671,7 @@ bool detect_stairs(int range)
                            (c_ptr->feat == FEAT_LESS_LESS) ||
                            (c_ptr->feat == FEAT_MORE) ||
                            (c_ptr->feat == FEAT_MORE_MORE) ||
-                           (c_ptr->feat == FEAT_ENTRANCE))
+                           (c_ptr->feat == FEAT_ENTRANCE))
                        {
                                /* Hack -- Memorize */
                                c_ptr->info |= (CAVE_MARK);
@@ -3466,7 +3803,7 @@ bool detect_objects_gold(int range)
                if (o_ptr->tval == TV_GOLD)
                {
                        /* Hack -- memorize it */
-                       o_ptr->marked = TRUE;
+                       o_ptr->marked |= OM_FOUND;
 
                        /* Redraw */
                        lite_spot(y, x);
@@ -3533,7 +3870,7 @@ bool detect_objects_normal(int range)
                if (o_ptr->tval != TV_GOLD)
                {
                        /* Hack -- memorize it */
-                       o_ptr->marked = TRUE;
+                       o_ptr->marked |= OM_FOUND;
 
                        /* Redraw */
                        lite_spot(y, x);
@@ -3625,12 +3962,13 @@ bool detect_objects_magic(int range)
                        (tv == TV_ARCANE_BOOK) ||
                        (tv == TV_ENCHANT_BOOK) ||
                        (tv == TV_DAEMON_BOOK) ||
+                       (tv == TV_CRUSADE_BOOK) ||
                        (tv == TV_MUSIC_BOOK) ||
                        (tv == TV_HISSATSU_BOOK) ||
                    ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
                {
                        /* Memorize the item */
-                       o_ptr->marked = TRUE;
+                       o_ptr->marked |= OM_FOUND;
 
                        /* Redraw */
                        lite_spot(y, x);
@@ -3684,14 +4022,13 @@ bool detect_monsters_normal(int range)
                if (distance(py, px, y, x) > range) continue;
 
                /* Detect all non-invisible monsters */
-               if ((!(r_ptr->flags2 & RF2_INVISIBLE)) ||
-                   p_ptr->see_inv || p_ptr->tim_invis)
+               if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv)
                {
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -3760,7 +4097,7 @@ bool detect_monsters_invis(int range)
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -3819,21 +4156,24 @@ bool detect_monsters_evil(int range)
                /* Detect evil monsters */
                if (r_ptr->flags3 & RF3_EVIL)
                {
-                       /* Take note that they are evil */
-                       r_ptr->r_flags3 |= (RF3_EVIL);
-
-                       /* Update monster recall window */
-                       if (p_ptr->monster_race_idx == m_ptr->r_idx)
+                       if (is_original_ap(m_ptr))
                        {
-                               /* Window stuff */
-                               p_ptr->window |= (PW_MONSTER);
+                               /* Take note that they are evil */
+                               r_ptr->r_flags3 |= (RF3_EVIL);
+
+                               /* Update monster recall window */
+                               if (p_ptr->monster_race_idx == m_ptr->r_idx)
+                               {
+                                       /* Window stuff */
+                                       p_ptr->window |= (PW_MONSTER);
+                               }
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -3902,7 +4242,7 @@ bool detect_monsters_nonliving(int range)
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -3969,7 +4309,7 @@ bool detect_monsters_mind(int range)
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -4036,7 +4376,7 @@ bool detect_monsters_string(int range, cptr Match)
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -4099,21 +4439,24 @@ cptr desc_monsters = "
                /* Detect evil monsters */
                if (r_ptr->flags3 & (match_flag))
                {
-                       /* Take note that they are something */
-                       r_ptr->r_flags3 |= (match_flag);
-
-                       /* Update monster recall window */
-                       if (p_ptr->monster_race_idx == m_ptr->r_idx)
+                       if (is_original_ap(m_ptr))
                        {
-                               /* Window stuff */
-                               p_ptr->window |= (PW_MONSTER);
+                               /* Take note that they are something */
+                               r_ptr->r_flags3 |= (match_flag);
+
+                               /* Update monster recall window */
+                               if (p_ptr->monster_race_idx == m_ptr->r_idx)
+                               {
+                                       /* Window stuff */
+                                       p_ptr->window |= (PW_MONSTER);
+                               }
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
                        /* Hack -- Detect monster */
-                       m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
+                       m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
 
                        /* Update the monster */
                        update_mon(i, FALSE);
@@ -4169,10 +4512,13 @@ bool detect_all(int range)
        bool detect = FALSE;
 
        /* Detect everything */
-       if (detect_traps(range)) detect = TRUE;
+       if (detect_traps(range, TRUE)) detect = TRUE;
        if (detect_doors(range)) detect = TRUE;
        if (detect_stairs(range)) detect = TRUE;
-       if (detect_treasure(range)) detect = TRUE;
+
+       /* There are too many hidden treasure.  So... */
+       /* if (detect_treasure(range)) detect = TRUE; */
+
        if (detect_objects_gold(range)) detect = TRUE;
        if (detect_objects_normal(range)) detect = TRUE;
        if (detect_monsters_invis(range)) detect = TRUE;
@@ -4194,7 +4540,7 @@ bool detect_all(int range)
 bool project_hack(int typ, int dam)
 {
        int     i, x, y;
-       int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE | PROJECT_NO_REF;
+       int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
        bool    obvious = FALSE;
 
 
@@ -4340,6 +4686,15 @@ bool dispel_demons(int dam)
 
 
 /*
+ * Crusade
+ */
+bool crusade(void)
+{
+       return (project_hack(GF_CRUSADE, p_ptr->lev*4));
+}
+
+
+/*
  * Wake up all monsters, and speed up "los" monsters.
  */
 void aggravate_monsters(int who)
@@ -4353,7 +4708,7 @@ void aggravate_monsters(int who)
        for (i = 1; i < m_max; i++)
        {
                monster_type    *m_ptr = &m_list[i];
-//             monster_race    *r_ptr = &r_info[m_ptr->r_idx];
+/*             monster_race    *r_ptr = &r_info[m_ptr->r_idx]; */
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -4369,9 +4724,10 @@ void aggravate_monsters(int who)
                        {
                                /* Wake up */
                                m_ptr->csleep = 0;
+                               if (r_info[m_ptr->r_idx].flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
                                sleep = TRUE;
                        }
-                       if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG_NOPET;
+                       if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET;
                }
 
                /* Speed up monsters in line of sight */
@@ -4409,7 +4765,7 @@ bool symbol_genocide(int power, int player_cast)
        int     msec = delay_factor * delay_factor * delay_factor;
 
        /* Prevent genocide in quest levels */
-       if (p_ptr->inside_quest && !random_quest_number(dun_level))
+       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
                return (FALSE);
        }
@@ -4448,9 +4804,9 @@ while(!get_com("
 
                else if (i == p_ptr->riding) angry = TRUE;
 
-               else if (player_cast && (r_ptr->level > rand_int(power))) angry = TRUE;
+               else if (player_cast && (r_ptr->level > randint0(power))) angry = TRUE;
 
-               else if (player_cast && (m_ptr->mflag2 & MFLAG_NOGENO)) angry = TRUE;
+               else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) angry = TRUE;
 
                /* Delete the monster */
                else delete_monster_idx(i);
@@ -4469,6 +4825,7 @@ msg_format("%^s
                        if (m_ptr->csleep)
                        {
                                m_ptr->csleep = 0;
+                               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
                                if (m_ptr->ml && !p_ptr->blind)
                                {
 #ifdef JP
@@ -4490,16 +4847,16 @@ msg_format("%^s
                                }
                                set_hostile(m_ptr);
                        }
-                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
+                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
                }
 
                if (player_cast)
                {
                        /* Take damage */
 #ifdef JP
-take_hit(DAMAGE_GENO, randint(4), "Ëõ»¦¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
+take_hit(DAMAGE_GENO, randint1(4), "Ëõ»¦¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
 #else
-                       take_hit(DAMAGE_GENO, randint(4), "the strain of casting Genocide", -1);
+                       take_hit(DAMAGE_GENO, randint1(4), "the strain of casting Genocide", -1);
 #endif
 
                }
@@ -4546,7 +4903,7 @@ bool mass_genocide(int power, int player_cast)
 
 
        /* Prevent mass genocide in quest levels */
-       if (p_ptr->inside_quest && !random_quest_number(dun_level))
+       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
                return (FALSE);
        }
@@ -4577,9 +4934,9 @@ bool mass_genocide(int power, int player_cast)
 
                else if (i == p_ptr->riding) angry = TRUE;
 
-               else if (player_cast && (r_ptr->level > rand_int(power))) angry = TRUE;
+               else if (player_cast && (r_ptr->level > randint0(power))) angry = TRUE;
 
-               else if (player_cast && (m_ptr->mflag2 & MFLAG_NOGENO)) angry = TRUE;
+               else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) angry = TRUE;
 
                /* Delete the monster */
                else delete_monster_idx(i);
@@ -4598,6 +4955,7 @@ msg_format("%^s
                        if (m_ptr->csleep)
                        {
                                m_ptr->csleep = 0;
+                               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
                                if (m_ptr->ml && !p_ptr->blind)
                                {
 #ifdef JP
@@ -4619,16 +4977,16 @@ msg_format("%^s
                                }
                                set_hostile(m_ptr);
                        }
-                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
+                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
                }
 
                if (player_cast)
                {
                        /* Hack -- visual feedback */
 #ifdef JP
-take_hit(DAMAGE_GENO, randint(3), "¼þÊÕËõ»¦¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
+take_hit(DAMAGE_GENO, randint1(3), "¼þÊÕËõ»¦¤Î¼öʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
 #else
-                       take_hit(DAMAGE_GENO, randint(3), "the strain of casting Mass Genocide", -1);
+                       take_hit(DAMAGE_GENO, randint1(3), "the strain of casting Mass Genocide", -1);
 #endif
 
                }
@@ -4676,7 +5034,7 @@ bool mass_genocide_undead(int power, int player_cast)
 
 
        /* Prevent mass genocide in quest levels */
-       if (p_ptr->inside_quest && !random_quest_number(dun_level))
+       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
                return (FALSE);
        }
@@ -4709,9 +5067,9 @@ bool mass_genocide_undead(int power, int player_cast)
 
                else if (i == p_ptr->riding) angry = TRUE;
 
-               else if (player_cast && (r_ptr->level > rand_int(power))) angry = TRUE;
+               else if (player_cast && (r_ptr->level > randint0(power))) angry = TRUE;
 
-               else if (player_cast && (m_ptr->mflag2 & MFLAG_NOGENO)) angry = TRUE;
+               else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) angry = TRUE;
 
                /* Delete the monster */
                else delete_monster_idx(i);
@@ -4730,6 +5088,7 @@ msg_format("%^s
                        if (m_ptr->csleep)
                        {
                                m_ptr->csleep = 0;
+                               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
                                if (m_ptr->ml && !p_ptr->blind)
                                {
 #ifdef JP
@@ -4751,16 +5110,16 @@ msg_format("%^s
                                }
                                set_hostile(m_ptr);
                        }
-                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
+                       if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
                }
 
                if (player_cast)
                {
                        /* Hack -- visual feedback */
 #ifdef JP
-take_hit(DAMAGE_GENO, randint(3), "¥¢¥ó¥Ç¥Ã¥É¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
+take_hit(DAMAGE_GENO, randint1(3), "¥¢¥ó¥Ç¥Ã¥É¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
 #else
-                       take_hit(DAMAGE_GENO, randint(3), "the strain of casting Mass Genocide", -1);
+                       take_hit(DAMAGE_GENO, randint1(3), "the strain of casting Annihilate Undead", -1);
 #endif
 
                }
@@ -4806,6 +5165,7 @@ bool probing(void)
        int cu, cv;
        bool    probe = FALSE;
        char buf[256];
+       cptr align;
 
        cu = Term->scr->cu;
        cv = Term->scr->cv;
@@ -4830,28 +5190,56 @@ bool probing(void)
                        char m_name[80];
 
                        /* Start the message */
+                       if (!probe)
+                       {
 #ifdef JP
-                       if (!probe) {msg_print("Ä´ººÃæ...");msg_print(NULL);}
+                               msg_print("Ä´ººÃæ...");
 #else
-                       if (!probe) {msg_print("Probing...");msg_print(NULL);}
+                               msg_print("Probing...");
 #endif
+                       }
+
+                       msg_print(NULL);
 
-                       if (m_ptr->mflag2 & MFLAG_KAGE)
+                       if (m_ptr->ap_r_idx != m_ptr->r_idx)
                        {
-                               m_ptr->mflag2 &= ~(MFLAG_KAGE);
+                               if (m_ptr->mflag2 & MFLAG2_KAGE)
+                                       m_ptr->mflag2 &= ~(MFLAG2_KAGE);
+
+                               m_ptr->ap_r_idx = m_ptr->r_idx;
                                lite_spot(m_ptr->fy, m_ptr->fx);
                        }
                        /* Get "the monster" or "something" */
-                       monster_desc(m_name, m_ptr, 0x204);
+                       monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
 
                        speed = m_ptr->mspeed - 110;
                        if(m_ptr->fast) speed += 10;
                        if(m_ptr->slow) speed -= 10;
+
+                       /* Get the monster's alignment */
+#ifdef JP
+                       if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "Á±°­";
+                       else if (r_ptr->flags3 & RF3_EVIL) align = "¼Ù°­";
+                       else if (r_ptr->flags3 & RF3_GOOD) align = "Á±ÎÉ";
+                       else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "ÃæΩ(Á±°­)";
+                       else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "ÃæΩ(¼Ù°­)";
+                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "ÃæΩ(Á±ÎÉ)";
+                       else align = "ÃæΩ";
+#else
+                       if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "good&evil";
+                       else if (r_ptr->flags3 & RF3_EVIL) align = "evil";
+                       else if (r_ptr->flags3 & RF3_GOOD) align = "good";
+                       else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "neutral(good&evil)";
+                       else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "neutral(evil)";
+                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "neutral(good)";
+                       else align = "neutral";
+#endif
+
                        /* Describe the monster */
 #ifdef JP
-sprintf(buf,"%s ... HP:%d/%d AC:%d Â®ÅÙ:%s%d ·Ð¸³:", m_name, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
+sprintf(buf,"%s ... Â°À­:%s HP:%d/%d AC:%d Â®ÅÙ:%s%d ·Ð¸³:", m_name, align, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
 #else
-sprintf(buf, "%s ... HP:%d/%d AC:%d speed:%s%d exp:", m_name, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
+sprintf(buf, "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:", m_name, align, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
 #endif
                        if (r_ptr->next_r_idx)
                        {
@@ -4883,14 +5271,33 @@ sprintf(buf, "%s ... HP:%d/%d AC:%d speed:%s%d exp:", m_name, m_ptr->hp, m_ptr->
                        p_ptr->window |= (PW_MESSAGE);
                        window_stuff();
 
-                       /* Learn all of the non-spell, non-treasure flags */
-                       lore_do_probe(i);
-
                        if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
                        inkey();
 
                        Term_erase(0, 0, 255);
 
+                       /* Learn everything about this monster */
+                       if (lore_do_probe(m_ptr->r_idx))
+                       {
+                               char buf[80];
+
+                               /* Get base name of monster */
+                               strcpy(buf, (r_name + r_ptr->name));
+
+#ifdef JP
+                               /* Note that we learnt some new flags  -Mogami- */
+                               msg_format("%s¤Ë¤Ä¤¤¤Æ¤µ¤é¤Ë¾Ü¤·¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", buf);
+#else
+                               /* Pluralize it */
+                               plural_aux(buf);
+
+                               /* Note that we learnt some new flags  -Mogami- */
+                               msg_format("You now know more about %s.", buf);
+#endif
+                               /* Clear -more- prompt */
+                               msg_print(NULL);
+                       }
+
                        /* Probe worked */
                        probe = TRUE;
                }
@@ -4927,27 +5334,26 @@ msg_print("
  * Later we may use one function for both "destruction" and
  * "earthquake" by using the "full" to select "destruction".
  */
-bool destroy_area(int y1, int x1, int r, int full)
+bool destroy_area(int y1, int x1, int r, bool in_generate)
 {
        int       y, x, k, t;
        cave_type *c_ptr;
        bool      flag = FALSE;
 
-
        /* Prevent destruction of quest levels and town */
-       if ((p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) || !dun_level)
+       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
        {
                return (FALSE);
        }
 
+       /* Lose monster light */
+       clear_mon_lite();
+
        /* Big area of affect */
        for (y = (y1 - r); y <= (y1 + r); y++)
        {
                for (x = (x1 - r); x <= (x1 + r); x++)
                {
-                       monster_type *m_ptr;
-                       monster_race *r_ptr;
-
                        /* Skip illegal grids */
                        if (!in_bounds(y, x)) continue;
 
@@ -4959,53 +5365,82 @@ bool destroy_area(int y1, int x1, int r, int full)
 
                        /* Access the grid */
                        c_ptr = &cave[y][x];
-                       m_ptr = &m_list[c_ptr->m_idx];
-                       r_ptr = &r_info[m_ptr->r_idx];
 
                        /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP);
+                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                        /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW);
 
-                       /* Hack -- Notice player affect */
-                       if ((x == px) && (y == py))
+                       if (!in_generate) /* Normal */
                        {
-                               /* Hurt the player later */
-                               flag = TRUE;
+                               /* Lose unsafety and runes/mirrors */
+                               c_ptr->info &= ~(CAVE_UNSAFE);
 
-                               /* Do not hurt this grid */
-                               continue;
+                               /* Hack -- Notice player affect */
+                               if (player_bold(y, x))
+                               {
+                                       /* Hurt the player later */
+                                       flag = TRUE;
+
+                                       /* Process "re-glowing" */
+                                       if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+
+                                       /* Do not hurt this grid */
+                                       continue;
+                               }
                        }
 
                        /* Hack -- Skip the epicenter */
-                       if ((y == y1) && (x == x1)) continue;
-
-                       if ((r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->flags7 & RF7_GUARDIAN) || ((m_ptr->mflag2 & MFLAG_CHAMELEON) && (r_ptr->flags1 & RF1_UNIQUE)))
+                       if ((y == y1) && (x == x1))
                        {
-                               /* Heal the monster */
-                               m_list[c_ptr->m_idx].hp = m_list[c_ptr->m_idx].maxhp;
+                               /* Process "re-glowing" */
+                               if (!in_generate && is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
 
-                               /* Try to teleport away quest monsters */
-                               if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TRUE)) continue;
+                               continue;
                        }
-                       else
+
+                       if (c_ptr->m_idx)
                        {
-                               if (c_ptr->m_idx)
+                               monster_type *m_ptr = &m_list[c_ptr->m_idx];
+                               monster_race *r_ptr = &r_info[m_ptr->r_idx];
+
+                               if (in_generate) /* In generation */
+                               {
+                                       /* Delete the monster (if any) */
+                                       delete_monster(y, x);
+                               }
+                               else if (r_ptr->flags1 & RF1_QUESTOR)
+                               {
+                                       /* Heal the monster */
+                                       m_ptr->hp = m_ptr->maxhp;
+
+                                       /* Try to teleport away quest monsters */
+                                       if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TRUE))
+                                       {
+                                               /* Process "re-glowing" */
+                                               if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+
+                                               continue;
+                                       }
+                               }
+                               else
                                {
-                                       if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname)
+                                       if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
                                        {
                                                char m_name[80];
 
-                                               monster_desc(m_name, &m_list[c_ptr->m_idx], 0x08);
+                                               monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                                                do_cmd_write_nikki(NIKKI_NAMED_PET, 6, m_name);
                                        }
+
+                                       /* Delete the monster (if any) */
+                                       delete_monster(y, x);
                                }
-                               /* Delete the monster (if any) */
-                               delete_monster(y, x);
                        }
 
-                       if (preserve_mode)
+                       /* During generation, destroyed artifacts are "preserved" */
+                       if (preserve_mode || in_generate)
                        {
                                s16b this_o_idx, next_o_idx = 0;
 
@@ -5021,90 +5456,133 @@ bool destroy_area(int y1, int x1, int r, int full)
                                        next_o_idx = o_ptr->next_o_idx;
 
                                        /* Hack -- Preserve unknown artifacts */
-                                       if (artifact_p(o_ptr) && !object_known_p(o_ptr))
+                                       if (artifact_p(o_ptr) && (!object_known_p(o_ptr) || in_generate))
                                        {
                                                /* Mega-Hack -- Preserve the artifact */
                                                a_info[o_ptr->name1].cur_num = 0;
+
+                                               if (in_generate && cheat_peek)
+                                               {
+                                                       char o_name[MAX_NLEN];
+                                                       object_desc_store(o_name, o_ptr, FALSE, 0);
+#ifdef JP
+                                                       msg_format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à (%s) ¤ÏÀ¸À®Ãæ¤Ë*Ç˲õ*¤µ¤ì¤¿¡£", o_name);
+#else
+                                                       msg_format("Artifact (%s) was *destroyed* during generation.", o_name);
+#endif
+                                               }
+                                       }
+                                       else if (in_generate && cheat_peek && o_ptr->art_name)
+                                       {
+#ifdef JP
+                                               msg_print("¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Î1¤Ä¤ÏÀ¸À®Ãæ¤Ë*Ç˲õ*¤µ¤ì¤¿¡£");
+#else
+                                               msg_print("One of the random artifacts was *destroyed* during generation.");
+#endif
                                        }
                                }
                        }
+
+                       /* Delete objects */
                        delete_object(y, x);
 
-                       /* Destroy "valid" grids */
+                       /* Destroy "non-permanent" grids */
                        if (!cave_perma_bold(y, x))
                        {
                                /* Wall (or floor) type */
-                               t = rand_int(200);
-
-                               /* Granite */
-                               if (t < 20)
-                               {
-                                       /* Create granite wall */
-                                       c_ptr->feat = FEAT_WALL_EXTRA;
-                               }
+                               t = randint0(200);
 
-                               /* Quartz */
-                               else if (t < 70)
+                               if (!in_generate) /* Normal */
                                {
-                                       /* Create quartz vein */
-                                       c_ptr->feat = FEAT_QUARTZ;
+                                       if (t < 20)
+                                       {
+                                               /* Create granite wall */
+                                               cave_set_feat(y, x, FEAT_WALL_EXTRA);
+                                       }
+                                       else if (t < 70)
+                                       {
+                                               /* Create quartz vein */
+                                               cave_set_feat(y, x, FEAT_QUARTZ);
+                                       }
+                                       else if (t < 100)
+                                       {
+                                               /* Create magma vein */
+                                               cave_set_feat(y, x, FEAT_MAGMA);
+                                       }
+                                       else
+                                       {
+                                               /* Create floor */
+                                               cave_set_feat(y, x, floor_type[randint0(100)]);
+                                       }
                                }
-
-                               /* Magma */
-                               else if (t < 100)
+                               else /* In generation */
                                {
-                                       /* Create magma vein */
-                                       c_ptr->feat = FEAT_MAGMA;
-                               }
+                                       if (t < 20)
+                                       {
+                                               /* Create granite wall */
+                                               place_extra_grid(c_ptr);
+                                       }
+                                       else if (t < 70)
+                                       {
+                                               /* Create quartz vein */
+                                               c_ptr->feat = FEAT_QUARTZ;
+                                       }
+                                       else if (t < 100)
+                                       {
+                                               /* Create magma vein */
+                                               c_ptr->feat = FEAT_MAGMA;
+                                       }
+                                       else
+                                       {
+                                               /* Create floor */
+                                               place_floor_grid(c_ptr);
+                                       }
 
-                               /* Floor */
-                               else
-                               {
-                                       /* Create floor */
-                                       c_ptr->feat = floor_type[rand_int(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
+                                       /* Clear garbage of hidden trap or door */
+                                       c_ptr->mimic = 0;
                                }
                        }
                }
        }
 
 
-       /* Hack -- Affect player */
-       if (flag)
+       if (!in_generate)
        {
-               /* Message */
+               /* Hack -- Affect player */
+               if (flag)
+               {
+                       /* Message */
 #ifdef JP
-msg_print("dz¤¨¤ë¤è¤¦¤ÊÁ®¸÷¤¬È¯À¸¤·¤¿¡ª");
+                       msg_print("dz¤¨¤ë¤è¤¦¤ÊÁ®¸÷¤¬È¯À¸¤·¤¿¡ª");
 #else
-               msg_print("There is a searing blast of light!");
+                       msg_print("There is a searing blast of light!");
 #endif
 
-
-               /* Blind the player */
-               if (!p_ptr->resist_blind && !p_ptr->resist_lite)
-               {
-                       /* Become blind */
-                       (void)set_blind(p_ptr->blind + 10 + randint(10));
+                       /* Blind the player */
+                       if (!p_ptr->resist_blind && !p_ptr->resist_lite)
+                       {
+                               /* Become blind */
+                               (void)set_blind(p_ptr->blind + 10 + randint1(10));
+                       }
                }
-       }
 
-       forget_flow();
+               forget_flow();
 
-       /* Mega-Hack -- Forget the view and lite */
-       p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
+               /* Mega-Hack -- Forget the view and lite */
+               p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
-       /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
+               /* Update stuff */
+               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
 
-       /* Update the monsters */
-       p_ptr->update |= (PU_MONSTERS);
+               /* Update the monsters */
+               p_ptr->update |= (PU_MONSTERS);
 
-       /* Redraw map */
-       p_ptr->redraw |= (PR_MAP);
+               /* Redraw map */
+               p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+               /* Window stuff */
+               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       }
 
        /* Success */
        return (TRUE);
@@ -5140,7 +5618,7 @@ bool earthquake(int cy, int cx, int r)
 
 
        /* Prevent destruction of quest levels and town */
-       if ((p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) || !dun_level)
+       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
        {
                return (FALSE);
        }
@@ -5176,27 +5654,39 @@ bool earthquake(int cy, int cx, int r)
                        c_ptr = &cave[yy][xx];
 
                        /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP);
+                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
 
                        /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
 
                        /* Skip the epicenter */
-                       if (!dx && !dy) continue;
+                       if (!dx && !dy)
+                       {
+                               /* Process "re-glowing" */
+                               if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+
+                               continue;
+                       }
 
                        /* Skip most grids */
-                       if (rand_int(100) < 85) continue;
+                       if (randint0(100) < 85)
+                       {
+                               /* Process "re-glowing" */
+                               if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+
+                               continue;
+                       }
 
                        /* Damage this grid */
                        map[16+yy-cy][16+xx-cx] = TRUE;
 
                        /* Hack -- Take note of player damage */
-                       if ((yy == py) && (xx == px)) hurt = TRUE;
+                       if (player_bold(yy, xx)) hurt = TRUE;
                }
        }
 
        /* First, affect the player (if necessary) */
-       if (hurt && !(p_ptr->prace == RACE_SPECTRE) && !(p_ptr->wraith_form) && !(p_ptr->kabenuke))
+       if (hurt && !prace_is_(RACE_SPECTRE) && !p_ptr->wraith_form && !p_ptr->kabenuke)
        {
                /* Check around the player */
                for (i = 0; i < 8; i++)
@@ -5217,14 +5707,14 @@ bool earthquake(int cy, int cx, int r)
                        sn++;
 
                        /* Randomize choice */
-                       if (rand_int(sn) > 0) continue;
+                       if (randint0(sn) > 0) continue;
 
                        /* Save the safe location */
                        sy = y; sx = x;
                }
 
                /* Random message */
-               switch (randint(3))
+               switch (randint1(3))
                {
                        case 1:
                        {
@@ -5275,7 +5765,7 @@ msg_print("
                else
                {
                        /* Calculate results */
-                       switch (randint(3))
+                       switch (randint1(3))
                        {
                                case 1:
                                {
@@ -5297,7 +5787,7 @@ msg_print("
 #endif
 
                                        damage = damroll(10, 4);
-                                       (void)set_stun(p_ptr->stun + randint(50));
+                                       (void)set_stun(p_ptr->stun + randint1(50));
                                        break;
                                }
                                case 3:
@@ -5309,7 +5799,7 @@ msg_print("
 #endif
 
                                        damage = damroll(10, 4);
-                                       (void)set_stun(p_ptr->stun + randint(50));
+                                       (void)set_stun(p_ptr->stun + randint1(50));
                                        break;
                                }
                        }
@@ -5411,8 +5901,8 @@ if (damage) take_hit(DAMAGE_ATTACK, damage, "
                                                        if (!cave_empty_bold(y, x)) continue;
 
                                                        /* Hack -- no safety on glyph of warding */
-                                                       if (cave[y][x].feat == FEAT_GLYPH) continue;
-                                                       if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
+                                                       if (is_glyph_grid(&cave[y][x])) continue;
+                                                       if (is_explosive_rune_grid(&cave[y][x])) continue;
 
                                                        /* ... nor on the Pattern */
                                                        if ((cave[y][x].feat <= FEAT_PATTERN_XTRA2) &&
@@ -5423,13 +5913,13 @@ if (damage) take_hit(DAMAGE_ATTACK, damage, "
                                                        if (map[16+y-cy][16+x-cx]) continue;
 
                                                        if (cave[y][x].m_idx) continue;
-                                                       if ((y == py) && (x == px)) continue;
+                                                       if (player_bold(y, x)) continue;
 
                                                        /* Count "safe" grids */
                                                        sn++;
 
                                                        /* Randomize choice */
-                                                       if (rand_int(sn) > 0) continue;
+                                                       if (randint0(sn) > 0) continue;
 
                                                        /* Save the safe grid */
                                                        sy = y; sx = x;
@@ -5472,7 +5962,7 @@ msg_format("%^s
                                                        {
                                                                char m2_name[80];
 
-                                                               monster_desc(m2_name, m_ptr, 0x08);
+                                                               monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
                                                                do_cmd_write_nikki(NIKKI_NAMED_PET, 7, m2_name);
                                                        }
                                                }
@@ -5513,6 +6003,8 @@ msg_format("%^s
                }
        }
 
+       /* Lose monster light */
+       clear_mon_lite();
 
        /* Examine the quaked region */
        for (dy = -r; dy <= r; dy++)
@@ -5530,7 +6022,7 @@ msg_format("%^s
                        c_ptr = &cave[yy][xx];
 
                        /* Paranoia -- never affect player */
-//                     if ((yy == py) && (xx == px)) continue;
+/*                     if (player_bold(yy, xx)) continue; */
 
                        /* Destroy location (if valid) */
                        if (cave_valid_bold(yy, xx))
@@ -5541,36 +6033,34 @@ msg_format("%^s
                                delete_object(yy, xx);
 
                                /* Wall (or floor) type */
-                               t = (floor ? rand_int(100) : 200);
+                               t = (floor ? randint0(100) : 200);
 
                                /* Granite */
                                if (t < 20)
                                {
                                        /* Create granite wall */
-                                       c_ptr->feat = FEAT_WALL_EXTRA;
+                                       cave_set_feat(yy, xx, FEAT_WALL_EXTRA);
                                }
 
                                /* Quartz */
                                else if (t < 70)
                                {
                                        /* Create quartz vein */
-                                       c_ptr->feat = FEAT_QUARTZ;
+                                       cave_set_feat(yy, xx, FEAT_QUARTZ);
                                }
 
                                /* Magma */
                                else if (t < 100)
                                {
                                        /* Create magma vein */
-                                       c_ptr->feat = FEAT_MAGMA;
+                                       cave_set_feat(yy, xx, FEAT_MAGMA);
                                }
 
                                /* Floor */
                                else
                                {
                                        /* Create floor */
-                                       c_ptr->feat = floor_type[rand_int(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
+                                       cave_set_feat(yy, xx, floor_type[randint0(100)]);
                                }
                        }
                }
@@ -5600,7 +6090,7 @@ msg_format("%^s
 }
 
 
-void discharge_minion(bool force)
+void discharge_minion(void)
 {
        int i;
        bool okay = TRUE;
@@ -5613,7 +6103,11 @@ void discharge_minion(bool force)
        }
        if (!okay || p_ptr->riding)
        {
+#ifdef JP
                if (!get_check("ËÜÅö¤ËÁ´¥Ú¥Ã¥È¤òÇúÇˤ·¤Þ¤¹¤«¡©"))
+#else
+               if (!get_check("You will blast all pets. Are you sure? "))
+#endif
                        return;
        }
        for (i = 1; i < m_max; i++)
@@ -5625,24 +6119,26 @@ void discharge_minion(bool force)
                if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
                r_ptr = &r_info[m_ptr->r_idx];
 
-               if (!force)
+               /* Uniques resist discharging */
+               if (r_ptr->flags1 & RF1_UNIQUE)
                {
-                       if (r_ptr->level/2+randint(r_ptr->level/2) > p_ptr->lev/2+randint(p_ptr->lev/2))
-                       {
-                               char m_name[80];
-                               monster_desc(m_name, m_ptr, 0x00);
-                               msg_format("%s¤ÏÇúÇˤµ¤ì¤ë¤Î¤ò·ù¤¬¤ê¡¢¾¡¼ê¤Ë¼«Ê¬¤ÎÀ¤³¦¤Ø¤Èµ¢¤Ã¤¿¡£", m_name);
-                               delete_monster_idx(i);
-                               continue;
-                       }
+                       char m_name[80];
+                       monster_desc(m_name, m_ptr, 0x00);
+#ifdef JP
+                       msg_format("%s¤ÏÇúÇˤµ¤ì¤ë¤Î¤ò·ù¤¬¤ê¡¢¾¡¼ê¤Ë¼«Ê¬¤ÎÀ¤³¦¤Ø¤Èµ¢¤Ã¤¿¡£", m_name);
+#else
+                       msg_format("%^s resists to be blasted, and run away.", m_name);
+#endif
+                       delete_monster_idx(i);
+                       continue;
                }
-               dam = m_ptr->hp / 2;
+               dam = m_ptr->maxhp / 2;
                if (dam > 100) dam = (dam-100)/2 + 100;
                if (dam > 400) dam = (dam-400)/2 + 400;
                if (dam > 800) dam = 800;
                project(i, 2+(r_ptr->level/20), m_ptr->fy,
                        m_ptr->fx, dam, GF_PLASMA, 
-                       PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_MONSTER, -1);
+                       PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
                delete_monster_idx(i);
        }
 }
@@ -5703,11 +6199,13 @@ static void cave_temp_room_lite(void)
                        if (r_ptr->flags2 & (RF2_SMART)) chance = 100;
 
                        /* Sometimes monsters wake up */
-                       if (m_ptr->csleep && (rand_int(100) < chance))
+                       if (m_ptr->csleep && (randint0(100) < chance))
                        {
                                /* Wake up! */
                                m_ptr->csleep = 0;
 
+                               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+
                                /* Notice the "waking up" */
                                if (m_ptr->ml)
                                {
@@ -5722,8 +6220,8 @@ msg_format("%^s
 #else
                                        msg_format("%^s wakes up.", m_name);
 #endif
-                                        /* Redraw the health bar */
-                                        if (p_ptr->health_who == c_ptr->m_idx)
+                                       /* Redraw the health bar */
+                                       if (p_ptr->health_who == c_ptr->m_idx)
                                                p_ptr->redraw |= (PR_HEALTH);
 
                                }
@@ -5770,13 +6268,13 @@ static void cave_temp_room_unlite(void)
                c_ptr->info &= ~(CAVE_TEMP);
 
                /* Darken the grid */
-               c_ptr->info &= ~(CAVE_GLOW);
+               if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
 
                /* Hack -- Forget "boring" grids */
                if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
                {
                        /* Forget the grid */
-                       c_ptr->info &= ~(CAVE_MARK);
+                       if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
 
                        /* Notice */
                        note_spot(y, x);
@@ -5800,15 +6298,70 @@ static void cave_temp_room_unlite(void)
 
 
 /*
+ * Determine how much contiguous open space this grid is next to
+ */
+static int next_to_open(int cy, int cx)
+{
+       int i;
+
+       int y, x;
+
+       int len = 0;
+       int blen = 0;
+
+       for (i = 0; i < 16; i++)
+       {
+               y = cy + ddy_cdd[i % 8];
+               x = cx + ddx_cdd[i % 8];
+
+               /* Found a wall, break the length */
+               if (!cave_floor_bold(y, x))
+               {
+                       /* Track best length */
+                       if (len > blen)
+                       {
+                               blen = len;
+                       }
+
+                       len = 0;
+               }
+               else
+               {
+                       len++;
+               }
+       }
+
+       return (MAX(len, blen));
+}
+
+
+static int next_to_walls_adj(int cy, int cx)
+{
+       int i;
+
+       int y, x;
+
+       int c = 0;
+
+       for (i = 0; i < 8; i++)
+       {
+               y = cy + ddy_ddd[i];
+               x = cx + ddx_ddd[i];
+
+               if (!cave_floor_bold(y, x)) c++;
+       }
+
+       return c;
+}
+
+
+/*
  * Aux function -- see below
  */
-static void cave_temp_room_aux(int y, int x)
+static void cave_temp_room_aux(int y, int x, bool only_room)
 {
        cave_type *c_ptr;
 
-       /* Verify */
-//     if (!in_bounds(y, x)) return;
-
        /* Get the grid */
        c_ptr = &cave[y][x];
 
@@ -5816,7 +6369,28 @@ static void cave_temp_room_aux(int y, int x)
        if (c_ptr->info & (CAVE_TEMP)) return;
 
        /* Do not "leave" the current room */
-       if (!(c_ptr->info & (CAVE_ROOM))) return;
+       if (!(c_ptr->info & (CAVE_ROOM)))
+       {
+               if (only_room) return;
+
+               /* Verify */
+               if (!in_bounds2(y, x)) return;
+
+               /* Do not exceed the maximum spell range */
+               if (distance(py, px, y, x) > MAX_RANGE) return;
+
+               /* Verify this grid */
+               /*
+                * The reason why it is ==6 instead of >5 is that 8 is impossible
+                * due to the check for cave_bold above.
+                * 7 lights dead-end corridors (you need to do this for the
+                * checkboard interesting rooms, so that the boundary is lit
+                * properly.
+                * This leaves only a check for 6 bounding walls!
+                */
+               if (in_bounds(y, x) && cave_floor_bold(y, x) &&
+                   (next_to_walls_adj(y, x) == 6) && (next_to_open(y, x) <= 1)) return;
+       }
 
        /* Paranoia -- verify space */
        if (temp_n == TEMP_MAX) return;
@@ -5830,6 +6404,22 @@ static void cave_temp_room_aux(int y, int x)
        temp_n++;
 }
 
+/*
+ * Aux function -- see below
+ */
+static void cave_temp_lite_room_aux(int y, int x)
+{
+       cave_temp_room_aux(y, x, FALSE);
+}
+
+/*
+ * Aux function -- see below
+ */
+static void cave_temp_unlite_room_aux(int y, int x)
+{
+       cave_temp_room_aux(y, x, TRUE);
+}
+
 
 
 
@@ -5841,7 +6431,7 @@ void lite_room(int y1, int x1)
        int i, x, y;
 
        /* Add the initial grid */
-       cave_temp_room_aux(y1, x1);
+       cave_temp_lite_room_aux(y1, x1);
 
        /* While grids are in the queue, add their neighbors */
        for (i = 0; i < temp_n; i++)
@@ -5852,20 +6442,25 @@ void lite_room(int y1, int x1)
                if (!cave_floor_bold(y, x)) continue;
 
                /* Spread adjacent */
-               cave_temp_room_aux(y + 1, x);
-               cave_temp_room_aux(y - 1, x);
-               cave_temp_room_aux(y, x + 1);
-               cave_temp_room_aux(y, x - 1);
+               cave_temp_lite_room_aux(y + 1, x);
+               cave_temp_lite_room_aux(y - 1, x);
+               cave_temp_lite_room_aux(y, x + 1);
+               cave_temp_lite_room_aux(y, x - 1);
 
                /* Spread diagonal */
-               cave_temp_room_aux(y + 1, x + 1);
-               cave_temp_room_aux(y - 1, x - 1);
-               cave_temp_room_aux(y - 1, x + 1);
-               cave_temp_room_aux(y + 1, x - 1);
+               cave_temp_lite_room_aux(y + 1, x + 1);
+               cave_temp_lite_room_aux(y - 1, x - 1);
+               cave_temp_lite_room_aux(y - 1, x + 1);
+               cave_temp_lite_room_aux(y + 1, x - 1);
        }
 
        /* Now, lite them all up at once */
        cave_temp_room_lite();
+
+       if (p_ptr->special_defense & NINJA_S_STEALTH)
+       {
+               if (cave[py][px].info & CAVE_GLOW) set_superstealth(FALSE);
+       }
 }
 
 
@@ -5877,7 +6472,7 @@ void unlite_room(int y1, int x1)
        int i, x, y;
 
        /* Add the initial grid */
-       cave_temp_room_aux(y1, x1);
+       cave_temp_unlite_room_aux(y1, x1);
 
        /* Spread, breadth first */
        for (i = 0; i < temp_n; i++)
@@ -5888,16 +6483,16 @@ void unlite_room(int y1, int x1)
                if (!cave_floor_bold(y, x)) continue;
 
                /* Spread adjacent */
-               cave_temp_room_aux(y + 1, x);
-               cave_temp_room_aux(y - 1, x);
-               cave_temp_room_aux(y, x + 1);
-               cave_temp_room_aux(y, x - 1);
+               cave_temp_unlite_room_aux(y + 1, x);
+               cave_temp_unlite_room_aux(y - 1, x);
+               cave_temp_unlite_room_aux(y, x + 1);
+               cave_temp_unlite_room_aux(y, x - 1);
 
                /* Spread diagonal */
-               cave_temp_room_aux(y + 1, x + 1);
-               cave_temp_room_aux(y - 1, x - 1);
-               cave_temp_room_aux(y - 1, x + 1);
-               cave_temp_room_aux(y + 1, x - 1);
+               cave_temp_unlite_room_aux(y + 1, x + 1);
+               cave_temp_unlite_room_aux(y - 1, x - 1);
+               cave_temp_unlite_room_aux(y - 1, x + 1);
+               cave_temp_unlite_room_aux(y + 1, x - 1);
        }
 
        /* Now, darken them all at once */
@@ -5916,7 +6511,11 @@ bool lite_area(int dam, int rad)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
        {
+#ifdef JP
                msg_print("¥À¥ó¥¸¥ç¥ó¤¬¸÷¤òµÛ¼ý¤·¤¿¡£");
+#else
+               msg_print("The darkness of this dungeon absorb your light.");
+#endif
                return FALSE;
        }
 
@@ -5937,11 +6536,6 @@ msg_print("
        /* Lite up the room */
        lite_room(py, px);
 
-       if (p_ptr->special_defense & NINJA_S_STEALTH)
-       {
-               set_superstealth(FALSE);
-       }
-
        /* Assume seen */
        return (TRUE);
 }
@@ -5988,7 +6582,7 @@ bool fire_ball(int typ, int dir, int dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
+       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        if (typ == GF_CONTROL_LIVING) flg|= PROJECT_HIDE;
        /* Use the given direction */
@@ -6018,7 +6612,7 @@ bool fire_rocket(int typ, int dir, int dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
+       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        /* Use the given direction */
        tx = px + 99 * ddx[dir];
@@ -6046,7 +6640,7 @@ bool fire_ball_hide(int typ, int dir, int dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF | PROJECT_HIDE;
+       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
 
        /* Use the given direction */
        tx = px + 99 * ddx[dir];
@@ -6075,13 +6669,66 @@ bool fire_ball_hide(int typ, int dir, int dam, int rad)
  */
 bool fire_meteor(int who, int typ, int y, int x, int dam, int rad)
 {
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
+       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        /* Analyze the "target" and the caster. */
        return (project(who, rad, y, x, dam, typ, flg, -1));
 }
 
 
+bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
+{
+       int ly, lx, ld;
+       int ty, tx, y, x;
+       int i;
+
+       int flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
+
+       /* Assume okay */
+       bool result = TRUE;
+
+       /* Use the given direction */
+       if (dir != 5)
+       {
+               ly = ty = py + 20 * ddy[dir];
+               lx = tx = px + 20 * ddx[dir];
+       }
+
+       /* Use an actual "target" */
+       else if (dir == 5)
+       {
+               tx = target_col;
+               ty = target_row;
+
+               lx = 20 * (tx - px) + px;
+               ly = 20 * (ty - py) + py;
+       }
+
+       ld = distance(py, px, ly, lx);
+
+       /* Blast */
+       for (i = 0; i < num; i++)
+       {
+               while (1)
+               {
+                       /* Get targets for some bolts */
+                       y = rand_spread(ly, ld * dev / 20);
+                       x = rand_spread(lx, ld * dev / 20);
+
+                       if (distance(ly, lx, y, x) <= ld * dev / 20) break;
+               }
+
+               /* Analyze the "dir" and the "target". */
+               if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1))
+               {
+                       result = FALSE;
+               }
+       }
+
+       return (result);
+}
+
+
 /*
  * Switch position with a monster.
  */
@@ -6144,7 +6791,7 @@ msg_print("
        m_ptr = &m_list[c_ptr->m_idx];
        r_ptr = &r_info[m_ptr->r_idx];
 
-       if (r_ptr->flags3 & RF3_RES_TELE)
+       if (r_ptr->flagsr & RFR_RES_TELE)
        {
 #ifdef JP
 msg_print("¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤵¤ì¤¿¡ª");
@@ -6152,7 +6799,11 @@ msg_print("
                msg_print("Your teleportation is blocked!");
 #endif
 
+               if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
+
                m_ptr->csleep = 0;
+               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+
                /* Failure */
                return FALSE;
        }
@@ -6165,8 +6816,8 @@ msg_print("
        c_ptr->m_idx = p_ptr->riding;
 
        /* Move the monster */
-       m_ptr->fy = (byte)py;
-       m_ptr->fx = (byte)px;
+       m_ptr->fy = py;
+       m_ptr->fx = px;
 
        /* Move the player */
        px = tx;
@@ -6199,14 +6850,7 @@ msg_print("
        verify_panel();
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
-
-       /* Notice changes in view */
-       if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
-       {
-               /* Update some things */
-               p_ptr->update |= (PU_MON_LITE);
-       }
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
 
        /* Update the monsters */
        p_ptr->update |= (PU_DISTANCE);
@@ -6253,21 +6897,21 @@ bool project_hook(int typ, int dir, int dam, int flg)
 
 
 /*
- * Cast a bolt spell
- * Stop if we hit a monster, as a "bolt"
- * Affect monsters (not grids or objects)
+ * Cast a bolt spell.
+ * Stop if we hit a monster, as a "bolt".
+ * Affect monsters and grids (not objects).
  */
 bool fire_bolt(int typ, int dir, int dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
        return (project_hook(typ, dir, dam, flg));
 }
 
 
 /*
- * Cast a beam spell
- * Pass through monsters, as a "beam"
- * Affect monsters (not grids or objects)
+ * Cast a beam spell.
+ * Pass through monsters, as a "beam".
+ * Affect monsters, grids and objects.
  */
 bool fire_beam(int typ, int dir, int dam)
 {
@@ -6281,7 +6925,7 @@ bool fire_beam(int typ, int dir, int dam)
  */
 bool fire_bolt_or_beam(int prob, int typ, int dir, int dam)
 {
-       if (rand_int(100) < prob)
+       if (randint0(100) < prob)
        {
                return (fire_beam(typ, dir, dam));
        }
@@ -6304,7 +6948,7 @@ bool lite_line(int dir)
 
 bool drain_life(int dir, int dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_DRAIN, dir, dam, flg));
 }
 
@@ -6312,14 +6956,14 @@ bool drain_life(int dir, int dam)
 bool wall_to_mud(int dir)
 {
        int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-       return (project_hook(GF_KILL_WALL, dir, 20 + randint(30), flg));
+       return (project_hook(GF_KILL_WALL, dir, 20 + randint1(30), flg));
 }
 
 
 bool wizard_lock(int dir)
 {
        int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-       return (project_hook(GF_JAM_DOOR, dir, 20 + randint(30), flg));
+       return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
 }
 
 
@@ -6339,28 +6983,28 @@ bool disarm_trap(int dir)
 
 bool heal_monster(int dir, int dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_HEAL, dir, dam, flg));
 }
 
 
 bool speed_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SPEED, dir, p_ptr->lev, flg));
 }
 
 
 bool slow_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLOW, dir, p_ptr->lev, flg));
 }
 
 
 bool sleep_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLEEP, dir, p_ptr->lev, flg));
 }
 
@@ -6371,23 +7015,29 @@ bool stasis_monster(int dir)
 }
 
 
+bool stasis_evil(int dir)
+{
+       return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
+}
+
+
 bool confuse_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CONF, dir, plev, flg));
 }
 
 
 bool stun_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_STUN, dir, plev, flg));
 }
 
 
 bool poly_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        bool tester = (project_hook(GF_OLD_POLY, dir, p_ptr->lev, flg));
        if (tester)
                chg_virtue(V_CHANCE, 1);
@@ -6397,21 +7047,21 @@ bool poly_monster(int dir)
 
 bool clone_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CLONE, dir, 0, flg));
 }
 
 
 bool fear_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_TURN_ALL, dir, plev, flg));
 }
 
 
 bool death_ray(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
 }
 
@@ -6460,7 +7110,7 @@ bool wall_stone(void)
        bool dummy = (project(0, 1, py, px, 0, GF_STONE_WALL, flg, -1));
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
 
        /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
@@ -6514,10 +7164,10 @@ void call_chaos(void)
                GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
        };
 
-       Chaos_type = hurt_types[rand_int(31)];
-       if (randint(4) == 1) line_chaos = TRUE;
+       Chaos_type = hurt_types[randint0(31)];
+       if (one_in_(4)) line_chaos = TRUE;
 
-       if (randint(6) == 1)
+       if (one_in_(6))
        {
                for (dummy = 1; dummy < 10; dummy++)
                {
@@ -6530,7 +7180,7 @@ void call_chaos(void)
                        }
                }
        }
-       else if (randint(3) == 1)
+       else if (one_in_(3))
        {
                fire_ball(Chaos_type, 0, 500, 8);
        }
@@ -6558,7 +7208,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
 
        do
        {
-               switch (randint(34))
+               switch (randint1(34))
                {
                case 28: case 29:
                        if (!(*count))
@@ -6569,8 +7219,8 @@ msg_print("
                                msg_print("The ground trembles...");
 #endif
 
-                               earthquake(py, px, 5 + rand_int(10));
-                               if (randint(6) != 1) break;
+                               earthquake(py, px, 5 + randint0(10));
+                               if (!one_in_(6)) break;
                        }
                case 30: case 31:
                        if (!(*count))
@@ -6588,7 +7238,7 @@ msg_print("
 #else
                                take_hit(DAMAGE_NOESCAPE, dam, "released pure mana", -1);
 #endif
-                               if (randint(6) != 1) break;
+                               if (!one_in_(6)) break;
                        }
                case 32: case 33:
                        if (!(*count))
@@ -6600,8 +7250,8 @@ msg_print("
 #endif
 
                                teleport_player(damroll(10, 10));
-                               if (rand_int(13)) (*count) += activate_hi_summon(py, px, FALSE);
-                               if (randint(6) != 1) break;
+                               if (randint0(13)) (*count) += activate_hi_summon(py, px, FALSE);
+                               if (!one_in_(6)) break;
                        }
                case 34:
 #ifdef JP
@@ -6611,7 +7261,7 @@ msg_print("
 #endif
 
                        wall_breaker();
-                       if (!rand_int(7))
+                       if (!randint0(7))
                        {
                                project(0, 7, py, px, 50, GF_KILL_WALL, flg, -1);
 #ifdef JP
@@ -6620,16 +7270,16 @@ msg_print("
                                take_hit(DAMAGE_NOESCAPE, 50, "surge of energy", -1);
 #endif
                        }
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 1: case 2: case 3: case 16: case 17:
                        aggravate_monsters(0);
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 4: case 5: case 6:
                        (*count) += activate_hi_summon(py, px, FALSE);
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 7: case 8: case 9: case 18:
-                       (*count) += summon_specific(0, py, px, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE);
-                       if (randint(6) != 1) break;
+                       (*count) += summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       if (!one_in_(6)) break;
                case 10: case 11: case 12:
 #ifdef JP
 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
@@ -6638,9 +7288,9 @@ msg_print("
 #endif
 
                        lose_exp(p_ptr->exp / 16);
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 13: case 14: case 15: case 19: case 20:
-                       if (stop_ty || (p_ptr->free_act && (randint(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
+                       if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
                        {
                                /* Do nothing */ ;
                        }
@@ -6653,15 +7303,15 @@ msg_print("Ħ
 #endif
 
                                if (p_ptr->free_act)
-                                       set_paralyzed(p_ptr->paralyzed + randint(3));
+                                       set_paralyzed(p_ptr->paralyzed + randint1(3));
                                else
-                                       set_paralyzed(p_ptr->paralyzed + randint(13));
+                                       set_paralyzed(p_ptr->paralyzed + randint1(13));
                                stop_ty = TRUE;
                        }
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 21: case 22: case 23:
-                       (void)do_dec_stat(rand_int(6));
-                       if (randint(6) != 1) break;
+                       (void)do_dec_stat(randint0(6));
+                       if (!one_in_(6)) break;
                case 24:
 #ifdef JP
 msg_print("¤Û¤¨¡©»ä¤Ïï¡©¤³¤³¤Ç²¿¤·¤Æ¤ë¡©");
@@ -6670,7 +7320,7 @@ msg_print("
 #endif
 
                        lose_all_info();
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                case 25:
                        /*
                         * Only summon Cyberdemons deep in the dungeon.
@@ -6681,7 +7331,7 @@ msg_print("
                                stop_ty = TRUE;
                                break;
                        }
-                       if (randint(6) != 1) break;
+                       if (!one_in_(6)) break;
                default:
                        while (i < 6)
                        {
@@ -6689,13 +7339,13 @@ msg_print("
                                {
                                        (void)do_dec_stat(i);
                                }
-                               while (randint(2) == 1);
+                               while (one_in_(2));
 
                                i++;
                        }
                }
        }
-       while ((randint(3) == 1) && !stop_ty);
+       while (one_in_(3) && !stop_ty);
 
        return stop_ty;
 }
@@ -6705,69 +7355,77 @@ int activate_hi_summon(int y, int x, bool can_pet)
 {
        int i;
        int count = 0;
-       bool pet = FALSE, friendly = FALSE;
        int summon_lev;
+       u32b mode = PM_ALLOW_GROUP;
+       bool pet = FALSE;
 
        if (can_pet)
        {
                if (one_in_(4))
                {
-                       friendly = TRUE;
+                       mode |= PM_FORCE_FRIENDLY;
                }
                else
                {
+                       mode |= PM_FORCE_PET;
                        pet = TRUE;
                }
        }
-       summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint(p_ptr->lev / 2) : dun_level);
 
-       for (i = 0; i < (randint(7) + (dun_level / 40)); i++)
+       if (!pet) mode |= PM_NO_PET;
+
+       summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level);
+
+       for (i = 0; i < (randint1(7) + (dun_level / 40)); i++)
        {
-               switch (randint(25) + (dun_level / 20))
+               switch (randint1(25) + (dun_level / 20))
                {
                        case 1: case 2:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
                                break;
                        case 3: case 4:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
                                break;
                        case 5: case 6:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
                                break;
                        case 7: case 8:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
                                break;
                        case 9: case 10:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
                                break;
                        case 11: case 12:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
                                break;
                        case 13: case 14:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
                                break;
                        case 15: case 16:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
                                break;
                        case 17:
-                               if (pet || friendly) break;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, TRUE, friendly, pet, TRUE, !pet);
+                               if (can_pet) break;
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
                                break;
                        case 18: case 19:
-                               if (pet || friendly) break;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, TRUE, friendly, pet, TRUE, !pet);
+                               if (can_pet) break;
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
                                break;
                        case 20: case 21:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, TRUE, friendly, pet, (!friendly && !pet), !pet);
+                               if (!can_pet) mode |= PM_ALLOW_UNIQUE;
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
                                break;
                        case 22: case 23:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, TRUE, friendly, pet, (!friendly && !pet), !pet);
+                               if (!can_pet) mode |= PM_ALLOW_UNIQUE;
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
                                break;
                        case 24:
-                               count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, TRUE, friendly, pet, FALSE, !pet);
+                               count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
                                break;
                        default:
-                               count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, TRUE, friendly, pet, (!friendly && !pet), !pet);
+                               if (!can_pet) mode |= PM_ALLOW_UNIQUE;
+                               count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
                }
        }
 
@@ -6779,25 +7437,22 @@ int activate_hi_summon(int y, int x, bool can_pet)
 int summon_cyber(int who, int y, int x)
 {
        int i;
-       int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint(2));
+       int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
        int count = 0;
-
-       bool friendly = FALSE;
-       bool pet = FALSE;
+       u32b mode = PM_ALLOW_GROUP;
 
        /* Summoned by a monster */
        if (who > 0)
        {
                monster_type *m_ptr = &m_list[who];
-               friendly = is_friendly(m_ptr);
-               pet = is_pet(m_ptr);
+               if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
        }
 
        if (max_cyber > 4) max_cyber = 4;
 
        for (i = 0; i < max_cyber; i++)
        {
-               count += summon_specific(who, y, x, 100, SUMMON_CYBER, TRUE, friendly, pet, FALSE, FALSE);
+               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode);
        }
 
        return count;
@@ -6810,21 +7465,21 @@ void wall_breaker(void)
        int y, x;
        int attempts = 1000;
 
-       if (randint(80 + p_ptr->lev) < 70)
+       if (randint1(80 + p_ptr->lev) < 70)
        {
-               while(attempts--)
+               while (attempts--)
                {
                        scatter(&y, &x, py, px, 4, 0);
 
                        if (!cave_floor_bold(y, x)) continue;
 
-                       if ((y != py) || (x != px)) break;
+                       if (!player_bold(y, x)) break;
                }
 
-               project(0, 0, y, x, 20 + randint(30), GF_KILL_WALL,
+               project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
                                  (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
        }
-       else if (randint(100) > 30)
+       else if (randint1(100) > 30)
        {
                earthquake(py, px, 1);
        }
@@ -6834,14 +7489,14 @@ void wall_breaker(void)
 
                for (i = 0; i < num; i++)
                {
-                       while(1)
+                       while (1)
                        {
                                scatter(&y, &x, py, px, 10, 0);
 
-                               if ((y != py) && (x != px)) break;
+                               if (!player_bold(y, x)) break;
                        }
 
-                       project(0, 0, y, x, 20 + randint(30), GF_KILL_WALL,
+                       project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
                                          (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
                }
        }
@@ -6980,7 +7635,7 @@ void kawarimi(bool success)
        int y, x;
 
        if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return;
-       if (rand_int(200) < p_ptr->stun) return;
+       if (randint0(200) < p_ptr->stun) return;
 
        if (!success && one_in_(3))
        {
@@ -6997,16 +7652,12 @@ void kawarimi(bool success)
        y = py;
        x = px;
 
-       teleport_player(10+randint(90));
+       teleport_player(10+randint1(90));
 
        object_wipe(q_ptr);
 
        object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
 
-#ifdef USE_SCRIPT
-       q_ptr->python = object_create_callback(q_ptr);
-#endif /* USE_SCRIPT */
-
        q_ptr->pval = MON_NINJA;
 
        /* Drop it in the dungeon */
@@ -7023,3 +7674,154 @@ void kawarimi(bool success)
        p_ptr->special_defense &= ~(NINJA_KAWARIMI);
        p_ptr->redraw |= (PR_STATUS);
 }
+
+
+/*
+ * "Rush Attack" routine for Samurai or Ninja
+ * Return value is for checking "done"
+ */
+bool rush_attack(bool *mdeath)
+{
+       int dir;
+       int tx, ty;
+       int tm_idx = 0;
+       u16b path_g[32];
+       int path_n, i;
+       bool tmp_mdeath = FALSE;
+       bool moved = FALSE;
+
+       if (mdeath) *mdeath = FALSE;
+
+       project_length = 5;
+       if (!get_aim_dir(&dir)) return FALSE;
+
+       /* Use the given direction */
+       tx = px + project_length * ddx[dir];
+       ty = py + project_length * ddy[dir];
+
+       /* Hack -- Use an actual "target" */
+       if ((dir == 5) && target_okay())
+       {
+               tx = target_col;
+               ty = target_row;
+       }
+
+       if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx;
+
+       path_n = project_path(path_g, project_length, py, px, ty, tx, PROJECT_STOP | PROJECT_KILL);
+       project_length = 0;
+
+       /* No need to move */
+       if (!path_n) return TRUE;
+
+       /* Use ty and tx as to-move point */
+       ty = py;
+       tx = px;
+
+       /* Project along the path */
+       for (i = 0; i < path_n; i++)
+       {
+               monster_type *m_ptr;
+
+               int ny = GRID_Y(path_g[i]);
+               int nx = GRID_X(path_g[i]);
+
+               if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat))
+               {
+                       ty = ny;
+                       tx = nx;
+
+                       /* Go to next grid */
+                       continue;
+               }
+
+               if (!cave[ny][nx].m_idx)
+               {
+                       if (tm_idx)
+                       {
+#ifdef JP
+                               msg_print("¼ºÇÔ¡ª");
+#else
+                               msg_print("Failed!");
+#endif
+                       }
+                       else
+                       {
+#ifdef JP
+                               msg_print("¤³¤³¤Ë¤ÏÆþ¿È¤Ç¤ÏÆþ¤ì¤Ê¤¤¡£");
+#else
+                               msg_print("You can't move to that place.");
+#endif
+                       }
+
+                       /* Exit loop */
+                       break;
+               }
+
+               /* Move player before updating the monster */
+               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE);
+
+               /* Update the monster */
+               update_mon(cave[ny][nx].m_idx, TRUE);
+
+               /* Found a monster */
+               m_ptr = &m_list[cave[ny][nx].m_idx];
+
+               if (tm_idx != cave[ny][nx].m_idx)
+               {
+#ifdef JP
+                       msg_format("%s%s¤¬Î©¤Á¤Õ¤µ¤¬¤Ã¤Æ¤¤¤ë¡ª", tm_idx ? "Ê̤Î" : "",
+                                  m_ptr->ml ? "¥â¥ó¥¹¥¿¡¼" : "²¿¤«");
+#else
+                       msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone");
+#endif
+               }
+               else if (!player_bold(ty, tx))
+               {
+                       /* Hold the monster name */
+                       char m_name[80];
+
+                       /* Get the monster name (BEFORE polymorphing) */
+                       monster_desc(m_name, m_ptr, 0);
+#ifdef JP
+                       msg_format("ÁÇÁ᤯%s¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª", m_name);
+#else
+                       msg_format("You quickly jump in and attack %s!", m_name);
+#endif
+               }
+
+               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE);
+               moved = TRUE;
+               tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN);
+
+               break;
+       }
+
+       if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE);
+
+       if (mdeath) *mdeath = tmp_mdeath;
+       return TRUE;
+}
+
+
+/*
+ * Remove all mirrors in this floor
+ */
+void remove_all_mirrors(bool explode)
+{
+       int x, y;
+
+       for (x = 0; x < cur_wid; x++)
+       {
+               for (y = 0; y < cur_hgt; y++)
+               {
+                       if (is_mirror_grid(&cave[y][x]))
+                       {
+                               remove_mirror(y, x);
+                               if (explode)
+                                       project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
+                                               (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+                       }
+               }
+       }
+}