diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 764294885a..d208644776 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -256,9 +256,8 @@ object Automation { city: City, construction: INonPerpetualConstruction ): Boolean { - return !(construction is Building && construction.isWonder && city.isPuppet) - && allowCreateImprovementBuildings(civInfo, city, construction) - && allowSpendingResource(civInfo, construction, city) + return allowCreateImprovementBuildings(civInfo, city, construction) + && allowSpendingResource(civInfo, construction, city) } @Suppress("MemberVisibilityCanBePrivate") diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index b4495804f0..a9b111ecdf 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -388,32 +388,32 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { if (!civ.tech.isResearched(requiredTech)) yield(RejectionReasonType.RequiresTech.toInstance("$requiredTech not researched!")) - // Regular wonders - if (isWonder) { - if (civ.gameInfo.getCities().any { it.cityConstructions.isBuilt(name) }) - yield(RejectionReasonType.WonderAlreadyBuilt.toInstance()) - + // All Wonders + if(isAnyWonder()) { if (civ.cities.any { it != cityConstructions.city && it.cityConstructions.isBeingConstructedOrEnqueued(name) }) yield(RejectionReasonType.WonderBeingBuiltElsewhere.toInstance()) if (civ.isCityState()) yield(RejectionReasonType.CityStateWonder.toInstance()) + if (cityConstructions.city.isPuppet) + yield(RejectionReasonType.PuppetWonder.toInstance()) + } + + // World Wonders + if (isWonder) { + if (civ.gameInfo.getCities().any { it.cityConstructions.isBuilt(name) }) + yield(RejectionReasonType.WonderAlreadyBuilt.toInstance()) + val startingEra = civ.gameInfo.gameParameters.startingEra if (name in ruleSet.eras[startingEra]!!.startingObsoleteWonders) yield(RejectionReasonType.WonderDisabledEra.toInstance()) } - // National wonders + // National Wonders if (isNationalWonder) { if (civ.cities.any { it.cityConstructions.isBuilt(name) }) yield(RejectionReasonType.NationalWonderAlreadyBuilt.toInstance()) - - if (civ.cities.any { it != cityConstructions.city && it.cityConstructions.isBeingConstructedOrEnqueued(name) }) - yield(RejectionReasonType.NationalWonderBeingBuiltElsewhere.toInstance()) - - if (civ.isCityState()) - yield(RejectionReasonType.CityStateNationalWonder.toInstance()) } if (requiredBuilding != null && !cityConstructions.containsBuildingOrEquivalent(requiredBuilding!!)) { diff --git a/core/src/com/unciv/models/ruleset/IConstruction.kt b/core/src/com/unciv/models/ruleset/IConstruction.kt index 656d755a90..c963c41c53 100644 --- a/core/src/com/unciv/models/ruleset/IConstruction.kt +++ b/core/src/com/unciv/models/ruleset/IConstruction.kt @@ -143,7 +143,6 @@ class RejectionReason(val type: RejectionReasonType, private val orderedImportantRejectionTypes = listOf( RejectionReasonType.ShouldNotBeDisplayed, RejectionReasonType.WonderBeingBuiltElsewhere, - RejectionReasonType.NationalWonderBeingBuiltElsewhere, RejectionReasonType.RequiresBuildingInAllCities, RejectionReasonType.RequiresBuildingInThisCity, RejectionReasonType.RequiresBuildingInSomeCity, @@ -206,9 +205,8 @@ enum class RejectionReasonType(val shouldShow: Boolean, val errorMessage: String WonderAlreadyBuilt(false, "Wonder already built"), NationalWonderAlreadyBuilt(false, "National Wonder already built"), WonderBeingBuiltElsewhere(true, "Wonder is being built elsewhere"), - NationalWonderBeingBuiltElsewhere(true, "National Wonder is being built elsewhere"), CityStateWonder(false, "No Wonders for city-states"), - CityStateNationalWonder(false, "No National Wonders for city-states"), + PuppetWonder(false, "No Wonders for Puppets"), WonderDisabledEra(false, "This Wonder is disabled when starting in this era"), ConsumesResources(true, "Consumes resources which you are lacking"),