|
|
|
@ -159,11 +159,14 @@ func _activate_hitbox(): |
|
|
|
# Update owner reference in case it changed |
|
|
|
# Update owner reference in case it changed |
|
|
|
_hitbox.owner_entity = owner_character |
|
|
|
_hitbox.owner_entity = owner_character |
|
|
|
|
|
|
|
|
|
|
|
# Activate hitbox immediately for entire animation duration |
|
|
|
# Activate hitbox immediately for the duration specified in weapon data |
|
|
|
_hitbox.activate() |
|
|
|
_hitbox.activate() |
|
|
|
|
|
|
|
|
|
|
|
# Keep active for the full attack cooldown |
|
|
|
# Calculate total active duration from weapon resource (startup + active) |
|
|
|
var duration = weapon_data.attack_cooldown if weapon_data else 0.5 |
|
|
|
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 |
|
|
|
await get_tree().create_timer(duration).timeout |
|
|
|
|
|
|
|
|
|
|
|
# Deactivate when attack is complete |
|
|
|
# Deactivate when attack is complete |
|
|
|
|