setup damage types and modifiers as resources
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 10m48s

This commit is contained in:
2026-01-17 14:32:48 +01:00
parent b1e78df6c7
commit 6b97c226f1
16 changed files with 136 additions and 11 deletions

View File

@@ -13,6 +13,9 @@ public partial class FlyingEnemy : CharacterBody3D, IDamageable, IKillable, IKno
[Export]
public RDamage GetDamageDealt { get; set; }
[Export]
public RDamageModifier[] DamageModifiers { get; set; }
private RayCast3D _groundDistanceRaycast;
private Area3D _damageBox;
@@ -83,6 +86,7 @@ public partial class FlyingEnemy : CharacterBody3D, IDamageable, IKillable, IKno
public void TakeDamage(RDamage damage)
{
GD.Print("Oh no I'm falling!", damage.DamageDealt);
foreach (var damageable in DamageModifiers.ToIDamageables())
damageable.TakeDamage(damage);
}
}