mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 03:18:18 +07:00
Improvements with 0 turns to build are 'placeable' improvements which can only be places by corresponding uniques
This commit is contained in:
parent
6889a60605
commit
e3187148f5
@ -3,8 +3,8 @@ package com.unciv.build
|
|||||||
object BuildConfig {
|
object BuildConfig {
|
||||||
const val kotlinVersion = "1.3.71"
|
const val kotlinVersion = "1.3.71"
|
||||||
const val appName = "Unciv"
|
const val appName = "Unciv"
|
||||||
const val appCodeNumber = 522
|
const val appCodeNumber = 523
|
||||||
const val appVersion = "3.12.9-patch1"
|
const val appVersion = "3.12.9-patch2"
|
||||||
|
|
||||||
const val gdxVersion = "1.9.12"
|
const val gdxVersion = "1.9.12"
|
||||||
const val roboVMVersion = "2.3.1"
|
const val roboVMVersion = "2.3.1"
|
||||||
|
@ -189,7 +189,8 @@ class WorkerAutomation(val unit: MapUnit) {
|
|||||||
else -> tile.getTileResource().improvement
|
else -> tile.getTileResource().improvement
|
||||||
}
|
}
|
||||||
|
|
||||||
val tileImprovements = civInfo.gameInfo.ruleSet.tileImprovements
|
// turnsToBuild is what defines them as buildable
|
||||||
|
val tileImprovements = civInfo.gameInfo.ruleSet.tileImprovements.filter { it.value.turnsToBuild!=0 }
|
||||||
val uniqueImprovement = tileImprovements.values
|
val uniqueImprovement = tileImprovements.values
|
||||||
.firstOrNull { it.uniqueTo == civInfo.civName }
|
.firstOrNull { it.uniqueTo == civInfo.civName }
|
||||||
|
|
||||||
|
@ -316,7 +316,8 @@ open class TileInfo {
|
|||||||
isCityCenter() -> false
|
isCityCenter() -> false
|
||||||
"Cannot be built on bonus resource" in improvement.uniques && resource != null
|
"Cannot be built on bonus resource" in improvement.uniques && resource != null
|
||||||
&& getTileResource().resourceType == ResourceType.Bonus -> false
|
&& getTileResource().resourceType == ResourceType.Bonus -> false
|
||||||
improvement.uniques.contains("Great Improvement") && isLand -> true
|
// Tiles with no terrains, and no turns to build, are like great improvements - they're placeable
|
||||||
|
improvement.terrainsCanBeBuiltOn.isEmpty() && improvement.turnsToBuild==0 && isLand -> true
|
||||||
improvement.terrainsCanBeBuiltOn.contains(topTerrain.name) -> true
|
improvement.terrainsCanBeBuiltOn.contains(topTerrain.name) -> true
|
||||||
improvement.uniqueObjects.filter { it.placeholderText == "Must be next to []" }.any {
|
improvement.uniqueObjects.filter { it.placeholderText == "Must be next to []" }.any {
|
||||||
val filter = it.params[0]
|
val filter = it.params[0]
|
||||||
|
@ -48,9 +48,9 @@ class ImprovementPickerScreen(val tileInfo: TileInfo, val onAccept: ()->Unit) :
|
|||||||
regularImprovements.defaults().pad(5f)
|
regularImprovements.defaults().pad(5f)
|
||||||
|
|
||||||
for (improvement in tileInfo.tileMap.gameInfo.ruleSet.tileImprovements.values) {
|
for (improvement in tileInfo.tileMap.gameInfo.ruleSet.tileImprovements.values) {
|
||||||
if (improvement.hasUnique("Unbuildable")) continue
|
if (improvement.turnsToBuild == 0) continue
|
||||||
if (!tileInfo.canBuildImprovement(improvement, currentPlayerCiv)) continue
|
|
||||||
if (improvement.name == tileInfo.improvement) continue
|
if (improvement.name == tileInfo.improvement) continue
|
||||||
|
if (!tileInfo.canBuildImprovement(improvement, currentPlayerCiv)) continue
|
||||||
|
|
||||||
val improvementButtonTable = Table()
|
val improvementButtonTable = Table()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user