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
@@ -171,6 +171,11 @@ func _process(delta: float) -> void:
if face_timer >= COLOR_CYCLE_TIME:
face_timer = 0.0
current_face = CandyColor.values()[(current_face + 1) % CandyColor.size()]
# Sync color to the Mekton NPC
if mekton_node and mekton_node.has_method("set_face_color_rpc"):
mekton_node.rpc("set_face_color_rpc", current_face)
# Sugar Rush timers
var any_rush = false
@@ -256,7 +261,11 @@ func get_multiplier(pid: int) -> float:
# ── Mekton Delivery ──
@rpc("any_peer", "call_local", "reliable")
func try_deliver(pid: int) -> bool:
if not multiplayer.is_server():
return false
var color = player_candy_color.get(pid, -1)
if color == -1 or player_candies.get(pid, 0) == 0:
return false
@@ -384,6 +393,8 @@ func _spawn_mekton_npc(center: Vector2i) -> Node:
var npc = load(path).instantiate()
npc.position = Vector3(center.x + 1, 0, center.y + 1)
add_child(npc)
if npc.has_method("set_face_color_rpc"):
npc.set_face_color_rpc(current_face)
return npc
return null
@@ -164,6 +164,15 @@ func simple_move_to(grid_position: Vector2i) -> bool:
else:
print("[Move] Failed: Blocked by Candy Survival Sticky cell at %s" % grid_position)
return false
if gm and gm.is_active and gm.has_method("try_deliver"):
var dist = abs(grid_position.x - 8) + abs(grid_position.y - 8)
if dist <= 2:
var pid = player.get("peer_id") if "peer_id" in player else player.name.to_int()
if multiplayer.is_server():
gm.try_deliver(pid)
else:
gm.rpc_id(1, "try_deliver", pid)
rotate_towards_target(grid_position)