spawning
This commit is contained in:
@@ -9,17 +9,18 @@ public partial class CHealth : Node, IHealthable
|
||||
public event Action<IHealthable> HealthDepleted;
|
||||
|
||||
[Export]
|
||||
public RHealth HealthResource;
|
||||
public RHealth RHealth { get; set; }
|
||||
|
||||
public float CurrentHealth { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
CurrentHealth = HealthResource.StartingHealth;
|
||||
CurrentHealth = RHealth.StartingHealth;
|
||||
}
|
||||
|
||||
public void ReduceHealth(IDamageable source, float amount)
|
||||
{
|
||||
GD.Print(CurrentHealth);
|
||||
CurrentHealth -= amount;
|
||||
HealthChanged?.Invoke(this, CurrentHealth);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user