summaryrefslogtreecommitdiff
path: root/scripts/Magic/DamageEffect.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Magic/DamageEffect.cs')
-rw-r--r--scripts/Magic/DamageEffect.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/Magic/DamageEffect.cs b/scripts/Magic/DamageEffect.cs
new file mode 100644
index 0000000..abd2cca
--- /dev/null
+++ b/scripts/Magic/DamageEffect.cs
@@ -0,0 +1,18 @@
+using Godot;
+using TheLegendOfGustav.Entities.Actors;
+
+namespace TheLegendOfGustav.Magic;
+
+[GlobalClass]
+public partial class DamageEffect : SpellEffect
+{
+ [Export]
+ public int Damage { get; set; }
+
+ public override void Apply(Actor caster, Actor target)
+ {
+ int damageDealt = Damage - target.Men;
+
+ target.Hp -= damageDealt;
+ }
+} \ No newline at end of file