summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-05 14:40:55 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-05 14:40:55 +0100
commit7dbe793d1a880032b4768c684170fe25ecf24e89 (patch)
treeebeef2cf22c31ffa8abf954429f12ac85ff15cdb /core/src/ch
parent41720ef975558b227e04c880a659a1b243731542 (diff)
downloadRustAndDust-7dbe793d1a880032b4768c684170fe25ecf24e89.zip
RustAndDust-7dbe793d1a880032b4768c684170fe25ecf24e89.tar.gz
Hex: add DEPRESSION TerrainType
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hex.java6
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java2
2 files changed, 7 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Hex.java b/core/src/ch/asynk/rustanddust/game/Hex.java
index b805146..e6cab3f 100644
--- a/core/src/ch/asynk/rustanddust/game/Hex.java
+++ b/core/src/ch/asynk/rustanddust/game/Hex.java
@@ -20,7 +20,8 @@ public class Hex extends Tile
CLEAR,
HILLS,
WOODS,
- TOWN
+ TOWN,
+ DEPRESSION
}
public static final int FOG = 0;
@@ -75,6 +76,9 @@ public class Hex extends Tile
@Override
public boolean blockLineOfSightFrom(Tile tile)
{
+ if (isA(Terrain.DEPRESSION))
+ return false;
+
if (isA(Terrain.CLEAR) && !hasUnits())
return false;
diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java
index ec259c1..ed15d4b 100644
--- a/core/src/ch/asynk/rustanddust/game/Unit.java
+++ b/core/src/ch/asynk/rustanddust/game/Unit.java
@@ -155,6 +155,8 @@ public class Unit extends HeadedPawn
@Override
public int getEngagementRangeFrom(Tile tile)
{
+ if (tile.isA(Terrain.DEPRESSION))
+ return 1;
if (!isA(UnitType.INFANTRY) && tile.isA(Terrain.HILLS))
return rng + 1;
return rng;