diff --git a/android/assets/jsons/Civ V - Vanilla/Terrains.json b/android/assets/jsons/Civ V - Vanilla/Terrains.json index 56666bbc81..6aeaf3e18f 100644 --- a/android/assets/jsons/Civ V - Vanilla/Terrains.json +++ b/android/assets/jsons/Civ V - Vanilla/Terrains.json @@ -50,8 +50,7 @@ "type": "Water", "food": 2, "gold": 1, - "RGB": [ 200, 200, 255], - "canHaveOverlay": false + "RGB": [ 200, 200, 255] }, { "name": "Hill", diff --git a/core/src/com/unciv/logic/map/MapGenerator.kt b/core/src/com/unciv/logic/map/MapGenerator.kt index a0e94b0944..5da27f68eb 100644 --- a/core/src/com/unciv/logic/map/MapGenerator.kt +++ b/core/src/com/unciv/logic/map/MapGenerator.kt @@ -379,7 +379,9 @@ class MapGenerator(val ruleset: Ruleset) { for (resource in strategicResources) { // remove the tiles where previous resources have been placed val suitableTiles = candidateTiles - .filter { it.resource == null && resource.terrainsCanBeFoundOn.contains(it.getBaseTerrain().name)} + .filter { it.resource == null + && resource.terrainsCanBeFoundOn.contains(it.getBaseTerrain().name) + && (it.terrainFeature==null || ruleset.tileImprovements.containsKey("Remove "+it.terrainFeature)) } val locations = chooseSpreadOutLocations(resourcesPerType, suitableTiles, distance) diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index ebcad6828b..74bba37fa5 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -8,6 +8,43 @@ import com.unciv.models.translations.tr import com.unciv.ui.utils.colorFromRGB class Terrain : NamedStats() { + + lateinit var type: TerrainType + + var overrideStats = false + + /** If true, other terrain layers can come over this one. For mountains, lakes etc. this is false */ + var canHaveOverlay = true + + /** If true, nothing can be built here - not even resource improvements */ + var unbuildable = false + + /** For terrain features */ + val occursOn: Collection? = null + + /** Used by Natural Wonders: it is the baseTerrain on top of which the Natural Wonder is placed */ + val turnsInto: String? = null + + /** Uniques (currently used only for Natural Wonders) */ + val uniques = ArrayList() + + /** Natural Wonder weight: probability to be picked */ + var weight = 10 + + /** RGB color of base terrain */ + var RGB: List? = null + var movementCost = 1 + var defenceBonus:Float = 0f + var impassable = false + var rough = false + + + fun getColor(): Color { // Can't be a lazy initialize. because w play around with the resulting color with lerp()s and the like + if (RGB == null) return Color.GOLD + return colorFromRGB(RGB!![0], RGB!![1], RGB!![2]) + } + + fun getDescription(ruleset: Ruleset): String { val sb = StringBuilder() sb.appendln(this.clone().toString()) @@ -37,53 +74,4 @@ class Terrain : NamedStats() { return sb.toString() } - - lateinit var type: TerrainType - - var overrideStats = false - - /*** - * If true, other terrain layers can come over this one. For mountains, lakes etc. this is false - */ - - var canHaveOverlay = true - - /*** - * If true, nothing can be built here - not even resource improvements - */ - var unbuildable = false - - /*** - * For terrain features - */ - val occursOn: Collection? = null - - /*** - * Used by Natural Wonders: it is the baseTerrain on top of which the Natural Wonder is placed - */ - val turnsInto: String? = null - - /** - * Uniques (currently used only for Natural Wonders) - */ - val uniques = ArrayList() - - /* - * Natural Wonder weight: probability to be picked - */ - var weight = 10 - - /** - * RGB color of base terrain - */ - var RGB: List? = null - var movementCost = 1 - var defenceBonus:Float = 0f - var impassable = false - var rough = false - - fun getColor(): Color { - if (RGB == null) return Color.GOLD - return colorFromRGB(RGB!![0], RGB!![1], RGB!![2]) - } } \ No newline at end of file