From 4786b6eba151ab24c17ed228aaba118d1d38658d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 5 Jan 2016 10:10:37 +0100 Subject: Ctrl: check if Player can do something after each action and at turn start --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index d75ef94..ec974ca 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -192,7 +192,11 @@ public class Ctrl implements Disposable if (battle.hasReinforcement()) hud.notify("You have reinforcement", 2, Position.MIDDLE_CENTER, true); hud.update(); - setState(battle.getState()); + if (!battle.getPlayer().canDoSomething()) { + hud.notify("No available Actions"); + setState(StateType.TURN_OVER); + } else + setState(battle.getState()); } } @@ -256,6 +260,9 @@ public class Ctrl implements Disposable if (battle.getPlayer().apExhausted()) { hud.notify("No more Action Points"); nextState = StateType.TURN_OVER; + } else if (!battle.getPlayer().canDoSomething()) { + hud.notify("No available Actions"); + nextState = StateType.TURN_OVER; } else nextState = battle.getState(); } -- cgit v1.1-2-g2b99