diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-30 16:09:06 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-30 16:09:06 +0200 |
commit | 007f93a4fcc3c36a4d1f2730ee63587e8769f4be (patch) | |
tree | d55589d5816de349291239e55fd331d879ab9fb2 /core/src/ch | |
parent | 80245aa6e0ab38354a488ff91ce068e27b6acbab (diff) | |
download | RustAndDust-007f93a4fcc3c36a4d1f2730ee63587e8769f4be.zip RustAndDust-007f93a4fcc3c36a4d1f2730ee63587e8769f4be.tar.gz |
Ctrl: completeReplayStep() does AP burn down, completeReplay() check for turn end
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 16 |
1 files 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(); |