feat: Implement PlayerActionManager for player actions and grid highlighting, SpecialTilesManager for special tile effects, and add freeze/hover tile meshes.
This commit is contained in:
@@ -76,7 +76,7 @@ func highlight_cells_if_authorized(cells_to_highlight: Array, item_id: int = -1)
|
||||
|
||||
for cell in cells_to_highlight:
|
||||
highlighted_cells.append(cell)
|
||||
# Use Layer 2 for overlay highlights (prevents overwriting walls on Layer 0)
|
||||
# Use Layer 2 for overlay highlights
|
||||
enhanced_gridmap.set_cell_item(
|
||||
Vector3i(cell.x, 2, cell.y),
|
||||
highlight_item
|
||||
@@ -181,8 +181,8 @@ func clear_highlights():
|
||||
# Check Layer 2 (Overlay Highlight)
|
||||
var l2_pos = Vector3i(cell.x, 2, cell.y)
|
||||
var l2_item = enhanced_gridmap.get_cell_item(l2_pos)
|
||||
# Only clear if it is a highlight and NOT a Safe Zone (ID 2)
|
||||
if l2_item != -1 and l2_item != 2:
|
||||
# Only clear if it is a highlight and NOT a Safe Zone (ID 2) or Freeze Area (ID 5)
|
||||
if l2_item != -1 and l2_item != 2 and l2_item != 5:
|
||||
enhanced_gridmap.set_cell_item(l2_pos, -1)
|
||||
|
||||
highlighted_cells.clear()
|
||||
|
||||
@@ -400,7 +400,7 @@ func _execute_area_freeze(target_pos: Vector2i = Vector2i(-9999, -9999)):
|
||||
else:
|
||||
NotificationManager.send_message(player, "Hit %d Players!" % hit_count, NotificationManager.MessageType.GOAL)
|
||||
|
||||
# Visual Feedback (Overlay Layer 1 - Ground Level Overlay)
|
||||
# Visual Feedback (Layer 2 - Overlay Level)
|
||||
if player.is_multiplayer_authority():
|
||||
var main_node = get_node_or_null("/root/Main")
|
||||
if main_node and main_node.has_method("sync_grid_items_batch"):
|
||||
@@ -409,8 +409,8 @@ func _execute_area_freeze(target_pos: Vector2i = Vector2i(-9999, -9999)):
|
||||
for rz in range(-radius, radius + 1):
|
||||
var cell_x = center_pos.x + rx
|
||||
var cell_z = center_pos.y + rz
|
||||
# Changed to Y=1 (Floor 1) to match Wall visual logic
|
||||
batch_data.append({"x": cell_x, "y": 1, "z": cell_z, "item": 5})
|
||||
# Put back on Layer 2 (Overlay) as requested
|
||||
batch_data.append({"x": cell_x, "y": 2, "z": cell_z, "item": 5})
|
||||
|
||||
if not batch_data.is_empty():
|
||||
main_node.rpc("sync_grid_items_batch", batch_data)
|
||||
@@ -424,9 +424,10 @@ func _execute_area_freeze(target_pos: Vector2i = Vector2i(-9999, -9999)):
|
||||
for rz in range(-radius, radius + 1):
|
||||
var cx = center_pos.x + rx
|
||||
var cz = center_pos.y + rz
|
||||
# Check if it is STILL Freeze Overlay on Layer 1
|
||||
if enhanced_gridmap.get_cell_item(Vector3i(cx, 1, cz)) == 5:
|
||||
clear_batch.append({"x": cx, "y": 1, "z": cz, "item": -1})
|
||||
# Check if it is STILL Freeze Overlay on Layer 2
|
||||
if enhanced_gridmap.get_cell_item(Vector3i(cx, 2, cz)) == 5:
|
||||
# Remove Item (back to -1)
|
||||
clear_batch.append({"x": cx, "y": 2, "z": cz, "item": -1})
|
||||
if not clear_batch.is_empty():
|
||||
cl_node.rpc("sync_grid_items_batch", clear_batch)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user