summaryrefslogtreecommitdiff
path: root/scripts/actors/Actor.cs
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/Actor.cs
parente17510951f1136f4afeb2afbf76c47df151b299b (diff)
Mudança no sistema de turnos.
Diffstat (limited to 'scripts/actors/Actor.cs')
-rw-r--r--scripts/actors/Actor.cs31
1 files changed, 30 insertions, 1 deletions
diff --git a/scripts/actors/Actor.cs b/scripts/actors/Actor.cs
index 642e9fd..b651286 100644
--- a/scripts/actors/Actor.cs
+++ b/scripts/actors/Actor.cs
@@ -21,7 +21,36 @@ public abstract partial class Actor : Sprite2D
/// Se o ator está vivo.
/// </summary>
public bool IsAlive { get => Hp > 0; }
-
+
+ private int energy;
+ /// <summary>
+ /// Utilizado no sistema de turnos.
+ /// Enquanto o ator tiver energia, ele poderá realizar turnos.
+ /// </summary>
+ public int Energy
+ {
+ get => energy;
+ set
+ {
+ if (value > Speed) {
+ energy = Speed;
+ } else {
+ energy = value;
+ }
+ }
+ }
+ /// <summary>
+ /// Taxa de recarga de energia.
+ /// </summary>
+ public int Speed { get => definition.Speed; }
+
+ /// <summary>
+ /// Executado uma vez por turno,
+ /// </summary>
+ public void RechargeEnergy() {
+ Energy += Speed;
+ }
+
private Vector2I gridPosition = Vector2I.Zero;
/// <summary>
/// Posição do ator no mapa do jogo. Diferentemente de Position, GridPosition tem como formato