OSDN Git Service

[Refactor] #38997 earthquake() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sun, 27 Oct 2019 06:03:01 +0000 (15:03 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 27 Oct 2019 06:07:38 +0000 (15:07 +0900)
12 files changed:
src/cmd/cmd-activate.c
src/cmd/cmd-usestaff.c
src/combat/melee1.c
src/mind.c
src/mutation.c
src/realm-hissatsu.c
src/realm-nature.c
src/realm-song.c
src/spells-floor.c
src/spells-floor.h
src/spells2.c
src/spells3.c

index cad8d1b..a424c9d 100644 (file)
@@ -1084,7 +1084,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_QUAKE:
        {
-               earthquake(user_ptr->y, user_ptr->x, 5, 0);
+               earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
                break;
        }
 
index 3fb09e8..9088a55 100644 (file)
@@ -234,7 +234,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
 
                case SV_STAFF_EARTHQUAKES:
                {
-                       if (earthquake(creature_ptr->y, creature_ptr->x, (powerful ? 15 : 10), 0))
+                       if (earthquake(creature_ptr, creature_ptr->y, creature_ptr->x, (powerful ? 15 : 10), 0))
                                ident = TRUE;
                        else
                                msg_print(_("ダンジョンが揺れた。", "The dungeon trembles."));
index 7c9d337..b08bded 100644 (file)
@@ -2154,7 +2154,7 @@ static void py_attack_aux(player_type *attacker_ptr, POSITION y, POSITION x, boo
        /* Mega-Hack -- apply earthquake brand */
        if (do_quake)
        {
-               earthquake(attacker_ptr->y, attacker_ptr->x, 10, 0);
+               earthquake(attacker_ptr, attacker_ptr->y, attacker_ptr->x, 10, 0);
                if (!floor_ptr->grid_array[y][x].m_idx) *mdeath = TRUE;
        }
 }
@@ -3379,7 +3379,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
                                        /* Radius 8 earthquake centered at the monster */
                                        if (damage > 23 || explode)
                                        {
-                                               earthquake(m_ptr->fy, m_ptr->fx, 8, m_idx);
+                                               earthquake(target_ptr, m_ptr->fy, m_ptr->fx, 8, m_idx);
                                        }
 
                                        break;
@@ -4503,7 +4503,7 @@ bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
 
                        case RBE_SHATTER:
                                damage -= (damage * ((ac < 150) ? ac : 150) / 250);
-                               if (damage > 23) earthquake(m_ptr->fy, m_ptr->fx, 8, m_idx);
+                               if (damage > 23) earthquake(p_ptr, m_ptr->fy, m_ptr->fx, 8, m_idx);
                                break;
 
                        case RBE_EXP_10:
index 30d8767..fdc13a9 100644 (file)
@@ -1517,7 +1517,7 @@ static bool cast_berserk_spell(int spell)
                break;
        }
        case 3:
-               earthquake(p_ptr->y, p_ptr->x, 8+randint0(5), 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 8+randint0(5), 0);
                break;
        case 4:
                massacre();
index 0acfe1d..cf936cb 100644 (file)
@@ -2252,7 +2252,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_EARTHQUAKE:
-                       (void)earthquake(creature_ptr->y, creature_ptr->x, 10, 0);
+                       (void)earthquake(creature_ptr, creature_ptr->y, creature_ptr->x, 10, 0);
                        break;
 
                case MUT1_EAT_MAGIC:
index 78deb5f..5a9e006 100644 (file)
@@ -573,7 +573,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                                py_attack(p_ptr, y, x, HISSATSU_QUAKE);
                        else
-                               earthquake(caster_ptr->y, caster_ptr->x, 10, 0);
+                               earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 10, 0);
                }
                break;
 
index db9ede8..3422813 100644 (file)
@@ -441,7 +441,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               earthquake(caster_ptr->y, caster_ptr->x, rad, 0);
+                               earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, rad, 0);
                        }
                }
                break;
@@ -563,7 +563,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        if (cast)
                        {
                                dispel_monsters(d_dam);
-                               earthquake(caster_ptr->y, caster_ptr->x, q_rad, 0);
+                               earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, q_rad, 0);
                                project(0, b_rad, caster_ptr->y, caster_ptr->x, b_dam, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
                        }
                }
index de57340..7df7720 100644 (file)
@@ -728,7 +728,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cont)
                        {
-                               earthquake(caster_ptr->y, caster_ptr->x, 10, 0);
+                               earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 10, 0);
                        }
                }
 
index 092b28d..f111ad3 100644 (file)
@@ -743,7 +743,7 @@ bool destroy_area(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION r, b
  * This has allowed massive simplification of the "monster" code.
  * </pre>
  */
-bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
+bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 {
        DIRECTION i;
        int t;
@@ -756,7 +756,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        bool map[32][32];
 
        /* Prevent destruction of quest levels and town */
-       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
+       if ((caster_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level)
        {
                return (FALSE);
        }
@@ -781,11 +781,11 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        yy = cy + dy;
                        xx = cx + dx;
 
-                       if (!in_bounds(p_ptr->current_floor_ptr, yy, xx)) continue;
+                       if (!in_bounds(caster_ptr->current_floor_ptr, yy, xx)) continue;
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[yy][xx];
 
                        /* Lose room and vault / Lose light and knowledge */
                        g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
@@ -806,13 +806,13 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        }
 
        /* First, affect the player (if necessary) */
-       if (hurt && !p_ptr->pass_wall && !p_ptr->kill_wall)
+       if (hurt && !caster_ptr->pass_wall && !caster_ptr->kill_wall)
        {
                /* Check around the player */
                for (i = 0; i < 8; i++)
                {
-                       y = p_ptr->y + ddy_ddd[i];
-                       x = p_ptr->x + ddx_ddd[i];
+                       y = caster_ptr->y + ddy_ddd[i];
+                       x = caster_ptr->x + ddx_ddd[i];
 
                        /* Skip non-empty grids */
                        if (!cave_empty_bold(y, x)) continue;
@@ -820,7 +820,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Important -- Skip "quake" grids */
                        if (map[16 + y - cy][16 + x - cx]) continue;
 
-                       if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
+                       if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
 
                        /* Count "safe" grids */
                        sn++;
@@ -837,17 +837,17 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                {
                case 1:
                {
-                       msg_print(_("ダンジョンの壁が崩れた!", "The p_ptr->current_floor_ptr->grid_array ceiling collapses!"));
+                       msg_print(_("ダンジョンの壁が崩れた!", "The caster_ptr->current_floor_ptr->grid_array ceiling collapses!"));
                        break;
                }
                case 2:
                {
-                       msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The p_ptr->current_floor_ptr->grid_array floor twists in an unnatural way!"));
+                       msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The caster_ptr->current_floor_ptr->grid_array floor twists in an unnatural way!"));
                        break;
                }
                default:
                {
-                       msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The p_ptr->current_floor_ptr->grid_array quakes!  You are pummeled with debris!"));
+                       msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The caster_ptr->current_floor_ptr->grid_array quakes!  You are pummeled with debris!"));
                        break;
                }
                }
@@ -876,24 +876,24 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        {
                                msg_print(_("岩石があなたに直撃した!", "You are bashed by rubble!"));
                                damage = damroll(10, 4);
-                               (void)set_stun(p_ptr, p_ptr->stun + randint1(50));
+                               (void)set_stun(caster_ptr, caster_ptr->stun + randint1(50));
                                break;
                        }
                        case 3:
                        {
                                msg_print(_("あなたは床と壁との間に挟まれてしまった!", "You are crushed between the floor and ceiling!"));
                                damage = damroll(10, 4);
-                               (void)set_stun(p_ptr, p_ptr->stun + randint1(50));
+                               (void)set_stun(caster_ptr, caster_ptr->stun + randint1(50));
                                break;
                        }
                        }
 
                        /* Move the player to the safe location */
-                       (void)move_player_effect(p_ptr, sy, sx, MPE_DONT_PICKUP);
+                       (void)move_player_effect(caster_ptr, sy, sx, MPE_DONT_PICKUP);
                }
 
                /* Important -- no wall on player */
-               map[16 + p_ptr->y - cy][16 + p_ptr->x - cx] = FALSE;
+               map[16 + caster_ptr->y - cy][16 + caster_ptr->x - cx] = FALSE;
 
                if (damage)
                {
@@ -902,7 +902,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        if (m_idx)
                        {
                                GAME_TEXT m_name[MAX_NLEN];
-                               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+                               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
                                monster_desc(m_name, m_ptr, MD_WRONGDOER_NAME);
                                killer = format(_("%sの起こした地震", "an earthquake caused by %s"), m_name);
                        }
@@ -911,7 +911,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                killer = _("地震", "an earthquake");
                        }
 
-                       take_hit(p_ptr, DAMAGE_ATTACK, damage, killer, -1);
+                       take_hit(caster_ptr, DAMAGE_ATTACK, damage, killer, -1);
                }
        }
 
@@ -925,14 +925,14 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip unaffected grids */
                        if (!map[16 + yy - cy][16 + xx - cx]) continue;
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[yy][xx];
 
-                       if (g_ptr->m_idx == p_ptr->riding) continue;
+                       if (g_ptr->m_idx == caster_ptr->riding) continue;
 
                        /* Process monsters */
                        if (g_ptr->m_idx)
                        {
-                               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+                               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
                                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                                /* Quest monsters */
@@ -966,8 +966,8 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        if (!cave_empty_bold(y, x)) continue;
 
                                                        /* Hack -- no safety on glyph of warding */
-                                                       if (is_glyph_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) continue;
-                                                       if (is_explosive_rune_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) continue;
+                                                       if (is_glyph_grid(&caster_ptr->current_floor_ptr->grid_array[y][x])) continue;
+                                                       if (is_explosive_rune_grid(&caster_ptr->current_floor_ptr->grid_array[y][x])) continue;
 
                                                        /* ... nor on the Pattern */
                                                        if (pattern_tile(y, x)) continue;
@@ -975,7 +975,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        /* Important -- Skip "quake" grids */
                                                        if (map[16 + y - cy][16 + x - cx]) continue;
 
-                                                       if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
+                                                       if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
                                                        if (player_bold(y, x)) continue;
 
                                                        /* Count "safe" grids */
@@ -1011,12 +1011,12 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                                                if (g_ptr->m_idx)
                                                {
-                                                       if (record_named_pet && is_pet(&p_ptr->current_floor_ptr->m_list[g_ptr->m_idx]) && p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].nickname)
+                                                       if (record_named_pet && is_pet(&caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx]) && caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx].nickname)
                                                        {
                                                                char m2_name[MAX_NLEN];
 
                                                                monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
-                                                               exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
+                                                               exe_write_diary(caster_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
                                                        }
                                                }
 
@@ -1029,13 +1029,13 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                        /* Hack -- Escape from the rock */
                                        if (sn)
                                        {
-                                               IDX m_idx_aux = p_ptr->current_floor_ptr->grid_array[yy][xx].m_idx;
+                                               IDX m_idx_aux = caster_ptr->current_floor_ptr->grid_array[yy][xx].m_idx;
 
                                                /* Update the old location */
-                                               p_ptr->current_floor_ptr->grid_array[yy][xx].m_idx = 0;
+                                               caster_ptr->current_floor_ptr->grid_array[yy][xx].m_idx = 0;
 
                                                /* Update the new location */
-                                               p_ptr->current_floor_ptr->grid_array[sy][sx].m_idx = m_idx_aux;
+                                               caster_ptr->current_floor_ptr->grid_array[sy][sx].m_idx = m_idx_aux;
 
                                                /* Move the monster */
                                                m_ptr->fy = sy;
@@ -1051,7 +1051,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        }
 
        /* Lose monster light */
-       clear_mon_lite(p_ptr->current_floor_ptr);
+       clear_mon_lite(caster_ptr->current_floor_ptr);
 
        /* Examine the quaked region */
        for (dy = -r; dy <= r; dy++)
@@ -1064,7 +1064,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Skip unaffected grids */
                        if (!map[16 + yy - cy][16 + xx - cx]) continue;
 
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[yy][xx];
 
                        /* Paranoia -- never affect player */
 /*                     if (player_bold(yy, xx)) continue; */
@@ -1116,14 +1116,14 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        yy = cy + dy;
                        xx = cx + dx;
 
-                       if (!in_bounds(p_ptr->current_floor_ptr, yy, xx)) continue;
+                       if (!in_bounds(caster_ptr->current_floor_ptr, yy, xx)) continue;
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[yy][xx];
 
                        if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
-                       else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+                       else if (!(d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
                        {
                                DIRECTION ii;
                                POSITION yyy, xxx;
@@ -1133,8 +1133,8 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                {
                                        yyy = yy + ddy_ddd[ii];
                                        xxx = xx + ddx_ddd[ii];
-                                       if (!in_bounds2(p_ptr->current_floor_ptr, yyy, xxx)) continue;
-                                       cc_ptr = &p_ptr->current_floor_ptr->grid_array[yyy][xxx];
+                                       if (!in_bounds2(caster_ptr->current_floor_ptr, yyy, xxx)) continue;
+                                       cc_ptr = &caster_ptr->current_floor_ptr->grid_array[yyy][xxx];
                                        if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                        {
                                                g_ptr->info |= CAVE_GLOW;
@@ -1146,13 +1146,13 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        }
 
        /* Mega-Hack -- Forget the view and lite */
-       p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
-       p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH | PR_MAP);
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       caster_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
+       caster_ptr->redraw |= (PR_HEALTH | PR_UHEALTH | PR_MAP);
+       caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
-       if (p_ptr->special_defense & NINJA_S_STEALTH)
+       if (caster_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+               if (caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].info & CAVE_GLOW) set_superstealth(caster_ptr, FALSE);
        }
 
        /* Success */
index 8e1765a..4aaa18b 100644 (file)
@@ -8,4 +8,4 @@ extern bool place_mirror(player_type *caster_ptr);
 extern void stair_creation(player_type *caster_ptr);
 extern void map_area(POSITION range);
 extern bool destroy_area(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate);
-extern bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
+extern bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
index 4918462..3948ed1 100644 (file)
@@ -2558,7 +2558,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        if (!(*count))
                        {
                                msg_print(_("地面が揺れた...", "The ground trembles..."));
-                               earthquake(p_ptr->y, p_ptr->x, 5 + randint0(10), 0);
+                               earthquake(p_ptr, p_ptr->y, p_ptr->x, 5 + randint0(10), 0);
                                if (!one_in_(6)) break;
                        }
                case 30: case 31:
@@ -2765,7 +2765,7 @@ void wall_breaker(void)
        }
        else if (randint1(100) > 30)
        {
-               earthquake(p_ptr->y, p_ptr->x, 1, 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 1, 0);
        }
        else
        {
@@ -3246,7 +3246,7 @@ void wild_magic(int spell)
                aggravate_monsters(0);
                break;
        case 26:
-               earthquake(p_ptr->y, p_ptr->x, 5, 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 5, 0);
                break;
        case 27:
        case 28:
@@ -3492,7 +3492,7 @@ void cast_wonder(DIRECTION dir)
        else if (die < 101) hypodynamic_bolt(dir, 100 + plev);
        else if (die < 104)
        {
-               earthquake(p_ptr->y, p_ptr->x, 12, 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 12, 0);
        }
        else if (die < 106)
        {
@@ -3633,7 +3633,7 @@ void cast_invoke_spirits(DIRECTION dir)
        }
        else if (die < 104)
        {
-               earthquake(p_ptr->y, p_ptr->x, 12, 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 12, 0);
        }
        else if (die < 106)
        {
@@ -3778,7 +3778,7 @@ void cast_shuffle(void)
        {
                msg_print(_("《塔》だ。", "It's the Tower."));
 
-               earthquake(p_ptr->y, p_ptr->x, 5, 0);
+               earthquake(p_ptr, p_ptr->y, p_ptr->x, 5, 0);
        }
        else if (die < 82)
        {
index 2a998c6..d4b2300 100644 (file)
@@ -3487,7 +3487,7 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                        if (!count)
                        {
                                msg_print(_("地面が揺れた...", "The ground trembles..."));
-                               earthquake(m_ptr->fy, m_ptr->fx, 4 + randint0(4), 0);
+                               earthquake(p_ptr, m_ptr->fy, m_ptr->fx, 4 + randint0(4), 0);
                                if (!one_in_(6)) break;
                        }
                case 3: case 4: case 5: case 6: