small death animation and toolbox
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 35s
Create tag and build when new code gets to main / Test (push) Successful in 6m20s
Create tag and build when new code gets to main / Export (push) Successful in 7m20s

This commit is contained in:
2026-01-27 16:42:31 +01:00
parent f1f0febf29
commit 056a68b0ad
19 changed files with 413 additions and 48 deletions

View File

@@ -436,9 +436,9 @@ public partial class PlayerController : CharacterBody3D,
PlayerUi.Initialize(CHealth.CurrentHealth);
CDamageable.DamageTaken += (damageable, record) => ReduceHealth(damageable, record);
CDamageable.DamageTaken += (damageable, record) => RegisterKnockback(new KnockbackRecord(record));
CDamageable.DamageTaken += (_, record) => RegisterKnockback(new KnockbackRecord(record));
CHealth.HealthChanged += PlayerUi.OnHealthChanged;
CHealth.HealthDepleted += Kill;
CHealth.HealthDepleted += (_) => Kill();
// State management
_playerState = StateChart.Of(GetNode("StateChart"));
@@ -499,6 +499,7 @@ public partial class PlayerController : CharacterBody3D,
HeadSystem.HitboxActivated += OnHitboxActivated;
HeadSystem.HitboxDeactivated += OnHitboxDeactivated;
HeadSystem.StepFoot += OnFootStepped;
HeadSystem.DeathAnimationFinished += OnDeathAnimationFinished;
// Movement stuff
// Getting universal setting from GODOT editor to be in sync
@@ -2172,7 +2173,12 @@ public partial class PlayerController : CharacterBody3D,
return kb;
}
public void Kill(IHealthable source)
public void Kill()
{
HeadSystem.OnStartDeathAnimation();
}
public void OnDeathAnimationFinished()
{
EmitSignalPlayerDied();
}