From 4b3c560ae4356eef1b805202d0f100e4e12dce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 15 Nov 2014 17:00:09 +0100 Subject: Ctrl: actionDone() -> if next state is DONE burn down AP end check for end of turn --- core/src/ch/asynk/tankontank/game/Ctrl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index cc6f801..f430846 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -151,14 +151,16 @@ public class Ctrl implements Disposable { StateType nextState = this.state.done(); - if (map.activatedPawns.size() > 0) { - player.burnDownOneAp(); - hud.update(); + if (nextState == StateType.DONE) { + if (map.activatedPawns.size() > 0) { + TankOnTank.debug("burn down 1AP"); + player.burnDownOneAp(); + hud.update(); + } + if (player.apExhausted()) + hud.notifyEndOfTurn(); } - if (player.apExhausted()) - swicthPlayer(); - if (nextState == StateType.DONE) nextState = battle.getState(player); -- cgit v1.1-2-g2b99