From 3d18a2aa0ae9e899817ef9b2bb33e73dcf0668b9 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 6 Feb 2020 22:21:58 +0200 Subject: [PATCH] Automated workers now build unique improvements --- .../com/unciv/logic/automation/WorkerAutomation.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/automation/WorkerAutomation.kt b/core/src/com/unciv/logic/automation/WorkerAutomation.kt index 897359fe86..ddc77d2422 100644 --- a/core/src/com/unciv/logic/automation/WorkerAutomation.kt +++ b/core/src/com/unciv/logic/automation/WorkerAutomation.kt @@ -182,14 +182,21 @@ class WorkerAutomation(val unit: MapUnit) { else -> tile.getTileResource().improvement } + val uniqueImprovement = civInfo.gameInfo.ruleSet.tileImprovements.values + .firstOrNull { it.uniqueTo==civInfo.civName} + val improvementString = when { tile.improvementInProgress != null -> tile.improvementInProgress improvementStringForResource != null -> improvementStringForResource tile.containsGreatImprovement() -> null tile.containsUnfinishedGreatImprovement() -> null - tile.terrainFeature == Constants.jungle -> "Trading post" - tile.terrainFeature == "Marsh" -> "Remove Marsh" + + // I think we can assume that the unique improvement is better + uniqueImprovement!=null && tile.canBuildImprovement(uniqueImprovement,civInfo) -> uniqueImprovement.name + tile.terrainFeature == "Fallout" -> "Remove Fallout" + tile.terrainFeature == "Marsh" -> "Remove Marsh" + tile.terrainFeature == Constants.jungle -> "Trading post" tile.terrainFeature == "Oasis" -> null tile.terrainFeature == Constants.forest -> "Lumber mill" tile.baseTerrain == Constants.hill -> "Mine"