OSDN Git Service

[Refactor] #40466 Separated spells-demon.c/h from player-effects.c/h
authorHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 13:28:00 +0000 (22:28 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 13:28:00 +0000 (22:28 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/core/magic-effects-timeout-reducer.c
src/player/player-effects.c
src/player/player-effects.h
src/realm/realm-demon.c
src/spell-realm/spells-demon.c [new file with mode: 0644]
src/spell-realm/spells-demon.h [new file with mode: 0644]

index 4efa8be..a52e440 100644 (file)
     <ClCompile Include="..\..\src\object-hook\hook-weapon.c" />\r
     <ClCompile Include="..\..\src\object-hook\hook-armor.c" />\r
     <ClCompile Include="..\..\src\spell-realm\spells-craft.c" />\r
+    <ClCompile Include="..\..\src\spell-realm\spells-demon.c" />\r
     <ClCompile Include="..\..\src\status\bad-status-setter.c" />\r
     <ClCompile Include="..\..\src\status\buff-setter.c" />\r
     <ClCompile Include="..\..\src\player\player-realm.c" />\r
     <ClInclude Include="..\..\src\object-hook\hook-quest.h" />\r
     <ClInclude Include="..\..\src\object-hook\hook-weapon.h" />\r
     <ClInclude Include="..\..\src\spell-realm\spells-craft.h" />\r
+    <ClInclude Include="..\..\src\spell-realm\spells-demon.h" />\r
     <ClInclude Include="..\..\src\status\bad-status-setter.h" />\r
     <ClInclude Include="..\..\src\status\buff-setter.h" />\r
     <ClInclude Include="..\..\src\player\player-realm.h" />\r
index 2e65498..1dc6e22 100644 (file)
     <ClCompile Include="..\..\src\status\experience.c">
       <Filter>status</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\spell-realm\spells-demon.c">
+      <Filter>spell-realm</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\status\experience.h">
       <Filter>status</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\spell-realm\spells-demon.h">
+      <Filter>spell-realm</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 9d13bd2..210b0cd 100644 (file)
@@ -550,6 +550,7 @@ hengband_SOURCES = \
        spell-realm/spells-chaos.c spell-realm/spells-chaos.h \
        spell-realm/spells-craft.c spell-realm/spells-craft.h \
        spell-realm/spells-crusade.c spell-realm/spells-crusade.h \
+       spell-realm/spells-demon.c spell-realm/spells-demon.h \
        spell-realm/spells-hex.c spell-realm/spells-hex.h \
        spell-realm/spells-song.c spell-realm/spells-song.h \
        spell-realm/spells-trump.c spell-realm/spells-trump.h \
index 80c596d..3a15e90 100644 (file)
@@ -5,6 +5,7 @@
 #include "mind/racial-kutar.h"
 #include "player/player-effects.h"
 #include "spell-realm/spells-craft.h"
+#include "spell-realm/spells-demon.h"
 #include "spell-realm/spells-song.h"
 #include "status/bad-status-setter.h"
 #include "status/buff-setter.h"
index 85eadbd..606268f 100644 (file)
@@ -62,6 +62,7 @@
 #include "realm/realm-song-numbers.h"
 #include "spell-kind/spells-floor.h"
 #include "spell-realm/spells-craft.h"
+#include "spell-realm/spells-demon.h"
 #include "spell-realm/spells-hex.h"
 #include "spell-realm/spells-song.h"
 #include "spell/spells-status.h"
@@ -378,48 +379,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
-{
-    bool notice = FALSE;
-    v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
-
-    if (creature_ptr->is_dead)
-        return FALSE;
-
-    if (v) {
-        if (creature_ptr->tim_sh_fire && !do_dec) {
-            if (creature_ptr->tim_sh_fire > v)
-                return FALSE;
-        } else if (!creature_ptr->tim_sh_fire) {
-            msg_print(_("体が炎のオーラで覆われた。", "You are enveloped by a fiery aura!"));
-            notice = TRUE;
-        }
-    } else {
-        if (creature_ptr->tim_sh_fire) {
-            msg_print(_("炎のオーラが消えた。", "The fiery aura disappeared."));
-            notice = TRUE;
-        }
-    }
-
-    creature_ptr->tim_sh_fire = v;
-    creature_ptr->redraw |= (PR_STATUS);
-
-    if (!notice)
-        return FALSE;
-
-    if (disturb_state)
-        disturb(creature_ptr, FALSE, FALSE);
-    creature_ptr->update |= (PU_BONUS);
-    handle_stuff(creature_ptr);
-    return TRUE;
-}
-
-/*!
  * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
index f171043..31587f9 100644 (file)
@@ -7,7 +7,6 @@ void dispel_player(player_type *creature_ptr);
 bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
index 6c92635..3f62f2c 100644 (file)
@@ -5,7 +5,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "player/player-class.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "player/player-race.h"
 #include "spell-kind/spells-charm.h"
 #include "spell-kind/spells-detection.h"
@@ -13,6 +12,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-pet.h"
 #include "spell-kind/spells-sight.h"
+#include "spell-realm/spells-demon.h"
 #include "spell/spells-diceroll.h"
 #include "spell/spells-object.h"
 #include "spell/spells-status.h"
diff --git a/src/spell-realm/spells-demon.c b/src/spell-realm/spells-demon.c
new file mode 100644 (file)
index 0000000..c4e1afa
--- /dev/null
@@ -0,0 +1,47 @@
+#include "spell-realm/spells-demon.h"
+#include "core/stuff-handler.h"
+#include "game-option/disturbance-options.h"
+#include "player/player-move.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
+ * @param v 継続時間
+ * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
+ */
+bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
+{
+    bool notice = FALSE;
+    v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+
+    if (creature_ptr->is_dead)
+        return FALSE;
+
+    if (v) {
+        if (creature_ptr->tim_sh_fire && !do_dec) {
+            if (creature_ptr->tim_sh_fire > v)
+                return FALSE;
+        } else if (!creature_ptr->tim_sh_fire) {
+            msg_print(_("体が炎のオーラで覆われた。", "You are enveloped by a fiery aura!"));
+            notice = TRUE;
+        }
+    } else {
+        if (creature_ptr->tim_sh_fire) {
+            msg_print(_("炎のオーラが消えた。", "The fiery aura disappeared."));
+            notice = TRUE;
+        }
+    }
+
+    creature_ptr->tim_sh_fire = v;
+    creature_ptr->redraw |= (PR_STATUS);
+
+    if (!notice)
+        return FALSE;
+
+    if (disturb_state)
+        disturb(creature_ptr, FALSE, FALSE);
+    creature_ptr->update |= (PU_BONUS);
+    handle_stuff(creature_ptr);
+    return TRUE;
+}
diff --git a/src/spell-realm/spells-demon.h b/src/spell-realm/spells-demon.h
new file mode 100644 (file)
index 0000000..4a1f47e
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);