feat: Add PlayerActionManager for handling player actions and highlights, and SpecialTilesManager for managing special tile effects and powerups.
This commit is contained in:
@@ -312,8 +312,12 @@ func _execute_area_freeze(center_pos: Vector2i = Vector2i.ZERO):
|
||||
var pos = center_pos + Vector2i(x, y)
|
||||
if enhanced_gridmap.is_position_valid(pos):
|
||||
var main = player.get_tree().get_root().get_node_or_null("Main")
|
||||
# Use Item 12 (Blue Freeze Tile) on Layer 0 (Floor)
|
||||
if main: main.rpc("sync_grid_item", pos.x, 0, pos.y, 12)
|
||||
if main:
|
||||
# CHECK: Don't overwrite Wall Block (Item 4)
|
||||
var current_item = enhanced_gridmap.get_cell_item(Vector3i(pos.x, 0, pos.y))
|
||||
if current_item != 4: # 4 is Wall Block
|
||||
# Use Item 12 (Blue Freeze Tile) on Layer 0 (Floor)
|
||||
main.rpc("sync_grid_item", pos.x, 0, pos.y, 12)
|
||||
|
||||
# Cleanup visual timer (managed locally by author)
|
||||
get_tree().create_timer(FREEZE_SLOW_DURATION).timeout.connect(func():
|
||||
@@ -322,8 +326,13 @@ func _execute_area_freeze(center_pos: Vector2i = Vector2i.ZERO):
|
||||
var pos = center_pos + Vector2i(x, y)
|
||||
if enhanced_gridmap.is_position_valid(pos):
|
||||
var main = player.get_tree().get_root().get_node_or_null("Main")
|
||||
# Restore to Item 0 (Standard Floor)
|
||||
if main: main.rpc("sync_grid_item", pos.x, 0, pos.y, 0)
|
||||
if main:
|
||||
# CHECK: Only restore if it is STILL Ice (Item 12)
|
||||
# This prevents removing a Wall that was placed AFTER the freeze started
|
||||
var current_check = enhanced_gridmap.get_cell_item(Vector3i(pos.x, 0, pos.y))
|
||||
if current_check == 12:
|
||||
# Restore to Item 0 (Standard Floor)
|
||||
main.rpc("sync_grid_item", pos.x, 0, pos.y, 0)
|
||||
)
|
||||
|
||||
func toggle_wall_orientation():
|
||||
|
||||
Reference in New Issue
Block a user