feat: shared creature root, enemy definitions, defend duty, and player downing

This commit is contained in:
Rijad Zuzo
2026-08-12 00:16:48 +02:00
parent 6de6d25bf5
commit 661d53f31a
23 changed files with 653 additions and 76 deletions
+15
View File
@@ -44,8 +44,15 @@ func _resolve_references() -> void:
func _physics_process(delta: float) -> void:
if not _references_resolved:
_resolve_references()
if simulation_manager != null and simulation_manager.has_method("update_player_combatant"):
simulation_manager.update_player_combatant(player.global_position)
attack_timer = maxf(attack_timer - delta, 0.0)
dash_timer = maxf(dash_timer - delta, 0.0)
if _player_is_downed():
attack_timer = 0.0
dash_timer = 0.0
dashing = false
return
if dashing:
player.velocity = dash_velocity
if dash_timer <= 0.0:
@@ -58,6 +65,14 @@ func _physics_process(delta: float) -> void:
_perform_dash()
func _player_is_downed() -> bool:
return (
simulation_manager != null
and simulation_manager.has_method("player_is_downed")
and simulation_manager.player_is_downed()
)
func _perform_attack() -> void:
attack_timer = attack_cooldown_seconds
_play_swing()