mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
Allow city- or tile- related conditionals on PerpetualStatConversion enabling unique (#9183)
This commit is contained in:
@ -231,10 +231,12 @@ open class PerpetualStatConversion(val stat: Stat) :
|
|||||||
fun getConversionRate(city: City) : Int = (1/city.cityStats.getStatConversionRate(stat)).roundToInt()
|
fun getConversionRate(city: City) : Int = (1/city.cityStats.getStatConversionRate(stat)).roundToInt()
|
||||||
|
|
||||||
override fun isBuildable(cityConstructions: CityConstructions): Boolean {
|
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 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 }
|
.any { it.params[0] == stat.name }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user