Resolved #2787 - AIs MUCH more likely to build the Apollo Program and win a scientific victory

This commit is contained in:
Yair Morgenstern 2020-07-02 19:56:59 +03:00
parent e1aaa88e3d
commit 4357d2513a

View File

@ -162,9 +162,9 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
}
}
private fun addWondersChoice() {
if (buildableWonders.any()) {
fun getWonderPriority(wonder: Building): Float {
private fun getWonderPriority(wonder: Building): Float {
if(wonder.uniques.contains("Enables construction of Spaceship parts"))
return 2f
if (preferredVictoryType == VictoryType.Cultural
&& wonder.name in listOf("Sistine Chapel", "Eiffel Tower", "Cristo Redentor", "Neuschwanstein", "Sydney Opera House"))
return 3f
@ -181,6 +181,9 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
return 1f
}
private fun addWondersChoice() {
if (!buildableWonders.any()) return
val highestPriorityWonder = buildableWonders
.maxBy { getWonderPriority(it) }!!
val citiesBuildingWonders = civInfo.cities
@ -190,7 +193,6 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
if (!cityIsOverAverageProduction) modifier /= 5 // higher production cities will deal with this
addChoice(relativeCostEffectiveness, highestPriorityWonder.name, modifier)
}
}
private fun addUnitTrainingBuildingChoice() {
val unitTrainingBuilding = buildableNotWonders.asSequence()