weapon timings

This commit is contained in:
Twirpytherobot
2025-11-28 18:40:23 +00:00
parent 7d18de1621
commit ddc1522174
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -159,11 +159,14 @@ func _activate_hitbox():
# Update owner reference in case it changed
_hitbox.owner_entity = owner_character
# Activate hitbox immediately for entire animation duration
# Activate hitbox immediately for the duration specified in weapon data
_hitbox.activate()
# Keep active for the full attack cooldown
var duration = weapon_data.attack_cooldown if weapon_data else 0.5
# Calculate total active duration from weapon resource (startup + active)
var startup = weapon_data.startup_time if weapon_data else 0.15
var active = weapon_data.active_time if weapon_data else 0.2
var duration = startup + active
await get_tree().create_timer(duration).timeout
# Deactivate when attack is complete