small death animation and toolbox
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user