summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-19 09:27:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-19 09:27:42 +0100
commit37c77308e3c9406533e711b0df05e7bc6288c2e6 (patch)
treedaccdc740b0051c9272a32c19f37e4b00370f771 /core/src/ch/asynk
parent52c8709d0585b360f3e527f476919ac1c4f2db8c (diff)
downloadRustAndDust-37c77308e3c9406533e711b0df05e7bc6288c2e6.zip
RustAndDust-37c77308e3c9406533e711b0df05e7bc6288c2e6.tar.gz
Unit: add HQ = 5 overlay
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index d5576be..164d43c 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -18,6 +18,7 @@ public class Unit extends HeadedPawn
public static final int FIRE = 2;
public static final int MAY_FIRE = 3;
public static final int ACE = 4;
+ public static final int HQ = 5;
public static final int FLANK_ATTACK_BONUS = 1;
@@ -69,6 +70,15 @@ public class Unit extends HeadedPawn
{
super(army, pawn, head, pawns, overlays);
ace = false;
+
+ }
+
+ private void commonSetup()
+ {
+ mpLeft = mp;
+ enableOverlay(HQ, isHq());
+ this.hasMoved = false;
+ this.hasFired = false;
}
// hard tager
@@ -78,12 +88,10 @@ public class Unit extends HeadedPawn
this.rng = range;
this.def = defense;
this.mp = movementPoints;
- mpLeft = mp;
this.id = id;
this.type = type;
- this.hasMoved = false;
- this.hasFired = false;
this.descr = id.toString() + " (" + rng + "-" + def + "-" + mp + ")";
+ commonSetup();
}
// soft tager
@@ -94,12 +102,10 @@ public class Unit extends HeadedPawn
this.def = defense;
this.cdef = concealedDefense;
this.mp = movementPoints;
- mpLeft = mp;
this.id = id;
this.type = type;
- this.hasMoved = false;
- this.hasFired = false;
this.descr = id.toString() + " (" + rng + "-" + def + "/" + cdef + "-" + mp + ")";
+ commonSetup();
}
public Hex getHex()
@@ -204,6 +210,7 @@ public class Unit extends HeadedPawn
return;
type = UnitType.HARD_TARGET_HQ;
+ enableOverlay(HQ, true);
}
public void degrade()
@@ -218,6 +225,7 @@ public class Unit extends HeadedPawn
return;
type = UnitType.HARD_TARGET;
+ enableOverlay(HQ, false);
}
@Override