Add two population-related conditional uniques (#12258)

* Added the Conditional Below Population

* Added the Conditional Between Population
This commit is contained in:
PLynx 2024-10-06 15:46:34 +02:00 committed by GitHub
parent 7fbd8a194b
commit 5d1c05d8e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View File

@ -195,6 +195,10 @@ object Conditionals {
checkOnCity { population.getPopulationFilterAmount(conditional.params[1]) >= conditional.params[0].toInt() }
UniqueType.ConditionalExactPopulationFilter ->
checkOnCity { population.getPopulationFilterAmount(conditional.params[1]) == conditional.params[0].toInt() }
UniqueType.ConditionalBetweenPopulationFilter ->
checkOnCity {population.getPopulationFilterAmount(conditional.params[2]) in conditional.params[0].toInt()..conditional.params[1].toInt() }
UniqueType.ConditionalBelowPopulationFilter ->
checkOnCity { population.getPopulationFilterAmount(conditional.params[1]) < conditional.params[0].toInt() }
UniqueType.ConditionalWhenGarrisoned ->
checkOnCity { getCenterTile().militaryUnit?.canGarrison() == true }

View File

@ -729,6 +729,8 @@ enum class UniqueType(
ConditionalCityWithoutBuilding("in cities without a [buildingFilter]", UniqueTarget.Conditional),
ConditionalPopulationFilter("in cities with at least [amount] [populationFilter]", UniqueTarget.Conditional),
ConditionalExactPopulationFilter("in cities with [amount] [populationFilter]", UniqueTarget.Conditional),
ConditionalBetweenPopulationFilter("in cities with between [amount] and [amount] [populationFilter]", UniqueTarget.Conditional),
ConditionalBelowPopulationFilter("in cities with less than [amount] [populationFilter]", UniqueTarget.Conditional),
ConditionalWhenGarrisoned("with a garrison", UniqueTarget.Conditional),
/////// unit conditionals

View File

@ -3005,6 +3005,16 @@ If your mod renames Coast or Lakes, do not use this with one of these as paramet
Applicable to: Conditional
??? example "&lt;in cities with between [amount] and [amount] [populationFilter]&gt;"
Example: "&lt;in cities with between [3] and [3] [Followers of this Religion]&gt;"
Applicable to: Conditional
??? example "&lt;in cities with less than [amount] [populationFilter]&gt;"
Example: "&lt;in cities with less than [3] [Followers of this Religion]&gt;"
Applicable to: Conditional
??? example "&lt;with a garrison&gt;"
Applicable to: Conditional