update
This commit is contained in:
@@ -7,15 +7,15 @@ const HOLO_TILES = [11, 12, 13, 14]
|
||||
|
||||
enum SpecialEffect {
|
||||
FASTER_SPEED, # ID 11
|
||||
AREA_FREEZE, # ID 12
|
||||
BLOCK_FLOOR, # ID 13
|
||||
AREA_FREEZE, # ID 12
|
||||
BLOCK_FLOOR, # ID 13
|
||||
INVISIBLE_MODE # ID 14
|
||||
}
|
||||
|
||||
# Levels & Cooldowns
|
||||
var powerup_levels: Dictionary = {} # EffectEnum -> int (1 to 8)
|
||||
var powerup_levels: Dictionary = {} # EffectEnum -> int (1 to 8)
|
||||
var powerup_cooldowns: Dictionary = {} # EffectEnum -> float (Time Remaining)
|
||||
var active_buffs: Dictionary = {} # EffectEnum -> float (Duration Running)
|
||||
var active_buffs: Dictionary = {} # EffectEnum -> float (Duration Running)
|
||||
|
||||
# Cooldown Constants (Level 1 / Level 8)
|
||||
const COOLDOWN_L1 = 15.0
|
||||
@@ -203,6 +203,11 @@ func activate_effect(effect: int, target_player: Node3D = null):
|
||||
if powerup_cooldowns.get(effect, 0.0) > 0:
|
||||
print("PowerUp %s on cooldown." % SpecialEffect.keys()[effect])
|
||||
return
|
||||
|
||||
# Check Carrying Restriction
|
||||
if player.get("is_carrying_tekton") and effect != SpecialEffect.FASTER_SPEED:
|
||||
NotificationManager.send_message(player, "Cannot use this power while carrying a Tekton!", NotificationManager.MessageType.WARNING)
|
||||
return
|
||||
|
||||
# Calculate Cooldown based on Level
|
||||
var level = powerup_levels.get(effect, 1)
|
||||
@@ -241,7 +246,7 @@ func activate_effect(effect: int, target_player: Node3D = null):
|
||||
NotificationManager.send_message(player, msg, NotificationManager.MessageType.NORMAL)
|
||||
# Do NOT set cooldown yet. Cooldown sets on execution.
|
||||
# Revert the cooldown set above (hacky but handles the split flow)
|
||||
powerup_cooldowns[effect] = 0.0
|
||||
powerup_cooldowns[effect] = 0.0
|
||||
emit_signal("cooldown_updated", effect, 0.0, 0.0)
|
||||
print("[SpecialTiles] Entered Targeting Mode for %s" % SpecialEffect.keys()[effect])
|
||||
return # Exit, wait for input
|
||||
@@ -406,7 +411,6 @@ func _execute_invisible_mode(target: Node3D):
|
||||
NotificationManager.send_message(target, "Invisible Mode!", NotificationManager.MessageType.POWERUP)
|
||||
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Helper: Spawn Powerups (For Super Push)
|
||||
# =============================================================================
|
||||
@@ -460,7 +464,7 @@ func _update_freeze_zones(delta: float):
|
||||
if dx <= zone.radius and dy <= zone.radius:
|
||||
# Apply slow effect repeatedly
|
||||
# We use a short duration so it expires quickly if they leave
|
||||
p.rpc("apply_slow_effect", 0.5)
|
||||
p.rpc("apply_slow_effect", 0.5)
|
||||
|
||||
if zone.timer <= 0:
|
||||
zones_to_remove.append(i)
|
||||
|
||||
Reference in New Issue
Block a user