Death animation

This commit is contained in:
2025-11-30 21:37:31 -08:00
parent c491ea5050
commit 8f8cc217dc
11 changed files with 338 additions and 146 deletions

View File

@@ -36,12 +36,18 @@ public class HealthComponent : IHealthComponent
public void Heal(int healAmount)
{
if (CurrentHP.Value <= 0)
return;
var cappedAmount = Math.Min(healAmount + _currentHP.Value, _maximumHP.Value);
_currentHP.OnNext(cappedAmount);
}
public void Damage(int damageAmount)
{
if (CurrentHP.Value <= 0)
return;
var cappedAmount = Math.Max(_currentHP.Value - damageAmount, 0);
_currentHP.OnNext(cappedAmount);