From b312d24d4a70092e340b6f3c9a468832c5c846cf Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 14 Apr 2021 18:32:39 +0300 Subject: [PATCH] Rough terrain specified through uniques --- android/assets/jsons/Civ V - Vanilla/Terrains.json | 7 +++---- core/src/com/unciv/logic/map/TileInfo.kt | 1 + core/src/com/unciv/models/ruleset/tile/Terrain.kt | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/Terrains.json b/android/assets/jsons/Civ V - Vanilla/Terrains.json index aa27994c59..937368689a 100644 --- a/android/assets/jsons/Civ V - Vanilla/Terrains.json +++ b/android/assets/jsons/Civ V - Vanilla/Terrains.json @@ -68,7 +68,7 @@ "overrideStats": true, "defenceBonus": 0.25, "RGB": [105,125,72], - "rough": true + "uniques": ["Rough terrain"] }, { "name": "Mountain", @@ -96,8 +96,7 @@ "unbuildable": true, "defenceBonus": 0.25, "occursOn": ["Tundra","Plains","Grassland","Hill"], - "rough": true, - "uniques": ["Provides a one-time Production bonus to the closest city when cut down"] + "uniques": ["Provides a one-time Production bonus to the closest city when cut down", "Rough terrain"] }, { "name": "Jungle", @@ -108,7 +107,7 @@ "unbuildable": true, "defenceBonus": 0.25, "occursOn": ["Plains","Grassland"], - "rough": true + "uniques": ["Rough terrain"] }, { "name": "Marsh", diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 9497c6e1bb..bb2651871e 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -438,6 +438,7 @@ open class TileInfo { } fun isRoughTerrain() = getBaseTerrain().rough || getTerrainFeatures().any { it.rough } + || getBaseTerrain().uniques.contains("Rough") || getTerrainFeatures().any { it.uniques.contains("Rough") } override fun toString(): String { // for debugging, it helps to see what you're doing return toString(null) diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index a901f9bc67..4d83370ab4 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -35,6 +35,8 @@ class Terrain : NamedStats() { var movementCost = 1 var defenceBonus:Float = 0f var impassable = false + + @Deprecated("As of 3.14.1") var rough = false