feat: Introduce PlayerActionManager for action point and grid highlighting, SpecialTilesManager for special tile effects, and a tile_freeze mesh resource.

This commit is contained in:
Yogi Wiguna
2026-03-25 15:53:55 +08:00
parent 5a6f704569
commit 5acf40c122
3 changed files with 28 additions and 17 deletions
+7 -2
View File
@@ -4,7 +4,8 @@ extends Node
var player: Node3D
var enhanced_gridmap: Node
var highlighted_cells = []
var highlighted_cells = [] # List of positions
# highlight_restore_items no longer needed for Layer 2
func initialize(p_player: Node3D, p_gridmap: Node):
player = p_player
@@ -76,7 +77,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
# Use Layer 2 for overlay highlights (prevents overwriting Execution on Layer 0)
enhanced_gridmap.set_cell_item(
Vector3i(cell.x, 2, cell.y),
highlight_item
@@ -96,6 +97,7 @@ func highlight_empty_adjacent_cells():
var current_cell = Vector3i(player.current_position.x, 1, player.current_position.y)
if enhanced_gridmap.get_cell_item(current_cell) == -1:
highlighted_cells.append(player.current_position)
# Set on Layer 2 (Overlay)
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 2, player.current_position.y),
enhanced_gridmap.hover_item)
print("Highlighted current position: ", player.current_position)
@@ -108,6 +110,7 @@ func highlight_empty_adjacent_cells():
var cell = Vector3i(cell_pos.x, 1, cell_pos.y)
if enhanced_gridmap.get_cell_item(cell) == -1: # Check if cell is empty
highlighted_cells.append(cell_pos)
# Set on Layer 2 (Overlay)
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 2, cell_pos.y),
enhanced_gridmap.hover_item)
print("Highlighted adjacent cell: ", cell_pos)
@@ -123,6 +126,7 @@ func highlight_random_valid_cells():
var current_item = enhanced_gridmap.get_cell_item(current_cell)
if current_item != -1:
highlighted_cells.append(player.current_position)
# Set on Layer 2 (Overlay)
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 2, player.current_position.y),
enhanced_gridmap.hover_item)
@@ -134,6 +138,7 @@ func highlight_random_valid_cells():
var cell = Vector3i(cell_pos.x, 1, cell_pos.y)
if enhanced_gridmap.get_cell_item(cell) != -1: # Only highlight cells with items
highlighted_cells.append(cell_pos)
# Set on Layer 2 (Overlay)
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 2, cell_pos.y),
enhanced_gridmap.hover_item)