mekton boss npc uses static tekton mesh w/ emission color cycling; updated bot ghost check

This commit is contained in:
god
2026-07-06 02:20:43 +08:00
parent 783b3b5894
commit b3a421bb55
6 changed files with 104 additions and 209 deletions
+27 -9
View File
@@ -215,6 +215,21 @@ func _run_ai_tick():
print("[BotController] Action Taken: Ghost (trapped)")
return
# Priority 0.7: Candy Survival — Deliver candies to Mekton NPC
if strategic_planner and strategic_planner.is_candy_survival_mode():
var gm = strategic_planner._get_candy_survival_manager()
if gm and gm.is_active:
var pid = actor.get("peer_id") if "peer_id" in actor else actor.name.to_int()
var held_color = gm.player_candy_color.get(pid, -1)
if held_color != -1 and gm.player_candies.get(pid, 0) > 0:
if held_color == gm.current_face:
# Face matches! Run to the NPC Center!
var path = strategic_planner.find_path(actor.current_position, Vector2i(8, 8))
if path.size() > 0:
_execute_move(path[0])
print("[BotController] Action Taken: Delivering candies to Mekton!")
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():
@@ -266,21 +281,24 @@ func _run_ai_tick():
func _try_activate_ghost() -> bool:
"""Activate Ghost powerup when the planner reports imminent danger.
Uses the existing SpecialTilesManager to activate the held ghost powerup.
Uses CandySurvivalManager to activate the native ghost charges.
Returns true if activation was triggered."""
if not strategic_planner or not strategic_planner.is_candy_survival_mode():
return false
if not strategic_planner.should_activate_ghost_now():
return false
var stm = actor.get_node_or_null("SpecialTilesManager")
if not stm:
var gm = strategic_planner._get_candy_survival_manager()
if not gm or not gm.is_active:
return false
if stm.has_method("activate_effect"):
stm.activate_effect(stm.SpecialEffect.INVISIBLE_MODE)
print("[BotController] %s activated Ghost powerup (trapped)" % actor.name)
return true
return false
var pid = actor.get("peer_id") if "peer_id" in actor else actor.name.to_int()
if multiplayer.is_server():
gm.try_activate_ghost(pid)
else:
gm.rpc_id(1, "try_activate_ghost", pid)
return true
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."""