summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-14 11:17:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-14 11:17:59 +0200
commit03d764fc87370a7dc024b9065b019ed21107c95e (patch)
treeac1653ac844cbb10d11e4e89b5781c0faa1f0829 /core/src/ch
parenta34c377e53061db4d2affe8bda13d12fb1038911 (diff)
downloadRustAndDust-03d764fc87370a7dc024b9065b019ed21107c95e.zip
RustAndDust-03d764fc87370a7dc024b9065b019ed21107c95e.tar.gz
Pawn,Unit add boolean canAssistAttackWithoutLos() and UnitType.ARTILLERY
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/Factory.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java9
3 files changed, 11 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index aa6e666..ef91544 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -53,6 +53,7 @@ public abstract class Pawn implements Drawable, Disposable
public abstract boolean canRotate();
public abstract boolean canAttack();
public abstract boolean canAttack(Pawn other);
+ public abstract boolean canAssistAttackWithoutLos();
public abstract void move(int cost);
public abstract void rotate(Orientation o);
diff --git a/core/src/ch/asynk/tankontank/game/Factory.java b/core/src/ch/asynk/tankontank/game/Factory.java
index 3f1e80a..ac4d671 100644
--- a/core/src/ch/asynk/tankontank/game/Factory.java
+++ b/core/src/ch/asynk/tankontank/game/Factory.java
@@ -73,6 +73,7 @@ public class Factory implements Board.TileBuilder, Disposable
u = new Unit(Army.GE, ut, 3, 11, 1, pawnAtlas, "ge-tiger", "head");
break;
case GE_WESPE:
+ ut = Unit.UnitType.ARTILLERY;
u = new Unit(Army.GE, ut, 5, 8, 1, pawnAtlas, "ge-wespe", "head");
break;
case US_AT_GUN:
@@ -90,6 +91,7 @@ public class Factory implements Board.TileBuilder, Disposable
u = new Unit(Army.US, utHq, 3, 10, 2, pawnAtlas, "us-pershing-hq", "head");
break;
case US_PRIEST:
+ ut = Unit.UnitType.ARTILLERY;
u = new Unit(Army.US, ut, 5, 8, 1, pawnAtlas, "us-priest", "head");
break;
case US_SHERMAN:
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index b559489..6798aed 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -17,7 +17,8 @@ public class Unit extends HeadedPawn
HARD_TARGET,
HARD_TARGET_HQ,
INFANTRY,
- AT_GUN
+ AT_GUN,
+ ARTILLERY
}
public int rng;
@@ -138,6 +139,12 @@ public class Unit extends HeadedPawn
}
@Override
+ public boolean canAssistAttackWithoutLos()
+ {
+ return (type == UnitType.ARTILLERY);
+ }
+
+ @Override
public boolean canAttack(Pawn other)
{
return isEnemy(other);