edit special power up
This commit is contained in:
@@ -84,8 +84,6 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
||||
if cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(grid_position):
|
||||
return false
|
||||
|
||||
if enhanced_gridmap.is_blocked_by_obstacle(player.current_position, grid_position, 3):
|
||||
return false
|
||||
|
||||
# All checks passed, perform move
|
||||
rotate_towards_target(grid_position)
|
||||
@@ -165,15 +163,7 @@ func highlight_movement_range():
|
||||
# First, identify all cells that are blocked by obstacles
|
||||
var blocked_cells = []
|
||||
|
||||
# Check all cells for obstacles and get their blocked cells
|
||||
for x in range(enhanced_gridmap.columns):
|
||||
for z in range(enhanced_gridmap.rows):
|
||||
var cell_pos = Vector2i(x, z)
|
||||
var cell_pos3d = Vector3i(x, 3, z)
|
||||
|
||||
if enhanced_gridmap.has_obstacle_at(cell_pos3d):
|
||||
var orientation = enhanced_gridmap.get_obstacle_orientation(cell_pos3d)
|
||||
blocked_cells.append_array(enhanced_gridmap.get_cells_blocked_by_obstacle(cell_pos, orientation, 3))
|
||||
# Obstacle blocking logic removed
|
||||
|
||||
# Now highlight all cells within movement range that aren't blocked
|
||||
for x in range(max(0, player.current_position.x - movement_range),
|
||||
@@ -252,16 +242,16 @@ func can_reach_cell(target_pos: Vector2i, blocked_cells: Array) -> bool:
|
||||
continue
|
||||
|
||||
# Check if movement between cells is blocked by an obstacle
|
||||
if not is_diagonal_direction(dir) and enhanced_gridmap.is_movement_blocked(current, next_pos, 3):
|
||||
continue
|
||||
# if not is_diagonal_direction(dir) and enhanced_gridmap.is_movement_blocked(current, next_pos, 3):
|
||||
# continue
|
||||
|
||||
# For diagonal movement, check if both orthogonal paths are blocked
|
||||
if is_diagonal_direction(dir):
|
||||
var mid1 = Vector2i(next_pos.x, current.y)
|
||||
var mid2 = Vector2i(current.x, next_pos.y)
|
||||
|
||||
var path1_blocked = mid1 in blocked_cells or enhanced_gridmap.is_movement_blocked(current, mid1, 3)
|
||||
var path2_blocked = mid2 in blocked_cells or enhanced_gridmap.is_movement_blocked(current, mid2, 3)
|
||||
var path1_blocked = mid1 in blocked_cells # or enhanced_gridmap.is_movement_blocked(current, mid1, 3)
|
||||
var path2_blocked = mid2 in blocked_cells # or enhanced_gridmap.is_movement_blocked(current, mid2, 3)
|
||||
|
||||
if path1_blocked and path2_blocked:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user