From 007f93a4fcc3c36a4d1f2730ee63587e8769f4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 30 Mar 2016 16:09:06 +0200 Subject: Ctrl: completeReplayStep() does AP burn down, completeReplay() check for turn end --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 522b562..01dc202 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -281,7 +281,7 @@ public abstract class Ctrl implements Disposable if (stateType == StateType.ANIMATION) { this.blockMap = hud.dialogActive(); if (nextState == StateType.REPLAY) - completeReplay(); + completeReplayStep(); } hud.playerInfo.blockEndOfTurn(nextState != StateType.SELECT); @@ -305,7 +305,7 @@ public abstract class Ctrl implements Disposable case DEPLOYMENT: return completeDeployment(); case REPLAY: - return battle.getState(); + return completeReplay(); default: return completeAction(); } @@ -352,7 +352,17 @@ public abstract class Ctrl implements Disposable return nextState; } - private void completeReplay() + private StateType completeReplay() + { + if (battle.getPlayer().apExhausted()) { + return StateType.TURN_OVER; + } else if (!battle.getPlayer().canDoSomething()) { + return StateType.TURN_OVER; + } else + return battle.getState(); + } + + private void completeReplayStep() { StateType nextState = replayState.execute(); -- cgit v1.1-2-g2b99