if (!(((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding))))
{
if (cost == 0) continue;
- if (!can_open_door && is_closed_door(g_ptr->feat)) continue;
+ if (!can_open_door && is_closed_door(target_ptr, g_ptr->feat)) continue;
}
/* Hack -- for kill or pass wall monster.. */
g_ptr = &floor_ptr->grid_array[y][x];
/* Skip locations in a wall */
- if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == target_ptr->riding) ? CEM_RIDING : 0)) continue;
+ if (!monster_can_cross_terrain(target_ptr, g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == target_ptr->riding) ? CEM_RIDING : 0)) continue;
/* Check for "availability" (if monsters can flow) */
if (!(m_ptr->mflag2 & MFLAG2_NOFLOW))
if (!in_bounds(floor_ptr, y, x)) continue;
/* Skip occupied locations */
- if (!monster_can_enter(y, x, r_ptr, 0)) continue;
+ if (!monster_can_enter(target_ptr, y, x, r_ptr, 0)) continue;
/* Check for hidden, available grid */
if (projectable(target_ptr, target_ptr->y, target_ptr->x, y, x) && clean_shot(target_ptr, fy, fx, y, x, FALSE))
g_ptr = &floor_ptr->grid_array[yy][xx];
/* Check grid */
- if (monster_can_cross_terrain(g_ptr->feat, r_ptr, 0))
+ if (monster_can_cross_terrain(target_ptr, g_ptr->feat, r_ptr, 0))
{
/* One more room grid */
room++;
if (!in_bounds2(floor_ptr, y2, x2)) continue;
/* Ignore filled grids */
- if (!monster_can_enter(y2, x2, r_ptr, 0)) continue;
+ if (!monster_can_enter(target_ptr, y2, x2, r_ptr, 0)) continue;
/* Try to fill this hole */
break;
/* Access that grid */
g_ptr = &target_ptr->current_floor_ptr->grid_array[ny][nx];
f_ptr = &f_info[g_ptr->feat];
- can_cross = monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
+ can_cross = monster_can_cross_terrain(target_ptr, g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
/* Access that grid's contents */
y_ptr = &target_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
}
/* Handle doors and secret doors */
- else if (is_closed_door(g_ptr->feat))
+ else if (is_closed_door(target_ptr, g_ptr->feat))
{
bool may_bash = TRUE;
if (did_open_door || did_bash_door)
{
/* Break down the door */
- if (did_bash_door && ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)))
+ if (did_bash_door && ((randint0(100) < 50) || (feat_state(target_ptr, g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)))
{
cave_alter_feat(target_ptr, ny, nx, FF_BASH);
g_ptr->mimic = 0;
note_spot(target_ptr, ny, nx);
- lite_spot(ny, nx);
+ lite_spot(target_ptr, ny, nx);
if (!monster_is_valid(m_ptr)) return;
/* Allow movement */
else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
(r_ptr->mexp > z_ptr->mexp) &&
can_cross && (g_ptr->m_idx != target_ptr->riding) &&
- monster_can_cross_terrain(target_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
+ monster_can_cross_terrain(target_ptr, target_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
{
/* Allow movement */
do_move = TRUE;
if (must_alter_to_move && (r_ptr->flags7 & RF7_AQUATIC))
{
- if (!monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0))
+ if (!monster_can_cross_terrain(target_ptr, g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0))
{
/* Assume no move allowed */
do_move = FALSE;
m_ptr->fx = nx;
update_monster(target_ptr, m_idx, TRUE);
- lite_spot(oy, ox);
- lite_spot(ny, nx);
+ lite_spot(target_ptr, oy, ox);
+ lite_spot(target_ptr, ny, nx);
}
else
{
msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
}
- delete_object_idx(target_ptr->current_floor_ptr, this_o_idx);
+ delete_object_idx(target_ptr, this_o_idx);
}
}