summaryrefslogtreecommitdiff
path: root/scripts/Magic/HealEffect.cs
blob: 3e924c32b3a9f1075efbc0f881fc376e26d10a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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}");
	}
}