feat: Introduce an EnhancedGridMap with advanced generation, randomization, pathfinding, and data serialization, along with new player, powerup, and portal managers.

This commit is contained in:
Yogi Wiguna
2026-03-04 17:40:10 +08:00
parent 8f03cc15c5
commit cd7881bc3f
12 changed files with 128 additions and 107 deletions
+31
View File
@@ -707,6 +707,9 @@ var immunity_timer: float = 0.0
@rpc("any_peer", "call_local")
func apply_stagger(duration: float = 1.5):
if is_carrying_tekton:
return # Cannot be staggered while carrying a Tekton
if immunity_timer > 0:
return # Immune!
@@ -2191,6 +2194,34 @@ func sync_throw_tekton(target_pos: Vector2i):
print("[Player %s] Threw Tekton to %s (Dist: %s)" % [name, target_pos, target_pos.distance_to(tekton.current_position)])
func drop_tekton():
"""Drops the Tekton at the current player position immediately."""
if not is_multiplayer_authority() or not is_carrying_tekton:
return
if is_multiplayer_authority() and can_rpc():
rpc("sync_drop_tekton")
@rpc("any_peer", "call_local", "reliable")
func sync_drop_tekton():
if carried_tekton:
var tekton = carried_tekton
carried_tekton = null
is_carrying_tekton = false
# Set its position to player's current position (but on ground)
var drop_pos = grid_to_world(current_position)
tekton.global_position = drop_pos
if tekton.has_method("set_carried"):
tekton.set_carried(false)
# Trigger landing effects (minimal scale)
if tekton.has_method("on_thrown_landing"):
tekton.on_thrown_landing(self, 1.0) # Minimal scale impact
print("[Player %s] Dropped Tekton at %s" % [name, current_position])
# is_attack_mode is already declared at top of file (or inherited?)
# Keeping is_knock_mode here for now or moving it up would be better, but let's just fix the error first.
var is_knock_mode: bool = false # Yellow mode for knocking Tekton