OSDN Git Service

[Refactor] #40466 Moved set_tim_stealth() from player-effects.c/h to spells-song.c/h
authorHourier <hourier@users.sourceforge.jp>
Mon, 29 Jun 2020 13:12:20 +0000 (22:12 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 29 Jun 2020 13:12:20 +0000 (22:12 +0900)
src/core/magic-effects-timeout-reducer.c
src/player/player-effects.c
src/player/player-effects.h
src/spell-realm/spells-song.c
src/spell-realm/spells-song.h

index 0118dc5..4893ed9 100644 (file)
@@ -4,6 +4,7 @@
 #include "mind/racial-kutar.h"
 #include "player/player-effects.h"
 #include "spell-realm/spells-craft.h"
+#include "spell-realm/spells-song.h"
 #include "status/bad-status-setter.h"
 #include "status/buff-setter.h"
 #include "status/element-resistance.h"
index 7c692e9..18ff337 100644 (file)
@@ -63,6 +63,7 @@
 #include "spell-kind/spells-floor.h"
 #include "spell-realm/spells-craft.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spells-status.h"
 #include "status/bad-status-setter.h"
 #include "status/buff-setter.h"
@@ -527,48 +528,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_tim_stealth(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_stealth && !do_dec) {
-            if (creature_ptr->tim_stealth > v)
-                return FALSE;
-        } else if (!is_time_limit_stealth(creature_ptr)) {
-            msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
-            notice = TRUE;
-        }
-    } else {
-        if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH)) {
-            msg_print(_("足音が大きくなった。", "You no longer walk silently."));
-            notice = TRUE;
-        }
-    }
-
-    creature_ptr->tim_stealth = 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_levitation", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
index 455f82b..a163689 100644 (file)
@@ -9,7 +9,6 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 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_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 bool set_tim_sh_touki(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);
index bc9e078..9f55378 100644 (file)
@@ -1,9 +1,12 @@
 #include "spell-realm/spells-song.h"
+#include "core/stuff-handler.h"
 #include "floor/floor.h"
+#include "game-option/disturbance-options.h"
+#include "player/player-move.h"
 #include "player/player-skill.h"
 #include "realm/realm-song-numbers.h"
-#include "spell/spells-execution.h"
 #include "spell/spell-info.h"
+#include "spell/spells-execution.h"
 #include "spell/technic-info-table.h"
 #include "view/display-messages.h"
 
@@ -65,3 +68,45 @@ void check_music(player_type *caster_ptr)
 
     exe_spell(caster_ptr, REALM_MUSIC, spell, SPELL_CONT);
 }
+
+/*!
+ * @brief 隠遁の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
+ * @param v 継続時間
+ * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
+ */
+bool set_tim_stealth(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_stealth && !do_dec) {
+            if (creature_ptr->tim_stealth > v)
+                return FALSE;
+        } else if (!is_time_limit_stealth(creature_ptr)) {
+            msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
+            notice = TRUE;
+        }
+    } else {
+        if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH)) {
+            msg_print(_("足音が大きくなった。", "You no longer walk silently."));
+            notice = TRUE;
+        }
+    }
+
+    creature_ptr->tim_stealth = 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 739df91..53c083d 100644 (file)
@@ -3,3 +3,4 @@
 #include "system/angband.h"
 
 void check_music(player_type *caster_ptr);
+bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);