From ee2ab74715eccea354e38a5c6cb5afe78f735f9f Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 21 Nov 2022 22:46:32 +0200 Subject: [PATCH] Converted all era uniques to conditional uniques for city-states --- .../Civ V - Gods & Kings/CityStateTypes.json | 43 ++++-- .../jsons/Civ V - Gods & Kings/Eras.json | 128 ------------------ .../unciv/models/translations/Translations.kt | 4 +- .../src/com/unciv/ui/trade/DiplomacyScreen.kt | 8 +- 4 files changed, 39 insertions(+), 144 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/CityStateTypes.json b/android/assets/jsons/Civ V - Gods & Kings/CityStateTypes.json index 2a4acd4c81..7872557e7e 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/CityStateTypes.json +++ b/android/assets/jsons/Civ V - Gods & Kings/CityStateTypes.json @@ -1,32 +1,55 @@ [ { - "name":"Cultured", - "friendBonusUniques": ["[+3 Culture]"], - "allyBonusUniques": ["[+6 Culture]"], + "name": "Cultured", + "friendBonusUniques": [ + "[+3 Culture] ", + "[+6 Culture] ", + "[+13 Culture] " + ], + "allyBonusUniques": [ + "[+6 Culture] ", + "[+12 Culture] ", + "[+26 Culture] " + ], "color": [139, 96, 255] }, { - "name":"Maritime", + "name": "Maritime", "friendBonusUniques": ["[+2 Food] [in capital]"], "allyBonusUniques": ["[+2 Food] [in capital]", "[+1 Food] [in all cities]"], "color": [56, 255, 112] }, { - "name":"Mercantile", - "friendBonusUniques": ["[+2 Happiness]"], - "allyBonusUniques": ["[+2 Happiness]", "Provides a unique luxury"], + "name": "Mercantile", + "friendBonusUniques": [ + "[+2 Happiness] ", + "[+3 Happiness] " + ], + "allyBonusUniques": [ + "[+2 Happiness] ", + "[+3 Happiness] ", + "Provides a unique luxury" + ], "color": [255, 216, 0] }, { - "name":"Militaristic", + "name": "Militaristic", "friendBonusUniques": ["Provides military units every ≈[20] turns"], "allyBonusUniques": ["Provides military units every ≈[17] turns"], "color": [255, 0, 0] }, { "name":"Religious", - "friendBonusUniques": ["[+3 Faith]"], - "allyBonusUniques": ["[+6 Faith]"], + "friendBonusUniques": [ + "[+3 Faith] ", + "[+6 Faith] ", + "[+13 Faith] " + ], + "allyBonusUniques": [ + "[+6 Faith] ", + "[+12 Faith] ", + "[+26 Faith] " + ], "color": [255, 255, 255] } ] diff --git a/android/assets/jsons/Civ V - Gods & Kings/Eras.json b/android/assets/jsons/Civ V - Gods & Kings/Eras.json index 35b65a2ce6..20870b85f4 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Eras.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Eras.json @@ -14,20 +14,6 @@ "embarkDefense": 3, "startPercent": 0, "citySound": "cityAncient", - "friendBonus": { - "Cultured": ["Provides [+3 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+2] Happiness"], - "Religious": ["Provides [+3 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+6 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+2] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+6 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [255, 87, 35] }, { @@ -44,20 +30,6 @@ "embarkDefense": 4, "startPercent": 10, "citySound": "cityClassical", - "friendBonus": { - "Cultured": ["Provides [+3 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+2] Happiness"], - "Religious": ["Provides [+3 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+6 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+2] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+6 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [233, 31, 99] }, { @@ -79,20 +51,6 @@ "embarkDefense": 6, "startPercent": 25, "citySound": "cityMedieval", - "friendBonus": { - "Cultured": ["Provides [+6 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+6 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+12 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+12 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [157, 39, 176] }, { @@ -112,20 +70,6 @@ "embarkDefense": 8, "startPercent": 37, "citySound": "cityRenaissance", - "friendBonus": { - "Cultured": ["Provides [+6 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+6 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+12 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+12 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "uniques": ["Every major Civilization gains a spy once a civilization enters this era"], "iconRGB": [104, 58, 183] }, @@ -147,20 +91,6 @@ "embarkDefense": 10, "startPercent": 50, "citySound": "cityIndustrial", - "friendBonus": { - "Cultured": ["Provides [+13 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+13 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+26 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+26 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [63, 81, 182], "uniques": ["May not generate great prophet equivalents naturally", "May buy [Great Prophet] units for [200] [Faith] [in all cities in which the majority religion is a major religion] at an increasing price ([100])", @@ -187,20 +117,6 @@ "embarkDefense": 13, "startPercent": 65, "citySound": "cityModern", - "friendBonus": { - "Cultured": ["Provides [+13 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+13 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+26 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+26 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [33, 150, 243], "uniques": ["May not generate great prophet equivalents naturally", "May buy [Great Prophet] units for [200] [Faith] [in all cities in which the majority religion is a major religion] at an increasing price ([100])", @@ -228,20 +144,6 @@ "embarkDefense": 16, "startPercent": 65, "citySound": "cityAtomic", - "friendBonus": { - "Cultured": ["Provides [+13 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+13 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+26 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+26 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - }, "iconRGB": [0, 150, 136], "uniques": ["May not generate great prophet equivalents naturally", "May buy [Great Prophet] units for [200] [Faith] [in all cities in which the majority religion is a major religion] at an increasing price ([100])", @@ -271,21 +173,6 @@ "startPercent": 80, "citySound": "cityInformation", - "friendBonus": { - "Cultured": ["Provides [+13 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+13 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+26 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+26 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - - }, "iconRGB": [76, 176, 81], "uniques": ["May not generate great prophet equivalents naturally", "May buy [Great Prophet] units for [200] [Faith] [in all cities in which the majority religion is a major religion] at an increasing price ([100])", @@ -316,21 +203,6 @@ "embarkDefense": 25, "startPercent": 80, "citySound": "cityFuture", - "friendBonus": { - "Cultured": ["Provides [+13 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn"], - "Mercantile": ["Provides [+3] Happiness"], - "Religious": ["Provides [+13 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[20] turns"] - }, - "allyBonus": { - "Cultured": ["Provides [+26 Culture] per turn"], - "Maritime": ["Provides [+2 Food] [in capital] per turn", "Provides [+1 Food] [in all cities] per turn"], - "Mercantile": ["Provides [+3] Happiness", "Provides a unique luxury"], - "Religious": ["Provides [+26 Faith] per turn"], - "Militaristic": ["Provides military units every ≈[17] turns"] - - }, "iconRGB": [76, 176, 81], "uniques": ["May not generate great prophet equivalents naturally", "May buy [Great Prophet] units for [200] [Faith] [in all cities in which the majority religion is a major religion] at an increasing price ([100])", diff --git a/core/src/com/unciv/models/translations/Translations.kt b/core/src/com/unciv/models/translations/Translations.kt index 96ace833b6..212eb36f5a 100644 --- a/core/src/com/unciv/models/translations/Translations.kt +++ b/core/src/com/unciv/models/translations/Translations.kt @@ -211,7 +211,7 @@ class Translations : LinkedHashMap(){ // Whenever this string is changed, it should also be changed in the translation files! // It is mostly used as the template for translating the order of conditionals const val englishConditionalOrderingString = - " " + " " const val conditionalUniqueOrderString = "ConditionalsPlacement" const val shouldCapitalizeString = "StartWithCapitalLetter" } @@ -305,7 +305,7 @@ fun String.tr(): String { var translatedBaseUnique = this.removeConditionals().tr() val conditionals = this.getConditionals().map { it.placeholderText } - val conditionsWithTranslation: HashMap = hashMapOf() + val conditionsWithTranslation: LinkedHashMap = linkedMapOf() for (conditional in this.getConditionals()) conditionsWithTranslation[conditional.placeholderText] = conditional.text.tr() diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index a7b397e491..391637e4e4 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -248,15 +248,15 @@ class DiplomacyScreen( val eraInfo = viewingCiv.getEra() - var friendBonusText = "{When Friends:} ".tr() + var friendBonusText = "{When Friends:}\n".tr() val friendBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Friend) val friendBonusStrings = getAdjustedBonuses(friendBonusObjects) - friendBonusText += friendBonusStrings.joinToString(separator = ", ") { it.tr() } + friendBonusText += friendBonusStrings.joinToString(separator = "\n") { it.tr() } - var allyBonusText = "{When Allies:} ".tr() + var allyBonusText = "{When Allies:}\n".tr() val allyBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Ally) val allyBonusStrings = getAdjustedBonuses(allyBonusObjects) - allyBonusText += allyBonusStrings.joinToString(separator = ", ") { it.tr() } + allyBonusText += allyBonusStrings.joinToString(separator = "\n") { it.tr() } val relationLevel = otherCivDiplomacyManager.relationshipLevel() if (relationLevel >= RelationshipLevel.Friend) {