OSDN Git Service

[Refactor] #963 Moved stop_singing() from player-status.h to spells-song.h
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Wed, 28 Apr 2021 14:51:05 +0000 (23:51 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Thu, 29 Apr 2021 09:39:41 +0000 (18:39 +0900)
15 files changed:
src/action/activation-execution.cpp
src/cmd-action/cmd-move.cpp
src/cmd-item/cmd-eat.cpp
src/mutation/mutation-processor.cpp
src/object-activation/activation-breath.cpp
src/object-activation/activation-others.cpp
src/object-use/quaff-execution.cpp
src/object-use/read-execution.cpp
src/player/player-status.cpp
src/player/player-status.h
src/racial/racial-switcher.cpp
src/realm/realm-song.cpp
src/spell-realm/spells-song.cpp
src/spell-realm/spells-song.h
src/status/action-setter.cpp

index 3c2446b..804b128 100644 (file)
@@ -32,6 +32,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "sv-definition/sv-lite-types.h"
 #include "sv-definition/sv-ring-types.h"
index 0712b02..c274697 100644 (file)
@@ -30,6 +30,7 @@
 #include "player/player-status.h"
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "status/action-setter.h"
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
index b5b0fbc..ae062b6 100644 (file)
@@ -35,6 +35,7 @@
 #include "player/player-status.h"
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spells-status.h"
 #include "status/action-setter.h"
 #include "status/bad-status-setter.h"
index cb3f401..8ad0c66 100644 (file)
@@ -29,6 +29,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell-kind/spells-world.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "spell/summon-types.h"
 #include "status/bad-status-setter.h"
index 158e9c6..bb64bb9 100644 (file)
@@ -4,6 +4,7 @@
 #include "player/player-status.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "status/element-resistance.h"
 #include "sv-definition/sv-ring-types.h"
index 81a7e87..883bc22 100644 (file)
@@ -38,6 +38,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell-kind/spells-world.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "spell/spells-status.h"
 #include "status/bad-status-setter.h"
index ef0f128..6363213 100644 (file)
@@ -35,6 +35,7 @@
 #include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-teleport.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/base-status.h"
index 507eba2..4281428 100644 (file)
@@ -45,6 +45,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell-kind/spells-world.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "spell/spells-object.h"
 #include "spell/spells-summon.h"
index 2d6807c..84b8546 100644 (file)
@@ -88,6 +88,7 @@
 #include "specific-object/bow.h"
 #include "specific-object/torch.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/range-calc.h"
 #include "spell/spells-describer.h"
 #include "spell/spells-execution.h"
@@ -3206,39 +3207,6 @@ bool can_two_hands_wielding(player_type *creature_ptr)
 }
 
 /*!
- * @brief 歌の停止を処理する / Stop singing if the player is a Bard
- * @return なし
- */
-void stop_singing(player_type *creature_ptr)
-{
-    if (creature_ptr->pclass != CLASS_BARD)
-        return;
-
-    /* Are there interupted song? */
-    if (get_interrupting_song_effect(creature_ptr) != 0) {
-        /* Forget interupted song */
-        set_interrupting_song_effect(creature_ptr, MUSIC_NONE);
-        return;
-    }
-
-    /* The player is singing? */
-    if (get_singing_song_effect(creature_ptr) == 0)
-        return;
-
-    /* Hack -- if called from set_action(), avoid recursive loop */
-    if (creature_ptr->action == ACTION_SING)
-        set_action(creature_ptr, ACTION_NONE);
-
-    /* Message text of each song or etc. */
-    exe_spell(creature_ptr, REALM_MUSIC, get_singing_song_id(creature_ptr), SPELL_STOP);
-
-    set_singing_song_effect(creature_ptr, MUSIC_NONE);
-    set_singing_song_id(creature_ptr, 0);
-    set_bits(creature_ptr->update, PU_BONUS);
-    set_bits(creature_ptr->redraw, PR_STATUS);
-}
-
-/*!
  * @brief 口を使う継続的な処理を中断する
  * @param caster_ptr プレーヤーへの参照ポインタ
  * @return なし
index 46246f3..1a35eb8 100644 (file)
@@ -48,7 +48,6 @@ bool is_shero(player_type *creature_ptr);
 bool is_echizen(player_type *creature_ptr);
 bool is_in_dungeon(player_type *creature_ptr);
 
-void stop_singing(player_type *creature_ptr);
 void stop_mouth(player_type *caster_ptr);
 PERCENTAGE calculate_upkeep(player_type *creature_ptr);
 bool music_singing(player_type *caster_ptr, int music_songs);
index dc61e29..47cb982 100644 (file)
@@ -69,6 +69,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell-kind/spells-world.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "spell/spells-status.h"
 #include "status/action-setter.h"
index 90e3a28..b7832e3 100644 (file)
@@ -18,6 +18,7 @@
 #include "spell-kind/spells-neighbor.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-world.h"
+#include "spell-realm/spells-song.h"
 #include "spell/spell-types.h"
 #include "spell/spells-status.h"
 #include "status/action-setter.h"
index 3398616..14130d9 100644 (file)
 #include "spell/spell-info.h"
 #include "spell/spells-execution.h"
 #include "spell/technic-info-table.h"
+#include "status/action-setter.h"
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
+#include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
 
 /*!
@@ -118,3 +120,30 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
     handle_stuff(creature_ptr);
     return TRUE;
 }
+
+/*!
+ * @brief 歌の停止を処理する / Stop singing if the player is a Bard
+ * @return なし
+ */
+void stop_singing(player_type *creature_ptr)
+{
+    if (creature_ptr->pclass != CLASS_BARD)
+        return;
+
+    if (get_interrupting_song_effect(creature_ptr) != 0) {
+        set_interrupting_song_effect(creature_ptr, MUSIC_NONE);
+        return;
+    }
+
+    if (get_singing_song_effect(creature_ptr) == 0)
+        return;
+
+    if (creature_ptr->action == ACTION_SING)
+        set_action(creature_ptr, ACTION_NONE);
+
+    (void)exe_spell(creature_ptr, REALM_MUSIC, get_singing_song_id(creature_ptr), SPELL_STOP);
+    set_singing_song_effect(creature_ptr, MUSIC_NONE);
+    set_singing_song_id(creature_ptr, 0);
+    set_bits(creature_ptr->update, PU_BONUS);
+    set_bits(creature_ptr->redraw, PR_STATUS);
+}
index f71779e..1156d2e 100644 (file)
@@ -5,3 +5,4 @@
 typedef struct player_type player_type;
 void check_music(player_type *caster_ptr);
 bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
+void stop_singing(player_type *creature_ptr);
index 53cd076..de7ea0d 100644 (file)
@@ -18,6 +18,7 @@
 #include "player/player-status.h"
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-song.h"
 #include "system/player-type-definition.h"
 #include "view/display-messages.h"