From aaf4167ad72c629c2a8aee3e32b3355e7ca54057 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 17 Jun 2025 18:51:15 +0300 Subject: [PATCH] Allow autoupdates for uniques with the same parameter appearing twice - e.g. 'from [amount] to [amount]' --- .../jsons/Civ V - Gods & Kings/GlobalUniques.json | 12 ++++++------ .../assets/jsons/Civ V - Vanilla/GlobalUniques.json | 12 ++++++------ .../com/unciv/models/ruleset/unique/UniqueType.kt | 8 ++++++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/GlobalUniques.json b/android/assets/jsons/Civ V - Gods & Kings/GlobalUniques.json index 153249b871..5a7310bba6 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/GlobalUniques.json +++ b/android/assets/jsons/Civ V - Gods & Kings/GlobalUniques.json @@ -1,12 +1,12 @@ { "name": "Global uniques", "uniques": [ - "[-75]% growth [in all cities] ", - "Nullifies Growth [in all cities] ", - "[-50]% [Production] [in all cities] ", - "[-33]% Strength ", - "Cannot build [Settler] units ", - "Rebel units may spawn ", + "[-75]% growth [in all cities] ", + "Nullifies Growth [in all cities] ", + "[-50]% [Production] [in all cities] ", + "[-33]% Strength ", + "Cannot build [Settler] units ", + "Rebel units may spawn ", "[-1] Sight ", // TODO: Implement the uniques below diff --git a/android/assets/jsons/Civ V - Vanilla/GlobalUniques.json b/android/assets/jsons/Civ V - Vanilla/GlobalUniques.json index 153249b871..5a7310bba6 100644 --- a/android/assets/jsons/Civ V - Vanilla/GlobalUniques.json +++ b/android/assets/jsons/Civ V - Vanilla/GlobalUniques.json @@ -1,12 +1,12 @@ { "name": "Global uniques", "uniques": [ - "[-75]% growth [in all cities] ", - "Nullifies Growth [in all cities] ", - "[-50]% [Production] [in all cities] ", - "[-33]% Strength ", - "Cannot build [Settler] units ", - "Rebel units may spawn ", + "[-75]% growth [in all cities] ", + "Nullifies Growth [in all cities] ", + "[-50]% [Production] [in all cities] ", + "[-33]% Strength ", + "Cannot build [Settler] units ", + "Rebel units may spawn ", "[-1] Sight ", // TODO: Implement the uniques below diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index d3638ddf41..e5860d2cfd 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -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