diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 14:03:47 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 14:03:47 +0200 |
commit | 7b5a827abd46ee5700793f024f5e70f4a4a3e723 (patch) | |
tree | 2f4a000188d4954b3d833cf5a1656a20e1303542 /core | |
parent | 62398d2e2009cc3a959422417096137811316e73 (diff) | |
download | RustAndDust-7b5a827abd46ee5700793f024f5e70f4a4a3e723.zip RustAndDust-7b5a827abd46ee5700793f024f5e70f4a4a3e723.tar.gz |
Map: fix attackPawn: must mark attacks done whatever the dic roll
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 1df308f..7f9e7ae 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -267,11 +267,15 @@ public abstract class Map extends Board int activatedUnits = activatedPawns.size(); - if (dice == 2) return false; - if (dice == 12) return true; - - // TODO : flank attack - boolean success = (dice + activatedUnits >= hex.defenseFor(target, activatedPawns)); + boolean success; + if (dice == 2) { + success = false; + } else if (dice == 12) { + success = true; + } else { + // TODO : flank attack + success = (dice + activatedUnits >= hex.defenseFor(target, activatedPawns)); + } // TODO : free move for infantry for (Pawn p : activatedPawns) |