diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-24 21:25:15 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-24 21:25:15 -0300 |
| commit | 639cd8cef403e9e66bf31e7888e786effac2b292 (patch) | |
| tree | a1b3872a91ad599a71629d0d62c72125138c5c14 /scripts/Magic | |
| parent | 52c32a24044aa574c9e7bf7aa4e2499349cc36b2 (diff) | |
refactor: Sistema de itens reescrito
Em tese, este novo sistema é mais fácil de serializar.
Descanse em paz pergaminhos, eu não quero reimplementá-los
neste novo sistema.
Diffstat (limited to 'scripts/Magic')
| -rw-r--r-- | scripts/Magic/HealEffect.cs | 20 | ||||
| -rw-r--r-- | scripts/Magic/HealEffect.cs.uid | 1 |
2 files changed, 21 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 diff --git a/scripts/Magic/HealEffect.cs.uid b/scripts/Magic/HealEffect.cs.uid new file mode 100644 index 0000000..c35b31a --- /dev/null +++ b/scripts/Magic/HealEffect.cs.uid @@ -0,0 +1 @@ +uid://bslt4pbvwvsj1 |
