diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-17 11:07:42 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-17 11:07:42 +0100 |
commit | b4c82404bcb7b2e1f58339088ccf48023c1da6f9 (patch) | |
tree | 2522aa4154f21e9cdc999509e785240ecb572bb2 /core/src/ch/asynk | |
parent | 1761ccbc8e6bb4d3da6a16fea30da7aff9f414ef (diff) | |
download | RustAndDust-b4c82404bcb7b2e1f58339088ccf48023c1da6f9.zip RustAndDust-b4c82404bcb7b2e1f58339088ccf48023c1da6f9.tar.gz |
Battle,Ctrl: add boolean getReinforcement(Ctrl)
Diffstat (limited to 'core/src/ch/asynk')
4 files changed, 19 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java index 7e52632..6f38a21 100644 --- a/core/src/ch/asynk/tankontank/game/Battle.java +++ b/core/src/ch/asynk/tankontank/game/Battle.java @@ -17,6 +17,8 @@ public interface Battle public Player checkVictory(Ctrl ctrl); + public boolean getReinforcement(Ctrl ctrl); + public EntryPoint getEntryPoint(Unit unit); public Position getHudPosition(Player player); diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 77bc56f..16a6a57 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -121,8 +121,10 @@ public class Ctrl implements Disposable private void startPlayerTurn() { player.turnStart(); - hud.update(); hud.notify(player.getName() + "'s turn", 2, Position.MIDDLE_CENTER, true); + if (battle.getReinforcement(this)) + hud.notify("You have reinforcement", 2, Position.MIDDLE_CENTER, true); + hud.update(); setState(battle.getState(player)); } diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java index c4e760d..f31aff4 100644 --- a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java +++ b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java @@ -55,6 +55,13 @@ public class BattleFrontalAssault extends BattleCommon return ((player.is(Army.GE) && (n == 4))); } + @Override + public boolean getReinforcement(Ctrl ctrl) + { + return false; + } + + @Override public Player checkVictory(Ctrl ctrl) { if (ctrl.opponent.unitsLeft() == 0) diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java index 8e9ed67..14efe77 100644 --- a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java +++ b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java @@ -47,6 +47,13 @@ public class BattleHeadToHead extends BattleCommon return StateType.SELECT; } + @Override + public boolean getReinforcement(Ctrl ctrl) + { + return false; + } + + @Override public Player checkVictory(Ctrl ctrl) { if (ctrl.opponent.unitsLeft() == 0) |