Allow autoupdates for uniques with the same parameter appearing twice - e.g. 'from [amount] to [amount]'

This commit is contained in:
yairm210 2025-06-17 18:51:15 +03:00
parent 6952ce04ac
commit aaf4167ad7
3 changed files with 18 additions and 14 deletions

View File

@ -1,12 +1,12 @@
{
"name": "Global uniques",
"uniques": [
"[-75]% growth [in all cities] <when between [-10] and [-1] Happiness>",
"Nullifies Growth [in all cities] <when below [-10] Happiness>",
"[-50]% [Production] [in all cities] <when below [-10] Happiness>",
"[-33]% Strength <for [All] units> <when below [-10] Happiness>",
"Cannot build [Settler] units <when below [-10] Happiness>",
"Rebel units may spawn <when below [-20] Happiness>",
"[-75]% growth [in all cities] <when between [-10] and [-1] [Happiness]>",
"Nullifies Growth [in all cities] <when below [-10] [Happiness]>",
"[-50]% [Production] [in all cities] <when below [-10] [Happiness]>",
"[-33]% Strength <for [All] units> <when below [-10] [Happiness]>",
"Cannot build [Settler] units <when below [-10] [Happiness]>",
"Rebel units may spawn <when below [-20] [Happiness]>",
"[-1] Sight <for [Embarked] units>",
// TODO: Implement the uniques below

View File

@ -1,12 +1,12 @@
{
"name": "Global uniques",
"uniques": [
"[-75]% growth [in all cities] <when between [-10] and [-1] Happiness>",
"Nullifies Growth [in all cities] <when below [-10] Happiness>",
"[-50]% [Production] [in all cities] <when below [-10] Happiness>",
"[-33]% Strength <for [All] units> <when below [-10] Happiness>",
"Cannot build [Settler] units <when below [-10] Happiness>",
"Rebel units may spawn <when below [-20] Happiness>",
"[-75]% growth [in all cities] <when between [-10] and [-1] [Happiness]>",
"Nullifies Growth [in all cities] <when below [-10] [Happiness]>",
"[-50]% [Production] [in all cities] <when below [-10] [Happiness]>",
"[-33]% Strength <for [All] units> <when below [-10] [Happiness]>",
"Cannot build [Settler] units <when below [-10] [Happiness]>",
"Rebel units may spawn <when below [-20] [Happiness]>",
"[-1] Sight <for [Embarked] units>",
// TODO: Implement the uniques below

View File

@ -706,9 +706,12 @@ enum class UniqueType(
ConditionalWLTKD("during We Love The King Day", UniqueTarget.Conditional),
ConditionalHappy("while the empire is happy", UniqueTarget.Conditional),
@Deprecated("As of 4.16.18", ReplaceWith("when between [amount] and [amount] [Happiness]"), DeprecationLevel.WARNING)
ConditionalBetweenHappiness("when between [amount] and [amount] Happiness", UniqueTarget.Conditional,
docDescription = " 'Between' is inclusive - so 'between 1 and 5' includes 1 and 5."),
@Deprecated("As of 4.16.18", ReplaceWith("when above [amount] [Happiness]"), DeprecationLevel.WARNING)
ConditionalAboveHappiness("when above [amount] Happiness", UniqueTarget.Conditional),
@Deprecated("As of 4.16.18", ReplaceWith("when below [amount] [Happiness]"), DeprecationLevel.WARNING)
ConditionalBelowHappiness("when below [amount] Happiness", UniqueTarget.Conditional),
ConditionalDuringEra("during the [era]", UniqueTarget.Conditional),
@ -746,11 +749,12 @@ enum class UniqueType(
// Supports also stockpileable resources (Gold, Faith, Culture, Science)
ConditionalWhenAboveAmountStatResource("when above [amount] [stat/resource]", UniqueTarget.Conditional, flags = setOf(UniqueFlag.AcceptsSpeedModifier),
docDescription = "Stats refers to the accumulated stat, not stat-per-turn"),
docDescription = "Stats refers to the accumulated stat, not stat-per-turn. Therefore, does not support Happiness - for that use 'when above [amount] Happiness'"),
ConditionalWhenBelowAmountStatResource("when below [amount] [stat/resource]", UniqueTarget.Conditional, flags = setOf(UniqueFlag.AcceptsSpeedModifier),
docDescription = "Stats refers to the accumulated stat, not stat-per-turn"),
docDescription = "Stats refers to the accumulated stat, not stat-per-turn. Therefore, does not support Happiness - for that use 'when below [amount] Happiness'"),
ConditionalWhenBetweenStatResource("when between [amount] and [amount] [stat/resource]", UniqueTarget.Conditional, flags = setOf(UniqueFlag.AcceptsSpeedModifier),
docDescription = "Stats refers to the accumulated stat, not stat-per-turn." +
" Therefore, does not support Happiness." +
" 'Between' is inclusive - so 'between 1 and 5' includes 1 and 5."),
/////// city conditionals