feat: Implement core playerboard management including item grabbing, power-up handling, goal completion, and grid refilling, alongside new Tekton entity and various game managers.

This commit is contained in:
2026-03-02 03:10:38 +08:00
parent 1c5c3d47f6
commit a7442bb1a6
17 changed files with 78 additions and 42 deletions
+5 -5
View File
@@ -255,7 +255,7 @@ func find_nearest_tile_of_type(tile_types: Array) -> Vector2i:
var found_in_layer = []
# In Stop n Go, prefer tiles "ahead" (higher X)
var is_stop_n_go = LobbyManager.game_mode == "Stop n Go"
var is_stop_n_go = LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO)
# Check the ring
for x_off in range(-r, r + 1):
@@ -311,7 +311,7 @@ func _check_spiral_cell(x: int, z: int, tile_types: Array, result_array: Array):
func find_optimal_move_target() -> Vector2i:
"""Calculate the best position to move towards."""
var main = actor.get_tree().get_root().get_node_or_null("Main")
var is_sng = LobbyManager.game_mode == "Stop n Go"
var is_sng = LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO)
var gc_manager = main.get_node_or_null("GoalsCycleManager") if main else null
var time_left = gc_manager.get_global_time_remaining() if gc_manager else 999.0
var is_match_running = gc_manager.is_match_running() if gc_manager else false
@@ -521,7 +521,7 @@ func evaluate_sabotage_opportunity() -> Dictionary:
return result
# 0. STOP N GO THRESHOLD: No sabotage until passing column 10
if LobbyManager.game_mode == "Stop n Go" and actor.current_position.x <= 10:
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x <= 10:
return result
# Get opponents
@@ -540,7 +540,7 @@ func evaluate_sabotage_opportunity() -> Dictionary:
# Condition 2: Opponent is close to completing their goal
var progress_threshold = 0.7
if LobbyManager.game_mode == "Stop n Go" and actor.current_position.x > 10:
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x > 10:
progress_threshold = 0.4 # More aggressive in late game!
for opponent in opponents:
@@ -563,7 +563,7 @@ func evaluate_sabotage_opportunity() -> Dictionary:
return result
# Condition 4: Random Aggression (Stop n Go Late Game)
if LobbyManager.game_mode == "Stop n Go" and actor.current_position.x > 12:
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x > 12:
if randf() < 0.3: # 30% chance each tick to just be mean
result.should_sabotage = true
result.reason = "random_aggression"