From 46cbb5e2a1a246594fa35b72a53b1a1c76980278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 9 Dec 2015 23:47:20 +0100 Subject: Ctrl: no more AP -> only notify user --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 12 ++++++++---- core/src/ch/asynk/rustanddust/game/State.java | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 7dd29d5..9fcfe08 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -233,6 +233,8 @@ public class Ctrl implements Disposable this.state.enter(tmp); + if (nextState == StateType.TURN_OVER) + turnDone(); } private StateType completeDeployment() @@ -257,13 +259,15 @@ public class Ctrl implements Disposable StateType nextState = this.state.execute(); if (nextState == StateType.DONE) { - if (battle.actionDone()) { + if (battle.getPlayer().apExhausted()) { + hud.notify("No more Action Points", 1f, Position.MIDDLE_CENTER, false); + nextState = StateType.TURN_OVER; + } + else if (battle.actionDone()) { hud.notify("1 Action Point burnt", 0.6f, Position.BOTTOM_CENTER, false); hud.update(); + nextState = battle.getState(); } - if (battle.getPlayer().apExhausted()) - hud.notifyNoMoreAP(); - nextState = battle.getState(); } return nextState; diff --git a/core/src/ch/asynk/rustanddust/game/State.java b/core/src/ch/asynk/rustanddust/game/State.java index db0d6af..386df8b 100644 --- a/core/src/ch/asynk/rustanddust/game/State.java +++ b/core/src/ch/asynk/rustanddust/game/State.java @@ -14,7 +14,8 @@ public interface State DEPLOYMENT, WITHDRAW, ABORT, - DONE + DONE, + TURN_OVER }; public void enter(StateType prevState); -- cgit v1.1-2-g2b99