diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-05 10:10:37 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-05 10:10:37 +0100 |
commit | 4786b6eba151ab24c17ed228aaba118d1d38658d (patch) | |
tree | 42f6b110739727d6c89251d9276cf8c053fbb55d /core/src/ch | |
parent | 917441a182f1deb7651deb6b2d90d2d5fb64ce1f (diff) | |
download | RustAndDust-4786b6eba151ab24c17ed228aaba118d1d38658d.zip RustAndDust-4786b6eba151ab24c17ed228aaba118d1d38658d.tar.gz |
Ctrl: check if Player can do something after each action and at turn start
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 9 |
1 files changed, 8 insertions, 1 deletions
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(); } |