diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 15:45:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 15:45:58 +0100 |
commit | ea211dc3b942c26874fecf6812d4894a364dfc07 (patch) | |
tree | 18b70d9191ca4e042c57bdf6fab5fa74a9621342 /core/src/ch/asynk/tankontank/game/states | |
parent | f2b3e093d2602bafa0669ef90a376a75cf4b7489 (diff) | |
download | RustAndDust-ea211dc3b942c26874fecf6812d4894a364dfc07.zip RustAndDust-ea211dc3b942c26874fecf6812d4894a364dfc07.tar.gz |
Map,States: implement infantry move after successfull attack
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/states')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateAttack.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java index 84ee3d8..34f7d61 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java @@ -81,8 +81,13 @@ public class StateAttack extends StateCommon int d1 = ctrl.player.d6(); int d2 = ctrl.player.d6(); System.err.print(" attack (" + selectedHex.getCol() + ";" + selectedHex.getRow() + ") -> (" + to.getCol() + ";" + to.getRow() + ") : 2D6 -> (" + d1 + " + " + d2 + ")"); - if (map.attackPawn(selectedUnit, activeUnit, d1 + d2)) + if (map.attackPawn(selectedUnit, activeUnit, d1 + d2)) { ctrl.player.casualty(activeUnit); + if (map.breakPawns.size() > 0) + setNextState(StateType.BREAK); + } + + activeUnit.showTarget(); ctrl.setState(StateType.ANIMATION); |