OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / realm-song.c
index 724a4f6..5119ca5 100644 (file)
@@ -1,5 +1,7 @@
 #include "angband.h"
 #include "cmd-spell.h"
+#include "spells-status.h"
+#include "projection.h"
 
 /*!
 * @brief 歌の開始を処理する / Start singing if the player is a Bard
@@ -19,46 +21,7 @@ static void start_singing(SPELL_IDX spell, MAGIC_NUM1 song)
        /* Now the player is singing */
        set_action(ACTION_SING);
 
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
-
-       /* Redraw status bar */
-       p_ptr->redraw |= (PR_STATUS);
-}
-
-/*!
-* @brief 歌の停止を処理する / Stop singing if the player is a Bard
-* @return なし
-*/
-void stop_singing(void)
-{
-       if (p_ptr->pclass != CLASS_BARD) return;
-
-       /* Are there interupted song? */
-       if (INTERUPTING_SONG_EFFECT(p_ptr))
-       {
-               /* Forget interupted song */
-               INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
-               return;
-       }
-
-       /* The player is singing? */
-       if (!SINGING_SONG_EFFECT(p_ptr)) return;
-
-       /* Hack -- if called from set_action(), avoid recursive loop */
-       if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
-
-       /* Message text of each song or etc. */
-       do_spell(REALM_MUSIC, SINGING_SONG_ID(p_ptr), SPELL_STOP);
-
-       SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
-       SINGING_SONG_ID(p_ptr) = 0;
-
-       /* Recalculate bonuses */
-       p_ptr->update |= (PU_BONUS);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 }
 
@@ -68,7 +31,7 @@ void stop_singing(void)
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
 */
-cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -77,7 +40,6 @@ cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
        bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
        bool cont = (mode == SPELL_CONT) ? TRUE : FALSE;
        bool stop = (mode == SPELL_STOP) ? TRUE : FALSE;
-       static const char s_dam[] = _("損傷:", "dam ");
 
        DIRECTION dir;
        PLAYER_LEVEL plev = p_ptr->lev;
@@ -335,7 +297,7 @@ cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        detect_monsters_invis(rad);
                                        detect_monsters_normal(rad);
 
-                                       if (plev > 19 && count < 6)
+                                       if (plev > 19 && count < A_MAX)
                                                SINGING_COUNT(p_ptr) = count + 1;
                                }
                                detect_traps(rad, TRUE);