OSDN Git Service

#37353 SINGING_COUNTを定義。 / Define SINGING_COUNT.
authorDeskull <desull@users.sourceforge.jp>
Tue, 19 Dec 2017 12:00:16 +0000 (21:00 +0900)
committerDeskull <desull@users.sourceforge.jp>
Tue, 19 Dec 2017 12:00:16 +0000 (21:00 +0900)
src/defines.h
src/do-spell.c
src/spells2.c

index c7124c6..bd7bcab 100644 (file)
@@ -5243,6 +5243,7 @@ extern int PlayerUID;
 
 #define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0])
 #define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1])
 
 #define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0])
 #define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1])
+#define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2])
 #define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0])
 #define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == (X)))
 #define music_singing_any() ((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
 #define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0])
 #define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == (X)))
 #define music_singing_any() ((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
index 04dbe2c..4308ebc 100644 (file)
@@ -7215,8 +7215,7 @@ static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        msg_print(_("静かな音楽が感覚を研ぎ澄まさせた...", "Your quiet music sharpens your sense of hearing..."));
                        /* Hack -- Initialize the turn count */
                {
                        msg_print(_("静かな音楽が感覚を研ぎ澄まさせた...", "Your quiet music sharpens your sense of hearing..."));
                        /* Hack -- Initialize the turn count */
-                       p_ptr->magic_num1[2] = 0;
-
+                       SINGING_COUNT(p_ptr) = 0;
                        start_singing(spell, MUSIC_DETECT);
                }
 
                        start_singing(spell, MUSIC_DETECT);
                }
 
@@ -7227,14 +7226,14 @@ static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cont)
                        {
 
                        if (cont)
                        {
-                               int count = p_ptr->magic_num1[2];
+                               int count = SINGING_COUNT(p_ptr);
 
                                if (count >= 19) wiz_lite(FALSE);
                                if (count >= 11)
                                {
                                        map_area(rad);
                                        if (plev > 39 && count < 19)
 
                                if (count >= 19) wiz_lite(FALSE);
                                if (count >= 11)
                                {
                                        map_area(rad);
                                        if (plev > 39 && count < 19)
-                                               p_ptr->magic_num1[2] = count + 1;
+                                               SINGING_COUNT(p_ptr) = count + 1;
                                }
                                if (count >= 6)
                                {
                                }
                                if (count >= 6)
                                {
@@ -7244,7 +7243,7 @@ static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        detect_objects_normal(rad);
 
                                        if (plev > 24 && count < 11)
                                        detect_objects_normal(rad);
 
                                        if (plev > 24 && count < 11)
-                                               p_ptr->magic_num1[2] = count + 1;
+                                               SINGING_COUNT(p_ptr) = count + 1;
                                }
                                if (count >= 3)
                                {
                                }
                                if (count >= 3)
                                {
@@ -7252,14 +7251,14 @@ static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        detect_monsters_normal(rad);
 
                                        if (plev > 19 && count < 6)
                                        detect_monsters_normal(rad);
 
                                        if (plev > 19 && count < 6)
-                                               p_ptr->magic_num1[2] = count + 1;
+                                               SINGING_COUNT(p_ptr) = count + 1;
                                }
                                detect_traps(rad, TRUE);
                                detect_doors(rad);
                                detect_stairs(rad);
 
                                if (plev > 14 && count < 3)
                                }
                                detect_traps(rad, TRUE);
                                detect_doors(rad);
                                detect_stairs(rad);
 
                                if (plev > 14 && count < 3)
-                                       p_ptr->magic_num1[2] = count + 1;
+                                       SINGING_COUNT(p_ptr) = count + 1;
                        }
                }
 
                        }
                }
 
index 69beaa6..02526df 100644 (file)
@@ -1890,7 +1890,7 @@ bool detect_traps(POSITION range, bool known)
 
        if (known) p_ptr->dtrap = TRUE;
 
 
        if (known) p_ptr->dtrap = TRUE;
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -1912,7 +1912,7 @@ bool detect_doors(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
 
 {
        bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -1934,7 +1934,7 @@ bool detect_stairs(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
 
 {
        bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -1956,7 +1956,7 @@ bool detect_treasure(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
 
 {
        bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -2015,7 +2015,7 @@ bool detect_objects_gold(POSITION range)
                }
        }
 
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -2079,7 +2079,7 @@ bool detect_objects_normal(POSITION range)
                }
        }
 
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
 
        /* Describe */
        if (detect)
@@ -2234,7 +2234,7 @@ bool detect_monsters_normal(POSITION range)
                }
        }
 
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
 
        /* Describe */
        if (flag)
@@ -2301,7 +2301,7 @@ bool detect_monsters_invis(POSITION range)
                }
        }
 
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
 
        /* Describe */
        if (flag)
@@ -2567,7 +2567,7 @@ bool detect_monsters_string(POSITION range, cptr Match)
                }
        }
 
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
 
        /* Describe */
        if (flag)