From 29e378ff070ae525a666ffa6a286caab898abbc7 Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 28 Aug 2025 18:23:02 -0300 Subject: Correção no sistema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/actors/actions/MeleeAction.cs | 2 +- scripts/actors/actions/MovementAction.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/actors/actions') diff --git a/scripts/actors/actions/MeleeAction.cs b/scripts/actors/actions/MeleeAction.cs index 56a2dc3..fe00422 100644 --- a/scripts/actors/actions/MeleeAction.cs +++ b/scripts/actors/actions/MeleeAction.cs @@ -14,6 +14,7 @@ public partial class MeleeAction : DirectionalAction /// public override void Perform() { + actor.Energy -= cost; // Eu te disse que este método seria útil. Actor target = GetTargetActor(); @@ -32,7 +33,6 @@ public partial class MeleeAction : DirectionalAction attackDesc += $" mas {target.ActorName} tem músculos de aço."; } - actor.Energy -= cost; GD.Print(attackDesc); } } diff --git a/scripts/actors/actions/MovementAction.cs b/scripts/actors/actions/MovementAction.cs index 6cec875..7d0c93b 100644 --- a/scripts/actors/actions/MovementAction.cs +++ b/scripts/actors/actions/MovementAction.cs @@ -11,6 +11,7 @@ public partial class MovementAction : DirectionalAction public override void Perform() { + actor.Energy -= cost; // Não anda se o destino for um tile sólido. if (!Map_Data.IsTileWalkable(Destination)) return; @@ -18,7 +19,6 @@ public partial class MovementAction : DirectionalAction // Na maioria dos casos, essa condição nunca é verdadeira. if (GetTargetActor() != null) return; - actor.Energy -= cost; actor.Walk(Offset); } } -- cgit v1.2.3