feat: Implement player input and movement managers for grid-based interaction and movement.

This commit is contained in:
Yogi Wiguna
2026-02-12 12:11:38 +08:00
parent 5cf77c19ab
commit 5275c4acd8
4 changed files with 71 additions and 7 deletions
+41 -2
View File
@@ -1951,7 +1951,40 @@ 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)])
# 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
func enter_attack_mode():
if not is_multiplayer_authority(): return
is_attack_mode = true
is_knock_mode = false # Mutually exclusive
NotificationManager.send_message(self, "Attack Mode ACTIVATED (Red)", NotificationManager.MessageType.POWERUP)
update_active_player_indicator()
func enter_knock_mode():
if not is_multiplayer_authority(): return
is_knock_mode = true
is_attack_mode = false # Mutually exclusive
NotificationManager.send_message(self, "Knock Mode ACTIVATED (Yellow)", NotificationManager.MessageType.POWERUP)
update_active_player_indicator()
func update_active_player_indicator():
var color = Color.WHITE
if is_attack_mode:
color = Color.RED
elif is_knock_mode:
color = Color.YELLOW
# Apply visual tint to character model across network
rpc("sync_modulate", color)
func knock_tekton():
# ... legacy or helper function ...
pass
if not is_multiplayer_authority() or is_frozen:
return
@@ -1967,13 +2000,19 @@ func knock_tekton():
if is_multiplayer_authority():
rpc("sync_knock_tekton", tekton.get_path())
# Reset Knock Mode after successful hit
is_knock_mode = false
NotificationManager.send_message(self, "Knock Successful!", NotificationManager.MessageType.POWERUP)
update_active_player_indicator()
@rpc("any_peer", "call_local", "reliable")
func sync_knock_tekton(tekton_path: NodePath):
var tekton = get_node_or_null(tekton_path)
if tekton:
# Intensity 2.0 for knock (drops 200% tiles)
tekton.on_hit(self , 2.0)
# Intensity 2.0 for knock (drops 200% tiles) + Shrink/Recover
# Use on_thrown_landing to trigger shrink animation and floor freeze
tekton.on_thrown_landing(self, 2.0)
print("[Player %s] Knocked Tekton %s" % [name, tekton.name])
# Visual feedback (Juice)