feat: introduce special power-up manager with inventory and associated UI

This commit is contained in:
Yogi Wiguna
2026-03-16 14:45:31 +08:00
parent ab3ca7661f
commit 64dc1de15a
2 changed files with 41 additions and 2 deletions
@@ -22,10 +22,12 @@ var active_buffs: Dictionary = {} # EffectEnum -> float (Duration Running)
# Cooldown Constants (Level 1 / Level 8)
const COOLDOWN_L1 = 15.0
const COOLDOWN_L8 = 5.0
const GLOBAL_COOLDOWN_MAX = 5.0
const FASTER_DURATION = 5.0
const FREEZE_SLOW_DURATION = 3.0
signal cooldown_updated(effect: int, time_left: float, max_time: float)
signal global_cooldown_updated(time_left: float, max_time: float)
signal powerup_unlocked(effect: int, level: int)
@@ -234,6 +236,7 @@ func activate_effect(effect: int, target_player: Node3D = null):
# Apply 5s cooldown globally
global_cooldown_timer = 5.0
emit_signal("global_cooldown_updated", global_cooldown_timer, GLOBAL_COOLDOWN_MAX)
# Play generic cast animation or sound?
if player.is_multiplayer_authority() and multiplayer.has_multiplayer_peer() and multiplayer.multiplayer_peer.get_connection_status() == MultiplayerPeer.CONNECTION_CONNECTED:
@@ -552,6 +555,9 @@ func _process(delta):
# Update Global Cooldown
if global_cooldown_timer > 0:
global_cooldown_timer -= delta
if global_cooldown_timer <= 0:
global_cooldown_timer = 0
emit_signal("global_cooldown_updated", global_cooldown_timer, GLOBAL_COOLDOWN_MAX)
# Update Active Buffs (Speed)
if active_buffs.has(SpecialEffect.FASTER_SPEED):