From 639cd8cef403e9e66bf31e7888e786effac2b292 Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 24 Oct 2025 21:25:15 -0300 Subject: refactor: Sistema de itens reescrito MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Em tese, este novo sistema é mais fácil de serializar. Descanse em paz pergaminhos, eu não quero reimplementá-los neste novo sistema. --- scripts/Magic/HealEffect.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/Magic/HealEffect.cs (limited to 'scripts/Magic/HealEffect.cs') 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 -- cgit v1.2.3