diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Factory.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 9 |
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); |