mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Avoid building many wonders at the same time.
This commit is contained in:
parent
af48f80e1a
commit
90f8421777
@ -135,8 +135,10 @@ class Automation {
|
|||||||
|
|
||||||
//Wonders
|
//Wonders
|
||||||
if (buildableWonders.isNotEmpty()) {
|
if (buildableWonders.isNotEmpty()) {
|
||||||
|
val citiesBuildingWonders = cityInfo.civInfo.cities
|
||||||
|
.filter { it.cityConstructions.isBuildingWonder() }.size
|
||||||
val wonder = buildableWonders.getRandom()
|
val wonder = buildableWonders.getRandom()
|
||||||
buildingValues[wonder.name] = wonder.cost / cityProduction / 5.0f
|
buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f
|
||||||
}
|
}
|
||||||
|
|
||||||
//other buildings
|
//other buildings
|
||||||
|
@ -72,6 +72,14 @@ class CityConstructions {
|
|||||||
|
|
||||||
fun isBeingConstructed(constructionName: String): Boolean = currentConstruction == constructionName
|
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 {
|
internal fun getConstruction(constructionName: String): IConstruction {
|
||||||
if (GameBasics.Buildings.containsKey(constructionName))
|
if (GameBasics.Buildings.containsKey(constructionName))
|
||||||
return GameBasics.Buildings[constructionName]!!
|
return GameBasics.Buildings[constructionName]!!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user