Add <every [positiveAmount] turns> Conditional unique (not TriggerCondition) (#10871)

* Added a ConditionalEveryTurns unique

* Auto-generated the docs entry
This commit is contained in:
PLynx 2024-01-07 15:06:55 +01:00 committed by GitHub
parent aa18e826df
commit 1b6d75c4db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,7 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
UniqueType.ModifierHiddenFromUsers -> true // allowed to be attached to any Unique to hide it, no-op otherwise
UniqueType.ConditionalChance -> stateBasedRandom.nextFloat() < condition.params[0].toFloat() / 100f
UniqueType.ConditionalEveryTurns -> checkOnCiv { gameInfo.turns % condition.params[0].toInt() == 0}
UniqueType.ConditionalBeforeTurns -> checkOnCiv { gameInfo.turns < condition.params[0].toInt() }
UniqueType.ConditionalAfterTurns -> checkOnCiv { gameInfo.turns >= condition.params[0].toInt() }

View File

@ -601,6 +601,7 @@ enum class UniqueType(
/////// general conditionals
ConditionalTimedUnique("for [amount] turns", UniqueTarget.Conditional),
ConditionalChance("with [amount]% chance", UniqueTarget.Conditional),
ConditionalEveryTurns("every [positiveAmount] turns", UniqueTarget.Conditional),
ConditionalBeforeTurns("before [amount] turns", UniqueTarget.Conditional),
ConditionalAfterTurns("after [amount] turns", UniqueTarget.Conditional),

View File

@ -1820,6 +1820,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Conditional
??? example "&lt;every [positiveAmount] turns&gt;"
Example: "&lt;every [3] turns&gt;"
Applicable to: Conditional
??? example "&lt;before [amount] turns&gt;"
Example: "&lt;before [3] turns&gt;"