feat: half update
This commit is contained in:
@@ -210,6 +210,11 @@ func _run_ai_tick():
|
||||
print("[BotController] Action Taken: Attack Pursuit")
|
||||
return
|
||||
|
||||
# Priority 0.5: Gauntlet (#075) — burn Cleanser if boxed in
|
||||
if await _try_activate_cleanser():
|
||||
print("[BotController] Action Taken: Cleanser (trapped)")
|
||||
return
|
||||
|
||||
# Priority 1: Tekton Management (Grab Tekton if full boost, or spawn if carrying)
|
||||
# Spawning while carrying is high priority; Hunting is medium priority.
|
||||
if await _try_tekton_action():
|
||||
@@ -254,6 +259,49 @@ func _run_ai_tick():
|
||||
elif not is_sng:
|
||||
return
|
||||
|
||||
# =============================================================================
|
||||
# Gauntlet (#075) — Cleanser + Sticky Avoidance wiring
|
||||
# =============================================================================
|
||||
|
||||
func _try_activate_cleanser() -> bool:
|
||||
"""Activate Cleanser when the planner reports imminent danger.
|
||||
|
||||
Server-authoritative RPC; we only request it. Returns true if the request
|
||||
was sent successfully (not a guarantee it landed on a sticky cell)."""
|
||||
if not strategic_planner or not strategic_planner.is_gauntlet_mode():
|
||||
return false
|
||||
if not strategic_planner.should_activate_cleanser_now():
|
||||
return false
|
||||
var gm = strategic_planner._get_gauntlet_manager()
|
||||
if not gm:
|
||||
return false
|
||||
var pid = actor.get("peer_id") if "peer_id" in actor else actor.name.to_int()
|
||||
if pid == null or pid < 0:
|
||||
return false
|
||||
if gm.has_method("rpc_activate_cleanser"):
|
||||
gm.rpc_activate_cleanser(pid)
|
||||
print("[BotController] %s requested Cleanser activation (trapped)" % actor.name)
|
||||
return true
|
||||
return false
|
||||
|
||||
func _on_step_onto_unsafe() -> bool:
|
||||
"""Refuse to step onto a sticky/telegraphed cell and re-plan. Returns true
|
||||
if the bot had to abort the planned move."""
|
||||
if not strategic_planner:
|
||||
return false
|
||||
var here = actor.current_position if "current_position" in actor else Vector2i(-1, -1)
|
||||
if here == Vector2i(-1, -1):
|
||||
return false
|
||||
# Post-move guard: if we somehow landed on a sticky without cleanser active,
|
||||
# burn Cleanser to clear ourselves out next tick.
|
||||
if strategic_planner.is_gauntlet_mode() and strategic_planner._is_overlay_unsafe(here):
|
||||
if not strategic_planner._is_bot_cleanser_active():
|
||||
var gm = strategic_planner._get_gauntlet_manager()
|
||||
if gm and gm.has_method("is_sticky_cell") and gm.is_sticky_cell(here):
|
||||
print("[BotController] %s stepped onto sticky at %s — burning Cleanser" % [actor.name, here])
|
||||
return _try_activate_cleanser()
|
||||
return false
|
||||
|
||||
# =============================================================================
|
||||
# Power-Up / Sabotage
|
||||
# =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user