feat: implement global SFXManager singleton and integrate into main scene initialization

This commit is contained in:
Yogi Wiguna
2026-03-31 12:40:57 +08:00
parent 82f2811c26
commit cc207bca3d
3 changed files with 36 additions and 8 deletions
+19 -1
View File
@@ -76,6 +76,8 @@ var is_attack_mode: bool = false:
return # Prevent infinite recursion / redundant updates
is_attack_mode = value
if is_attack_mode:
attack_mode_timer = MAX_ATTACK_MODE_TIME
_refresh_player_visuals()
# Sync to others if we are the authority
@@ -836,6 +838,8 @@ var slow_timer: float = 0.0
var tekton_carry_timer: float = 0.0
const MAX_TEKTON_CARRY_TIME: float = 3.0
var attack_mode_timer: float = 0.0
const MAX_ATTACK_MODE_TIME: float = 5.0
@rpc("any_peer", "call_local")
func apply_stagger(duration: float = 1.5):
@@ -1184,12 +1188,24 @@ func _process(delta):
if movement_manager:
movement_manager._process(delta)
# Attack/Knock Mode Expiration Timer
if is_multiplayer_authority() and (is_attack_mode or is_knock_mode):
if attack_mode_timer > 0:
attack_mode_timer -= delta
if attack_mode_timer <= 0:
attack_mode_timer = 0.0
is_attack_mode = false
is_knock_mode = false
NotificationManager.send_message(self, "Knock Mode Expired!", NotificationManager.MessageType.WARNING)
if powerup_manager:
powerup_manager.reset_boost()
# Immunity Timer Logic
if immunity_timer > 0:
immunity_timer -= delta
if immunity_timer <= 0:
immunity_timer = 0
_apply_tint_recursive(self , Color.WHITE) # Remove immunity tint
_apply_tint_recursive(self, Color.WHITE) # Remove immunity tint
# Slow Timer Logic
if slow_timer > 0:
@@ -2445,6 +2461,8 @@ var is_knock_mode: bool = false:
set(value):
if is_knock_mode == value: return
is_knock_mode = value
if is_knock_mode:
attack_mode_timer = MAX_ATTACK_MODE_TIME
_refresh_player_visuals()
func enter_attack_mode():