From 147bb12b5d48c5432aa1bd1cbe60b8435294445b Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 4 Sep 2025 17:20:48 -0300 Subject: Ações gratuitas são mais explícitas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/Time/TurnManager.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts/Time/TurnManager.cs') diff --git a/scripts/Time/TurnManager.cs b/scripts/Time/TurnManager.cs index fd16f0f..01efc18 100644 --- a/scripts/Time/TurnManager.cs +++ b/scripts/Time/TurnManager.cs @@ -50,17 +50,18 @@ public partial class TurnManager : RefCounted StartTurn(); } + bool actionResult = true;; // Primeiro executamos a ação do jogador, se ele puder. if (playerActionQueue.Count > 0 && Player.Energy > 0) { Action action = playerActionQueue[0]; playerActionQueue.RemoveAt(0); - action.Perform(); + actionResult = action.Perform(); } - // Se o jogador ainda tem energia, ele poderá fazer - // mais um turno sem interrupções. - if (Player.Energy <= 0) { + // Se a ação do jogador for gratuita ou se o jogador ainda possuir energia, + // ele poderá fazer mais um turno sem interrupções. + if (actionResult && Player.Energy <= 0) { // Depois computamos os turnos dos outros atores. HandleEnemyTurns(); map.UpdateFOV(Player.GridPosition); -- cgit v1.2.3