Avoid building many wonders at the same time.

This commit is contained in:
Duan Tao 2019-03-20 22:25:34 +08:00
parent af48f80e1a
commit 90f8421777
2 changed files with 11 additions and 1 deletions

View File

@ -135,8 +135,10 @@ class Automation {
//Wonders
if (buildableWonders.isNotEmpty()) {
val citiesBuildingWonders = cityInfo.civInfo.cities
.filter { it.cityConstructions.isBuildingWonder() }.size
val wonder = buildableWonders.getRandom()
buildingValues[wonder.name] = wonder.cost / cityProduction / 5.0f
buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f
}
//other buildings

View File

@ -72,6 +72,14 @@ class CityConstructions {
fun isBeingConstructed(constructionName: String): Boolean = currentConstruction == constructionName
fun isBuildingWonder(): Boolean {
val currentConstruction = getCurrentConstruction()
if (currentConstruction is Building) {
return currentConstruction.isWonder
}
return false
}
internal fun getConstruction(constructionName: String): IConstruction {
if (GameBasics.Buildings.containsKey(constructionName))
return GameBasics.Buildings[constructionName]!!