diff options
Diffstat (limited to 'scripts/Magic/HealEffect.cs')
| -rw-r--r-- | scripts/Magic/HealEffect.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/Magic/HealEffect.cs b/scripts/Magic/HealEffect.cs new file mode 100644 index 0000000..3e924c3 --- /dev/null +++ b/scripts/Magic/HealEffect.cs @@ -0,0 +1,20 @@ +using Godot; +using TheLegendOfGustav.Entities.Actors; +using TheLegendOfGustav.Utils; + +namespace TheLegendOfGustav.Magic; + +[GlobalClass] +public partial class HealEffect : SpellEffect +{ + [Export] + public int Healing { get; set; } + + public override void Apply(Actor caster, Actor target) + { + int prevHealth = target.Hp; + target.Hp += Healing; + int healingDealt = target.Hp - prevHealth; + MessageLogData.Instance.AddMessage($"{caster.DisplayName} restaurou {healingDealt} de HP de {target.DisplayName}"); + } +}
\ No newline at end of file |
