Death animation
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user