summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-05-10 14:15:54 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-05-10 14:15:54 +0200
commit3cbad22ab26755efcb4a2d6e9e8672138b5ab09d (patch)
tree6990267a368676fb45961ff4792102a871d2f300 /core/src/ch/asynk/rustanddust/game
parent758793c53e9fbb9701d2a9b62abc5adb4b67477e (diff)
downloadRustAndDust-3cbad22ab26755efcb4a2d6e9e8672138b5ab09d.zip
RustAndDust-3cbad22ab26755efcb4a2d6e9e8672138b5ab09d.tar.gz
Ctrl: cleanup according to latest db changes
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index 80bbd8f..bf944e8 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -431,15 +431,10 @@ public abstract class Ctrl implements Disposable
setState(nextState);
} else {
if (!synched) {
- storeState();
+ storeGameState();
synched = true;
}
- if (battle.getPlayer().apExhausted())
- postTurnDone();
- else if (!battle.getPlayer().canDoSomething())
- postTurnDone();
- else
- setState(battle.getState());
+ checkPlayer(battle.getState());
}
}
@@ -452,7 +447,7 @@ public abstract class Ctrl implements Disposable
game.ctrl.hud.engagementSummary(order.engagement);
}
if (this.mode == Mode.PLAY)
- storeOrders();
+ storeGameOrders();
hud.update();
}
@@ -485,19 +480,26 @@ public abstract class Ctrl implements Disposable
battle.getPlayer().burnDownOneAp();
hud.notify("1 Action Point burnt");
- hud.update();
+ checkPlayer(nextState);
+ storeGameState();
+ }
+ private void checkPlayer(StateType nextState)
+ {
+ // FIXME msg stacking
+ // FIXME maybe add default msg as param
if (battle.getPlayer().apExhausted()) {
- hud.notify("No more Action Points");
+ if (mode == Mode.PLAY)
+ hud.notify("No more Action Points");
postTurnDone();
} else if (!battle.getPlayer().canDoSomething()) {
- hud.notify("No available Actions");
+ if (mode == Mode.PLAY)
+ hud.notify("No available Actions");
postTurnDone();
} else {
post(nextState);
}
-
- storeState();
+ hud.update();
}
private void completeOrder(Order order)
@@ -540,6 +542,7 @@ public abstract class Ctrl implements Disposable
if (debugCtrl) RustAndDust.debug(" TURN DONE");
setState(StateType.WAIT_EVENT);
+ storeTurnOrders();
if (battle.turnDone())
hud.victory(battle.getPlayer(), battle.getOpponent());