OSDN Git Service

[Refactor] #40466 Moved set_tim_pain_packer()...no, set_tim_eyeeye() from player...
authorHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 14:12:23 +0000 (23:12 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 30 Jun 2020 14:12:23 +0000 (23:12 +0900)
src/effect/effect-player.c
src/monster-attack/monster-attack-player.c
src/mspell/mspell-special.c
src/player/player-effects.c
src/player/player-effects.h
src/spell-realm/spells-crusade.c
src/spell-realm/spells-crusade.h

index a20cfde..c337a9e 100644 (file)
 #include "monster-race/monster-race.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
-#include "player/player-effects.h"
 #include "player/player-move.h"
 #include "player/special-defense-types.h"
 #include "realm/realm-hex-numbers.h"
+#include "spell-realm/spells-crusade.h"
 #include "spell-realm/spells-hex.h"
 #include "spell/spell-types.h"
 #include "view/display-messages.h"
index c7271b7..8ec6285 100644 (file)
 #include "object-hook/hook-armor.h"
 #include "object/item-tester-hooker.h"
 #include "pet/pet-fall-off.h"
-#include "status/bad-status-setter.h"
 #include "player/player-damage.h"
 #include "player/player-effects.h"
 #include "player/player-move.h"
 #include "player/player-skill.h"
 #include "player/special-defense-types.h"
 #include "realm/realm-hex-numbers.h"
+#include "spell-realm/spells-crusade.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell-realm/spells-hex.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
+#include "status/bad-status-setter.h"
 #include "view/display-messages.h"
 
 static bool check_no_blow(player_type *target_ptr, monap_type *monap_ptr)
index 3fca93c..108a3bd 100644 (file)
@@ -23,9 +23,9 @@
 #include "mspell/mspell-util.h"
 #include "mspell/mspells1.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "player/player-move.h"
 #include "spell-kind/spells-teleport.h"
+#include "spell-realm/spells-crusade.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
 #include "view/display-messages.h"
index 70b72b2..53aa5f5 100644 (file)
@@ -381,48 +381,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_tim_eyeeye(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_eyeeye && !do_dec) {
-            if (creature_ptr->tim_eyeeye > v)
-                return FALSE;
-        } else if (!creature_ptr->tim_eyeeye) {
-            msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
-            notice = TRUE;
-        }
-    } else {
-        if (creature_ptr->tim_eyeeye) {
-            msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
-            notice = TRUE;
-        }
-    }
-
-    creature_ptr->tim_eyeeye = 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_reflect", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
index 43a511f..a090d87 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_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool inc_stat(player_type *creature_ptr, int stat);
index dff920e..d98c4cb 100644 (file)
@@ -13,6 +13,7 @@
 #include "grid/grid.h"
 #include "io/targeting.h"
 #include "player/player-move.h"
+#include "spell-realm/spells-crusade.h"
 #include "spell/range-calc.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
@@ -133,3 +134,46 @@ bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
     handle_stuff(creature_ptr);
     return TRUE;
 }
+
+/*!
+ * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
+ * @param v 継続時間
+ * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す
+ * @details 呪術領域でも使えるが、汎用性と行数の兼ね合いを考えて破邪側に入れた
+ */
+bool set_tim_eyeeye(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_eyeeye && !do_dec) {
+            if (creature_ptr->tim_eyeeye > v)
+                return FALSE;
+        } else if (!creature_ptr->tim_eyeeye) {
+            msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
+            notice = TRUE;
+        }
+    } else {
+        if (creature_ptr->tim_eyeeye) {
+            msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
+            notice = TRUE;
+        }
+    }
+
+    creature_ptr->tim_eyeeye = 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 2be9bf3..a7f341b 100644 (file)
@@ -4,3 +4,4 @@
 
 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);
+bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);