OSDN Git Service

[Refactor] #40466 Moved set_tim_sh_holy() from player-effects.c/h to spells-crusade.c/h
authorHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 13:32:14 +0000 (22:32 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 13:32:14 +0000 (22:32 +0900)
src/core/magic-effects-timeout-reducer.c
src/player/player-effects.c
src/player/player-effects.h
src/spell-realm/spells-crusade.c
src/spell-realm/spells-crusade.h

index 3a15e90..3df2898 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-crusade.h"
 #include "spell-realm/spells-demon.h"
 #include "spell-realm/spells-song.h"
 #include "status/bad-status-setter.h"
index 606268f..b846ea4 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-crusade.h"
 #include "spell-realm/spells-demon.h"
 #include "spell-realm/spells-hex.h"
 #include "spell-realm/spells-song.h"
@@ -379,48 +380,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_tim_sh_holy(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_holy && !do_dec) {
-            if (creature_ptr->tim_sh_holy > v)
-                return FALSE;
-        } else if (!creature_ptr->tim_sh_holy) {
-            msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
-            notice = TRUE;
-        }
-    } else {
-        if (creature_ptr->tim_sh_holy) {
-            msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
-            notice = TRUE;
-        }
-    }
-
-    creature_ptr->tim_sh_holy = 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_eyeeye", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
index 31587f9..42330e7 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_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);
 bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
index b8d7267..dff920e 100644 (file)
@@ -5,15 +5,19 @@
  */
 
 #include "spell-realm/spells-crusade.h"
+#include "core/stuff-handler.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor.h"
+#include "game-option/disturbance-options.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
 #include "io/targeting.h"
+#include "player/player-move.h"
 #include "spell/range-calc.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
 #include "util/bit-flags-calculator.h"
+#include "view/display-messages.h"
 
 /*!
 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
@@ -87,3 +91,45 @@ bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
 
        return TRUE;
 }
+
+/*!
+ * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
+ * @param v 継続時間
+ * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
+ */
+bool set_tim_sh_holy(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_holy && !do_dec) {
+            if (creature_ptr->tim_sh_holy > v)
+                return FALSE;
+        } else if (!creature_ptr->tim_sh_holy) {
+            msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
+            notice = TRUE;
+        }
+    } else {
+        if (creature_ptr->tim_sh_holy) {
+            msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
+            notice = TRUE;
+        }
+    }
+
+    creature_ptr->tim_sh_holy = 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;
+}
index 3271042..2be9bf3 100644 (file)
@@ -3,3 +3,4 @@
 #include "system/angband.h"
 
 bool cast_wrath_of_the_god(player_type* caster_ptr, HIT_POINT dam, POSITION rad);
+bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);