summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-30 16:09:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-30 16:09:06 +0200
commit007f93a4fcc3c36a4d1f2730ee63587e8769f4be (patch)
treed55589d5816de349291239e55fd331d879ab9fb2 /core/src
parent80245aa6e0ab38354a488ff91ce068e27b6acbab (diff)
downloadRustAndDust-007f93a4fcc3c36a4d1f2730ee63587e8769f4be.zip
RustAndDust-007f93a4fcc3c36a4d1f2730ee63587e8769f4be.tar.gz
Ctrl: completeReplayStep() does AP burn down, completeReplay() check for turn end
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java16
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();