summaryrefslogtreecommitdiff
path: root/scripts/actors/actions
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-28 17:46:54 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-28 17:46:54 -0300
commit2ed63124ef044a223fc9c7b660100c91af6f39b0 (patch)
treeea0887e9aec0f88cea1979877f325faf6024a444 /scripts/actors/actions
parente17510951f1136f4afeb2afbf76c47df151b299b (diff)
Mudança no sistema de turnos.
Diffstat (limited to 'scripts/actors/actions')
-rw-r--r--scripts/actors/actions/Action.cs5
-rw-r--r--scripts/actors/actions/BumpAction.cs4
-rw-r--r--scripts/actors/actions/MeleeAction.cs1
-rw-r--r--scripts/actors/actions/MovementAction.cs1
-rw-r--r--scripts/actors/actions/WaitAction.cs1
5 files changed, 10 insertions, 2 deletions
diff --git a/scripts/actors/actions/Action.cs b/scripts/actors/actions/Action.cs
index 0320dd8..f20e262 100644
--- a/scripts/actors/actions/Action.cs
+++ b/scripts/actors/actions/Action.cs
@@ -11,8 +11,13 @@ public abstract partial class Action : RefCounted {
/// </summary>
protected Actor actor;
+ // O custo da ação.
+ protected int cost;
+
public Action(Actor actor) {
this.actor = actor;
+ // Custo base, subclasses podem sobreescrever isto se quiserem.
+ cost = 10;
}
/// <summary>
diff --git a/scripts/actors/actions/BumpAction.cs b/scripts/actors/actions/BumpAction.cs
index 0ce7fbe..805520c 100644
--- a/scripts/actors/actions/BumpAction.cs
+++ b/scripts/actors/actions/BumpAction.cs
@@ -11,10 +11,10 @@ public partial class BumpAction : DirectionalAction
{
}
+ // Como esta ação inevitavelmente gera outras ações,
+ // não faz sentido descontar a energia do ator.
public override void Perform()
{
- Vector2I destination = actor.GridPosition + Offset;
-
// Declaramos uma ação genérica.
Action action;
diff --git a/scripts/actors/actions/MeleeAction.cs b/scripts/actors/actions/MeleeAction.cs
index c61a803..56a2dc3 100644
--- a/scripts/actors/actions/MeleeAction.cs
+++ b/scripts/actors/actions/MeleeAction.cs
@@ -32,6 +32,7 @@ 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 b37f9ae..6cec875 100644
--- a/scripts/actors/actions/MovementAction.cs
+++ b/scripts/actors/actions/MovementAction.cs
@@ -18,6 +18,7 @@ public partial class MovementAction : DirectionalAction
// Na maioria dos casos, essa condição nunca é verdadeira.
if (GetTargetActor() != null) return;
+ actor.Energy -= cost;
actor.Walk(Offset);
}
}
diff --git a/scripts/actors/actions/WaitAction.cs b/scripts/actors/actions/WaitAction.cs
index 4ad064a..2d3ccc2 100644
--- a/scripts/actors/actions/WaitAction.cs
+++ b/scripts/actors/actions/WaitAction.cs
@@ -96,6 +96,7 @@ public partial class WaitAction : Action
//@@@@@@@@@@@@*====+==++=*@. @ @@* .@* @ .*#. @ @* #: -@ @@% @ -+ =*%@@= @@: @ @ +. #+ *@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@======++====+*%@@@@%%%@@@@%*+#@@@@@%#%@@#=+**=. =**+=***==*#*: :%@@@@@@@@@**=+#*==*###*=. -=**+::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@+==+==++=====++=====++=+++++++++===+++++#% +@@@* :#%= =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ actor.Energy -= cost;
}