mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Resolved #1372 - AI should now build spaceship parts and be able to win a scientific victory =)
This commit is contained in:
parent
8854cafc96
commit
8826c4e84f
@ -58,6 +58,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
|
|||||||
addDefenceBuildingChoice()
|
addDefenceBuildingChoice()
|
||||||
addUnitTrainingBuildingChoice()
|
addUnitTrainingBuildingChoice()
|
||||||
addCultureBuildingChoice()
|
addCultureBuildingChoice()
|
||||||
|
addSpaceshipPartChoice()
|
||||||
|
|
||||||
if(!cityInfo.isPuppet) {
|
if(!cityInfo.isPuppet) {
|
||||||
addWondersChoice()
|
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() {
|
private fun addWondersChoice() {
|
||||||
if (buildableWonders.isNotEmpty()) {
|
if (buildableWonders.isNotEmpty()) {
|
||||||
fun getWonderPriority(wonder: Building): Float {
|
fun getWonderPriority(wonder: Building): Float {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user