OSDN Git Service

refactor: RF6_SPECIAL, RF6_TELE*
authordis- <dis.rogue@gmail.com>
Sat, 22 Feb 2014 11:47:02 +0000 (20:47 +0900)
committerdis- <dis.rogue@gmail.com>
Sat, 22 Feb 2014 11:47:02 +0000 (20:47 +0900)
src/externs.h
src/mspells1.c
src/mspells2.c
src/mspells4.c

index 06a36d7..a83d836 100644 (file)
@@ -1598,10 +1598,6 @@ extern bool spell_learnable(int m_idx);
 extern int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx);
 extern int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx);
 
-extern int spell_RF6_SPECIAL(int y, int x, int m_idx);
-extern void spell_RF6_TELE_TO(int m_idx);
-extern void spell_RF6_TELE_AWAY(int m_idx);
-extern void spell_RF6_TELE_LEVEL(int m_idx);
 extern int spell_RF6_PSY_SPEAR(int y, int x, int m_idx);
 extern void spell_RF6_DARKNESS(int m_idx);
 extern void spell_RF6_TRAPS(int y, int x, int m_idx);
index 3bd78c5..f950902 100644 (file)
@@ -507,7 +507,7 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend)
  * @param typ ¸ú²Ì°À­ID
  * @param dam_hp °ÒÎÏ
  * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¡¦E¤¥ä¡¼¤Ê¤¡¦ONSTER_TO_PLAYER
+ * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¥ì¥¤¥ä¡¼¤Ê¤éMONSTER_TO_PLAYER
  * @return ¤Ê¤·
  */
 void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -538,7 +538,7 @@ void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
  * @param typ ¸ú²Ì°À­ID
  * @param dam_hp °ÒÎÏ
  * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¡¦E¤¥ä¡¼¤Ê¤¡¦ONSTER_TO_PLAYER
+ * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¥ì¥¤¥ä¡¼¤Ê¤éMONSTER_TO_PLAYER
  * @return ¤Ê¤·
  */
 void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -572,7 +572,7 @@ void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
  * @param rad È¾·Â
  * @param breath TRUE¤Ê¤é¤Ð¥Ö¡¦E¹½èÍ¡¦¡¥ALSE¤Ê¤é¤Ð¥Ü¡¼¡¦EèÍ
  * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¡¦E¤¥ä¡¼¤Ê¤¡¦ONSTER_TO_PLAYER
+ * @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, int target_type)
index 4f06082..9109ac0 100644 (file)
@@ -739,244 +739,6 @@ bool monst_spell_monst(int m_idx)
        switch (thrown_spell)
     {
 
-       /* RF6_SPECIAL */
-       case 160+7:
-               switch (m_ptr->r_idx)
-               {
-               case MON_OHMU:
-                       /* Moved to process_monster(), like multiplication */
-                       return FALSE;
-
-               case MON_ROLENTO:
-                       if (known)
-                       {
-                               if (see_either)
-                               {
-                                       disturb(1, 1);
-
-                                       msg_format(_("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."), m_name);
-                               }
-                               else
-                               {
-                                       mon_fight = TRUE;
-                               }
-                       }
-
-                       {
-                               int num = 1 + randint1(3);
-                               for (k = 0; k < num; k++)
-                               {
-                                       count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, 0);
-                               }
-                       }
-
-                       if (known && !see_t && count)
-                       {
-                               mon_fight = TRUE;
-                       }
-                       break;
-
-               default:
-                       if (r_ptr->d_char == 'B')
-                       {
-                               if (one_in_(3))
-                               {
-                                       if (see_m)
-                                       {
-                                               msg_format(_("%^s¤ÏÆÍÁ³µÞ¾å¾º¤·¤Æ»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"), m_name);
-                                       }
-                                       teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
-                                       p_ptr->update |= (PU_MONSTERS);
-                               }
-                               else
-                               {
-                                       if (known)
-                                       {
-                                               if (see_either)
-                                               {
-                                                       msg_format(_("%^s¤¬%s¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", "%^s holds %s, and drops from the sky."), m_name, t_name);
-                                               }
-                                               else
-                                               {
-                                                       mon_fight = TRUE;
-                                               }
-                                       }
-
-                                       dam = damroll(4, 8);
-
-                                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-                                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-
-                                       sound(SOUND_FALL);
-
-                                       if (tr_ptr->flags7 & RF7_CAN_FLY)
-                                       {
-                                               if (see_t) msg_format(_("%^s¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "%^s floats gently down to the ground."), t_name);
-                                       }
-                                       else
-                                       {
-                                               if (see_t) msg_format(_("%^s¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", "%^s crashed into the ground."), t_name);
-
-                                               dam += damroll(6, 8);
-                                       }
-
-                                       if (p_ptr->riding == t_idx)
-                                       {
-                                               int get_damage = 0;
-
-                                               /* 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)
-                                               {
-                                                       char m_name_self[80];
-
-                                                       /* hisself */
-                                                       monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
-
-                                                       _(msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name),
-                                                         msg_format("The attack of %s has wounded %s!", m_name, m_name_self));
-
-                                                       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);
-                                               }
-                                       }
-
-                                       mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
-                               }
-                               break;
-                       }
-
-                       /* Something is wrong */
-                       else return FALSE;
-               }
-
-               /* done */
-               break;
-
-       /* RF6_TELE_TO */
-       case 160+8:
-               if (known)
-               {
-                       if (see_either)
-                       {
-                               msg_format(_("%^s¤¬%s¤ò°ú¤­Ìᤷ¤¿¡£", "%^s commands %s to return."), m_name, t_name);
-                       }
-                       else
-                       {
-                               mon_fight = TRUE;
-                       }
-               }
-
-               if (tr_ptr->flagsr & RFR_RES_TELE)
-               {
-                       if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
-                       {
-                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
-                               if (see_t)
-                               {
-                                       msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
-                               }
-
-                               resists_tele = TRUE;
-                       }
-                       else if (tr_ptr->level > randint1(100))
-                       {
-                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
-                               if (see_t)
-                               {
-                                       msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
-                               }
-
-                               resists_tele = TRUE;
-                       }
-               }
-
-               if (!resists_tele)
-               {
-                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
-                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
-               }
-
-               wake_up = TRUE;
-               break;
-
-       /* RF6_TELE_AWAY */
-       case 160+9:
-               if (known)
-               {
-                       if (see_either)
-                       {
-                               msg_format(_("%^s¤Ï%s¤ò¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤¿¡£", "%^s teleports %s away."), m_name, t_name);
-                       }
-                       else
-                       {
-                               mon_fight = TRUE;
-                       }
-               }
-
-               if (tr_ptr->flagsr & RFR_RES_TELE)
-               {
-                       if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
-                       {
-                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
-                               if (see_t)
-                               {
-                                       msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
-                               }
-
-                               resists_tele = TRUE;
-                       }
-                       else if (tr_ptr->level > randint1(100))
-                       {
-                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
-                               if (see_t)
-                               {
-                                       msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
-                               }
-
-                               resists_tele = TRUE;
-                       }
-               }
-
-               if (!resists_tele)
-               {
-                       if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
-                       else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
-               }
-
-               wake_up = TRUE;
-               break;
-
-       /* RF6_TELE_LEVEL */
-       case 160+10:
-               if (known)
-               {
-                       if (see_either)
-                       {
-                               msg_format(_("%^s¤¬%s¤Î­¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at %s's feet."), m_name, t_name);
-                       }
-                       else
-                       {
-                               mon_fight = TRUE;
-                       }
-               }
-
-               if (tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE))
-               {
-                       if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
-               }
-               else if ((tr_ptr->flags1 & RF1_QUESTOR) ||
-                           (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10))
-               {
-                       if (see_t) msg_format(_("%^s¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "%^s resist the effects!"), t_name);
-               }
-               else teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
-
-               wake_up = TRUE;
-               break;
-
        /* RF6_PSY_SPEAR */
        case 160+11:
                if (known)
index 2ac376f..34e9340 100644 (file)
@@ -105,7 +105,7 @@ void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int
 
 void simple_monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, int TARGET_TYPE)
 {
-    monspell_message_base(m_idx, t_idx, msg1, msg1, msg2, msg2, p_ptr->blind, TARGET_TYPE);
+    monspell_message_base(m_idx, t_idx, msg1, msg2, msg1, msg2, p_ptr->blind, TARGET_TYPE);
 }
 
 void spell_RF4_SHRIEK(int m_idx, int t_idx, int TARGET_TYPE)
@@ -1543,51 +1543,41 @@ int spell_RF6_WORLD(int m_idx)
     return who;
 }
 
-int spell_RF6_SPECIAL(int y, int x, int m_idx)
+int spell_RF6_SPECIAL_BANORLUPART(int m_idx, int mode)
 {
     monster_type    *m_ptr = &m_list[m_idx];
-    monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-    u32b mode = 0L;
-    bool direct = player_bold(y, x);
-    int k, dam, count=0;
-       char m_name[80];
-    monster_name(m_idx, m_name);
-
-    disturb(1, 1);
-    switch (m_ptr->r_idx)
-    {
-        case MON_OHMU:
-            /* Moved to process_monster(), like multiplication */
-            return -1;
-        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 -1;
-            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;
-
-            msg_print(_("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª","Banor=Rupart splits in two person!"));
-            break;
-        }
-
+       int dummy_hp, dummy_maxhp, k;
+       int dummy_y = m_ptr->fy;
+       int dummy_x = m_ptr->fx;
+
+       switch(m_ptr->r_idx)
+       {
+               case MON_BANORLUPART:
+                       dummy_hp = (m_ptr->hp + 1) / 2;
+                       dummy_maxhp = m_ptr->maxhp / 2;
+                       
+                       if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) 
+                               return -1;
+
+                       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;
+
+                       msg_print(_("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª","Banor=Rupart splits in two person!"));
+                       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;
+            dummy_hp = 0;
+            dummy_maxhp = 0;
+
+            if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) 
+                               return -1;
 
-            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)
@@ -1608,146 +1598,312 @@ int spell_RF6_SPECIAL(int y, int x, int m_idx)
 
             msg_print(_("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª", "Banor and Rupart combine into one!"));
             break;
-        }
+       }
+       return 0;
+}
 
-        case MON_ROLENTO:
-            if (p_ptr->blind)
-                msg_format(_("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", "%^s spreads something."), m_name);
-            else
-                msg_format(_("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."), m_name);
 
-            {
-                int num = 1 + randint1(3);
+int spell_RF6_SPECIAL_ROLENTO(int y, int x, int m_idx, int t_idx, int mode, int TARGET_TYPE)
+{
+       int count = 0, k;
+       int num = 1 + randint1(3);
+       
+       monspell_message(m_idx, t_idx,
+               _("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", "%^s spreads something."),
+               _("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."),
+        _("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."),
+        TARGET_TYPE);
 
-                for (k = 0; k < num; k++)
-                {
-                    count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
-                }
-            }
+       for (k = 0; k < num; k++)
+       {
+               count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
+       }
+       
+       if (p_ptr->blind && count)
+               msg_print(_("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¤Ð¤é¤Þ¤«¤ì¤ë²»¤¬¤¹¤ë¡£", "You hear many things are scattered nearby."));
+       
+       return 0;
+}
+
+int spell_RF6_SPECIAL_B(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
+{
+       int dam;
+    monster_type    *m_ptr = &m_list[m_idx];
+    monster_type    *t_ptr = &m_list[t_idx];
+    monster_race    *tr_ptr = &r_info[t_ptr->r_idx];
+       bool monster_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
+       bool monster_to_monster = (TARGET_TYPE == MONSTER_TO_MONSTER);
+    bool direct = player_bold(y, x);
+       char m_name[80];
+    monster_name(m_idx, m_name);
+
+       disturb(1, 1);
+       if (one_in_(3) || !direct)
+       {               
+               simple_monspell_message(m_idx, t_idx,
+                       _("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"),
+                       _("%^s¤ÏÆÍÁ³µÞ¾å¾º¤·¤Æ»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"),
+                       TARGET_TYPE);
+                               
+               teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
+               p_ptr->update |= (PU_MONSTERS);
+       }
+       else
+       {
+               int get_damage = 0;
+               bool fear; /* dummy */
+       
+               simple_monspell_message(m_idx, t_idx,
+                       _("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", "%^s holds you, and drops from the sky."),
+                       _("%^s¤¬%s¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", "%^s holds %s, and drops from the sky."),
+                       TARGET_TYPE);
+
+               dam = damroll(4, 8);
+
+               if (monster_to_player || t_idx == p_ptr->riding)
+                       teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+               else 
+                       teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+
+               sound(SOUND_FALL);
+
+               if ((monster_to_player && p_ptr->levitation) ||
+                       (monster_to_monster && (tr_ptr->flags7 & RF7_CAN_FLY)))
+               {
+                       simple_monspell_message(m_idx, t_idx,
+                               _("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "You float gently down to the ground."),
+                               _("%^s¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "%^s floats gently down to the ground."),
+                               TARGET_TYPE);
+               }
+               else
+               {
+                       simple_monspell_message(m_idx, t_idx,
+                               _("¤¢¤Ê¤¿¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", "You crashed into the ground."),
+                               _("%^s¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", "%^s crashed into the ground."),
+                               TARGET_TYPE);
+                       dam += damroll(6, 8);
+               }
+
+               if(monster_to_player ||
+                  (monster_to_monster && p_ptr->riding == t_idx))
+               {
+                       /* 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)
+                       {
+                               char m_name_self[80];
+                               /* hisself */
+                               monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
+
+                               msg_format(_("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", "The attack of %s has wounded %s!"), m_name, m_name_self);
+
+                               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(monster_to_player && 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);
+
+               if(monster_to_monster)
+                       mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
+       }
+       return dam;
+}
+
+int spell_RF6_SPECIAL(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
+{
+    monster_type    *m_ptr = &m_list[m_idx];
+    monster_race    *r_ptr = &r_info[m_ptr->r_idx];
+    u32b mode = 0L;
+    int count=0;
 
-            if (p_ptr->blind && count)
-                msg_print(_("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¤Ð¤é¤Þ¤«¤ì¤ë²»¤¬¤¹¤ë¡£", "You hear many things are scattered nearby."));
+    disturb(1, 1);
+    switch (m_ptr->r_idx)
+    {
+        case MON_OHMU:
+            /* Moved to process_monster(), like multiplication */
+            return -1;
 
+        case MON_BANORLUPART:
+        case MON_BANOR:
+        case MON_LUPART:
+                       return spell_RF6_SPECIAL_BANORLUPART(m_idx, mode);
+
+        case MON_ROLENTO:
+                       return spell_RF6_SPECIAL_ROLENTO(y, x, m_idx, t_idx, mode, TARGET_TYPE);
             break;
 
         default:
         if (r_ptr->d_char == 'B')
         {
-            disturb(1, 1);
-            if (one_in_(3) || !direct)
-            {
-                msg_format(_("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"), m_name);
-                teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
-                p_ptr->update |= (PU_MONSTERS);
-            }
-            else
-            {
-                int get_damage = 0;
-                bool fear; /* dummy */
-
-                msg_format(_("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£",
-                    "%^s holds you, and drops from the sky."), m_name);
-                dam = damroll(4, 8);
-                teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-
-                sound(SOUND_FALL);
-
-                if (p_ptr->levitation)
-                {
-                    msg_print(_("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "You float gently down to the ground."));
-                }
-                else
-                {
-                    msg_print(_("¤¢¤Ê¤¿¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", "You crashed into the ground."));
-                    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("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", 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);
-            }
+            return spell_RF6_SPECIAL_B(y, x, m_idx, t_idx, TARGET_TYPE);
             break;
         }
 
         /* Something is wrong */
         else return -1;
     }
-    return dam;
 }
 
-
-void spell_RF6_TELE_TO(int m_idx)
+void spell_RF6_TELE_TO(int m_idx, int t_idx, int TARGET_TYPE)
 {
     monster_type    *m_ptr = &m_list[m_idx];
-       char m_name[80];
-    monster_name(m_idx, m_name);
-
-    disturb(1, 1);
-    msg_format(_("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", "%^s commands you to return."), m_name);
+    monster_type    *t_ptr = &m_list[t_idx];
+    monster_race    *tr_ptr = &r_info[t_ptr->r_idx];
 
-    teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
-    learn_spell(MS_TELE_TO);
+       simple_monspell_message(m_idx, t_idx,
+               _("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", "%^s commands you to return."),
+               _("%^s¤¬%s¤ò°ú¤­Ìᤷ¤¿¡£", "%^s commands %s to return."),
+               TARGET_TYPE);
+       
+       if (TARGET_TYPE == MONSTER_TO_PLAYER)
+       {
+               teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
+               learn_spell(MS_TELE_TO);
+       }
+       else if (TARGET_TYPE == MONSTER_TO_MONSTER)
+       {
+               bool resists_tele = FALSE;
+               char t_name[80];
+               monster_name(t_idx, t_name);
+
+               if (tr_ptr->flagsr & RFR_RES_TELE)
+               {
+                       if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
+                       {
+                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
+                               if (see_monster(t_idx))
+                               {
+                                       msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
+                               }
+                               resists_tele = TRUE;
+                       }
+                       else if (tr_ptr->level > randint1(100))
+                       {
+                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
+                               if (see_monster(t_idx))
+                               {
+                                       msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
+                               }
+                               resists_tele = TRUE;
+                       }
+               }
+
+               if (!resists_tele)
+               {
+                       if (t_idx == p_ptr->riding) 
+                               teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
+                       else 
+                               teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
+               }
+        monster_wakeup(t_idx);
+       }
 }
 
-void spell_RF6_TELE_AWAY(int m_idx)
+void spell_RF6_TELE_AWAY(int m_idx, int t_idx, int TARGET_TYPE)
 {
-       char m_name[80];
-    monster_name(m_idx, m_name);
-    disturb(1, 1);
-
-    msg_format(_("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", "%^s teleports you away."), m_name);
-    if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
-        msg_print(_("¤¯¤Ã¤½¡Á", ""));
+    monster_type    *m_ptr = &m_list[m_idx];
+    monster_type    *t_ptr = &m_list[t_idx];
+    monster_race    *tr_ptr = &r_info[t_ptr->r_idx];
 
-    learn_spell(MS_TELE_AWAY);
-    teleport_player_away(m_idx, 100);
+       simple_monspell_message(m_idx, t_idx,
+               _("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", "%^s teleports you away."),
+               _("%^s¤Ï%s¤ò¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤¿¡£", "%^s teleports %s away."),
+               TARGET_TYPE);
+       
+       if (TARGET_TYPE == MONSTER_TO_PLAYER)
+       {
+               if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
+                       msg_print(_("¤¯¤Ã¤½¡Á", ""));
+               
+               learn_spell(MS_TELE_AWAY);
+               teleport_player_away(m_idx, 100);
+       }
+       else if (TARGET_TYPE == MONSTER_TO_MONSTER)
+       {
+               bool resists_tele = FALSE;
+               char t_name[80];
+               monster_name(t_idx, t_name);
+
+               if (tr_ptr->flagsr & RFR_RES_TELE)
+               {
+                       if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
+                       {
+                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
+                               if (see_monster(t_idx))
+                               {
+                                       msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
+                               }
+                               resists_tele = TRUE;
+                       }
+                       else if (tr_ptr->level > randint1(100))
+                       {
+                               if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
+                               if (see_monster(t_idx))
+                               {
+                                       msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
+                               }
+                               resists_tele = TRUE;
+                       }
+               }
+
+               if (!resists_tele)
+               {
+                       if (t_idx == p_ptr->riding) 
+                               teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
+                       else 
+                               teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
+               }
+        monster_wakeup(t_idx);
+       }
 }
 
-void spell_RF6_TELE_LEVEL(int m_idx)
+void spell_RF6_TELE_LEVEL(int m_idx, int t_idx, int TARGET_TYPE)
 {
+    monster_type    *t_ptr = &m_list[t_idx];
+    monster_race    *tr_ptr = &r_info[t_ptr->r_idx];
     int rlev = monster_level_idx(m_idx);
-       char m_name[80];
-    monster_name(m_idx, m_name);
-
-    disturb(1, 1);
-
-    if (p_ptr->blind)
-        msg_format(_("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles strangely."), m_name);
-    else
-        msg_format(_("%^s¤¬¤¢¤Ê¤¿¤Î­¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at your feet."), m_name);
+    bool resist, saving_throw;
 
-    if (p_ptr->resist_nexus)
-    {
-        msg_print(_("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", "You are unaffected!"));
-    }
-    else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
+    if (TARGET_TYPE == MONSTER_TO_PLAYER)
     {
-        msg_print(_("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "You resist the effects!"));
+        resist = p_ptr->resist_nexus;
+        saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
+        spell_badstatus_message(m_idx, t_idx,
+            _("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles strangely."),
+            _("%^s¤¬¤¢¤Ê¤¿¤Î­¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at your feet."),
+            _("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", "You are unaffected!"),
+            _("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "You resist the effects!"),
+            resist, saving_throw, TARGET_TYPE);
+
+        if (!resist && !saving_throw)
+        {
+                       teleport_level(0);
+        }
+               learn_spell(MS_TELE_LEVEL);
+               update_smart_learn(m_idx, DRS_NEXUS);
     }
-    else
+    else if (TARGET_TYPE == MONSTER_TO_MONSTER)
     {
-        teleport_level(0);
+        resist = tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE);
+        saving_throw = (tr_ptr->flags1 & RF1_QUESTOR) ||
+                                  (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
+
+        spell_badstatus_message(m_idx, t_idx, 
+            _("%^s¤¬%s¤Î­¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at %s's feet."),
+            _("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"),
+            _("%^s¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "%^s resist the effects!"),
+            "",
+            resist, saving_throw, TARGET_TYPE);
+
+        if (!resist && !saving_throw)
+        {
+                       teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
+        }
     }
-    learn_spell(MS_TELE_LEVEL);
-    update_smart_learn(m_idx, DRS_NEXUS);
 }
 
 int spell_RF6_PSY_SPEAR(int y, int x, int m_idx)
@@ -2473,10 +2629,10 @@ int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx)
     case 160 + 4:  spell_RF6_BLINK(m_idx, MONSTER_TO_PLAYER); break;   /* RF6_BLINK */
     case 160 + 5:  spell_RF6_TPORT(m_idx, MONSTER_TO_PLAYER); break;   /* RF6_TPORT */
     case 160 + 6:  return spell_RF6_WORLD(m_idx); break;    /* RF6_WORLD */
-    case 160 + 7:  return spell_RF6_SPECIAL(y, x, m_idx);   /* RF6_SPECIAL */
-    case 160 + 8:  spell_RF6_TELE_TO(m_idx); break; /* RF6_TELE_TO */
-    case 160 + 9:  spell_RF6_TELE_AWAY(m_idx); break;   /* RF6_TELE_AWAY */
-    case 160 + 10: spell_RF6_TELE_LEVEL(m_idx); break;  /* RF6_TELE_LEVEL */
+    case 160 + 7:  return spell_RF6_SPECIAL(y, x, m_idx, 0, MONSTER_TO_PLAYER);   /* RF6_SPECIAL */
+    case 160 + 8:  spell_RF6_TELE_TO(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_TO */
+    case 160 + 9:  spell_RF6_TELE_AWAY(m_idx, 0, MONSTER_TO_PLAYER); break;   /* RF6_TELE_AWAY */
+    case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, 0, MONSTER_TO_PLAYER); break;  /* RF6_TELE_LEVEL */
     case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx); break; /* RF6_PSY_SPEAR */
     case 160 + 12: spell_RF6_DARKNESS(m_idx); break;    /* RF6_DARKNESS */
     case 160 + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
@@ -2577,6 +2733,10 @@ int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx)
     case 160 + 4:  spell_RF6_BLINK(m_idx, MONSTER_TO_MONSTER); break;   /* RF6_BLINK */
     case 160 + 5:  spell_RF6_TPORT(m_idx, MONSTER_TO_MONSTER); break;   /* RF6_TPORT */
     case 160 + 6:  return -1; break;    /* RF6_WORLD */
+    case 160 + 7:  return spell_RF6_SPECIAL(y, x, m_idx, t_idx, MONSTER_TO_MONSTER);   /* RF6_SPECIAL */
+    case 160 + 8:  spell_RF6_TELE_TO(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_TO */
+    case 160 + 9:  spell_RF6_TELE_AWAY(m_idx, t_idx, MONSTER_TO_MONSTER); break;   /* RF6_TELE_AWAY */
+    case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, t_idx, MONSTER_TO_PLAYER); break;  /* RF6_TELE_LEVEL */
     }
     return 0;
 }
\ No newline at end of file