ok so this should be the way to go
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 10m24s

This commit is contained in:
2026-01-17 21:51:57 +01:00
parent 7c74b8b5e5
commit 561e026834
14 changed files with 64 additions and 35 deletions

View File

@@ -5,18 +5,18 @@ using Movementtests.interfaces;
[GlobalClass]
public partial class CDamageable : Node, IDamageable
{
[Signal]
public delegate void DamageTakenEventHandler(float damageTaken);
public event Action<IDamageable, float> DamageTaken;
[Export]
public RDamageModifier[] DamageModifiers { get; set; }
public float TakeDamage(RDamage damage)
{
var finalDamage = 0f;
foreach (var damageable in DamageModifiers.ToIDamageables())
finalDamage += damageable.TakeDamage(damage);
EmitSignalDamageTaken(finalDamage);
DamageTaken?.Invoke(this, finalDamage);
return finalDamage;
}
}