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

@@ -14,6 +14,8 @@ public partial class FirstEnemy : CharacterBody3D, IDamageable, IKillable, IKnoc
[Export]
public RDamage GetDamageDealt { get; set; }
[Export]
public RDamageModifier[] DamageModifiers { get; set; }
private RayCast3D _wallInFrontRayCast;
private Area3D _damageBox;
@@ -53,6 +55,7 @@ public partial class FirstEnemy : CharacterBody3D, IDamageable, IKillable, IKnoc
public void TakeDamage(RDamage damage)
{
GD.Print("Emotional daaamaaage!", damage.DamageDealt);
foreach (var damageable in DamageModifiers.ToIDamageables())
damageable.TakeDamage(damage);
}
}