feat: update

This commit is contained in:
2026-07-07 18:15:47 +08:00
parent 286d0ce069
commit 950b1969d8
97 changed files with 388 additions and 3755 deletions
+10 -10
View File
@@ -106,7 +106,7 @@ func _physics_process(delta):
return
# Only run if game has started
if not GameStateManager.is_game_started():
if not Engine.get_main_loop().root.get_node_or_null("GameStateManager").is_game_started():
return
# STUCK PREVENTION
@@ -143,7 +143,7 @@ func _physics_process(delta):
# Rate limiting (with difficulty scaling for Stop n Go)
var current_tick_rate = tick_rate
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x > 10:
if Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x > 10:
current_tick_rate = int(tick_rate * 0.6) # 40% faster updates after column 10
_tick_counter += 1
@@ -168,7 +168,7 @@ func _run_ai_tick():
if actor.is_player_moving:
return
if TurnManager.turn_based_mode:
if Engine.get_main_loop().root.get_node_or_null("TurnManager").turn_based_mode:
_tick_counter = tick_rate # Force immediate evaluation in turn-based
# Update cooldowns
@@ -176,7 +176,7 @@ func _run_ai_tick():
_tekton_spawn_cooldown -= get_process_delta_time()
# STOP N GO: Don't process if already at finish line
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x >= 21:
if Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO) and actor.current_position.x >= 21:
return
# STOP N GO: Red light freezing logic
@@ -193,7 +193,7 @@ func _run_ai_tick():
print("[BotController] %s AI Tick. Goals: %s, Fullness: %.2f" % [actor.name, actor.goals, board_fullness])
# 0. BOT AGGRESSION THRESHOLD (Stop n Go)
var is_sng = LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO)
var is_sng = Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO)
var can_be_aggressive = not is_sng or actor.current_position.x > 10
# PRIORITY OVERRIDE: If board is getting full, prioritize clearing space!
@@ -481,7 +481,7 @@ func _try_attack_chase() -> bool:
if not push_success:
# If attack failed (e.g. Safe Zone in Stop n Go), don't just loop!
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO):
if Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO):
if victim.current_position.x in [6, 7, 8, 14, 15, 16]: # Safe Zone Columns
print("[BotController] %s target is in Safe Zone. Moving to find better angle." % actor.name)
await _try_unstuck_move()
@@ -507,7 +507,7 @@ func _try_attack_chase() -> bool:
var next_step = Vector2i(path[1].x, path[1].y)
# STOP N GO BOUNDARY PROTECTION
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and next_step.x >= 21:
if Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO) and next_step.x >= 21:
var main = get_tree().root.get_node_or_null("Main")
var gc_manager = main.get_node_or_null("GoalsCycleManager") if main else null
var time_remaining = gc_manager.get_global_time_remaining() if gc_manager else 999.0
@@ -575,7 +575,7 @@ func _try_grab() -> bool:
pass
# Check if goals already achieved
if _is_goals_achieved() and LobbyManager.game_mode != "Stop n Go":
if _is_goals_achieved() and Engine.get_main_loop().root.get_node_or_null("LobbyManager").game_mode != "Stop n Go":
return false
# Get tiles we need
@@ -634,7 +634,7 @@ func _find_tile_to_grab(tiles_needed: Array) -> Dictionary:
func _try_move() -> bool:
"""Try to move toward needed tiles taking single steps like a player."""
if _is_goals_achieved() and LobbyManager.game_mode != "Stop n Go":
if _is_goals_achieved() and Engine.get_main_loop().root.get_node_or_null("LobbyManager").game_mode != "Stop n Go":
return false
# Find optimal movement target
@@ -888,7 +888,7 @@ func _get_board_fullness_ratio() -> float:
func _is_goals_achieved() -> bool:
"""Check if goal pattern is complete (Standard) or mission complete (Stop n Go)."""
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO):
if Engine.get_main_loop().root.get_node_or_null("LobbyManager").is_game_mode(GameMode.Mode.STOP_N_GO):
var main = get_tree().root.get_node_or_null("Main")
if main:
var sng_manager = main.get_node_or_null("StopNGoManager")