From e1884768fde72022ed1eed36cd5dea8a71c38e1b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 12 Jun 2019 22:34:39 +0300 Subject: [PATCH] Added priority to wonders by type --- core/src/com/unciv/logic/automation/Automation.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 93cc93f850..36283ef560 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -156,9 +156,18 @@ class Automation { //Wonders if (buildableWonders.isNotEmpty()) { + val wondersByPriority = buildableWonders.sortedByDescending { + if(it.isStatRelated(Stat.Science)){ + if(preferredVictoryType==VictoryType.Scientific) return@sortedByDescending 1.5f + else return@sortedByDescending 1.3f + } + if(it.isStatRelated(Stat.Happiness)) return@sortedByDescending 1.2f + if(it.isStatRelated(Stat.Production)) return@sortedByDescending 1.1f + 1f + } + val wonder = wondersByPriority.first() val citiesBuildingWonders = cityInfo.civInfo.cities .count { it.cityConstructions.isBuildingWonder() } - val wonder = buildableWonders.random() relativeCostEffectiveness.add(ConstructionChoice(wonder.name,3.5f / (citiesBuildingWonders + 1))) }