OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / mspells1.c
index 766eddd..5e87124 100644 (file)
@@ -1,6 +1,6 @@
-/*!
+/*!
  * @file mspells1.c
- * @brief \83\82\83\93\83X\83^\81[\96\82\96@\82Ì\8eÀ\91\95 / Monster spells (attack player)
+ * @brief モンスター魔法の実装 / Monster spells (attack player)
  * @date 2014/01/17
  * @author
  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
  */
 
 #include "angband.h"
+#include "object-curse.h"
+#include "projection.h"
+#include "quest.h"
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82ª\83v\83\8c\83C\83\84\81[\82Ì\8eã\93_\82ð\82Â\82¢\82½\91I\91ð\82ð\8eæ\82é\82©\82Ç\82¤\82©\82Ì\94»\92è /
+ * @brief モンスターがプレイヤーの弱点をついた選択を取るかどうかの判定 /
  * Internal probability routine
- * @param r_ptr \83\82\83\93\83X\83^\81[\8eí\91°\82Ì\8d\\91¢\91Ì\8eQ\8fÆ\83|\83C\83\93\83^
- * @param prob \8aî\96{\8am\97¦(%)
- * @return \93K\82µ\82½\91I\91ð\82ð\8eæ\82é\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param r_ptr モンスター種族の構造体参照ポインタ
+ * @param prob 基本確率(%)
+ * @return 適した選択を取るならばTRUEを返す。
  */
-static bool int_outof(monster_race *r_ptr, int prob)
+static bool int_outof(monster_race *r_ptr, PERCENTAGE prob)
 {
        /* Non-Smart monsters are half as "smart" */
        if (!(r_ptr->flags2 & RF2_SMART)) prob = prob / 2;
@@ -59,15 +62,15 @@ static bool int_outof(monster_race *r_ptr, int prob)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\96\82\96@\88ê\97\97\82©\82ç\90í\8fp\93I\82É\93K\82³\82È\82¢\96\82\96@\82ð\8f\9c\8aO\82·\82é /
+ * @brief モンスターの魔法一覧から戦術的に適さない魔法を除外する /
  * Remove the "bad" spells from a spell list
- * @param m_idx \83\82\83\93\83X\83^\81[\82Ì\8d\\91¢\91Ì\8eQ\8fÆ\83|\83C\83\93\83^
- * @param f4p \83\82\83\93\83X\83^\81[\96\82\96@\82Ì\83t\83\89\83O\83\8a\83X\83g1
- * @param f5p \83\82\83\93\83X\83^\81[\96\82\96@\82Ì\83t\83\89\83O\83\8a\83X\83g2
- * @param f6p \83\82\83\93\83X\83^\81[\96\82\96@\82Ì\83t\83\89\83O\83\8a\83X\83g3
- * @return \82È\82µ
+ * @param m_idx モンスターの構造体参照ポインタ
+ * @param f4p モンスター魔法のフラグリスト1
+ * @param f5p モンスター魔法のフラグリスト2
+ * @param f6p モンスター魔法のフラグリスト3
+ * @return なし
  */
-static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
+static void remove_bad_spells(MONSTER_IDX m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
 {
        monster_type *m_ptr = &m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
@@ -332,7 +335,6 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
                if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
                if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
                if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
-               if (int_outof(r_ptr, 150)) f4 &= ~(RF4_SHOOT);
        }
 
        if (smart & (SM_IMM_FREE))
@@ -346,7 +348,7 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
                f5 &= ~(RF5_DRAIN_MANA);
        }
 
-       /* XXX XXX XXX No spells left? */
+       /* No spells left? */
        /* if (!f4 && !f5 && !f6) ... */
 
        (*f4p) = f4;
@@ -356,15 +358,15 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82É\82Æ\82Á\82Ä\8f\8a\92è\82Ì\92n\93_\82ª\8f¢\8aÒ\82É\91\8a\89\9e\82µ\82¢\92n\93_\82©\82Ç\82¤\82©\82ð\95Ô\82·\81B /
+ * @brief モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 /
  * Determine if there is a space near the player in which a summoned creature can appear
- * @param y1 \94»\92è\82ð\8ds\82¢\82½\82¢\83}\83X\82ÌY\8dÀ\95W
- * @param x1 \94»\92è\82ð\8ds\82¢\82½\82¢\83}\83X\82ÌX\8dÀ\95W
- * @return \8f¢\8aÒ\82É\91\8a\89\9e\82µ\82¢\82È\82ç\82ÎTRUE\82ð\95Ô\82·
+ * @param y1 判定を行いたいマスのY座標
+ * @param x1 判定を行いたいマスのX座標
+ * @return 召還に相応しいならばTRUEを返す
  */
-bool summon_possible(int y1, int x1)
+bool summon_possible(POSITION y1, POSITION x1)
 {
-       int y, x;
+       POSITION y, x;
 
        /* Start at the player's location, and check 2 grids in each dir */
        for (y = y1 - 2; y <= y1 + 2; y++)
@@ -390,17 +392,17 @@ bool summon_possible(int y1, int x1)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82É\82Æ\82Á\82Ä\8e\80\8eÒ\95\9c\8a\88\82ð\8ds\82¤\82×\82«\8fó\91Ô\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief モンスターにとって死者復活を行うべき状態かどうかを返す /
  * Determine if there is a space near the player in which a summoned creature can appear
- * @param m_ptr \94»\92è\82ð\8ds\82¢\82½\82¢\83\82\83\93\83X\83^\81[\82Ì\8d\\91¢\91Ì\8eQ\8fÆ\83|\83C\83\93\83^
- * @return \8e\80\8eÒ\95\9c\8a\88\82ª\97L\8cø\82È\8fó\91Ô\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param m_ptr 判定を行いたいモンスターの構造体参照ポインタ
+ * @return 死者復活が有効な状態ならばTRUEを返す。
  */
 bool raise_possible(monster_type *m_ptr)
 {
-       int xx, yy;
-       int y = m_ptr->fy;
-       int x = m_ptr->fx;
-       s16b this_o_idx, next_o_idx = 0;
+       POSITION xx, yy;
+       POSITION y = m_ptr->fy;
+       POSITION x = m_ptr->fx;
+       OBJECT_IDX this_o_idx, next_o_idx = 0;
        cave_type *c_ptr;
 
        for (xx = x - 5; xx <= x + 5; xx++)
@@ -415,7 +417,6 @@ bool raise_possible(monster_type *m_ptr)
                        /* Scan the pile of objects */
                        for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
-                               /* Acquire object */
                                object_type *o_ptr = &o_list[this_o_idx];
 
                                /* Acquire next object */
@@ -435,14 +436,14 @@ bool raise_possible(monster_type *m_ptr)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82É\82Æ\82Á\82Ä\83{\83\8b\83g\8c^\96\82\96@\82ª\97L\8cø\82È\8fó\91Ô\82©\82ð\95Ô\82· /
+ * @brief モンスターにとってボルト型魔法が有効な状態かを返す /
  * Determine if a bolt spell will hit the player.
- * @param y1 \83{\83\8b\83g\96\82\96@\94­\8eË\92n\93_\82ÌY\8dÀ\95W
- * @param x1 \83{\83\8b\83g\96\82\96@\94­\8eË\92n\93_\82ÌX\8dÀ\95W
- * @param y2 \83{\83\8b\83g\96\82\96@\96Ú\95W\92n\93_\82ÌY\8dÀ\95W
- * @param x2 \83{\83\8b\83g\96\82\96@\96Ú\95W\92n\93_\82ÌX\8dÀ\95W
- * @param is_friend \83\82\83\93\83X\83^\81[\82ª\83v\83\8c\83C\83\84\81[\82É\8aQ\88Ó\82ð\8e\9d\82½\82È\82¢(\83y\83b\83g\82©\97F\8dD\93I)\82È\82ç\82ÎTRUE\82ð\82Â\82¯\82é
- * @return \83{\83\8b\83g\8c^\96\82\96@\82ª\97L\8cø\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param y1 ボルト魔法発射地点のY座標
+ * @param x1 ボルト魔法発射地点のX座標
+ * @param y2 ボルト魔法目標地点のY座標
+ * @param x2 ボルト魔法目標地点のX座標
+ * @param is_friend モンスターがプレイヤーに害意を持たない(ペットか友好的)ならばTRUEをつける
+ * @return ボルト型魔法が有効ならばTRUEを返す。
  * @details
  * Originally, it was possible for a friendly to shoot another friendly.\n
  * Change it so a "clean shot" means no equally friendly monster is\n
@@ -453,11 +454,12 @@ bool raise_possible(monster_type *m_ptr)
  * no equally friendly monster is\n
  * between the attacker and target.\n
  */
-bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend)
+bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend)
 {
        /* Must be the same as projectable() */
 
-       int i, y, x;
+       int i;
+       POSITION y, x;
 
        int grid_n = 0;
        u16b grid_g[512];
@@ -499,62 +501,98 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend)
 }
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\83{\83\8b\83g\8c^\96\82\96@\8f\88\97\9d /
+ * @brief モンスターのボルト型魔法処理 /
  * Cast a bolt at the player Stop if we hit a monster Affect monsters and the player
- * @param m_idx \83\82\83\93\83X\83^\81[\82ÌID
- * @param typ \8cø\89Ê\91®\90«ID
- * @param dam_hp \88Ð\97Í
- * @param monspell \83\82\83\93\83X\83^\81[\96\82\96@\82ÌID
- * @param learnable \83\89\81[\83j\83\93\83O\89Â\94\\82©\94Û\82©
- * @return \82È\82µ
+ * @param m_idx モンスターのID
+ * @param y 目標のY座標
+ * @param x 目標のX座標
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
  */
-void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
-{
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
+void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type)
+  {
+    BIT_FLAGS flg = 0;
+    bool learnable = spell_learnable(m_idx);
+
+    switch (target_type)
+    {
+    case MONSTER_TO_MONSTER:
+        flg = PROJECT_STOP | PROJECT_KILL;
+        break;
+    case MONSTER_TO_PLAYER:
+        flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
+        break;
+    }
        if (typ != GF_ARROW) flg  |= PROJECT_REFLECTABLE;
 
        /* Target the player with a bolt attack */
-       (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
+       (void)project(m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
 }
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\83r\81[\83\80\8c^\96\82\96@\8f\88\97\9d /
- * @param m_idx \83\82\83\93\83X\83^\81[\82ÌID
- * @param typ \8cø\89Ê\91®\90«ID
- * @param dam_hp \88Ð\97Í
- * @param monspell \83\82\83\93\83X\83^\81[\96\82\96@\82ÌID
- * @param learnable \83\89\81[\83j\83\93\83O\89Â\94\\82©\94Û\82©
- * @return \82È\82µ
+ * @brief モンスターのビーム型魔法処理 /
+ * @param m_idx モンスターのID
+ * @param y 目標のY座標
+ * @param x 目標のX座標
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
  */
-static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
+void beam(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type)
 {
-       int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER;
+    BIT_FLAGS flg = 0;
+    bool learnable = spell_learnable(m_idx);
+
+    switch (target_type)
+    {
+    case MONSTER_TO_MONSTER:
+        flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU;
+        break;
+    case MONSTER_TO_PLAYER:
+        flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER;
+        break;
+    }
 
        /* Target the player with a bolt attack */
-       (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
+       (void)project(m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
 }
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\83{\81[\83\8b\8c^\81\95\83u\83\8c\83X\8c^\96\82\96@\8f\88\97\9d /
+ * @brief モンスターのボール型&ブレス型魔法処理 /
  * Cast a breath (or ball) attack at the player Pass over any monsters that may be in the way Affect grids, objects, monsters, and the player
- * @param y \96Ú\95W\92n\93_\82ÌY\8dÀ\95W
- * @param x \96Ú\95W\92n\93_\82ÌX\8dÀ\95W
- * @param m_idx \83\82\83\93\83X\83^\81[\82ÌID
- * @param typ \8cø\89Ê\91®\90«ID
- * @param dam_hp \88Ð\97Í
- * @param rad \94¼\8ca
- * @param breath TRUE\82È\82ç\82Î\83u\83\8c\83X\8f\88\97\9d\81AFALSE\82È\82ç\82Î\83{\81[\83\8b\8f\88\97\9d
- * @param monspell \83\82\83\93\83X\83^\81[\96\82\96@\82ÌID
- * @param learnable \83\89\81[\83j\83\93\83O\89Â\94\\82©\94Û\82©
- * @return \82È\82µ
+ * @param y 目標地点のY座標
+ * @param x 目標地点のX座標
+ * @param m_idx モンスターのID
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param rad 半径
+ * @param breath 
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
  */
-void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
+void breath(POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
+    monster_type *m_ptr = &m_list[m_idx];
+    monster_race *r_ptr = &r_info[m_ptr->r_idx];
+    bool learnable = spell_learnable(m_idx);
+       BIT_FLAGS flg = 0x00;
 
-       monster_type *m_ptr = &m_list[m_idx];
-       monster_race *r_ptr = &r_info[m_ptr->r_idx];
+    switch (target_type)
+    {
+        case MONSTER_TO_MONSTER:
+            flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+            break;
+        case MONSTER_TO_PLAYER:
+            flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
+            break;
+    }
 
        /* Determine the radius of the blast */
        if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
@@ -583,118 +621,14 @@ void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath,
        (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
 }
 
-/*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\83{\81[\83\8b\8c^\81\95\83u\83\8c\83X\8c^\96\82\96@\8f\88\97\9d /
- * @param power \8eô\82¢\82Ì\92i\8aK
- * @param o_ptr \8eô\82¢\82ð\82©\82¯\82ç\82ê\82é\91\95\94õ\83I\83u\83W\83F\83N\83g\82Ì\8d\\91¢\91Ì\8eQ\8fÆ\83|\83C\83\93\83^
- * @return \97^\82¦\82é\8eô\82¢\82ÌID
- */
-u32b get_curse(int power, object_type *o_ptr)
-{
-       u32b new_curse;
-
-       while(1)
-       {
-               new_curse = (1 << (randint0(MAX_CURSE)+4));
-               if (power == 2)
-               {
-                       if (!(new_curse & TRC_HEAVY_MASK)) continue;
-               }
-               else if (power == 1)
-               {
-                       if (new_curse & TRC_SPECIAL_MASK) continue;
-               }
-               else if (power == 0)
-               {
-                       if (new_curse & TRC_HEAVY_MASK) continue;
-               }
-               if (new_curse == TRC_LOW_MELEE && !object_is_weapon(o_ptr)) continue;
-               if (new_curse == TRC_LOW_AC && !object_is_armour(o_ptr)) continue;
-               break;
-       }
-       return new_curse;
-}
-
-/*!
- * @brief \91\95\94õ\82Ö\82Ì\8eô\82¢\95t\89Á\94»\92è\82Æ\95t\89Á\8f\88\97\9d /
- * @param chance \8eô\82¢\82Ì\8aî\96{\8am\97¦
- * @param heavy_chance \8fd\82¢\8eô\82¢\82ð\91I\91ð\8e\88\82É\93ü\82ê\82é\82©\94Û\82©\81B
- * @return \82È\82µ
- */
-void curse_equipment(int chance, int heavy_chance)
-{
-       bool        changed = FALSE;
-       int         curse_power = 0;
-       u32b        new_curse;
-       u32b oflgs[TR_FLAG_SIZE];
-       object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
-       char o_name[MAX_NLEN];
-
-       if (randint1(100) > chance) return;
 
-       if (!o_ptr->k_idx) return;
-
-       object_flags(o_ptr, oflgs);
-
-       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-       /* Extra, biased saving throw for blessed items */
-       if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance))
-       {
-#ifdef JP
-msg_format("%s\82Í\8eô\82¢\82ð\92µ\82Ë\95Ô\82µ\82½\81I", o_name,
-#else
-               msg_format("Your %s resist%s cursing!", o_name,
-#endif
-
-                       ((o_ptr->number > 1) ? "" : "s"));
-               /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
-               return;
-       }
-
-       if ((randint1(100) <= heavy_chance) &&
-           (object_is_artifact(o_ptr) || object_is_ego(o_ptr)))
-       {
-               if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
-                       changed = TRUE;
-               o_ptr->curse_flags |= TRC_HEAVY_CURSE;
-               o_ptr->curse_flags |= TRC_CURSED;
-               curse_power++;
-       }
-       else
-       {
-               if (!object_is_cursed(o_ptr))
-                       changed = TRUE;
-               o_ptr->curse_flags |= TRC_CURSED;
-       }
-       if (heavy_chance >= 50) curse_power++;
-
-       new_curse = get_curse(curse_power, o_ptr);
-       if (!(o_ptr->curse_flags & new_curse))
-       {
-               changed = TRUE;
-               o_ptr->curse_flags |= new_curse;
-       }
-
-       if (changed)
-       {
-#ifdef JP
-msg_format("\88«\88Ó\82É\96\9e\82¿\82½\8d\95\82¢\83I\81[\83\89\82ª%s\82ð\82Æ\82è\82Ü\82¢\82½...", o_name);
-#else
-               msg_format("There is a malignant black aura surrounding %s...", o_name);
-#endif
-
-               o_ptr->feeling = FEEL_NONE;
-       }
-       p_ptr->update |= (PU_BONUS);
-}
 
 
 /*!
- * @brief ID\92l\82ª\90³\82µ\82¢\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が正しいモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell is good for hurting the player (directly).
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \90³\82µ\82¢ID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 正しいIDならばTRUEを返す。
  */
 static bool spell_attack(byte spell)
 {
@@ -719,10 +653,10 @@ static bool spell_attack(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\91Þ\94ð\96Ú\93I\82É\93K\82µ\82½\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が退避目的に適したモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell is good for escaping.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \93K\82µ\82½\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 適した魔法のIDならばTRUEを返す。
  */
 static bool spell_escape(byte spell)
 {
@@ -737,10 +671,10 @@ static bool spell_escape(byte spell)
 }
 
 /*!
- * @brief ID\92l\82ª\96W\8aQ\96Ú\93I\82É\93K\82µ\82½\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が妨害目的に適したモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell is good for annoying the player.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \93K\82µ\82½\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 適した魔法のIDならばTRUEを返す。
  */
 static bool spell_annoy(byte spell)
 {
@@ -767,10 +701,10 @@ static bool spell_annoy(byte spell)
 }
 
 /*!
- * @brief ID\92l\82ª\8f¢\8a«\8c^\82Ì\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が召喚型のモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell is good for annoying the player.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8f¢\8a«\8c^\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
  */
 static bool spell_summon(byte spell)
 {
@@ -783,10 +717,10 @@ static bool spell_summon(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\8e\80\8eÒ\95\9c\8a\88\8f\88\97\9d\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が死者復活処理かどうかを返す /
  * Return TRUE if a spell is good for annoying the player.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8e\80\8eÒ\95\9c\8a\88\82Ì\8f\88\97\9d\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 死者復活の処理ならばTRUEを返す。
  */
 static bool spell_raise(byte spell)
 {
@@ -798,10 +732,10 @@ static bool spell_raise(byte spell)
 }
 
 /*!
- * @brief ID\92l\82ª\90í\8fp\93I\82È\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が戦術的なモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell is good in a tactical situation.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \90í\8fp\93I\82È\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 戦術的な魔法のIDならばTRUEを返す。
  */
 static bool spell_tactic(byte spell)
 {
@@ -813,10 +747,10 @@ static bool spell_tactic(byte spell)
 }
 
 /*!
- * @brief ID\92l\82ª\96³\93G\89»\82·\82é\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が無敵化するモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell makes invulnerable.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8f¢\8a«\8c^\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
  */
 static bool spell_invulner(byte spell)
 {
@@ -828,10 +762,10 @@ static bool spell_invulner(byte spell)
 }
 
 /*!
- * @brief ID\92l\82ª\89Á\91¬\82·\82é\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が加速するモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell hastes.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8f¢\8a«\8c^\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
  */
 static bool spell_haste(byte spell)
 {
@@ -844,10 +778,10 @@ static bool spell_haste(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\8e\9e\8aÔ\92â\8e~\82ð\8ds\82¤\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が時間停止を行うモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell world.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8e\9e\8aÔ\92â\8e~\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 時間停止魔法のIDならばTRUEを返す。
  */
 static bool spell_world(byte spell)
 {
@@ -857,10 +791,10 @@ static bool spell_world(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\93Á\95Ê\8cø\89Ê\82Ì\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が特別効果のモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell special.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \93Á\95Ê\8cø\89Ê\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 特別効果魔法のIDならばTRUEを返す。
  */
 static bool spell_special(byte spell)
 {
@@ -871,10 +805,10 @@ static bool spell_special(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\8cõ\82Ì\8c\95\82Ì\83\82\83\93\83X\83^\81[\96\82\96@ID\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が光の剣のモンスター魔法IDかどうかを返す /
  * Return TRUE if a spell psycho-spear.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8cõ\82Ì\8c\95\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 光の剣のIDならばTRUEを返す。
  */
 static bool spell_psy_spe(byte spell)
 {
@@ -887,10 +821,10 @@ static bool spell_psy_spe(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\8e¡\96ü\96\82\96@\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が治癒魔法かどうかを返す /
  * Return TRUE if a spell is good for healing.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \8e¡\96ü\96\82\96@\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 治癒魔法のIDならばTRUEを返す。
  */
 static bool spell_heal(byte spell)
 {
@@ -903,10 +837,10 @@ static bool spell_heal(byte spell)
 
 
 /*!
- * @brief ID\92l\82ª\96\82\97Í\8fÁ\8b\8e\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が魔力消去かどうかを返す /
  * Return TRUE if a spell is good for dispel.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \96\82\97Í\8fÁ\8b\8e\82ÌID\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 魔力消去のIDならばTRUEを返す。
  */
 static bool spell_dispel(byte spell)
 {
@@ -919,12 +853,12 @@ static bool spell_dispel(byte spell)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82ª\83v\83\8c\83C\83\84\81[\82É\96\82\97Í\8fÁ\8b\8e\82ð\97^\82¦\82é\82×\82«\82©\82ð\94»\92è\82·\82é\83\8b\81[\83`\83\93
+ * @brief モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン
  * Check should monster cast dispel spell.
- * @param m_idx \83\82\83\93\83X\83^\81[\82Ì\8d\\91¢\91Ì\94z\97ñID
- * @return \96\82\97Í\8fÁ\8b\8e\82ð\82©\82¯\82é\82×\82«\82È\82çTRUE\82ð\95Ô\82·\81B
+ * @param m_idx モンスターの構造体配列ID
+ * @return 魔力消去をかけるべきならTRUEを返す。
  */
-bool dispel_check(int m_idx)
+bool dispel_check(MONSTER_IDX m_idx)
 {
        monster_type *m_ptr = &m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
@@ -1023,12 +957,12 @@ bool dispel_check(int m_idx)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\96\82\96@\91I\91ð\83\8b\81[\83`\83\93
+ * @brief モンスターの魔法選択ルーチン
  * Have a monster choose a spell from a list of "useful" spells.
- * @param m_idx \83\82\83\93\83X\83^\81[\82Ì\8d\\91¢\91Ì\94z\97ñID
- * @param spells \8có\95â\96\82\96@ID\82ð\82Ü\82Æ\82ß\82½\94z\97ñ
- * @param num spells\82Ì\92·\82³
- * @return \91I\91ð\82µ\82½\83\82\83\93\83X\83^\81[\96\82\96@\82ÌID
+ * @param m_idx モンスターの構造体配列ID
+ * @param spells 候補魔法IDをまとめた配列
+ * @param num spellsの長さ
+ * @return 選択したモンスター魔法のID
  * @details
  * Note that this list does NOT include spells that will just hit\n
  * other monsters, and the list is restricted when the monster is\n
@@ -1041,7 +975,7 @@ bool dispel_check(int m_idx)
  *\n
  * This function may well be an efficiency bottleneck.\n
  */
-static int choose_attack_spell(int m_idx, byte spells[], byte num)
+static int choose_attack_spell(MONSTER_IDX m_idx, byte spells[], byte num)
 {
        monster_type *m_ptr = &m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
@@ -1174,7 +1108,7 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num)
        }
 
        /* Player is close and we have attack spells, blink away */
-       if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
+       if ((distance(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->a_ability_flags2 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
        {
                /* Choose tactical spell */
                if (tactic_num) return (tactic[randint0(tactic_num)]);
@@ -1265,12 +1199,12 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num)
 
 
 /*!
- * @brief ID\92l\82ª\94ñ\96\82\8fp\93I\82È\93Á\8eê\8bZ\94\\82©\82Ç\82¤\82©\82ð\95Ô\82· /
+ * @brief ID値が非魔術的な特殊技能かどうかを返す /
  * Return TRUE if a spell is inate spell.
- * @param spell \94»\92è\91Î\8fÛ\82ÌID
- * @return \94ñ\96\82\8fp\93I\82È\93Á\8eê\8bZ\94\\82È\82ç\82ÎTRUE\82ð\95Ô\82·\81B
+ * @param spell 判定対象のID
+ * @return 非魔術的な特殊技能ならばTRUEを返す。
  */
-bool spell_is_inate(u16b spell)
+bool spell_is_inate(SPELL_IDX spell)
 {
        if (spell < 32 * 4) /* Set RF4 */
        {
@@ -1291,16 +1225,16 @@ bool spell_is_inate(u16b spell)
 
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82ª\83v\83\8c\83C\83\84\81[\82É\83_\83\81\81[\83W\82ð\97^\82¦\82é\82½\82ß\82Ì\8dÅ\93K\82È\8dÀ\95W\82ð\8eZ\8fo\82·\82é /
- * @param m_ptr \8bZ\94\\82ð\8eg\97p\82·\82é\83\82\83\93\83X\83^\81[\8d\\91¢\91Ì\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
- * @param yp \8dÅ\93K\82È\96Ú\95W\92n\93_\82ÌY\8dÀ\95W\82ð\95Ô\82·\8eQ\8fÆ\83|\83C\83\93\83^
- * @param xp \8dÅ\93K\82È\96Ú\95W\92n\93_\82ÌX\8dÀ\95W\82ð\95Ô\82·\8eQ\8fÆ\83|\83C\83\93\83^
- * @param f_flag \8eË\90ü\82É\93ü\82ê\82é\82Ì\82ð\94ð\82¯\82é\92n\8c`\82Ì\8f\8a\8e\9d\83t\83\89\83O
- * @param path_check \8eË\90ü\82ð\94»\92è\82·\82é\82½\82ß\82Ì\8aÖ\90\94\83|\83C\83\93\83^
- * @return \97L\8cø\82È\8dÀ\95W\82ª\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ * @brief モンスターがプレイヤーにダメージを与えるための最適な座標を算出する /
+ * @param m_ptr 技能を使用するモンスター構造体の参照ポインタ
+ * @param yp 最適な目標地点のY座標を返す参照ポインタ
+ * @param xp 最適な目標地点のX座標を返す参照ポインタ
+ * @param f_flag 射線に入れるのを避ける地形の所持フラグ
+ * @param path_check 射線を判定するための関数ポインタ
+ * @return 有効な座標があった場合TRUEを返す
  */
-static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
-       int f_flag, bool (*path_check)(int, int, int, int))
+static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp,
+       int f_flag, bool (*path_check)(POSITION, POSITION, POSITION, POSITION))
 {
        int i;
        int tonari;
@@ -1313,9 +1247,9 @@ static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
                                             {-1,  0,  1, -1,  1, -1,  0,  1},
                                             { 1,  0, -1,  1, -1,  1,  0, -1}};
 
-       if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
-       else if (m_ptr->fy < py) tonari = 1;
-       else if (m_ptr->fx < px) tonari = 2;
+       if (m_ptr->fy < p_ptr->y && m_ptr->fx < p_ptr->x) tonari = 0;
+       else if (m_ptr->fy < p_ptr->y) tonari = 1;
+       else if (m_ptr->fx < p_ptr->x) tonari = 2;
        else tonari = 3;
 
        for (i = 0; i < 8; i++)
@@ -1347,19 +1281,19 @@ static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
 #define DO_SPELL_BA_LITE 3
 
 /*!
- * @brief \83\82\83\93\83X\83^\81[\82Ì\93Á\8eê\8bZ\94\\83\81\83C\83\93\83\8b\81[\83`\83\93 /
+ * @brief モンスターの特殊技能メインルーチン /
  * Creatures can cast spells, shoot missiles, and breathe.
- * @param m_idx \83\82\83\93\83X\83^\81[\8d\\91¢\91Ì\94z\97ñ\82ÌID
- * @return \8eÀ\8dÛ\82É\93Á\8eê\8bZ\94\\82ð\97\98\97p\82µ\82½\82çTRUE\82ð\95Ô\82·
+ * @param m_idx モンスター構造体配列のID
+ * @return 実際に特殊技能を利用したらTRUEを返す
  * @details
  * Returns "TRUE" if a spell (or whatever) was (successfully) cast.\n
  *\n
- * XXX XXX XXX This function could use some work, but remember to\n
+ * This function could use some work, but remember to\n
  * keep it as optimized as possible, while retaining generic code.\n
  *\n
  * Verify the various "blind-ness" checks in the code.\n
  *\n
- * XXX XXX XXX Note that several effects should really not be "seen"\n
+ * Note that several effects should really not be "seen"\n
  * if the player is blind.  See also "effects.c" for other "mistakes".\n
  *\n
  * Perhaps monsters should breathe at locations *near* the player,\n
@@ -1404,44 +1338,34 @@ static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
  * Note the special "MFLAG_NICE" flag, which prevents a monster from using\n
  * any spell attacks until the player has had a single chance to move.\n
  */
-bool make_attack_spell(int m_idx)
+bool make_attack_spell(MONSTER_IDX m_idx)
 {
-       int             k, thrown_spell = 0, rlev, failrate;
-       byte            spell[96], num = 0;
-       u32b            f4, f5, f6;
-       monster_type    *m_ptr = &m_list[m_idx];
-       monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-       char            m_name[80];
+       int k;
+       SPELL_IDX thrown_spell = 0;
+       DEPTH rlev;
+       PERCENTAGE failrate;
+       byte spell[96], num = 0;
+       BIT_FLAGS f4, f5, f6;
+       monster_type *m_ptr = &m_list[m_idx];
+       monster_race *r_ptr = &r_info[m_ptr->r_idx];
+       GAME_TEXT m_name[MAX_NLEN];
 #ifndef JP
-       char            m_poss[80];
+       char m_poss[80];
 #endif
        bool            no_inate = FALSE;
        bool            do_spell = DO_SPELL_NONE;
        int             dam = 0;
-       u32b mode = 0L;
-       int s_num_6 = (easy_band ? 2 : 6);
-       int s_num_4 = (easy_band ? 1 : 4);
-       int rad = 0; //For elemental spells
 
-       /* Target location */
-       int x = px;
-       int y = py;
+       POSITION x = p_ptr->x;
+       POSITION y = p_ptr->y;
 
        /* Target location for lite breath */
-       int x_br_lite = 0;
-       int y_br_lite = 0;
-
-       /* Summon count */
-       int count = 0;
-
-       /* Extract the blind-ness */
-       bool blind = (p_ptr->blind ? TRUE : FALSE);
+       POSITION x_br_lite = 0;
+       POSITION y_br_lite = 0;
 
        /* Extract the "see-able-ness" */
-       bool seen = (!blind && m_ptr->ml);
-
+    bool seen = (!p_ptr->blind && m_ptr->ml);
        bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
-       bool learnable = (seen && maneable && !world_monster);
 
        /* Check "projectable" */
        bool direct;
@@ -1468,13 +1392,13 @@ bool make_attack_spell(int m_idx)
        /* Sometimes forbid inate attacks (breaths) */
        if (randint0(100) >= (r_ptr->freq_spell * 2)) no_inate = TRUE;
 
-       /* XXX XXX XXX Handle "track_target" option (?) */
+       /* Handle "track_target" option (?) */
 
 
        /* Extract the racial spell flags */
        f4 = r_ptr->flags4;
-       f5 = r_ptr->flags5;
-       f6 = r_ptr->flags6;
+       f5 = r_ptr->a_ability_flags1;
+       f6 = r_ptr->a_ability_flags2;
 
        /*** require projectable player ***/
 
@@ -1543,7 +1467,7 @@ bool make_attack_spell(int m_idx)
                }
                else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE))
                {
-                       int by = y, bx = x;
+                       POSITION by = y, bx = x;
                        get_project_point(m_ptr->fy, m_ptr->fx, &by, &bx, 0L);
                        if ((distance(by, bx, y, x) <= 3) && los(by, bx, y, x) && one_in_(5))
                        {
@@ -1585,7 +1509,6 @@ bool make_attack_spell(int m_idx)
 
        reset_target(m_ptr);
 
-       /* Extract the monster level */
        rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
 
        /* Forbid inate attacks sometimes */
@@ -1662,7 +1585,7 @@ bool make_attack_spell(int m_idx)
                if (((f4 & RF4_BOLT_MASK) ||
                     (f5 & RF5_BOLT_MASK) ||
                     (f6 & RF6_BOLT_MASK)) &&
-                   !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
+                   !clean_shot(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x, FALSE))
                {
                        /* Remove spells that will only hurt friends */
                        f4 &= ~(RF4_BOLT_MASK);
@@ -1705,19 +1628,19 @@ bool make_attack_spell(int m_idx)
        /* Extract the "inate" spells */
        for (k = 0; k < 32; k++)
        {
-               if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
+        if (f4 & (1L << k)) spell[num++] = k + RF4_SPELL_START;
        }
 
        /* Extract the "normal" spells */
        for (k = 0; k < 32; k++)
        {
-               if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
+        if (f5 & (1L << k)) spell[num++] = k + RF5_SPELL_START;
        }
 
        /* Extract the "bizarre" spells */
        for (k = 0; k < 32; k++)
        {
-               if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
+        if (f6 & (1L << k)) spell[num++] = k + RF6_SPELL_START;
        }
 
        /* No spells left */
@@ -1779,9 +1702,8 @@ bool make_attack_spell(int m_idx)
        if (!spell_is_inate(thrown_spell)
            && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate)))
        {
-               disturb(1, 1);
-               /* Message */
-               msg_format(_("%^s\82Í\8eô\95\82ð\8f¥\82¦\82æ\82¤\82Æ\82µ\82½\82ª\8e¸\94s\82µ\82½\81B", "%^s tries to cast a spell, but fails."), m_name);
+               disturb(TRUE, TRUE);
+               msg_format(_("%^sは呪文を唱えようとしたが失敗した。", "%^s tries to cast a spell, but fails."), m_name);
 
                return (TRUE);
        }
@@ -1789,7 +1711,7 @@ bool make_attack_spell(int m_idx)
        /* Hex: Anti Magic Barrier */
        if (!spell_is_inate(thrown_spell) && magic_barrier(m_idx))
        {
-               msg_format(_("\94½\96\82\96@\83o\83\8a\83A\82ª%^s\82Ì\8eô\95\82ð\82©\82«\8fÁ\82µ\82½\81B", "Anti magic barrier cancels the spell which %^s casts."), m_name);
+               msg_format(_("反魔法バリアが%^sの呪文をかき消した。", "Anti magic barrier cancels the spell which %^s casts."), m_name);
                return (TRUE);
        }
 
@@ -1821,1569 +1743,25 @@ bool make_attack_spell(int m_idx)
             case 128 + 24:  /* RF5_BO_PLAS */
             case 128 + 25:  /* RF5_BO_ICEE */
             case 128 + 26:  /* RF5_MISSILE */
+            case 128 + 27:  /* RF5_SCARE */
+            case 128 + 28:  /* RF5_BLIND */
+            case 128 + 29:  /* RF5_CONF */
+            case 128 + 30:  /* RF5_SLOW */
+            case 128 + 31:  /* RF5_HOLD */
+            case 160 + 1:   /* RF6_HAND_DOOM */
+            case 160 + 8:   /* RF6_TELE_TO */
+            case 160 + 9:   /* RF6_TELE_AWAY */
+            case 160 + 10:  /* RF6_TELE_LEVEL */
+            case 160 + 11:  /* RF6_PSY_SPEAR */
+            case 160 + 12:  /* RF6_DARKNESS */
+            case 160 + 14:  /* RF6_FORGET */
                 return (FALSE);
         }
     }
 
-       /* Cast the spell. */
-       switch (thrown_spell)
-       {
-        case 96 + 0:   spell_RF4_SHRIEK(m_idx, m_name); break;  /* RF4_SHRIEK */
-        case 96 + 1:   break;   /* RF4_XXX1 */
-        case 96 + 2:   spell_RF4_DISPEL(blind, m_name); break;  /* RF4_DISPEL */
-        case 96 + 3:   spell_RF4_ROCKET(blind, m_name, m_ptr, y, x, m_idx, learnable); break;   /* RF4_ROCKET */
-        case 96 + 4:   spell_RF4_SHOOT(blind, m_name, r_ptr, m_idx, learnable); break;    /* RF4_SHOOT */
-        case 96 + 5:   break;   /* RF4_XXX2 */
-        case 96 + 6:   break;   /* RF4_XXX3 */
-        case 96 + 7:   break;   /* RF4_XXX4 */
-        case 96 + 8:   spell_RF4_BREATH(GF_ACID, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_ACID */
-        case 96 + 9:   spell_RF4_BREATH(GF_ELEC, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_ELEC */
-        case 96 + 10:  spell_RF4_BREATH(GF_FIRE, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_FIRE */
-        case 96 + 11:  spell_RF4_BREATH(GF_COLD, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_COLD */
-        case 96 + 12:  spell_RF4_BREATH(GF_POIS, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_POIS */
-        case 96 + 13:  spell_RF4_BREATH(GF_NETHER, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_NETH */
-        case 96 + 14:  spell_RF4_BREATH(GF_LITE, blind, m_name, m_ptr, y_br_lite, x_br_lite, m_idx, learnable); break;    /* RF4_BR_LITE */
-        case 96 + 15:  spell_RF4_BREATH(GF_DARK, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_DARK */
-        case 96 + 16:  spell_RF4_BREATH(GF_CONFUSION, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_CONF */
-        case 96 + 17:  spell_RF4_BREATH(GF_SOUND, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_SOUN */
-        case 96 + 18:  spell_RF4_BREATH(GF_CHAOS, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_CHAO */
-        case 96 + 19:  spell_RF4_BREATH(GF_DISENCHANT, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_DISE */
-        case 96 + 20:  spell_RF4_BREATH(GF_NEXUS, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_NEXU */
-        case 96 + 21:  spell_RF4_BREATH(GF_TIME, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_TIME */
-        case 96 + 22:  spell_RF4_BREATH(GF_INERTIA, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_INER */
-        case 96 + 23:  spell_RF4_BREATH(GF_GRAVITY, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_GRAV */
-        case 96 + 24:  spell_RF4_BREATH(GF_SHARDS, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_SHAR */
-        case 96 + 25:  spell_RF4_BREATH(GF_PLASMA, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_PLAS */
-        case 96 + 26:  spell_RF4_BREATH(GF_FORCE, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_WALL */
-        case 96 + 27:  spell_RF4_BREATH(GF_MANA, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_MANA */
-        case 96 + 28:  spell_RF4_BA_NUKE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;   /* RF4_BA_NUKE */
-        case 96 + 29:  spell_RF4_BREATH(GF_NUKE, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_NUKE */
-        case 96 + 30:  spell_RF4_BA_CHAO(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;  /* RF4_BA_CHAO */
-        case 96 + 31:  spell_RF4_BREATH(GF_DISINTEGRATE, blind, m_name, m_ptr, y, x, m_idx, learnable); break;    /* RF4_BR_DISI */
-        case 128 + 0:  spell_RF5_BA_ACID(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_ACID */
-        case 128 + 1:  spell_RF5_BA_ELEC(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_ELEC */
-        case 128 + 2:  spell_RF5_BA_FIRE(m_ptr, blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_FIRE */
-        case 128 + 3:  spell_RF5_BA_COLD(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_COLD */
-        case 128 + 4:  spell_RF5_BA_POIS(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_POIS */
-        case 128 + 5:  spell_RF5_BA_NETH(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_NETH */
-        case 128 + 6:  spell_RF5_BA_WATE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_WATE */
-        case 128 + 7:  spell_RF5_BA_MANA(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_MANA */
-        case 128 + 8:  spell_RF5_BA_DARK(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_DARK */
-        case 128 + 9:  spell_RF5_DRAIN_MANA(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_DRAIN_MANA */
-        case 128 + 10: spell_RF5_MIND_BLAST(seen, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_MIND_BLAST */
-        case 128 + 11: spell_RF5_BRAIN_SMASH(seen, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_MIND_BLAST */
-        case 128 + 12: spell_RF5_CAUSE_1(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_CAUSE_1 */
-        case 128 + 13: spell_RF5_CAUSE_2(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_CAUSE_2 */
-        case 128 + 14: spell_RF5_CAUSE_3(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_CAUSE_3 */
-        case 128 + 15: spell_RF5_CAUSE_4(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_CAUSE_4 */
-        case 128 + 16: spell_RF5_BO_ACID(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_ACID */
-        case 128 + 17: spell_RF5_BO_ELEC(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_ELEC */
-        case 128 + 18: spell_RF5_BO_FIRE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_FIRE */
-        case 128 + 19: spell_RF5_BO_COLD(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_COLD */
-        case 128 + 20: spell_RF5_BA_LITE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BA_LITE */
-        case 128 + 21: spell_RF5_BO_NETH(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_NETH */
-        case 128 + 22: spell_RF5_BO_WATE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_WATE */
-        case 128 + 23: spell_RF5_BO_MANA(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_MANA */
-        case 128 + 24: spell_RF5_BO_PLAS(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_PLAS */
-        case 128 + 25: spell_RF5_BO_ICEE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_BO_ICEE */
-        case 128 + 26: spell_RF5_MISSILE(blind, m_name, r_ptr, rlev, y, x, m_idx, learnable); break;    /* RF5_MISSILE */
-
-               /* RF5_SCARE */
-               case 128+27:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82­\82Æ\81A\8b°\82ë\82µ\82°\82È\89¹\82ª\95·\82±\82¦\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\8b°\82ë\82µ\82°\82È\8c\8ao\82ð\8dì\82è\8fo\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s casts a fearful illusion.", m_name);
-#endif
-
-                       if (p_ptr->resist_fear)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8b°\95|\82É\90N\82³\82ê\82È\82©\82Á\82½\81B");
-#else
-                               msg_print("You refuse to be frightened.");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8b°\95|\82É\90N\82³\82ê\82È\82©\82Á\82½\81B");
-#else
-                               msg_print("You refuse to be frightened.");
-#endif
-
-                       }
-                       else
-                       {
-                               (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
-                       }
-                       learn_spell(MS_SCARE);
-                       update_smart_learn(m_idx, DRS_FEAR);
-                       break;
-               }
-
-               /* RF5_BLIND */
-               case 128+28:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\8eô\95\82ð\8f¥\82¦\82Ä\82 \82È\82½\82Ì\96Ú\82ð\82­\82ç\82Ü\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s casts a spell, burning your eyes!", m_name);
-#endif
-
-                       if (p_ptr->resist_blind)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\89Ê\82ª\82È\82©\82Á\82½\81I");
-#else
-                               msg_print("You are unaffected!");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\97Í\82ð\92µ\82Ë\95Ô\82µ\82½\81I");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
-                       }
-                       else
-                       {
-                               (void)set_blind(12 + randint0(4));
-                       }
-                       learn_spell(MS_BLIND);
-                       update_smart_learn(m_idx, DRS_BLIND);
-                       break;
-               }
-
-               /* RF5_CONF */
-               case 128+29:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82­\82Æ\81A\93ª\82ð\94Y\82Ü\82·\89¹\82ª\82µ\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\97U\98f\93I\82È\8c\8ao\82ð\8dì\82è\8fo\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s creates a mesmerising illusion.", m_name);
-#endif
-
-                       if (p_ptr->resist_conf)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8c\8ao\82É\82Í\82¾\82Ü\82³\82ê\82È\82©\82Á\82½\81B");
-#else
-                               msg_print("You disbelieve the feeble spell.");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8c\8ao\82É\82Í\82¾\82Ü\82³\82ê\82È\82©\82Á\82½\81B");
-#else
-                               msg_print("You disbelieve the feeble spell.");
-#endif
-
-                       }
-                       else
-                       {
-                               (void)set_confused(p_ptr->confused + randint0(4) + 4);
-                       }
-                       learn_spell(MS_CONF);
-                       update_smart_learn(m_idx, DRS_CONF);
-                       break;
-               }
-
-               /* RF5_SLOW */
-               case 128+30:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-msg_format("%^s\82ª\82 \82È\82½\82Ì\8bØ\97Í\82ð\8bz\82¢\8eæ\82ë\82¤\82Æ\82µ\82½\81I", m_name);
-#else
-                       msg_format("%^s drains power from your muscles!", m_name);
-#endif
-
-                       if (p_ptr->free_act)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\89Ê\82ª\82È\82©\82Á\82½\81I");
-#else
-                               msg_print("You are unaffected!");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\97Í\82ð\92µ\82Ë\95Ô\82µ\82½\81I");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
-                       }
-                       else
-                       {
-                               (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
-                       }
-                       learn_spell(MS_SLOW);
-                       update_smart_learn(m_idx, DRS_FREE);
-                       break;
-               }
-
-               /* RF5_HOLD */
-               case 128+31:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\82 \82È\82½\82Ì\96Ú\82ð\82\82Á\82Æ\8c©\82Â\82ß\82½\81I", m_name);
-#else
-                       else msg_format("%^s stares deep into your eyes!", m_name);
-#endif
-
-                       if (p_ptr->free_act)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\89Ê\82ª\82È\82©\82Á\82½\81I");
-#else
-                               msg_print("You are unaffected!");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_format("\82µ\82©\82µ\8cø\97Í\82ð\92µ\82Ë\95Ô\82µ\82½\81I");
-#else
-                               msg_format("You resist the effects!");
-#endif
-
-                       }
-                       else
-                       {
-                               (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
-                       }
-                       learn_spell(MS_SLEEP);
-                       update_smart_learn(m_idx, DRS_FREE);
-                       break;
-               }
-
-               /* RF6_HASTE */
-               case 160+0:
-               {
-                       disturb(1, 1);
-                       if (blind)
-                       {
-#ifdef JP
-msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                               msg_format("%^s mumbles.", m_name);
-#endif
-
-                       }
-                       else
-                       {
-#ifdef JP
-msg_format("%^s\82ª\8e©\95ª\82Ì\91Ì\82É\94O\82ð\91\97\82Á\82½\81B", m_name);
-#else
-                               msg_format("%^s concentrates on %s body.", m_name, m_poss);
-#endif
-
-                       }
-
-                       /* Allow quick speed increases to base+10 */
-                       if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
-                       {
-#ifdef JP
-                               msg_format("%^s\82Ì\93®\82«\82ª\91¬\82­\82È\82Á\82½\81B", m_name);
-#else
-                               msg_format("%^s starts moving faster.", m_name);
-#endif
-                       }
-                       break;
-               }
-
-               /* RF6_HAND_DOOM */
-               case 160+1:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-msg_format("%^s\82ª<\94j\96Å\82Ì\8eè>\82ð\95ú\82Á\82½\81I", m_name);
-#else
-                       msg_format("%^s invokes the Hand of Doom!", m_name);
-#endif
-                       dam = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
-                       breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, learnable);
-                       break;
-               }
-
-               /* RF6_HEAL */
-               case 160+2:
-               {
-                       disturb(1, 1);
-
-                       /* Message */
-                       if (blind)
-                       {
-#ifdef JP
-msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                               msg_format("%^s mumbles.", m_name);
-#endif
-
-                       }
-                       else
-                       {
-#ifdef JP
-msg_format("%^s\82ª\8e©\95ª\82Ì\8f\9d\82É\8fW\92\86\82µ\82½\81B", m_name);
-#else
-                               msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
-#endif
-
-                       }
-
-                       /* Heal some */
-                       m_ptr->hp += (rlev * 6);
-
-                       /* Fully healed */
-                       if (m_ptr->hp >= m_ptr->maxhp)
-                       {
-                               /* Fully healed */
-                               m_ptr->hp = m_ptr->maxhp;
-
-                               /* Message */
-                               if (seen)
-                               {
-#ifdef JP
-msg_format("%^s\82Í\8a®\91S\82É\8e¡\82Á\82½\81I", m_name);
-#else
-                                       msg_format("%^s looks completely healed!", m_name);
-#endif
-
-                               }
-                               else
-                               {
-#ifdef JP
-msg_format("%^s\82Í\8a®\91S\82É\8e¡\82Á\82½\82æ\82¤\82¾\81I", m_name);
-#else
-                                       msg_format("%^s sounds completely healed!", m_name);
-#endif
-
-                               }
-                       }
-
-                       /* Partially healed */
-                       else
-                       {
-                               /* Message */
-                               if (seen)
-                               {
-#ifdef JP
-msg_format("%^s\82Í\91Ì\97Í\82ð\89ñ\95\9c\82µ\82½\82æ\82¤\82¾\81B", m_name);
-#else
-                                       msg_format("%^s looks healthier.", m_name);
-#endif
-
-                               }
-                               else
-                               {
-#ifdef JP
-msg_format("%^s\82Í\91Ì\97Í\82ð\89ñ\95\9c\82µ\82½\82æ\82¤\82¾\81B", m_name);
-#else
-                                       msg_format("%^s sounds healthier.", m_name);
-#endif
-
-                               }
-                       }
-
-                       /* Redraw (later) if needed */
-                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-
-                       /* Cancel fear */
-                       if (MON_MONFEAR(m_ptr))
-                       {
-                               /* Cancel fear */
-                               (void)set_monster_monfear(m_idx, 0);
-
-                               /* Message */
-#ifdef JP
-                               msg_format("%^s\82Í\97E\8bC\82ð\8eæ\82è\96ß\82µ\82½\81B", m_name);
-#else
-                               msg_format("%^s recovers %s courage.", m_name, m_poss);
-#endif
-                       }
-                       break;
-               }
-
-               /* RF6_INVULNER */
-               case 160+3:
-               {
-                       disturb(1, 1);
-
-                       /* Message */
-                       if (!seen)
-                       {
-#ifdef JP
-msg_format("%^s\82ª\89½\82©\82ð\97Í\8b­\82­\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                               msg_format("%^s mumbles powerfully.", m_name);
-#endif
-
-                       }
-                       else
-                       {
-#ifdef JP
-msg_format("%s\82Í\96³\8f\9d\82Ì\8b\85\82Ì\8eô\95\82ð\8f¥\82¦\82½\81B", m_name);
-#else
-                               msg_format("%^s casts a Globe of Invulnerability.", m_name);
-#endif
-
-                       }
-
-                       if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
-                       break;
-               }
-
-               /* RF6_BLINK */
-               case 160+4:
-               {
-                       disturb(1, 1);
-                       if (teleport_barrier(m_idx))
-                       {
-#ifdef JP
-                               msg_format("\96\82\96@\82Ì\83o\83\8a\83A\82ª%^s\82Ì\83e\83\8c\83|\81[\83g\82ð\8e×\96\82\82µ\82½\81B", m_name);
-#else
-                               msg_format("Magic barrier obstructs teleporting of %^s.", m_name);
-#endif
-                       }
-                       else
-                       {
-#ifdef JP
-                               msg_format("%^s\82ª\8fu\8e\9e\82É\8fÁ\82¦\82½\81B", m_name);
-#else
-                               msg_format("%^s blinks away.", m_name);
-#endif
-                               teleport_away(m_idx, 10, 0L);
-                               p_ptr->update |= (PU_MONSTERS);
-                       }
-                       break;
-               }
-
-               /* RF6_TPORT */
-               case 160+5:
-               {
-                       disturb(1, 1);
-                       if (teleport_barrier(m_idx))
-                       {
-#ifdef JP
-                               msg_format("\96\82\96@\82Ì\83o\83\8a\83A\82ª%^s\82Ì\83e\83\8c\83|\81[\83g\82ð\8e×\96\82\82µ\82½\81B", m_name);
-#else
-                               msg_format("Magic barrier obstructs teleporting of %^s.", m_name);
-#endif
-                       }
-                       else
-                       {
-#ifdef JP
-                               msg_format("%^s\82ª\83e\83\8c\83|\81[\83g\82µ\82½\81B", m_name);
-#else
-                               msg_format("%^s teleports away.", m_name);
-#endif
-                               teleport_away_followable(m_idx);
-                       }
-                       break;
-               }
-
-               /* RF6_WORLD */
-               case 160+6:
-               {
-                       int who = 0;
-                       disturb(1, 1);
-                       if(m_ptr->r_idx == MON_DIO) who = 1;
-                       else if(m_ptr->r_idx == MON_WONG) who = 3;
-                       dam = who;
-                       if (!process_the_world(randint1(2)+2, who, TRUE)) return (FALSE);
-                       break;
-               }
-
-               /* RF6_SPECIAL */
-               case 160+7:
-               {
-                       int k;
-
-                       disturb(1, 1);
-                       switch (m_ptr->r_idx)
-                       {
-                       case MON_OHMU:
-                               /* Moved to process_monster(), like multiplication */
-                               return FALSE;
-
-                       case MON_BANORLUPART:
-                               {
-                                       int dummy_hp = (m_ptr->hp + 1) / 2;
-                                       int dummy_maxhp = m_ptr->maxhp/2;
-                                       int dummy_y = m_ptr->fy;
-                                       int dummy_x = m_ptr->fx;
-
-                                       if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
-                                       delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
-                                       summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
-                                       m_list[hack_m_idx_ii].hp = dummy_hp;
-                                       m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
-                                       summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
-                                       m_list[hack_m_idx_ii].hp = dummy_hp;
-                                       m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
-
-#ifdef JP
-                                       msg_print("\81w\83o\81[\83m\81[\83\8b\81E\83\8b\83p\81[\83g\81x\82ª\95ª\97ô\82µ\82½\81I");
-#else
-                                       msg_print("Banor=Rupart splits in two person!");
-#endif
-
-                                       break;
-                               }
-
-                       case MON_BANOR:
-                       case MON_LUPART:
-                               {
-                                       int dummy_hp = 0;
-                                       int dummy_maxhp = 0;
-                                       int dummy_y = m_ptr->fy;
-                                       int dummy_x = m_ptr->fx;
-
-                                       if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
-                                       for (k = 1; k < m_max; k++)
-                                       {
-                                               if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
-                                               {
-                                                       dummy_hp += m_list[k].hp;
-                                                       dummy_maxhp += m_list[k].maxhp;
-                                                       if (m_list[k].r_idx != m_ptr->r_idx)
-                                                       {
-                                                               dummy_y = m_list[k].fy;
-                                                               dummy_x = m_list[k].fx;
-                                                       }
-                                                       delete_monster_idx(k);
-                                               }
-                                       }
-                                       summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
-                                       m_list[hack_m_idx_ii].hp = dummy_hp;
-                                       m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
-
-#ifdef JP
-                                       msg_print("\81w\83o\81[\83m\81[\83\8b\81x\82Æ\81w\83\8b\83p\81[\83g\81x\82ª\8d\87\91Ì\82µ\82½\81I");
-#else
-                                       msg_print("Banor and Rupart combine into one!");
-#endif
-
-                                       break;
-                               }
-
-                       case MON_ROLENTO:
-#ifdef JP
-                               if (blind) msg_format("%^s\82ª\89½\82©\91å\97Ê\82É\93\8a\82°\82½\81B", m_name);
-                               else msg_format("%^s\82Í\8eè\9eÖ\92e\82ð\82Î\82ç\82Ü\82¢\82½\81B", m_name);
-#else
-                               if (blind) msg_format("%^s spreads something.", m_name);
-                               else msg_format("%^s throws some hand grenades.", m_name);
-#endif
-
-                               {
-                                       int num = 1 + randint1(3);
-
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
-                                       }
-                               }
-#ifdef JP
-                               if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\82Î\82ç\82Ü\82©\82ê\82é\89¹\82ª\82·\82é\81B");
-#else
-                               if (blind && count) msg_print("You hear many things are scattered nearby.");
-#endif
-                               break;
-
-                       default:
-                               if (r_ptr->d_char == 'B')
-                               {
-                                       disturb(1, 1);
-                                       if (one_in_(3) || !direct)
-                                       {
-#ifdef JP
-                                               msg_format("%^s\82Í\93Ë\91R\8e\8b\8aE\82©\82ç\8fÁ\82¦\82½!", m_name);
-#else
-                                               msg_format("%^s suddenly go out of your sight!", m_name);
-#endif
-                                               teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
-                                               p_ptr->update |= (PU_MONSTERS);
-                                       }
-                                       else
-                                       {
-                                               int get_damage = 0;
-                                               bool fear; /* dummy */
-
-#ifdef JP
-                                               msg_format("%^s\82ª\82 \82È\82½\82ð\92Í\82ñ\82Å\8bó\92\86\82©\82ç\93\8a\82°\97\8e\82Æ\82µ\82½\81B", m_name);
-#else
-                                               msg_format("%^s holds you, and drops from the sky.", m_name);
-#endif
-                                               dam = damroll(4, 8);
-                                               teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-
-                                               sound(SOUND_FALL);
-
-                                               if (p_ptr->levitation)
-                                               {
-#ifdef JP
-                                                       msg_print("\82 \82È\82½\82Í\90Ã\82©\82É\92\85\92n\82µ\82½\81B");
-#else
-                                                       msg_print("You float gently down to the ground.");
-#endif
-                                               }
-                                               else
-                                               {
-#ifdef JP
-                                                       msg_print("\82 \82È\82½\82Í\92n\96Ê\82É\92@\82«\82Â\82¯\82ç\82ê\82½\81B");
-#else
-                                                       msg_print("You crashed into the ground.");
-#endif
-                                                       dam += damroll(6, 8);
-                                               }
-
-                                               /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
-                                                  -- henkma
-                                                */
-                                               get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
-                                               if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
-                                               {
-#ifdef JP
-                                                       msg_format("\8dU\8c\82\82ª%s\8e©\90g\82ð\8f\9d\82Â\82¯\82½\81I", m_name);
-#else
-                                                       char m_name_self[80];
-
-                                                       /* hisself */
-                                                       monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
-
-                                                       msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
-#endif
-                                                       project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
-                                                       set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
-                                               }
-
-                                               if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx);
-                                       }
-                                       break;
-                               }
-
-                               /* Something is wrong */
-                               else return FALSE;
-                       }
-                       break;
-               }
-
-               /* RF6_TELE_TO */
-               case 160+8:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-msg_format("%^s\82ª\82 \82È\82½\82ð\88ø\82«\96ß\82µ\82½\81B", m_name);
-#else
-                       msg_format("%^s commands you to return.", m_name);
-#endif
-
-                       teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
-                       learn_spell(MS_TELE_TO);
-                       break;
-               }
-
-               /* RF6_TELE_AWAY */
-               case 160+9:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-msg_format("%^s\82É\83e\83\8c\83|\81[\83g\82³\82¹\82ç\82ê\82½\81B", m_name);
-                       if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
-                               msg_print("\82­\82Á\82»\81`");
-#else
-                       msg_format("%^s teleports you away.", m_name);
-#endif
-
-                       learn_spell(MS_TELE_AWAY);
-                       teleport_player_away(m_idx, 100);
-                       break;
-               }
-
-               /* RF6_TELE_LEVEL */
-               case 160+10:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\8aï\96­\82È\8c¾\97t\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles strangely.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\82 \82È\82½\82Ì\91«\82ð\8ew\82³\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s gestures at your feet.", m_name);
-#endif
-
-                       if (p_ptr->resist_nexus)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\89Ê\82ª\82È\82©\82Á\82½\81I");
-#else
-                               msg_print("You are unaffected!");
-#endif
-
-                       }
-                       else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\97Í\82ð\92µ\82Ë\95Ô\82µ\82½\81I");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
-                       }
-                       else
-                       {
-                               teleport_level(0);
-                       }
-                       learn_spell(MS_TELE_LEVEL);
-                       update_smart_learn(m_idx, DRS_NEXUS);
-                       break;
-               }
-
-               /* RF6_PSY_SPEAR */
-               case 160+11:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\8cõ\82Ì\8c\95\82ð\95ú\82Á\82½\81B", m_name);
-#else
-                       else msg_format("%^s throw a Psycho-Spear.", m_name);
-#endif
-
-                       dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
-                       beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
-                       break;
-               }
-
-               /* RF6_DARKNESS */
-               case 160+12:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-                       if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-                       else if (can_use_lite_area) msg_format("%^s\82ª\95Ó\82è\82ð\96¾\82é\82­\8fÆ\82ç\82µ\82½\81B", m_name);
-                       else msg_format("%^s\82ª\88Ã\88Å\82Ì\92\86\82Å\8eè\82ð\90U\82Á\82½\81B", m_name);
-#else
-                       else if (can_use_lite_area) msg_format("%^s cast a spell to light up.", m_name);
-                       else msg_format("%^s gestures in shadow.", m_name);
-#endif
-
-                       if (can_use_lite_area) (void)lite_area(0, 3);
-                       else
-                       {
-                               learn_spell(MS_DARKNESS);
-                               (void)unlite_area(0, 3);
-                       }
-                       break;
-               }
-
-               /* RF6_TRAPS */
-               case 160+13:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82Ä\8e×\88«\82É\94÷\8fÎ\82ñ\82¾\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\8eô\95\82ð\8f¥\82¦\82Ä\8e×\88«\82É\94÷\8fÎ\82ñ\82¾\81B", m_name);
-#else
-                       else msg_format("%^s casts a spell and cackles evilly.", m_name);
-#endif
-
-                       learn_spell(MS_MAKE_TRAP);
-                       (void)trap_creation(y, x);
-                       break;
-               }
-
-               /* RF6_FORGET */
-               case 160+14:
-               {
-                       if (!direct) return (FALSE);
-                       disturb(1, 1);
-#ifdef JP
-msg_format("%^s\82ª\82 \82È\82½\82Ì\8bL\89¯\82ð\8fÁ\8b\8e\82µ\82æ\82¤\82Æ\82µ\82Ä\82¢\82é\81B", m_name);
-#else
-                       msg_format("%^s tries to blank your mind.", m_name);
-#endif
-
-
-                       if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("\82µ\82©\82µ\8cø\97Í\82ð\92µ\82Ë\95Ô\82µ\82½\81I");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
-                       }
-                       else if (lose_all_info())
-                       {
-#ifdef JP
-msg_print("\8bL\89¯\82ª\94\96\82ê\82Ä\82µ\82Ü\82Á\82½\81B");
-#else
-                               msg_print("Your memories fade away.");
-#endif
-
-                       }
-                       learn_spell(MS_FORGET);
-                       break;
-               }
-
-               /* RF6_RAISE_DEAD */
-               case 160+15:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\8e\80\8eÒ\95\9c\8a\88\82Ì\8eô\95\82ð\8f¥\82¦\82½\81B", m_name);
-#else
-                       else msg_format("%^s casts a spell to revive corpses.", m_name);
-#endif
-                       animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
-                       break;
-               }
-
-               /* RF6_S_KIN */
-               case 160+16:
-               {
-                       disturb(1, 1);
-                       if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
-                       {
-#ifdef JP
-                               if (blind)
-                                       msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-                               else
-                                       msg_format("%^s\82ª\83_\83\93\83W\83\87\83\93\82Ì\8eå\82ð\8f¢\8a«\82µ\82½\81B", m_name);
-#else
-                               if (blind)
-                                       msg_format("%^s mumbles.", m_name);
-                               else
-                                       msg_format("%^s magically summons guardians of dungeons.", m_name);
-#endif
-                       }
-                       else
-                       {
-#ifdef JP
-                               if (blind)
-                                       msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-                               else
-                                       msg_format("%^s\82Í\96\82\96@\82Å%s\82ð\8f¢\8a«\82µ\82½\81B",
-                                       m_name,
-                                       ((r_ptr->flags1) & RF1_UNIQUE ?
-                                       "\8eè\89º" : "\92\87\8aÔ"));
-#else
-                               if (blind)
-                                       msg_format("%^s mumbles.", m_name);
-                               else
-                                       msg_format("%^s magically summons %s %s.",
-                                       m_name, m_poss,
-                                       ((r_ptr->flags1) & RF1_UNIQUE ?
-                                       "minions" : "kin"));
-#endif
-                       }
-
-                       switch (m_ptr->r_idx)
-                       {
-                       case MON_MENELDOR:
-                       case MON_GWAIHIR:
-                       case MON_THORONDOR:
-                               {
-                                       int num = 4 + randint1(3);
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                                       }
-                               }
-                               break;
-
-                       case MON_BULLGATES:
-                               {
-                                       int num = 2 + randint1(3);
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_named_creature(m_idx, y, x, MON_IE, mode);
-                                       }
-                               }
-                               break;
-
-                       case MON_SERPENT:
-                       case MON_ZOMBI_SERPENT:
-                               {
-                                       int num = 2 + randint1(3);
-
-                                       if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
-                                       {
-#ifdef JP
-                                               msg_print("\92n\96Ê\82©\82ç\90\85\82ª\90\81\82«\8fo\82µ\82½\81I");
-#else
-                                               msg_print("Water blew off from the ground!");
-#endif
-                                               fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
-                                       }
-
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                                       }
-                               }
-                               break;
-
-                       case MON_CALDARM:
-                               {
-                                       int num = randint1(3);
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode);
-                                       }
-                               }
-                               break;
-
-                       case MON_LOUSY:
-                               {
-                                       int num = 2 + randint1(3);
-                                       for (k = 0; k < num; k++)
-                                       {
-                                               count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
-                                       }
-                               }
-                               break;
-
-                       default:
-                               summon_kin_type = r_ptr->d_char; /* Big hack */
-
-                               for (k = 0; k < 4; k++)
-                               {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
-                               }
-                               break;
-                       }
-#ifdef JP
-                       if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_CYBER */
-               case 160+17:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\83T\83C\83o\81[\83f\81[\83\82\83\93\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons Cyberdemons!", m_name);
-#endif
-
-#ifdef JP
-if (blind && count) msg_print("\8fd\8cú\82È\91«\89¹\82ª\8bß\82­\82Å\95·\82±\82¦\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear heavy steps nearby.");
-#endif
-
-                       summon_cyber(m_idx, y, x);
-                       break;
-               }
-
-               /* RF6_S_MONSTER */
-               case 160+18:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\92\87\8aÔ\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons help!", m_name);
-#endif
-
-                       for (k = 0; k < 1; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-#ifdef JP
-if (blind && count) msg_print("\89½\82©\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear something appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_MONSTERS */
-               case 160+19:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83\82\83\93\83X\83^\81[\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons monsters!", m_name);
-#endif
-
-                       for (k = 0; k < s_num_6; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-#ifdef JP
-if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_ANT */
-               case 160+20:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83A\83\8a\82ð\8f¢\8a«\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s magically summons ants.", m_name);
-#endif
-
-                       for (k = 0; k < s_num_6; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_SPIDER */
-               case 160+21:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83N\83\82\82ð\8f¢\8a«\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s magically summons spiders.", m_name);
-#endif
-
-                       for (k = 0; k < s_num_6; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_HOUND */
-               case 160+22:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83n\83E\83\93\83h\82ð\8f¢\8a«\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s magically summons hounds.", m_name);
-#endif
-
-                       for (k = 0; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_HYDRA */
-               case 160+23:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83q\83h\83\89\82ð\8f¢\8a«\82µ\82½\81B", m_name);
-#else
-                       else msg_format("%^s magically summons hydras.", m_name);
-#endif
-
-                       for (k = 0; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear many things appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_ANGEL */
-               case 160+24:
-               {
-                       int num = 1;
-
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\93V\8eg\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons an angel!", m_name);
-#endif
-
-                       if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
-                       {
-                               num += r_ptr->level/40;
-                       }
-
-                       for (k = 0; k < num; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
-                       }
-
-                       if (count < 2)
-                       {
-#ifdef JP
-if (blind && count) msg_print("\89½\82©\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                               if (blind && count) msg_print("You hear something appear nearby.");
-#endif
-                       }
-                       else
-                       {
-#ifdef JP
-if (blind) msg_print("\91½\82­\82Ì\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                               if (blind) msg_print("You hear many things appear nearby.");
-#endif
-                       }
-
-                       break;
-               }
-
-               /* RF6_S_DEMON */
-               case 160+25:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82Í\96\82\96@\82Å\8d¬\93×\82Ì\8b{\92ì\82©\82ç\88«\96\82\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
-#endif
-
-                       for (k = 0; k < 1; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\89½\82©\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear something appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_UNDEAD */
-               case 160+26:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83A\83\93\83f\83b\83h\82Ì\8b­\93G\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons an undead adversary!", m_name);
-#endif
-
-                       for (k = 0; k < 1; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\89½\82©\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear something appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_DRAGON */
-               case 160+27:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\83h\83\89\83S\83\93\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons a dragon!", m_name);
-#endif
-
-                       for (k = 0; k < 1; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
-                       }
-#ifdef JP
-if (blind && count) msg_print("\89½\82©\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\82·\82é\81B");
-#else
-                       if (blind && count) msg_print("You hear something appear nearby.");
-#endif
-
-                       break;
-               }
-
-               /* RF6_S_HI_UNDEAD */
-               case 160+28:
-               {
-                       disturb(1, 1);
-
-                       if (((m_ptr->r_idx == MON_MORGOTH) || (m_ptr->r_idx == MON_SAURON) || (m_ptr->r_idx == MON_ANGMAR)) && ((r_info[MON_NAZGUL].cur_num+2) < r_info[MON_NAZGUL].max_num))
-                       {
-                               int cy = y;
-                               int cx = x;
-
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                               if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\97H\8bS\90í\91à\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                               else msg_format("%^s magically summons rangers of Nazgul!", m_name);
-#endif
-                               msg_print(NULL);
-
-                               for (k = 0; k < 30; k++)
-                               {
-                                       if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
-                                       {
-                                               int j;
-                                               for (j = 100; j > 0; j--)
-                                               {
-                                                       scatter(&cy, &cx, y, x, 2, 0);
-                                                       if (cave_empty_bold(cy, cx)) break;
-                                               }
-                                               if (!j) break;
-                                       }
-                                       if (!cave_empty_bold(cy, cx)) continue;
-
-                                       if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
-                                       {
-                                               y = cy;
-                                               x = cx;
-                                               count++;
-                                               if (count == 1)
-#ifdef JP
-msg_format("\81u\97H\8bS\90í\91à%d\8d\86\81A\83i\83Y\83O\83\8b\81E\83u\83\89\83b\83N\81I\81v", count);
-#else
-                                                       msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
-#endif
-                                               else
-#ifdef JP
-msg_format("\81u\93¯\82\82­%d\8d\86\81A\83i\83Y\83O\83\8b\81E\83u\83\89\83b\83N\81I\81v", count);
-#else
-                                                       msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
-#endif
-                                               msg_print(NULL);
-                                       }
-                               }
-#ifdef JP
-msg_format("\81u%d\90l\82»\82ë\82Á\82Ä\81A\83\8a\83\93\83O\83\8c\83\93\83W\83\83\81[\81I\81v", count);
-#else
-msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
-#endif
-                               msg_print(NULL);
-                       }
-                       else
-                       {
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                               if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\8b­\97Í\82È\83A\83\93\83f\83b\83h\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                               else msg_format("%^s magically summons greater undead!", m_name);
-#endif
-
-                               for (k = 0; k < s_num_6; k++)
-                               {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                               }
-                       }
-                       if (blind && count)
-                       {
-#ifdef JP
-msg_print("\8aÔ\8bß\82Å\89½\82©\91½\82­\82Ì\82à\82Ì\82ª\94\87\82¢\89ñ\82é\89¹\82ª\95·\82±\82¦\82é\81B");
-#else
-                               msg_print("You hear many creepy things appear nearby.");
-#endif
-
-                       }
-                       break;
-               }
-
-               /* RF6_S_HI_DRAGON */
-               case 160+29:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\8cÃ\91ã\83h\83\89\83S\83\93\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons ancient dragons!", m_name);
-#endif
-
-                       for (k = 0; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-                       if (blind && count)
-                       {
-#ifdef JP
-msg_print("\91½\82­\82Ì\97Í\8b­\82¢\82à\82Ì\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\95·\82±\82¦\82é\81B");
-#else
-                               msg_print("You hear many powerful things appear nearby.");
-#endif
-
-                       }
-                       break;
-               }
-
-               /* RF6_S_AMBERITES */
-               case 160+30:
-               {
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\83A\83\93\83o\81[\82Ì\89¤\91°\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons Lords of Amber!", m_name);
-#endif
-
-
-
-                       for (k = 0; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-                       if (blind && count)
-                       {
-#ifdef JP
-msg_print("\95s\8e\80\82Ì\8eÒ\82ª\8bß\82­\82É\8c»\82ê\82é\82Ì\82ª\95·\82±\82¦\82½\81B");
-#else
-                               msg_print("You hear immortal beings appear nearby.");
-#endif
-
-                       }
-                       break;
-               }
-
-               /* RF6_S_UNIQUE */
-               case 160+31:
-               {
-                       bool uniques_are_summoned = FALSE;
-                       int non_unique_type = SUMMON_HI_UNDEAD;
-
-                       disturb(1, 1);
-#ifdef JP
-if (blind) msg_format("%^s\82ª\89½\82©\82ð\82Â\82Ô\82â\82¢\82½\81B", m_name);
-#else
-                       if (blind) msg_format("%^s mumbles.", m_name);
-#endif
-
-#ifdef JP
-else msg_format("%^s\82ª\96\82\96@\82Å\93Á\95Ê\82È\8b­\93G\82ð\8f¢\8a«\82µ\82½\81I", m_name);
-#else
-                       else msg_format("%^s magically summons special opponents!", m_name);
-#endif
-
-                       for (k = 0; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-
-                       if (count) uniques_are_summoned = TRUE;
-
-                       if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
-                               non_unique_type = 0;
-                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
-                               non_unique_type = SUMMON_ANGEL;
-
-                       for (k = count; k < s_num_4; k++)
-                       {
-                               count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-                       }
-
-                       if (blind && count)
-                       {
-#ifdef JP
-                               msg_format("\91½\82­\82Ì%s\82ª\8aÔ\8bß\82É\8c»\82ê\82½\89¹\82ª\95·\82±\82¦\82é\81B", uniques_are_summoned ? "\97Í\8b­\82¢\82à\82Ì" : "\82à\82Ì");
-#else
-                               msg_format("You hear many %s appear nearby.", uniques_are_summoned ? "powerful things" : "things");
-#endif
-                       }
-                       break;
-               }
-       }
+    /* Cast the spell. */
+    dam = monspell_to_player(thrown_spell, y, x, m_idx);
+    if (dam < 0) return FALSE;
 
        if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
        {