summaryrefslogtreecommitdiff
path: root/scripts/entities/actions/MeleeAction.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/entities/actions/MeleeAction.cs')
-rw-r--r--scripts/entities/actions/MeleeAction.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/entities/actions/MeleeAction.cs b/scripts/entities/actions/MeleeAction.cs
index 6dfeb78..09c5cc7 100644
--- a/scripts/entities/actions/MeleeAction.cs
+++ b/scripts/entities/actions/MeleeAction.cs
@@ -12,14 +12,14 @@ public partial class MeleeAction : DirectionalAction
/// <summary>
/// Ataca o ator na direção da ação.
/// </summary>
- public override void Perform()
+ public override bool Perform()
{
// Eu te disse que este método seria útil.
Entity potentialTarget = GetTarget();
// Só podemos atacar atores.
if (potentialTarget is not Actor) {
- return;
+ return false;
}
Actor target = (Actor)potentialTarget;
@@ -27,7 +27,7 @@ public partial class MeleeAction : DirectionalAction
// Se não houver um ator na direção, não podemos continuar.
// Isto é uma ação gratuita.
- if (target == null) return;
+ if (target == null) return false;
// não podemos ter dano negativo.
int damage = actor.Atk - target.Def;
@@ -43,5 +43,6 @@ public partial class MeleeAction : DirectionalAction
MessageLogData.Instance.AddMessage(attackDesc);
actor.Energy -= cost;
+ return true;
}
}