OSDN Git Service

bug fix: disable target of spreading shuriken with index 0
[hengband/hengband.git] / src / mutation.c
index 4773cc3..bd74d3d 100644 (file)
@@ -3299,6 +3299,13 @@ int calc_mutant_regenerate_mod(void)
 }
 
 
+void mutation_stop_mouth()
+{
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
 bool mutation_power_aux(u32b power)
 {
        int     dir = 0;
@@ -3309,6 +3316,7 @@ bool mutation_power_aux(u32b power)
        {
                case MUT1_SPIT_ACID:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       mutation_stop_mouth();
 #ifdef JP
                        msg_print("»À¤òÅǤ­¤«¤±¤¿...");
 #else
@@ -3320,6 +3328,7 @@ bool mutation_power_aux(u32b power)
 
                case MUT1_BR_FIRE:
                        if (!get_aim_dir(&dir)) return FALSE;
+                       mutation_stop_mouth();
 #ifdef JP
                        msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿...");
 #else
@@ -3358,7 +3367,7 @@ bool mutation_power_aux(u32b power)
                        msg_print("You concentrate...");
 #endif
 
-                       teleport_player(10 + 4 * lvl);
+                       teleport_player(10 + 4 * lvl, 0L);
                        break;
 
                case MUT1_MIND_BLST:
@@ -3393,6 +3402,8 @@ bool mutation_power_aux(u32b power)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               mutation_stop_mouth();
+
                                if (!(c_ptr->m_idx))
                                {
 #ifdef JP
@@ -3444,30 +3455,35 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_SMELL_MET:
+                       mutation_stop_mouth();
                        (void)detect_treasure(DETECT_RAD_DEFAULT);
                        break;
 
                case MUT1_SMELL_MON:
+                       mutation_stop_mouth();
                        (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
                        break;
 
                case MUT1_BLINK:
-                       teleport_player(10);
+                       teleport_player(10, 0L);
                        break;
 
                case MUT1_EAT_ROCK:
                        {
-                               int x, y, ox, oy;
+                               int x, y;
                                cave_type *c_ptr;
-                               feature_type *f_ptr;
+                               feature_type *f_ptr, *mimic_f_ptr;
 
                                if (!get_rep_dir2(&dir)) return FALSE;
                                y = py + ddy[dir];
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
                                f_ptr = &f_info[c_ptr->feat];
+                               mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
 
-                               if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_HURT_ROCK))
+                               mutation_stop_mouth();
+
+                               if (!have_flag(mimic_f_ptr->flags, FF_HURT_ROCK))
                                {
 #ifdef JP
                                        msg_print("¤³¤ÎÃÏ·Á¤Ï¿©¤Ù¤é¤ì¤Ê¤¤¡£");
@@ -3479,9 +3495,9 @@ bool mutation_power_aux(u32b power)
                                else if (have_flag(f_ptr->flags, FF_PERMANENT))
                                {
 #ifdef JP
-                                       msg_format("¤¤¤Æ¤Ã¡ª¤³¤Î%s¤Ï¤¢¤Ê¤¿¤Î»õ¤è¤ê¹Å¤¤¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
+                                       msg_format("¤¤¤Æ¤Ã¡ª¤³¤Î%s¤Ï¤¢¤Ê¤¿¤Î»õ¤è¤ê¹Å¤¤¡ª", f_name + mimic_f_ptr->name);
 #else
-                                       msg_format("Ouch!  This %s is harder than your teeth!", f_name + f_info[get_feat_mimic(c_ptr)].name);
+                                       msg_format("Ouch!  This %s is harder than your teeth!", f_name + mimic_f_ptr->name);
 #endif
                                        break;
                                }
@@ -3506,6 +3522,15 @@ bool mutation_power_aux(u32b power)
 #endif
                                        break;
                                }
+                               else if (have_flag(f_ptr->flags, FF_GLASS))
+                               {
+#ifdef JP
+                                       msg_print("¥¬¥é¥¹¤ÎÌ£¤Ï¹¥¤­¤¸¤ã¤Ê¤¤¡ª");
+#else
+                                       msg_print("You don't like the glassy taste!");
+#endif
+                                       break;
+                               }
                                else if (have_flag(f_ptr->flags, FF_DOOR) || have_flag(f_ptr->flags, FF_CAN_DIG))
                                {
                                        (void)set_food(p_ptr->food + 3000);
@@ -3517,9 +3542,9 @@ bool mutation_power_aux(u32b power)
                                else
                                {
 #ifdef JP
-                                       msg_format("¤³¤Î%s¤Ï¤È¤Æ¤â¤ª¤¤¤·¤¤¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
+                                       msg_format("¤³¤Î%s¤Ï¤È¤Æ¤â¤ª¤¤¤·¤¤¡ª", f_name + mimic_f_ptr->name);
 #else
-                                       msg_format("This %s is very filling!", f_name + f_info[get_feat_mimic(c_ptr)].name);
+                                       msg_format("This %s is very filling!", f_name + mimic_f_ptr->name);
 #endif
                                        (void)set_food(p_ptr->food + 10000);
                                }
@@ -3527,29 +3552,8 @@ bool mutation_power_aux(u32b power)
                                /* Destroy the wall */
                                cave_alter_feat(y, x, FF_HURT_ROCK);
 
-                               oy = py;
-                               ox = px;
-
-                               py = y;
-                               px = x;
-
-                               if (p_ptr->riding)
-                               {
-                                       m_list[p_ptr->riding].fy = py;
-                                       m_list[p_ptr->riding].fx = px;
-                                       cave[py][px].m_idx = p_ptr->riding;
-                                       cave[oy][ox].m_idx = 0;
-                                       update_mon(p_ptr->riding, TRUE);
-                               }
-
-                               lite_spot(py, px);
-                               lite_spot(oy, ox);
-
-                               verify_panel();
-
-                               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-                               p_ptr->update |= (PU_DISTANCE);
-                               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+                               /* Move the player */
+                               (void)move_player_effect(y, x, MPE_DONT_PICKUP);
                        }
                        break;
 
@@ -3565,6 +3569,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_SHRIEK:
+                       mutation_stop_mouth();
                        (void)fire_ball(GF_SOUND, 0, 2 * lvl, 8);
                        (void)aggravate_monsters(0);
                        break;
@@ -3582,7 +3587,7 @@ bool mutation_power_aux(u32b power)
                                        object_type *o_ptr = &inventory[i];
 
                                        if (!o_ptr->k_idx) continue;
-                                       if (!cursed_p(o_ptr)) continue;
+                                       if (!object_is_cursed(o_ptr)) continue;
 
                                        o_ptr->feeling = FEEL_CURSED;
                                }
@@ -3693,7 +3698,7 @@ bool mutation_power_aux(u32b power)
 #else
                                                msg_print("You failed to teleport.");
 #endif
-                                       else teleport_player(30);
+                                       else teleport_player(30, 0L);
                                }
                                else
                                {
@@ -3756,6 +3761,14 @@ bool mutation_power_aux(u32b power)
                                        (r_ptr->level < randint1(p_ptr->lev+50)) &&
                                        !(m_ptr->mflag2 & MFLAG2_NOGENO))
                                {
+                                       if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
+                                       {
+                                               char m_name[80];
+
+                                               monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
+                                               do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
+                                       }
+
                                        /* Delete the monster, rather than killing it. */
                                        delete_monster_idx(c_ptr->m_idx);
 #ifdef JP
@@ -3805,7 +3818,7 @@ bool mutation_power_aux(u32b power)
                /* XXX_XXX_XXX Hack!  MUT1_LAUNCHER is negative, see above */
                case 3: /* MUT1_LAUNCHER */
                        /* Gives a multiplier of 2 at first, up to 3 at 40th */
-                       if (!do_cmd_throw_aux(2 + lvl / 40, FALSE, 0)) return FALSE;
+                       if (!do_cmd_throw_aux(2 + lvl / 40, FALSE, -1)) return FALSE;
                        break;
 
                default: