From 3bbac04303969a84de1dfce412860a6e6c32862f Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 15 Mar 2021 22:37:07 +0200 Subject: [PATCH] Deprecated uniques replaced in 3.12.10 --- .../jsons/Civ V - Vanilla/Buildings.json | 2 +- core/src/com/unciv/logic/battle/Battle.kt | 2 -- .../unciv/logic/city/CityExpansionManager.kt | 13 +---------- core/src/com/unciv/logic/city/CityStats.kt | 22 ------------------- 4 files changed, 2 insertions(+), 37 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/Buildings.json b/android/assets/jsons/Civ V - Vanilla/Buildings.json index 03e2dd238a..98d08768db 100644 --- a/android/assets/jsons/Civ V - Vanilla/Buildings.json +++ b/android/assets/jsons/Civ V - Vanilla/Buildings.json @@ -110,7 +110,7 @@ "isWonder": true, "cost": 185, "greatPersonPoints": {"production": 1}, - "uniques": ["+[10]% growth in all cities", "+[15]% Production when constructing [Ranged] units"], + "uniques": ["+[10]% growth in all cities", "+[15]% Production when constructing [Ranged] units [in all cities]"], "requiredTech": "Archery", "quote": "'It is not so much for its beauty that the forest makes a claim upon men's hearts, as for that subtle something, that quality of air, that emanation from old trees, that so wonderfully changes and renews a weary spirit.' - Robert Louis Stevenson" }, diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 5384788f4a..1939d33229 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -258,8 +258,6 @@ object Battle { return var XPModifier = 1f - // deprecated as of 3.12.10, keeping this for now in to avoid breaking mods - if (thisCombatant.getCivInfo().hasUnique("Military units gain 50% more Experience from combat")) XPModifier += 0.5f for (unique in thisCombatant.getCivInfo().getMatchingUniques("[] units gain []% more Experience from combat")) { if (thisCombatant.unit.matchesFilter(unique.params[0])) XPModifier += unique.params[1].toFloat() / 100 diff --git a/core/src/com/unciv/logic/city/CityExpansionManager.kt b/core/src/com/unciv/logic/city/CityExpansionManager.kt index 52d3f9750b..f2e13b8383 100644 --- a/core/src/com/unciv/logic/city/CityExpansionManager.kt +++ b/core/src/com/unciv/logic/city/CityExpansionManager.kt @@ -37,11 +37,7 @@ class CityExpansionManager { if (cityInfo.matchesFilter(unique.params[1])) cultureToNextTile *= (100 - unique.params[0].toFloat()) / 100 } - // Deprecated as of 3.12.10 - replaced with "-[]% Culture cost of acquiring tiles []", either [in capital] or [in this city] or [in all cities] - if (cityInfo.civInfo.hasUnique("Cost of acquiring new tiles reduced by 25%")) - cultureToNextTile *= 0.75 //Speciality of Angkor Wat - if (cityInfo.containsBuildingUnique("Culture and Gold costs of acquiring new tiles reduced by 25% in this city")) - cultureToNextTile *= 0.75 // Specialty of Krepost + if (cityInfo.civInfo.hasUnique("Increased rate of border expansion")) cultureToNextTile *= 0.75 return cultureToNextTile.roundToInt() @@ -66,13 +62,6 @@ class CityExpansionManager { if (cityInfo.matchesFilter(unique.params[1])) cost *= (100 - unique.params[0].toFloat()) / 100 } - // Deprecated as of 3.12.10 - replaced with "-[]% Gold cost of acquiring tiles []", either [in capital] or [in this city] or [in all cities] - if (cityInfo.civInfo.hasUnique("Cost of acquiring new tiles reduced by 25%")) - cost *= 0.75 //Speciality of Angkor Wat - if (cityInfo.containsBuildingUnique("Culture and Gold costs of acquiring new tiles reduced by 25% in this city")) - cost *= 0.75 // Specialty of Krepost - if (cityInfo.civInfo.hasUnique("-50% cost when purchasing tiles")) - cost /= 2 return cost.roundToInt() } diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 275237d554..574a5bdcb8 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -305,11 +305,6 @@ class CityStats { // Since this is sometimes run from a different thread (getConstructionButtonDTOs), // this helps mitigate concurrency problems. - // Deprecated as of 3.12.10 - changed to "+[50]% Production when constructing [Settler] units [in capital]" - if (currentConstruction.name == Constants.settler && cityInfo.isCapital() - && uniques.any { it.text == "Training of settlers increased +50% in capital" }) - stats.production += 50f - if (currentConstruction is Building && !currentConstruction.isWonder && !currentConstruction.isNationalWonder) for (unique in uniques.filter { it.placeholderText == "+[]% Production when constructing [] buildings" }) { val stat = Stat.valueOf(unique.params[1]) @@ -340,12 +335,6 @@ class CityStats { stats.production += unique.params[0].toInt() } - // Deprecated as of 3.12.10 - changed to "+[amount]% Production when constructing [unitFilter] units [in all cities]" - for (unique in uniques.filter { it.placeholderText == "+[]% Production when constructing [] units" }) { - if (currentConstruction is BaseUnit && currentConstruction.matchesFilter(unique.params[1])) - stats.production += unique.params[0].toInt() - } - // "+[amount]% Production when constructing [unitFilter] units [cityFilter]" for (unique in uniques.filter { it.placeholderText == "+[]% Production when constructing [] units []" }) { if (currentConstruction is BaseUnit && currentConstruction.matchesFilter(unique.params[1]) @@ -354,20 +343,9 @@ class CityStats { } - // Deprecated as of 3.12.10 - changed to "+[33]% [Culture] [in all cities with a world wonder]" - if (cityInfo.cityConstructions.getBuiltBuildings().any { it.isWonder } - && uniques.any { it.text == "+33% culture in all cities with a world wonder" }) - stats.culture += 33f - // Deprecated as of 3.12.10 - changed to "+[25]% [Gold] [in capital]" (Commerce policy) - if (uniques.any { it.text == "+25% gold in capital" } && cityInfo.isCapital()) - stats.gold += 25f if (cityInfo.civInfo.getHappiness() >= 0 && uniques.any { it.text == "+15% science while empire is happy" }) stats.science += 15f - // Deprecated as of 3.12.10 - changed to "+[25]% [Culture] [in all cities]" (Sistine Chapel) - if (uniques.any { it.text == "Culture in all cities increased by 25%" }) - stats.culture += 25f - return stats }