From 7dbe793d1a880032b4768c684170fe25ecf24e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 5 Nov 2015 14:40:55 +0100 Subject: Hex: add DEPRESSION TerrainType --- core/src/ch/asynk/rustanddust/game/Hex.java | 6 +++++- core/src/ch/asynk/rustanddust/game/Unit.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.1-2-g2b99