OSDN Git Service

[Refactor] #37353 stop_singing() を player-status.c/h へ移動. / Move stop_singing() to...
authordeskull <deskull@users.sourceforge.jp>
Tue, 11 Feb 2020 05:21:51 +0000 (14:21 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 11 Feb 2020 05:27:23 +0000 (14:27 +0900)
src/cmd/cmd-basic.c
src/player-status.c
src/player-status.h
src/spells-status.c
src/spells-status.h

index dc3c76c..4a80e66 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include "angband.h"
-#include "util.h"
 #include "core.h"
 #include "term.h"
 
 #include "chest.h"
 #include "trap.h"
 #include "dungeon.h"
-#include "feature.h"
-#include "floor.h"
 #include "melee.h"
 #include "object-hook.h"
-#include "spells.h"
-#include "spells-summon.h"
 #include "spells-status.h"
 #include "monster.h"
 #include "monster-status.h"
index e36f445..dfab803 100644 (file)
@@ -5372,3 +5372,36 @@ bool can_two_hands_wielding(player_type *creature_ptr)
 {
        return !creature_ptr->riding || (creature_ptr->pet_extra_flags & PF_TWO_HANDS);
 }
+
+
+
+/*!
+* @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 (INTERUPTING_SONG_EFFECT(creature_ptr))
+       {
+               /* Forget interupted song */
+               INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
+               return;
+       }
+
+       /* The player is singing? */
+       if (!SINGING_SONG_EFFECT(creature_ptr)) 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, SINGING_SONG_ID(creature_ptr), SPELL_STOP);
+
+       SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
+       SINGING_SONG_ID(creature_ptr) = 0;
+       creature_ptr->update |= (PU_BONUS);
+       creature_ptr->redraw |= (PR_STATUS);
+}
index 3486007..41d13ac 100644 (file)
@@ -834,3 +834,5 @@ extern bool can_two_hands_wielding(player_type *creature_ptr);
 #define PY_REGEN_MNBASE         524     /* Min amount mana regen*2^16 */
 
 extern void cheat_death(player_type *creature_ptr);
+
+extern void stop_singing(player_type *creature_ptr);
index 7557041..d5b12a9 100644 (file)
@@ -172,38 +172,6 @@ bool fear_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
 }
 
 
-/*!
-* @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 (INTERUPTING_SONG_EFFECT(creature_ptr))
-       {
-               /* Forget interupted song */
-               INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
-               return;
-       }
-
-       /* The player is singing? */
-       if (!SINGING_SONG_EFFECT(creature_ptr)) 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, SINGING_SONG_ID(creature_ptr), SPELL_STOP);
-
-       SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
-       SINGING_SONG_ID(creature_ptr) = 0;
-       creature_ptr->update |= (PU_BONUS);
-       creature_ptr->redraw |= (PR_STATUS);
-}
-
-
 bool time_walk(player_type *creature_ptr)
 {
        if (creature_ptr->timewalk)
index 5dd81f5..a7c4d81 100644 (file)
@@ -10,7 +10,6 @@ extern bool stun_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL pl
 extern bool fear_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
 extern bool poly_monster(player_type *caster_ptr, DIRECTION dir, int power);
 extern bool clone_monster(player_type *caster_ptr, DIRECTION dir);
-extern void stop_singing(player_type *creature_ptr);
 extern bool time_walk(player_type *creature_ptr);
 extern void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options);
 extern bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack virtue_change);