Desert now a constant

This commit is contained in:
Yair Morgenstern 2019-10-18 17:39:13 +03:00
parent 894ec1ee6f
commit 384194c531
4 changed files with 8 additions and 5 deletions

View File

@ -13,6 +13,9 @@ class Constants{
const val coast = "Coast"
const val plains = "Plains"
const val lakes = "Lakes"
const val desert = "Desert"
const val barbarianEncampment = "Barbarian encampment"
const val ancientRuins = "Ancient ruins"

View File

@ -188,7 +188,7 @@ class WorkerAutomation(val unit: MapUnit) {
tile.terrainFeature == "Marsh" -> "Remove Marsh"
tile.terrainFeature == Constants.forest -> "Lumber mill"
tile.baseTerrain == Constants.hill -> "Mine"
tile.baseTerrain in listOf("Grassland","Desert",Constants.plains) -> "Farm"
tile.baseTerrain in listOf("Grassland",Constants.desert,Constants.plains) -> "Farm"
tile.baseTerrain == "Tundra" -> "Trading post"
else -> throw Exception("No improvement found for "+tile.baseTerrain)
}

View File

@ -201,14 +201,14 @@ class CelluarAutomataRandomMapGenerator(): SeedRandomMapGenerator() {
//change grassland to desert or tundra based on y
if (abs(getLatitude(tile.position)) < maxLatitude * 0.1) {
if (terrain == "Grassland" || terrain == "Tundra")
terrain = "Desert"
terrain = Constants.desert
} else if (abs(getLatitude(tile.position)) > maxLatitude * 0.7) {
if (terrain == "Grassland" || terrain == Constants.plains || terrain == "Desert" || terrain == Constants.ocean) {
if (terrain == "Grassland" || terrain == Constants.plains || terrain == Constants.desert || terrain == Constants.ocean) {
terrain = "Tundra"
}
} else {
if (terrain == "Tundra") terrain = Constants.plains
else if (terrain == "Desert") terrain = "Grassland"
else if (terrain == Constants.desert) terrain = "Grassland"
}
val area = Area(terrain)

View File

@ -229,7 +229,7 @@ class Building : NamedStats(), IConstruction{
if (construction.isBuilt(name)) return "Already built"
if ("Must be next to desert" in uniques
&& !construction.cityInfo.getCenterTile().getTilesInDistance(1).any { it.baseTerrain == "Desert" })
&& !construction.cityInfo.getCenterTile().getTilesInDistance(1).any { it.baseTerrain == Constants.desert })
return "Must be next to desert"
if ("Must be next to mountain" in uniques