feat: introduce special power-up manager with inventory and associated UI
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user