OSDN Git Service

[Refactor] #39963 Separated effect-monster-charm.c/h from effect-monster-switcher.c
authorHourier <hourier@users.sourceforge.jp>
Sat, 2 May 2020 12:43:47 +0000 (21:43 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 2 May 2020 12:43:47 +0000 (21:43 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/effect/effect-monster-charm.c [new file with mode: 0644]
src/effect/effect-monster-charm.h [new file with mode: 0644]
src/effect/effect-monster-oldies.c
src/effect/effect-monster-oldies.h
src/effect/effect-monster-switcher.c

index a29e063..3dec2fa 100644 (file)
     <ClCompile Include="..\..\src\cmd\dump-util.c" />\r
     <ClCompile Include="..\..\src\effect\effect-feature.c" />\r
     <ClCompile Include="..\..\src\effect\effect-item.c" />\r
+    <ClCompile Include="..\..\src\effect\effect-monster-charm.c" />\r
     <ClCompile Include="..\..\src\effect\effect-monster-domination.c" />\r
     <ClCompile Include="..\..\src\effect\effect-monster-oldies.c" />\r
     <ClCompile Include="..\..\src\effect\effect-monster-psi.c" />\r
     <ClInclude Include="..\..\src\cmd\dump-util.h" />\r
     <ClInclude Include="..\..\src\effect\effect-feature.h" />\r
     <ClInclude Include="..\..\src\effect\effect-item.h" />\r
+    <ClInclude Include="..\..\src\effect\effect-monster-charm.h" />\r
     <ClInclude Include="..\..\src\effect\effect-monster-domination.h" />\r
     <ClInclude Include="..\..\src\effect\effect-monster-oldies.h" />\r
     <ClInclude Include="..\..\src\effect\effect-monster-psi.h" />\r
index 5708bac..1411799 100644 (file)
     <ClCompile Include="..\..\src\effect\effect-monster-oldies.c">
       <Filter>effect</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\effect\effect-monster-charm.c">
+      <Filter>effect</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\effect\effect-monster-oldies.h">
       <Filter>effect</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\effect\effect-monster-charm.h">
+      <Filter>effect</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
diff --git a/src/effect/effect-monster-charm.c b/src/effect/effect-monster-charm.c
new file mode 100644 (file)
index 0000000..789f8ac
--- /dev/null
@@ -0,0 +1,216 @@
+#include "angband.h"
+#include "effect/effect-monster-util.h"
+#include "effect/effect-monster-charm.h"
+#include "avatar.h"
+#include "spells-diceroll.h"
+#include "monsterrace-hook.h"
+
+static void effect_monster_charm_resist(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
+       {
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else if (caster_ptr->cursed & TRC_AGGRAVATE)
+       {
+               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else
+       {
+               em_ptr->note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
+               set_pet(caster_ptr, em_ptr->m_ptr);
+
+               chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
+               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
+                       chg_virtue(caster_ptr, V_NATURE, 1);
+       }
+}
+
+
+gf_switch_result effect_monster_charm(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       int vir = virtue_number(caster_ptr, V_HARMONY);
+       if (vir)
+       {
+               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
+       }
+
+       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
+       }
+
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       effect_monster_charm_resist(caster_ptr, em_ptr);
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
+
+
+gf_switch_result effect_monster_control_undead(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       int vir = virtue_number(caster_ptr, V_UNLIFE);
+       if (vir)
+       {
+               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
+       }
+
+       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
+       }
+
+       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
+               !(em_ptr->r_ptr->flags3 & RF3_UNDEAD))
+       {
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else if (caster_ptr->cursed & TRC_AGGRAVATE)
+       {
+               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else
+       {
+               em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
+               set_pet(caster_ptr, em_ptr->m_ptr);
+       }
+
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
+
+
+gf_switch_result effect_monster_control_demon(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       int vir = virtue_number(caster_ptr, V_UNLIFE);
+       if (vir)
+       {
+               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
+       }
+
+       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
+       }
+
+       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
+               !(em_ptr->r_ptr->flags3 & RF3_DEMON))
+       {
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else if (caster_ptr->cursed & TRC_AGGRAVATE)
+       {
+               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else
+       {
+               em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
+               set_pet(caster_ptr, em_ptr->m_ptr);
+       }
+
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
+
+
+gf_switch_result effect_monster_control_animal(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       int vir = virtue_number(caster_ptr, V_NATURE);
+       if (vir)
+       {
+               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
+       }
+
+       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
+       }
+
+       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
+               !(em_ptr->r_ptr->flags3 & RF3_ANIMAL))
+       {
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else if (caster_ptr->cursed & TRC_AGGRAVATE)
+       {
+               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else
+       {
+               em_ptr->note = _("はなついた。", " is tamed!");
+               set_pet(caster_ptr, em_ptr->m_ptr);
+               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
+                       chg_virtue(caster_ptr, V_NATURE, 1);
+       }
+
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
+
+
+gf_switch_result effect_monster_charm_living(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       int vir = virtue_number(caster_ptr, V_UNLIFE);
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       vir = virtue_number(caster_ptr, V_UNLIFE);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 10;
+       }
+
+       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
+       if (vir)
+       {
+               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
+       }
+
+       msg_format(_("%sを見つめた。", "You stare into %s."), em_ptr->m_name);
+
+       if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
+               !monster_living(em_ptr->m_ptr->r_idx))
+       {
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else if (caster_ptr->cursed & TRC_AGGRAVATE)
+       {
+               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
+               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
+       }
+       else
+       {
+               em_ptr->note = _("を支配した。", " is tamed!");
+               set_pet(caster_ptr, em_ptr->m_ptr);
+               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
+                       chg_virtue(caster_ptr, V_NATURE, 1);
+       }
+
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
diff --git a/src/effect/effect-monster-charm.h b/src/effect/effect-monster-charm.h
new file mode 100644 (file)
index 0000000..383770b
--- /dev/null
@@ -0,0 +1,7 @@
+#pragma once
+
+gf_switch_result effect_monster_charm(player_type *caster_ptr, effect_monster_type *em_ptr);
+gf_switch_result effect_monster_control_undead(player_type *caster_ptr, effect_monster_type *em_ptr);
+gf_switch_result effect_monster_control_demon(player_type *caster_ptr, effect_monster_type *em_ptr);
+gf_switch_result effect_monster_control_animal(player_type *caster_ptr, effect_monster_type *em_ptr);
+gf_switch_result effect_monster_charm_living(player_type *caster_ptr, effect_monster_type *em_ptr);
index a6da8d5..e228111 100644 (file)
@@ -222,3 +222,27 @@ gf_switch_result effect_monster_old_sleep(player_type *caster_ptr, effect_monste
        em_ptr->dam = 0;
        return GF_SWITCH_CONTINUE;
 }
+
+
+gf_switch_result effect_monster_old_conf(player_type *caster_ptr, effect_monster_type *em_ptr)
+{
+       if (em_ptr->seen) em_ptr->obvious = TRUE;
+
+       em_ptr->do_conf = damroll(3, (em_ptr->dam / 2)) + 1;
+       if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
+               (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) ||
+               (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
+       {
+               if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
+               {
+                       if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
+               }
+
+               em_ptr->do_conf = 0;
+               em_ptr->note = _("には効果がなかった。", " is unaffected.");
+               em_ptr->obvious = FALSE;
+       }
+
+       em_ptr->dam = 0;
+       return GF_SWITCH_CONTINUE;
+}
index b18e684..e211bc5 100644 (file)
@@ -7,3 +7,4 @@ gf_switch_result effect_monster_old_heal(player_type *caster_ptr, effect_monster
 gf_switch_result effect_monster_old_speed(player_type *caster_ptr, effect_monster_type *em_ptr);
 gf_switch_result effect_monster_old_slow(player_type *caster_ptr, effect_monster_type *em_ptr);
 gf_switch_result effect_monster_old_sleep(player_type *caster_ptr, effect_monster_type *em_ptr);
+gf_switch_result effect_monster_old_conf(player_type *caster_ptr, effect_monster_type *em_ptr);
index e5f82d3..605cd9c 100644 (file)
@@ -14,7 +14,6 @@
 #include "monster-status.h"
 #include "effect/spells-effect-util.h"
 #include "player-effects.h"
-#include "spells-diceroll.h"
 #include "monsterrace-hook.h"
 #include "combat/melee.h"
 #include "cmd/cmd-pet.h" // 暫定、後で消すかも.
@@ -23,6 +22,7 @@
 #include "effect/effect-monster-psi.h"
 #include "effect/effect-monster-domination.h"
 #include "effect/effect-monster-oldies.h"
+#include "effect/effect-monster-charm.h"
 
 gf_switch_result effect_monster_hypodynamia(player_type *caster_ptr, effect_monster_type *em_ptr)
 {
@@ -47,6 +47,7 @@ gf_switch_result effect_monster_hypodynamia(player_type *caster_ptr, effect_mons
 }
 
 
+// todo リファクタリング前のコード時点で、単に耐性があるだけでもダメージ0だった.
 gf_switch_result effect_monster_death_ray(player_type *caster_ptr, effect_monster_type *em_ptr)
 {
        if (em_ptr->seen) em_ptr->obvious = TRUE;
@@ -105,217 +106,6 @@ gf_switch_result effect_monster_stasis(effect_monster_type *em_ptr, bool to_evil
 }
 
 
-static void effect_monster_charm_resist(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
-       {
-               em_ptr->note = _("には効果がなかった。", " is unaffected.");
-               em_ptr->obvious = FALSE;
-
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else if (caster_ptr->cursed & TRC_AGGRAVATE)
-       {
-               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else
-       {
-               em_ptr->note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
-               set_pet(caster_ptr, em_ptr->m_ptr);
-
-               chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
-               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
-                       chg_virtue(caster_ptr, V_NATURE, 1);
-       }
-}
-
-
-gf_switch_result effect_monster_charm(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       int vir = virtue_number(caster_ptr, V_HARMONY);
-       if (vir)
-       {
-               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
-       }
-
-       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
-       }
-
-       if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-       effect_monster_charm_resist(caster_ptr, em_ptr);
-       em_ptr->dam = 0;
-       return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_control_undead(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-       int vir = virtue_number(caster_ptr, V_UNLIFE);
-       if (vir)
-       {
-               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
-       }
-
-       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
-       }
-
-       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
-               !(em_ptr->r_ptr->flags3 & RF3_UNDEAD))
-       {
-               em_ptr->note = _("には効果がなかった。", " is unaffected.");
-               em_ptr->obvious = FALSE;
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else if (caster_ptr->cursed & TRC_AGGRAVATE)
-       {
-               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else
-       {
-               em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
-               set_pet(caster_ptr, em_ptr->m_ptr);
-       }
-
-       em_ptr->dam = 0;
-       return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_control_demon(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-       int vir = virtue_number(caster_ptr, V_UNLIFE);
-       if (vir)
-       {
-               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
-       }
-
-       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
-       }
-
-       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
-               !(em_ptr->r_ptr->flags3 & RF3_DEMON))
-       {
-               em_ptr->note = _("には効果がなかった。", " is unaffected.");
-               em_ptr->obvious = FALSE;
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else if (caster_ptr->cursed & TRC_AGGRAVATE)
-       {
-               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else
-       {
-               em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
-               set_pet(caster_ptr, em_ptr->m_ptr);
-       }
-
-       em_ptr->dam = 0;
-       return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_control_animal(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-       int vir = virtue_number(caster_ptr, V_NATURE);
-       if (vir)
-       {
-               em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
-       }
-
-       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
-       }
-
-       if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
-               !(em_ptr->r_ptr->flags3 & RF3_ANIMAL))
-       {
-               em_ptr->note = _("には効果がなかった。", " is unaffected.");
-               em_ptr->obvious = FALSE;
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else if (caster_ptr->cursed & TRC_AGGRAVATE)
-       {
-               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else
-       {
-               em_ptr->note = _("はなついた。", " is tamed!");
-               set_pet(caster_ptr, em_ptr->m_ptr);
-               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
-                       chg_virtue(caster_ptr, V_NATURE, 1);
-       }
-
-       em_ptr->dam = 0;
-       return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_charm_living(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
-       int vir = virtue_number(caster_ptr, V_UNLIFE);
-       if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-       vir = virtue_number(caster_ptr, V_UNLIFE);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 10;
-       }
-
-       vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
-       if (vir)
-       {
-               em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
-       }
-
-       msg_format(_("%sを見つめた。", "You stare into %s."), em_ptr->m_name);
-
-       if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
-               !monster_living(em_ptr->m_ptr->r_idx))
-       {
-               em_ptr->note = _("には効果がなかった。", " is unaffected.");
-               em_ptr->obvious = FALSE;
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else if (caster_ptr->cursed & TRC_AGGRAVATE)
-       {
-               em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
-               if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
-       }
-       else
-       {
-               em_ptr->note = _("を支配した。", " is tamed!");
-               set_pet(caster_ptr, em_ptr->m_ptr);
-               if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
-                       chg_virtue(caster_ptr, V_NATURE, 1);
-       }
-
-       em_ptr->dam = 0;
-       return GF_SWITCH_CONTINUE;
-}
-
-
 /*!
  * @brief 魔法の効果によって様々なメッセーを出力したり与えるダメージの増減を行ったりする
  * @param em_ptr モンスター効果構造体への参照ポインタ
@@ -426,27 +216,7 @@ gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_
        case GF_CHARM_LIVING:
                return effect_monster_charm_living(caster_ptr, em_ptr);
        case GF_OLD_CONF:
-       {
-               if (em_ptr->seen) em_ptr->obvious = TRUE;
-
-               em_ptr->do_conf = damroll(3, (em_ptr->dam / 2)) + 1;
-               if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
-                       (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) ||
-                       (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
-               {
-                       if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
-                       {
-                               if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
-                       }
-
-                       em_ptr->do_conf = 0;
-                       em_ptr->note = _("には効果がなかった。", " is unaffected.");
-                       em_ptr->obvious = FALSE;
-               }
-
-               em_ptr->dam = 0;
-               break;
-       }
+               return effect_monster_old_conf(caster_ptr, em_ptr);
        case GF_STUN:
        {
                if (em_ptr->seen) em_ptr->obvious = TRUE;