Rough terrain specified through uniques

This commit is contained in:
Yair Morgenstern 2021-04-14 18:32:39 +03:00
parent e424ec4a91
commit b312d24d4a
3 changed files with 6 additions and 4 deletions

View File

@ -68,7 +68,7 @@
"overrideStats": true, "overrideStats": true,
"defenceBonus": 0.25, "defenceBonus": 0.25,
"RGB": [105,125,72], "RGB": [105,125,72],
"rough": true "uniques": ["Rough terrain"]
}, },
{ {
"name": "Mountain", "name": "Mountain",
@ -96,8 +96,7 @@
"unbuildable": true, "unbuildable": true,
"defenceBonus": 0.25, "defenceBonus": 0.25,
"occursOn": ["Tundra","Plains","Grassland","Hill"], "occursOn": ["Tundra","Plains","Grassland","Hill"],
"rough": true, "uniques": ["Provides a one-time Production bonus to the closest city when cut down", "Rough terrain"]
"uniques": ["Provides a one-time Production bonus to the closest city when cut down"]
}, },
{ {
"name": "Jungle", "name": "Jungle",
@ -108,7 +107,7 @@
"unbuildable": true, "unbuildable": true,
"defenceBonus": 0.25, "defenceBonus": 0.25,
"occursOn": ["Plains","Grassland"], "occursOn": ["Plains","Grassland"],
"rough": true "uniques": ["Rough terrain"]
}, },
{ {
"name": "Marsh", "name": "Marsh",

View File

@ -438,6 +438,7 @@ open class TileInfo {
} }
fun isRoughTerrain() = getBaseTerrain().rough || getTerrainFeatures().any { it.rough } 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 override fun toString(): String { // for debugging, it helps to see what you're doing
return toString(null) return toString(null)

View File

@ -35,6 +35,8 @@ class Terrain : NamedStats() {
var movementCost = 1 var movementCost = 1
var defenceBonus:Float = 0f var defenceBonus:Float = 0f
var impassable = false var impassable = false
@Deprecated("As of 3.14.1")
var rough = false var rough = false