edit special power up

This commit is contained in:
2026-01-09 22:41:00 +08:00
parent 6aede0a382
commit 6948a4aed1
11 changed files with 326 additions and 468 deletions
+1 -32
View File
@@ -163,37 +163,6 @@ func highlight_occupied_playerboard_slots():
# Update the UI to reflect changes
main.ui_manager.update_playerboard_ui()
func highlight_valid_obstacle_cells():
if not player.is_multiplayer_authority() or player.is_bot or player.is_in_group("Bots"):
return
clear_highlights()
var cells_to_highlight = []
# Highlight all empty cells on the grid except those occupied by players or obstacles
for x in range(enhanced_gridmap.columns):
for z in range(enhanced_gridmap.rows):
var pos = Vector2i(x, z)
var cell = Vector3i(x, 3, z) # Check floor 3 for occupancy
var occupied_by_player = false
var occupied_by_obstacle = false
# Check if cell is occupied by any player
for p in player.get_tree().get_nodes_in_group("Players"):
if p.current_position == pos:
occupied_by_player = true
break
# Check if cell is occupied by an obstacle
if enhanced_gridmap.get_cell_item(cell) in enhanced_gridmap.obstacle_items:
occupied_by_obstacle = true
# Only add to highlights if not occupied by player or obstacle
if not occupied_by_player and not occupied_by_obstacle:
cells_to_highlight.append(pos)
highlight_cells_if_authorized(cells_to_highlight)
func clear_highlights():
# Never allow bots to clear highlights for human players
@@ -220,7 +189,7 @@ func clear_highlights():
child.hide()
# Restore highlights based on current action state
if main and current_state == main.ui_manager.ActionState.MOVING and player.is_my_turn and current_state != main.ui_manager.ActionState.PLACING_OBSTACLE:
if main and current_state == main.ui_manager.ActionState.MOVING and player.is_my_turn:
player.highlight_movement_range()
func clear_playerboard_highlights():