OSDN Git Service

[Refactor] #40574 Separated mutation/mutation-investor.c from mutation.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 1 Aug 2020 02:41:38 +0000 (11:41 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 1 Aug 2020 02:41:38 +0000 (11:41 +0900)
15 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/core/player-processor.c
src/effect/effect-player-resist-hurt.c
src/mutation/mutation-investor.c [new file with mode: 0644]
src/mutation/mutation-investor.h [new file with mode: 0644]
src/mutation/mutation.c
src/mutation/mutation.h
src/object-use/quaff-execution.c
src/player/patron.c
src/player/player-status.c
src/spell-kind/spells-random.c
src/status/shape-changer.c
src/wizard/wizard-special-process.c

index 67790c9..e5359e0 100644 (file)
     <ClCompile Include="..\..\src\mspell\specified-summon.c" />\r
     <ClCompile Include="..\..\src\mutation\gain-mutation-switcher.c" />\r
     <ClCompile Include="..\..\src\mutation\gain-mutation-util.c" />\r
+    <ClCompile Include="..\..\src\mutation\mutation-investor.c" />\r
     <ClCompile Include="..\..\src\object-use\read-execution.c" />\r
     <ClCompile Include="..\..\src\player\player-status-flags.c" />\r
     <ClCompile Include="..\..\src\racial\racial-kutar.c" />\r
     <ClInclude Include="..\..\src\mspell\specified-summon.h" />\r
     <ClInclude Include="..\..\src\mutation\gain-mutation-switcher.h" />\r
     <ClInclude Include="..\..\src\mutation\gain-mutation-util.h" />\r
+    <ClInclude Include="..\..\src\mutation\mutation-investor.h" />\r
     <ClInclude Include="..\..\src\object-use\read-execution.h" />\r
     <ClInclude Include="..\..\src\player\player-status-flags.h" />\r
     <ClInclude Include="..\..\src\racial\racial-kutar.h" />\r
index cf6815f..8dc583c 100644 (file)
     <ClCompile Include="..\..\src\mutation\gain-mutation-switcher.c">
       <Filter>mutation</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\mutation\mutation-investor.c">
+      <Filter>mutation</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\combat\shoot.h">
     <ClInclude Include="..\..\src\mutation\gain-mutation-switcher.h">
       <Filter>mutation</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mutation\mutation-investor.h">
+      <Filter>mutation</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 6ebe116..c300e14 100644 (file)
@@ -493,6 +493,7 @@ hengband_SOURCES = \
        \
        mutation/gain-mutation-switcher.c mutation/gain-mutation-switcher.h \
        mutation/gain-mutation-util.c mutation/gain-mutation-util.h \
+       mutation/mutation-investor.c mutation/mutation-investor.h \
        mutation/mutation.c mutation/mutation.h \
        mutation/mutation-flag-types.h \
        mutation/mutation-processor.c mutation/mutation-processor.h \
index a52aaaa..8e572f0 100644 (file)
@@ -32,7 +32,7 @@
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
 #include "monster/monster-util.h"
-#include "mutation/mutation.h"
+#include "mutation/mutation-investor.h"
 #include "player/attack-defense-types.h"
 #include "player/player-skill.h"
 #include "player/special-defense-types.h"
index ad337d4..d699fd6 100644 (file)
@@ -9,7 +9,7 @@
 #include "inventory/inventory-slot-types.h"
 #include "mind/mind-mirror-master.h"
 #include "monster-race/race-indice-types.h"
-#include "mutation/mutation.h"
+#include "mutation/mutation-investor.h"
 #include "object/object-broken.h"
 #include "player/player-damage.h"
 #include "player/player-race-types.h"
diff --git a/src/mutation/mutation-investor.c b/src/mutation/mutation-investor.c
new file mode 100644 (file)
index 0000000..4e2a9ac
--- /dev/null
@@ -0,0 +1,235 @@
+#include "mutation/mutation-investor.h"
+#include "core/player-update-types.h"
+#include "core/stuff-handler.h"
+#include "mutation/gain-mutation-switcher.h"
+#include "mutation/gain-mutation-util.h"
+#include "mutation/mutation-flag-types.h"
+#include "mutation/mutation.h" // todo calc_mutant_regenerate_mod() が相互依存している、後で消す.
+#include "player/avatar.h"
+#include "view/display-messages.h"
+
+static void sweep_gain_mutation(player_type *creature_ptr, gm_type *gm_ptr)
+{
+    int attempts_left = 20;
+    if (gm_ptr->choose_mut)
+        attempts_left = 1;
+
+    while (attempts_left--) {
+        switch_gain_mutation(creature_ptr, gm_ptr);
+        if ((gm_ptr->muta_class != NULL) && (gm_ptr->muta_which != 0) && ((*gm_ptr->muta_class & gm_ptr->muta_which) == 0))
+            gm_ptr->muta_chosen = TRUE;
+
+        if (gm_ptr->muta_chosen)
+            break;
+    }
+}
+
+static void race_dependent_mutation(player_type *creature_ptr, gm_type *gm_ptr)
+{
+    if (gm_ptr->choose_mut != 0)
+        return;
+
+    if (creature_ptr->prace == RACE_VAMPIRE && !(creature_ptr->muta1 & MUT1_HYPN_GAZE) && (randint1(10) < 7)) {
+        gm_ptr->muta_class = &(creature_ptr->muta1);
+        gm_ptr->muta_which = MUT1_HYPN_GAZE;
+        gm_ptr->muta_desc = _("眼が幻惑的になった...", "Your eyes look mesmerizing...");
+        return;
+    }
+
+    if (creature_ptr->prace == RACE_IMP && !(creature_ptr->muta2 & MUT2_HORNS) && (randint1(10) < 7)) {
+        gm_ptr->muta_class = &(creature_ptr->muta2);
+        gm_ptr->muta_which = MUT2_HORNS;
+        gm_ptr->muta_desc = _("角が額から生えてきた!", "Horns pop forth into your forehead!");
+        return;
+    }
+
+    if (creature_ptr->prace == RACE_YEEK && !(creature_ptr->muta1 & MUT1_SHRIEK) && (randint1(10) < 7)) {
+        gm_ptr->muta_class = &(creature_ptr->muta1);
+        gm_ptr->muta_which = MUT1_SHRIEK;
+        gm_ptr->muta_desc = _("声質がかなり強くなった。", "Your vocal cords get much tougher.");
+        return;
+    }
+
+    if (creature_ptr->prace == RACE_BEASTMAN && !(creature_ptr->muta1 & MUT1_POLYMORPH) && (randint1(10) < 2)) {
+        gm_ptr->muta_class = &(creature_ptr->muta1);
+        gm_ptr->muta_which = MUT1_POLYMORPH;
+        gm_ptr->muta_desc = _("あなたの肉体は変化できるようになった、", "Your body seems mutable.");
+        return;
+    }
+
+    if (creature_ptr->prace == RACE_MIND_FLAYER && !(creature_ptr->muta2 & MUT2_TENTACLES) && (randint1(10) < 7)) {
+        gm_ptr->muta_class = &(creature_ptr->muta2);
+        gm_ptr->muta_which = MUT2_TENTACLES;
+        gm_ptr->muta_desc = _("邪悪な触手が口の周りに生えた。", "Evil-looking tentacles sprout from your mouth.");
+    }
+}
+
+static void neutralize_base_status(player_type *creature_ptr, gm_type *gm_ptr)
+{
+    if (gm_ptr->muta_which == MUT3_PUNY) {
+        if (creature_ptr->muta3 & MUT3_HYPER_STR) {
+            msg_print(_("あなたはもう超人的に強くはない!", "You no longer feel super-strong!"));
+            creature_ptr->muta3 &= ~(MUT3_HYPER_STR);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_HYPER_STR) {
+        if (creature_ptr->muta3 & MUT3_PUNY) {
+            msg_print(_("あなたはもう虚弱ではない!", "You no longer feel puny!"));
+            creature_ptr->muta3 &= ~(MUT3_PUNY);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_MORONIC) {
+        if (creature_ptr->muta3 & MUT3_HYPER_INT) {
+            msg_print(_("あなたの脳はもう生体コンピュータではない。", "Your brain is no longer a living computer."));
+            creature_ptr->muta3 &= ~(MUT3_HYPER_INT);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_HYPER_INT) {
+        if (creature_ptr->muta3 & MUT3_MORONIC) {
+            msg_print(_("あなたはもう精神薄弱ではない。", "You are no longer moronic."));
+            creature_ptr->muta3 &= ~(MUT3_MORONIC);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_IRON_SKIN) {
+        if (creature_ptr->muta3 & MUT3_SCALES) {
+            msg_print(_("鱗がなくなった。", "You lose your scales."));
+            creature_ptr->muta3 &= ~(MUT3_SCALES);
+        }
+
+        if (creature_ptr->muta3 & MUT3_FLESH_ROT) {
+            msg_print(_("肉体が腐乱しなくなった。", "Your flesh rots no longer."));
+            creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
+        }
+
+        if (creature_ptr->muta3 & MUT3_WART_SKIN) {
+            msg_print(_("肌のイボイボがなくなった。", "You lose your warts."));
+            creature_ptr->muta3 &= ~(MUT3_WART_SKIN);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_WART_SKIN || gm_ptr->muta_which == MUT3_SCALES || gm_ptr->muta_which == MUT3_FLESH_ROT) {
+        if (creature_ptr->muta3 & MUT3_IRON_SKIN) {
+            msg_print(_("あなたの肌はもう鉄ではない。", "Your skin is no longer made of steel."));
+            creature_ptr->muta3 &= ~(MUT3_IRON_SKIN);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_FEARLESS) {
+        if (creature_ptr->muta2 & MUT2_COWARDICE) {
+            msg_print(_("臆病でなくなった。", "You are no longer cowardly."));
+            creature_ptr->muta2 &= ~(MUT2_COWARDICE);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_FLESH_ROT) {
+        if (creature_ptr->muta3 & MUT3_REGEN) {
+            msg_print(_("急速に回復しなくなった。", "You stop regenerating."));
+            creature_ptr->muta3 &= ~(MUT3_REGEN);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_REGEN) {
+        if (creature_ptr->muta3 & MUT3_FLESH_ROT) {
+            msg_print(_("肉体が腐乱しなくなった。", "Your flesh stops rotting."));
+            creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_LIMBER) {
+        if (creature_ptr->muta3 & MUT3_ARTHRITIS) {
+            msg_print(_("関節が痛くなくなった。", "Your joints stop hurting."));
+            creature_ptr->muta3 &= ~(MUT3_ARTHRITIS);
+        }
+
+        return;
+    }
+
+    if (gm_ptr->muta_which == MUT3_ARTHRITIS) {
+        if (creature_ptr->muta3 & MUT3_LIMBER) {
+            msg_print(_("あなたはしなやかでなくなった。", "You no longer feel limber."));
+            creature_ptr->muta3 &= ~(MUT3_LIMBER);
+        }
+
+        return;
+    }
+}
+
+static void neutralize_other_status(player_type *creature_ptr, gm_type *gm_ptr)
+{
+    if (gm_ptr->muta_which == MUT2_COWARDICE) {
+        if (creature_ptr->muta3 & MUT3_FEARLESS) {
+            msg_print(_("恐れ知らずでなくなった。", "You no longer feel fearless."));
+            creature_ptr->muta3 &= ~(MUT3_FEARLESS);
+        }
+    }
+
+    if (gm_ptr->muta_which == MUT2_BEAK) {
+        if (creature_ptr->muta2 & MUT2_TRUNK) {
+            msg_print(_("あなたの鼻はもう象の鼻のようではなくなった。", "Your nose is no longer elephantine."));
+            creature_ptr->muta2 &= ~(MUT2_TRUNK);
+        }
+    }
+
+    if (gm_ptr->muta_which == MUT2_TRUNK) {
+        if (creature_ptr->muta2 & MUT2_BEAK) {
+            msg_print(_("硬いクチバシがなくなった。", "You no longer have a hard beak."));
+            creature_ptr->muta2 &= ~(MUT2_BEAK);
+        }
+    }
+}
+
+/*!
+ * @brief プレイヤーに突然変異を与える
+ * @param choose_mut 与えたい突然変異のID、0ならばランダムに選択
+ * @return なし
+ */
+bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut)
+{
+    gm_type tmp_gm;
+    gm_type *gm_ptr = initialize_gm_type(&tmp_gm, choose_mut);
+    sweep_gain_mutation(creature_ptr, gm_ptr);
+    if (!gm_ptr->muta_chosen) {
+        msg_print(_("普通になった気がする。", "You feel normal."));
+        return FALSE;
+    }
+
+    chg_virtue(creature_ptr, V_CHANCE, 1);
+    race_dependent_mutation(creature_ptr, gm_ptr);
+    msg_print(_("突然変異した!", "You mutate!"));
+    msg_print(gm_ptr->muta_desc);
+    if (gm_ptr->muta_class != NULL)
+        *gm_ptr->muta_class |= gm_ptr->muta_which;
+
+    if (gm_ptr->muta_class == &(creature_ptr->muta3)) {
+        neutralize_base_status(creature_ptr, gm_ptr);
+    } else if (gm_ptr->muta_class == &(creature_ptr->muta2)) {
+        neutralize_other_status(creature_ptr, gm_ptr);
+    }
+
+    creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(creature_ptr);
+    creature_ptr->update |= PU_BONUS;
+    handle_stuff(creature_ptr);
+    return TRUE;
+}
diff --git a/src/mutation/mutation-investor.h b/src/mutation/mutation-investor.h
new file mode 100644 (file)
index 0000000..f7e89b8
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut);
index c3397d4..a582d38 100644 (file)
@@ -39,6 +39,7 @@
 #include "mutation/gain-mutation-switcher.h"
 #include "mutation/gain-mutation-util.h"
 #include "mutation/mutation-flag-types.h"
+#include "mutation/mutation-investor.h" // todo 相互依存している、このファイルからの依存はOK.
 #include "mutation/mutation-techniques.h"
 #include "object-enchant/item-feeling.h"
 #include "object-hook/hook-checker.h"
 #include "target/target-getter.h"
 #include "view/display-messages.h"
 
-static void sweep_gain_mutation(player_type *creature_ptr, gm_type *gm_ptr)
-{
-    int attempts_left = 20;
-    if (gm_ptr->choose_mut)
-        attempts_left = 1;
-
-    while (attempts_left--) {
-        switch_gain_mutation(creature_ptr, gm_ptr);
-        if ((gm_ptr->muta_class != NULL) && (gm_ptr->muta_which != 0) && ((*gm_ptr->muta_class & gm_ptr->muta_which) == 0))
-            gm_ptr->muta_chosen = TRUE;
-
-        if (gm_ptr->muta_chosen)
-            break;
-    }
-}
-
-static void race_dependent_mutation(player_type *creature_ptr, gm_type *gm_ptr)
-{
-    if (gm_ptr->choose_mut != 0)
-        return;
-
-    if (creature_ptr->prace == RACE_VAMPIRE && !(creature_ptr->muta1 & MUT1_HYPN_GAZE) && (randint1(10) < 7)) {
-        gm_ptr->muta_class = &(creature_ptr->muta1);
-        gm_ptr->muta_which = MUT1_HYPN_GAZE;
-        gm_ptr->muta_desc = _("眼が幻惑的になった...", "Your eyes look mesmerizing...");
-        return;
-    }
-    
-    if (creature_ptr->prace == RACE_IMP && !(creature_ptr->muta2 & MUT2_HORNS) && (randint1(10) < 7)) {
-        gm_ptr->muta_class = &(creature_ptr->muta2);
-        gm_ptr->muta_which = MUT2_HORNS;
-        gm_ptr->muta_desc = _("角が額から生えてきた!", "Horns pop forth into your forehead!");
-        return;
-    }
-    
-    if (creature_ptr->prace == RACE_YEEK && !(creature_ptr->muta1 & MUT1_SHRIEK) && (randint1(10) < 7)) {
-        gm_ptr->muta_class = &(creature_ptr->muta1);
-        gm_ptr->muta_which = MUT1_SHRIEK;
-        gm_ptr->muta_desc = _("声質がかなり強くなった。", "Your vocal cords get much tougher.");
-        return;
-    }
-    
-    if (creature_ptr->prace == RACE_BEASTMAN && !(creature_ptr->muta1 & MUT1_POLYMORPH) && (randint1(10) < 2)) {
-        gm_ptr->muta_class = &(creature_ptr->muta1);
-        gm_ptr->muta_which = MUT1_POLYMORPH;
-        gm_ptr->muta_desc = _("あなたの肉体は変化できるようになった、", "Your body seems mutable.");
-        return;
-    }
-    
-    if (creature_ptr->prace == RACE_MIND_FLAYER && !(creature_ptr->muta2 & MUT2_TENTACLES) && (randint1(10) < 7)) {
-        gm_ptr->muta_class = &(creature_ptr->muta2);
-        gm_ptr->muta_which = MUT2_TENTACLES;
-        gm_ptr->muta_desc = _("邪悪な触手が口の周りに生えた。", "Evil-looking tentacles sprout from your mouth.");
-    }
-}
-
-static void neutralize_base_status(player_type *creature_ptr, gm_type *gm_ptr)
-{
-    if (gm_ptr->muta_which == MUT3_PUNY) {
-        if (creature_ptr->muta3 & MUT3_HYPER_STR) {
-            msg_print(_("あなたはもう超人的に強くはない!", "You no longer feel super-strong!"));
-            creature_ptr->muta3 &= ~(MUT3_HYPER_STR);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_HYPER_STR) {
-        if (creature_ptr->muta3 & MUT3_PUNY) {
-            msg_print(_("あなたはもう虚弱ではない!", "You no longer feel puny!"));
-            creature_ptr->muta3 &= ~(MUT3_PUNY);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_MORONIC) {
-        if (creature_ptr->muta3 & MUT3_HYPER_INT) {
-            msg_print(_("あなたの脳はもう生体コンピュータではない。", "Your brain is no longer a living computer."));
-            creature_ptr->muta3 &= ~(MUT3_HYPER_INT);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_HYPER_INT) {
-        if (creature_ptr->muta3 & MUT3_MORONIC) {
-            msg_print(_("あなたはもう精神薄弱ではない。", "You are no longer moronic."));
-            creature_ptr->muta3 &= ~(MUT3_MORONIC);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_IRON_SKIN) {
-        if (creature_ptr->muta3 & MUT3_SCALES) {
-            msg_print(_("鱗がなくなった。", "You lose your scales."));
-            creature_ptr->muta3 &= ~(MUT3_SCALES);
-        }
-
-        if (creature_ptr->muta3 & MUT3_FLESH_ROT) {
-            msg_print(_("肉体が腐乱しなくなった。", "Your flesh rots no longer."));
-            creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
-        }
-
-        if (creature_ptr->muta3 & MUT3_WART_SKIN) {
-            msg_print(_("肌のイボイボがなくなった。", "You lose your warts."));
-            creature_ptr->muta3 &= ~(MUT3_WART_SKIN);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_WART_SKIN || gm_ptr->muta_which == MUT3_SCALES || gm_ptr->muta_which == MUT3_FLESH_ROT) {
-        if (creature_ptr->muta3 & MUT3_IRON_SKIN) {
-            msg_print(_("あなたの肌はもう鉄ではない。", "Your skin is no longer made of steel."));
-            creature_ptr->muta3 &= ~(MUT3_IRON_SKIN);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_FEARLESS) {
-        if (creature_ptr->muta2 & MUT2_COWARDICE) {
-            msg_print(_("臆病でなくなった。", "You are no longer cowardly."));
-            creature_ptr->muta2 &= ~(MUT2_COWARDICE);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_FLESH_ROT) {
-        if (creature_ptr->muta3 & MUT3_REGEN) {
-            msg_print(_("急速に回復しなくなった。", "You stop regenerating."));
-            creature_ptr->muta3 &= ~(MUT3_REGEN);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_REGEN) {
-        if (creature_ptr->muta3 & MUT3_FLESH_ROT) {
-            msg_print(_("肉体が腐乱しなくなった。", "Your flesh stops rotting."));
-            creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_LIMBER) {
-        if (creature_ptr->muta3 & MUT3_ARTHRITIS) {
-            msg_print(_("関節が痛くなくなった。", "Your joints stop hurting."));
-            creature_ptr->muta3 &= ~(MUT3_ARTHRITIS);
-        }
-
-        return;
-    }
-    
-    if (gm_ptr->muta_which == MUT3_ARTHRITIS) {
-        if (creature_ptr->muta3 & MUT3_LIMBER) {
-            msg_print(_("あなたはしなやかでなくなった。", "You no longer feel limber."));
-            creature_ptr->muta3 &= ~(MUT3_LIMBER);
-        }
-
-        return;
-    }
-}
-
-static void neutralize_other_status(player_type *creature_ptr, gm_type *gm_ptr)
-{
-    if (gm_ptr->muta_which == MUT2_COWARDICE) {
-        if (creature_ptr->muta3 & MUT3_FEARLESS) {
-            msg_print(_("恐れ知らずでなくなった。", "You no longer feel fearless."));
-            creature_ptr->muta3 &= ~(MUT3_FEARLESS);
-        }
-    }
-
-    if (gm_ptr->muta_which == MUT2_BEAK) {
-        if (creature_ptr->muta2 & MUT2_TRUNK) {
-            msg_print(_("あなたの鼻はもう象の鼻のようではなくなった。", "Your nose is no longer elephantine."));
-            creature_ptr->muta2 &= ~(MUT2_TRUNK);
-        }
-    }
-
-    if (gm_ptr->muta_which == MUT2_TRUNK) {
-        if (creature_ptr->muta2 & MUT2_BEAK) {
-            msg_print(_("硬いクチバシがなくなった。", "You no longer have a hard beak."));
-            creature_ptr->muta2 &= ~(MUT2_BEAK);
-        }
-    }
-}
-
-/*!
- * @brief プレイヤーに突然変異を与える
- * @param choose_mut 与えたい突然変異のID、0ならばランダムに選択
- * @return なし
- */
-bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut)
-{
-    gm_type tmp_gm;
-    gm_type *gm_ptr = initialize_gm_type(&tmp_gm, choose_mut);
-    sweep_gain_mutation(creature_ptr, gm_ptr);
-    if (!gm_ptr->muta_chosen) {
-        msg_print(_("普通になった気がする。", "You feel normal."));
-        return FALSE;
-    }
-
-    chg_virtue(creature_ptr, V_CHANCE, 1);
-    race_dependent_mutation(creature_ptr, gm_ptr);
-    msg_print(_("突然変異した!", "You mutate!"));
-    msg_print(gm_ptr->muta_desc);
-    if (gm_ptr->muta_class != NULL)
-        *gm_ptr->muta_class |= gm_ptr->muta_which;
-
-    if (gm_ptr->muta_class == &(creature_ptr->muta3)) {
-        neutralize_base_status(creature_ptr, gm_ptr);
-    } else if (gm_ptr->muta_class == &(creature_ptr->muta2)) {
-        neutralize_other_status(creature_ptr, gm_ptr);
-    }
-
-    creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(creature_ptr);
-    creature_ptr->update |= PU_BONUS;
-    handle_stuff(creature_ptr);
-    return TRUE;
-}
-
 /*!
  * @brief プレイヤーから突然変異を取り除く
  * @param choose_mut 取り除きたい突然変異のID、0ならばランダムに消去
index c904b09..3edcf48 100644 (file)
@@ -2,7 +2,6 @@
 
 #include "system/angband.h"
 
-bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut);
 bool lose_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut);
 void lose_all_mutations(player_type *creature_ptr);
 int calc_mutant_regenerate_mod(player_type *creature_ptr);
index f256868..9fa6983 100644 (file)
@@ -14,6 +14,7 @@
 #include "inventory/inventory-object.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
+#include "mutation/mutation-investor.h"
 #include "mutation/mutation.h"
 #include "object/object-broken.h"
 #include "object/object-generator.h"
index 61c5690..c1651d7 100644 (file)
@@ -9,7 +9,7 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "mutation/mutation-flag-types.h"
-#include "mutation/mutation.h"
+#include "mutation/mutation-investor.h"
 #include "object-enchant/object-curse.h"
 #include "object/object-kind-hook.h"
 #include "player/player-class.h"
index a04d35f..d01a35b 100644 (file)
@@ -44,6 +44,7 @@
 #include "monster/monster-update.h"
 #include "monster/smart-learn-types.h"
 #include "mutation/mutation-flag-types.h"
+#include "mutation/mutation-investor.h"
 #include "mutation/mutation.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/special-object-flags.h"
index 28f7015..d71c313 100644 (file)
@@ -11,7 +11,7 @@
 #include "main/sound-of-music.h"
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
-#include "mutation/mutation.h"
+#include "mutation/mutation-investor.h"
 #include "player/avatar.h"
 #include "player/player-damage.h"
 #include "spell-kind/earthquake.h"
index bb0cd55..fe32b6d 100644 (file)
@@ -10,6 +10,7 @@
 #include "core/window-redrawer.h"
 #include "game-option/disturbance-options.h"
 #include "grid/grid.h"
+#include "mutation/mutation-investor.h"
 #include "mutation/mutation.h"
 #include "player/avatar.h"
 #include "player/player-class.h"
index dae708c..8df699b 100644 (file)
@@ -48,7 +48,7 @@
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "monster/smart-learn-types.h"
-#include "mutation/mutation.h"
+#include "mutation/mutation-investor.h"
 #include "object-enchant/apply-magic.h"
 #include "object-enchant/item-apply-magic.h"
 #include "object-enchant/trc-types.h"