mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Revert "AI can no longer buy wonders" (#11994)
This reverts commit f8c5dc5b145386c21fd2c24963c158b465c35643.
This commit is contained in:
parent
e7132abc01
commit
503b0d8d59
@ -699,15 +699,13 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
|
||||
|
||||
/** This is the *one true test* of "can we butyb this construction"
|
||||
* This tests whether the buy button should be _enabled_ */
|
||||
/** This tests whether the buy button should be _enabled_ */
|
||||
fun isConstructionPurchaseAllowed(construction: INonPerpetualConstruction, stat: Stat, constructionBuyCost: Int): Boolean {
|
||||
return when {
|
||||
city.isPuppet && !city.getMatchingUniques(UniqueType.MayBuyConstructionsInPuppets).any() -> false
|
||||
city.isInResistance() -> false
|
||||
!construction.isPurchasable(city.cityConstructions) -> false // checks via 'rejection reason'
|
||||
construction is BaseUnit && !city.canPlaceNewUnit(construction) -> false
|
||||
!construction.canBePurchasedWithStat(city, Stat.Gold) -> false
|
||||
city.civ.gameInfo.gameParameters.godMode -> true
|
||||
constructionBuyCost == 0 -> true
|
||||
else -> city.getStatReserve(stat) >= constructionBuyCost
|
||||
|
Loading…
x
Reference in New Issue
Block a user