OSDN Git Service

吟遊詩人の歌に関する修正.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 10 Feb 2004 17:01:59 +0000 (17:01 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 10 Feb 2004 17:01:59 +0000 (17:01 +0000)
* 食べ物を食べる, 魔法の笛を吹く, ブレスを吐くなどといった口を使う行
  動の際にも歌が止まるように修正.
* 吟遊詩人が何かの歌を歌っている判定をマクロmusic_singing_any()として
  まとめた. music_singing()と違い, 番号の指定はない.

src/cmd6.c
src/defines.h
src/dungeon.c
src/load.c
src/mspells1.c
src/mutation.c
src/racial.c

index ebd8d1a..7e178e9 100644 (file)
@@ -59,6 +59,8 @@ static void do_cmd_eat_food_aux(int item)
        int ident, lev;
        object_type *o_ptr;
 
+       if (music_singing_any()) stop_singing();
+
        /* Get the item (in the pack) */
        if (item >= 0)
        {
@@ -726,10 +728,7 @@ static void do_cmd_quaff_potion_aux(int item)
                return;
        }
 
-       if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
-       {
-               stop_singing();
-       }
+       if (music_singing_any()) stop_singing();
 
        /* Get the item (in the pack) */
        if (item >= 0)
@@ -1615,10 +1614,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
                return;
        }
 
-       if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
-       {
-               stop_singing();
-       }
+       if (music_singing_any()) stop_singing();
 
        /* Not identified yet */
        ident = FALSE;
@@ -5289,6 +5285,7 @@ msg_print("
 
                        case ART_BOROMIR:
                        {
+                               if (music_singing_any()) stop_singing();
 #ifdef JP
                                msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤­ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
 #else
@@ -5929,6 +5926,8 @@ msg_print("
                /* Get a direction for breathing (or abort) */
                if (!get_aim_dir(&dir)) return;
 
+               if (music_singing_any()) stop_singing();
+
                /* Branch on the sub-type */
                switch (o_ptr->sval)
                {
@@ -6372,6 +6371,8 @@ msg_print("
 
        else if (o_ptr->tval == TV_WHISTLE)
        {
+               if (music_singing_any()) stop_singing();
+
 #if 0
                if (object_is_cursed(o_ptr))
                {
index a1102fe..6a76a06 100644 (file)
@@ -5206,7 +5206,8 @@ extern int PlayerUID;
 
 #define MUSIC_DETECT            101
 
-#define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == X))
+#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 HISSATSU_NONE   0
 #define HISSATSU_2      1
index be59821..240987a 100644 (file)
@@ -2670,6 +2670,7 @@ static void process_world_aux_mutation(void)
 
                msg_print(NULL);
                set_food(PY_FOOD_WEAK);
+               if (music_singing_any()) stop_singing();
        }
 
        if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
index cf899a7..bec4b48 100644 (file)
@@ -1636,7 +1636,7 @@ static void rd_extra(void)
                        }
                }
        }
-       if ((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0]) p_ptr->action = ACTION_SING;
+       if (music_singing_any()) p_ptr->action = ACTION_SING;
 
        if (z_older_than(11, 0, 7))
        {
index 3d29ace..5525d74 100644 (file)
@@ -1723,9 +1723,8 @@ msg_format("%^s
 #else
                                msg_print("Your hands stop glowing.");
 #endif
-
                        }
-                       if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
+                       if (music_singing_any())
                        {
                                p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
                                p_ptr->magic_num1[0] = 0;
index 63fbbb7..ab7e59e 100644 (file)
@@ -3309,6 +3309,7 @@ bool mutation_power_aux(u32b power)
        {
                case MUT1_SPIT_ACID:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_print("»À¤òÅǤ­¤«¤±¤¿...");
 #else
@@ -3320,6 +3321,7 @@ bool mutation_power_aux(u32b power)
 
                case MUT1_BR_FIRE:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿...");
 #else
@@ -3393,6 +3395,8 @@ bool mutation_power_aux(u32b power)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!(c_ptr->m_idx))
                                {
 #ifdef JP
@@ -3444,10 +3448,12 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_SMELL_MET:
+                       if (music_singing_any()) stop_singing();
                        (void)detect_treasure(DETECT_RAD_DEFAULT);
                        break;
 
                case MUT1_SMELL_MON:
+                       if (music_singing_any()) stop_singing();
                        (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
                        break;
 
@@ -3467,6 +3473,8 @@ bool mutation_power_aux(u32b power)
                                c_ptr = &cave[y][x];
                                f_ptr = &f_info[c_ptr->feat];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_HURT_ROCK))
                                {
 #ifdef JP
@@ -3544,6 +3552,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_SHRIEK:
+                       if (music_singing_any()) stop_singing();
                        (void)fire_ball(GF_SOUND, 0, 2 * lvl, 8);
                        (void)aggravate_monsters(0);
                        break;
index 4a09d48..0d10f6e 100644 (file)
@@ -1354,6 +1354,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
@@ -1384,6 +1385,8 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
@@ -1589,6 +1592,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_YEEK:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¶«¤ÓÀ¼¤ò¾å¤²¤¿¡ª");
 #else
@@ -1600,6 +1604,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_KLACKON:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_print("»À¤òÅǤ¤¤¿¡£");
 #else
@@ -1840,6 +1845,8 @@ static bool cmd_racial_power_aux(s32b command)
                                        }
                                }
 
+                               if (music_singing_any()) stop_singing();
+
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", Type_desc);
 #else
@@ -1922,6 +1929,8 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
@@ -1972,6 +1981,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_SPECTRE:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       if (music_singing_any()) stop_singing();
 #ifdef JP
                        msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤¶«¤ÓÀ¼¤ò¤¢¤²¤¿¡ª");
 #else
@@ -1996,6 +2006,7 @@ static bool cmd_racial_power_aux(s32b command)
                        {
                                int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
                                if (!get_aim_dir(&dir)) return FALSE;
+                               if (music_singing_any()) stop_singing();
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else