summaryrefslogtreecommitdiff
path: root/scripts/actors/actions
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/actors/actions')
-rw-r--r--scripts/actors/actions/MeleeAction.cs3
-rw-r--r--scripts/actors/actions/MovementAction.cs2
2 files changed, 3 insertions, 2 deletions
diff --git a/scripts/actors/actions/MeleeAction.cs b/scripts/actors/actions/MeleeAction.cs
index ae94eff..b20430a 100644
--- a/scripts/actors/actions/MeleeAction.cs
+++ b/scripts/actors/actions/MeleeAction.cs
@@ -14,11 +14,11 @@ public partial class MeleeAction : DirectionalAction
/// </summary>
public override void Perform()
{
- actor.Energy -= cost;
// Eu te disse que este método seria útil.
Actor target = GetTargetActor();
// Se não houver um ator na direção, não podemos continuar.
+ // Isto é uma ação gratuita.
if (target == null) return;
// não podemos ter dano negativo.
@@ -34,5 +34,6 @@ public partial class MeleeAction : DirectionalAction
}
MessageLogData.Instance.AddMessage(attackDesc);
+ actor.Energy -= cost;
}
}
diff --git a/scripts/actors/actions/MovementAction.cs b/scripts/actors/actions/MovementAction.cs
index 7d0c93b..3608357 100644
--- a/scripts/actors/actions/MovementAction.cs
+++ b/scripts/actors/actions/MovementAction.cs
@@ -11,7 +11,6 @@ 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;
@@ -20,5 +19,6 @@ public partial class MovementAction : DirectionalAction
if (GetTargetActor() != null) return;
actor.Walk(Offset);
+ actor.Energy -= cost;
}
}