feat: Implement powerup inventory UI and manager, introducing ghost and area freeze special tiles.
This commit is contained in:
@@ -70,7 +70,11 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
||||
return false
|
||||
|
||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(grid_position.x, 0, grid_position.y))
|
||||
if cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items:
|
||||
|
||||
# Allow passing through Walls (Item 4) if Invisible
|
||||
var is_wall_passable = player.get("is_invisible") and cell_item == 4
|
||||
|
||||
if (cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items) and not is_wall_passable:
|
||||
return false
|
||||
|
||||
if player.is_position_occupied(grid_position):
|
||||
@@ -234,7 +238,14 @@ func highlight_movement_range():
|
||||
|
||||
# Check basic walkability
|
||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(x, 0, z))
|
||||
if cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(test_pos):
|
||||
|
||||
# Allow passing through Walls (Item 4) if Invisible
|
||||
var is_wall_passable = player.get("is_invisible") and cell_item == 4
|
||||
|
||||
if (cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items) and not is_wall_passable:
|
||||
continue
|
||||
|
||||
if player.is_position_occupied(test_pos):
|
||||
continue
|
||||
|
||||
# Check if there's a valid path to this cell
|
||||
@@ -284,8 +295,14 @@ func can_reach_cell(target_pos: Vector2i, blocked_cells: Array) -> bool:
|
||||
# Skip if already visited, blocked, or not valid
|
||||
if visited.has(next_pos) or next_pos in blocked_cells:
|
||||
continue
|
||||
|
||||
if not enhanced_gridmap.is_position_valid(next_pos) or not enhanced_gridmap.is_cell_walkable(next_pos, 0):
|
||||
|
||||
# Custom Walkable Check incorporating invisibility
|
||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(next_pos.x, 0, next_pos.y))
|
||||
var is_wall_passable = player.get("is_invisible") and cell_item == 4
|
||||
|
||||
if (not enhanced_gridmap.is_position_valid(next_pos) or \
|
||||
(cell_item in enhanced_gridmap.non_walkable_items and not is_wall_passable) or \
|
||||
cell_item == -1):
|
||||
continue
|
||||
|
||||
if player.is_position_occupied(next_pos) and next_pos != target_pos:
|
||||
|
||||
Reference in New Issue
Block a user