summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-13 14:03:47 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-13 14:03:47 +0200
commit7b5a827abd46ee5700793f024f5e70f4a4a3e723 (patch)
tree2f4a000188d4954b3d833cf5a1656a20e1303542 /core/src/ch/asynk/tankontank/game
parent62398d2e2009cc3a959422417096137811316e73 (diff)
downloadRustAndDust-7b5a827abd46ee5700793f024f5e70f4a4a3e723.zip
RustAndDust-7b5a827abd46ee5700793f024f5e70f4a4a3e723.tar.gz
Map: fix attackPawn: must mark attacks done whatever the dic roll
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java14
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)