From 8461032a52ee82db358c4cdf2c302bb1b40019c9 Mon Sep 17 00:00:00 2001 From: will-ca Date: Sun, 23 Jan 2022 09:08:59 -0800 Subject: [PATCH] Try to fix a potentially miscapitalized/broken policy cost unique. (#6016) * Try to fix a potentially miscapitalized/broken policy cost unique. * Deprecate old capitalization. --- android/assets/jsons/Civ V - Gods & Kings/Policies.json | 2 +- core/src/com/unciv/logic/civilization/PolicyManager.kt | 2 +- core/src/com/unciv/models/ruleset/unique/UniqueType.kt | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Policies.json b/android/assets/jsons/Civ V - Gods & Kings/Policies.json index 5fccb2813f..9f1ded2dfd 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Policies.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Policies.json @@ -166,7 +166,7 @@ }, { "name": "Free Religion", - "uniques": ["[-10]% Culture cost of adopting new policies"], + "uniques": ["[-10]% Culture cost of adopting new Policies"], "requires": ["Mandate Of Heaven", "Reformation"], "row": 3, "column": 4 diff --git a/core/src/com/unciv/logic/civilization/PolicyManager.kt b/core/src/com/unciv/logic/civilization/PolicyManager.kt index fa74f6e4de..c245201a21 100644 --- a/core/src/com/unciv/logic/civilization/PolicyManager.kt +++ b/core/src/com/unciv/logic/civilization/PolicyManager.kt @@ -91,7 +91,7 @@ class PolicyManager { for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCostDeprecated)) policyCultureCost *= 1 - unique.params[0].toFloat() / 100 // - for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCost)) + for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCost) + civInfo.getMatchingUniques(UniqueType.LessPolicyCostDeprecated2)) policyCultureCost *= unique.params[0].toPercent() if (civInfo.isPlayerCivilization()) policyCultureCost *= civInfo.getDifficulty().policyCostModifier diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index c3bf431aea..80772363c7 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -205,9 +205,11 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: @Deprecated("As of 3.18.17", ReplaceWith("[+amount] Happiness from each type of luxury resource")) BonusHappinessFromLuxuryDeprecated("+[amount] happiness from each type of luxury resource", UniqueTarget.Global), LessPolicyCostFromCities("Each city founded increases culture cost of policies [amount]% less than normal", UniqueTarget.Global), - LessPolicyCost("[amount]% Culture cost of adopting new policies", UniqueTarget.Global), - @Deprecated("As of 3.18.17", ReplaceWith("[amount]% Culture cost of adopting new policies")) + LessPolicyCost("[amount]% Culture cost of adopting new Policies", UniqueTarget.Global), + @Deprecated("As of 3.18.17", ReplaceWith("[amount]% Culture cost of adopting new Policies")) LessPolicyCostDeprecated("Culture cost of adopting new Policies reduced by [amount]%", UniqueTarget.Global), + @Deprecated("As of 3.19.1", ReplaceWith("[amount]% Culture cost of adopting new Policies")) + LessPolicyCostDeprecated2("[amount]% Culture cost of adopting new policies", UniqueTarget.Global), EnablesOpenBorders("Enables Open Borders agreements", UniqueTarget.Global), // Should the 'R' in 'Research agreements' be capitalized?