mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-15 04:14:44 +07:00
Allow city- or tile- related conditionals on PerpetualStatConversion enabling unique (#9183)
This commit is contained in:
parent
26d16fc1cc
commit
3b3db71fd8
@ -231,10 +231,12 @@ open class PerpetualStatConversion(val stat: Stat) :
|
||||
fun getConversionRate(city: City) : Int = (1/city.cityStats.getStatConversionRate(stat)).roundToInt()
|
||||
|
||||
override fun isBuildable(cityConstructions: CityConstructions): Boolean {
|
||||
if (stat == Stat.Faith && !cityConstructions.city.civ.gameInfo.isReligionEnabled())
|
||||
val city = cityConstructions.city
|
||||
if (stat == Stat.Faith && !city.civ.gameInfo.isReligionEnabled())
|
||||
return false
|
||||
|
||||
return cityConstructions.city.civ.getMatchingUniques(UniqueType.EnablesCivWideStatProduction)
|
||||
val stateForConditionals = StateForConditionals(city.civ, city, tile = city.getCenterTile())
|
||||
return city.civ.getMatchingUniques(UniqueType.EnablesCivWideStatProduction, stateForConditionals)
|
||||
.any { it.params[0] == stat.name }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user