basic healthbars for enemies

This commit is contained in:
2026-01-23 13:31:11 +01:00
parent 8b2bf3e32e
commit 4d419b9010
13 changed files with 139 additions and 18 deletions

View File

@@ -3,14 +3,16 @@ using Godot;
namespace Movementtests.interfaces;
public record HealthChangedRecord(float CurrentHealth, float PreviousHealth, float MaxHealth);
public interface IHealthable
{
event Action<IHealthable, float> HealthChanged;
event Action<IHealthable, HealthChangedRecord> HealthChanged;
event Action<IHealthable> HealthDepleted;
[Export] RHealth RHealth { get; set; }
float CurrentHealth { get; set; }
void ReduceHealth(IDamageable source, DamageRecord damageRecord);
HealthChangedRecord ReduceHealth(IDamageable source, DamageRecord damageRecord);
}