mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-25 23:29:47 +07:00
Resolved #1372 - AI should now build spaceship parts and be able to win a scientific victory =)
This commit is contained in:
@ -58,6 +58,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
|
||||
addDefenceBuildingChoice()
|
||||
addUnitTrainingBuildingChoice()
|
||||
addCultureBuildingChoice()
|
||||
addSpaceshipPartChoice()
|
||||
|
||||
if(!cityInfo.isPuppet) {
|
||||
addWondersChoice()
|
||||
@ -136,6 +137,17 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
|
||||
}
|
||||
}
|
||||
|
||||
private fun addSpaceshipPartChoice() {
|
||||
val spaceshipPart = buildableNotWonders.firstOrNull { it.uniques.contains("Spaceship part") }
|
||||
if (spaceshipPart != null) {
|
||||
var modifier = 1.5f
|
||||
if(cityInfo.cityStats.currentCityStats.culture==0f) // It won't grow if we don't help it
|
||||
modifier=0.8f
|
||||
if (preferredVictoryType == VictoryType.Scientific) modifier = 2f
|
||||
addChoice(relativeCostEffectiveness, spaceshipPart.name, modifier)
|
||||
}
|
||||
}
|
||||
|
||||
private fun addWondersChoice() {
|
||||
if (buildableWonders.isNotEmpty()) {
|
||||
fun getWonderPriority(wonder: Building): Float {
|
||||
|
Reference in New Issue
Block a user