diff --git a/android/assets/jsons/translations/English.properties b/android/assets/jsons/translations/English.properties index b66aab2348..f5104a0c5b 100644 --- a/android/assets/jsons/translations/English.properties +++ b/android/assets/jsons/translations/English.properties @@ -2722,6 +2722,10 @@ Scout = Armor = # Requires translation! City = + # Requires translation! +Missile = +WaterAircraftCarrier = Water Aircraft Carrier +WaterMissileCarrier = Water Missile Carrier # Units diff --git a/android/assets/jsons/translations/French.properties b/android/assets/jsons/translations/French.properties index 49798a50ec..e841bde10c 100644 --- a/android/assets/jsons/translations/French.properties +++ b/android/assets/jsons/translations/French.properties @@ -1041,6 +1041,9 @@ Workers = Ouvriers Nations = Nations Promotions = Promotions Available for [unitTypes] = Disponible pour [unitTypes] +Free promotion: = Promotion gratuite: +Free promotions: = Promocions gratuites: +Free for [units] = Libre pour [units] # Policies @@ -1467,6 +1470,9 @@ Mounted = Montée Scout = Éclaireur Armor = Blindé City = Ville +Missile = Missile +WaterAircraftCarrier = Porte-avions +WaterMissileCarrier = Porte-missiles # Units diff --git a/android/assets/jsons/translations/German.properties b/android/assets/jsons/translations/German.properties index e8b11d46f7..af8e5ad9c8 100644 --- a/android/assets/jsons/translations/German.properties +++ b/android/assets/jsons/translations/German.properties @@ -1068,6 +1068,9 @@ Workers = Arbeiter Nations = Nationen Promotions = Beförderungen Available for [unitTypes] = Verfügbar für [unitTypes] +Free promotion: = Freie Beförderung: +Free promotions: = Freie Beförderungen: +Free for [units] = Frei für [units] # Policies @@ -1498,6 +1501,9 @@ Mounted = Beritten Scout = KundschafterIn Armor = Rüstung City = Stadt +Missile = Rakete +WaterAircraftCarrier = Flugzeugträger +WaterMissileCarrier = Raketenträger # Units diff --git a/android/assets/jsons/translations/Spanish.properties b/android/assets/jsons/translations/Spanish.properties index f1af582531..3e90131051 100644 --- a/android/assets/jsons/translations/Spanish.properties +++ b/android/assets/jsons/translations/Spanish.properties @@ -1132,6 +1132,9 @@ Workers = Trabajadores Nations = Naciones Promotions = Ascensos Available for [unitTypes] = Disponible para [unitTypes] +Free promotion: = Ascenso libre: +Free promotions: = Ascensos libres: +Free for [units] = Libre para [units] # Policies @@ -1564,6 +1567,9 @@ Mounted = Montado Scout = Explorador Armor = Blindado City = Ciudad +Missile = Misil +WaterAircraftCarrier = Portaaviones +WaterMissileCarrier = Portamisiles # Units diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 01077498a6..e5fcbe3901 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -1041,6 +1041,9 @@ Workers = Nations = Promotions = Available for [unitTypes] = +Free promotion: = +Free promotions: = +Free for [units] = # Policies @@ -1467,6 +1470,9 @@ Mounted = Scout = Armor = City = +Missile = +WaterAircraftCarrier = +WaterMissileCarrier = # Units diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 88c0356a5f..c0a428873a 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -71,8 +71,11 @@ class BaseUnit : INamed, IConstruction { for(unique in uniques) sb.appendln(Translations.translateBonusOrPenalty(unique)) - for(promotion in promotions) - sb.appendln(promotion.tr()) + if (promotions.isNotEmpty()) { + sb.append((if (promotions.size==1) "Free promotion:" else "Free promotions:").tr()) + for (promotion in promotions) + sb.appendln(" " + promotion.tr()) + } sb.appendln("{Movement}: $movement".tr()) return sb.toString() diff --git a/core/src/com/unciv/models/ruleset/unit/Promotion.kt b/core/src/com/unciv/models/ruleset/unit/Promotion.kt index e94bc7c5d1..e5dbcc7316 100644 --- a/core/src/com/unciv/models/ruleset/unit/Promotion.kt +++ b/core/src/com/unciv/models/ruleset/unit/Promotion.kt @@ -1,5 +1,6 @@ package com.unciv.models.ruleset.unit +import com.unciv.models.ruleset.Ruleset import com.unciv.models.stats.INamed import com.unciv.models.translations.Translations import com.unciv.models.translations.tr @@ -10,7 +11,7 @@ class Promotion : INamed{ lateinit var effect:String var unitTypes = listOf() // The json parser woulddn't agree to deserialize this as a list of UnitTypes. =( - fun getDescription(promotionsForUnitType: Collection, forCivilopedia:Boolean=false):String { + fun getDescription(promotionsForUnitType: Collection, forCivilopedia:Boolean=false, ruleSet:Ruleset? = null):String { // we translate it before it goes in to get uniques like "vs units in rough terrain" and after to get "vs city val stringBuilder = StringBuilder() stringBuilder.appendln(Translations.translateBonusOrPenalty(effect.tr())) @@ -23,8 +24,18 @@ class Promotion : INamed{ stringBuilder.appendln("{Requires}: ".tr()+prerequisitesString.joinToString(" OR ".tr())) } if(forCivilopedia){ - val unitTypesString = unitTypes.joinToString(", "){it.tr()} - stringBuilder.appendln("Available for [$unitTypesString]".tr()) + if (unitTypes.isNotEmpty()) { + val unitTypesString = unitTypes.joinToString(", ") { it.tr() } + stringBuilder.appendln("Available for [$unitTypesString]".tr()) + } + + if (ruleSet!=null) { + val freeforUnits = ruleSet.units.filter { it.value.promotions.contains(name) } + if (freeforUnits.isNotEmpty()) { + val freeforString = freeforUnits.map { it.value.name }.joinToString(", ") { it.tr() } + stringBuilder.appendln("Free for [$freeforString]".tr()) + } + } } return stringBuilder.toString() } diff --git a/core/src/com/unciv/ui/CivilopediaScreen.kt b/core/src/com/unciv/ui/CivilopediaScreen.kt index 4edd4d4d88..2657a19d75 100644 --- a/core/src/com/unciv/ui/CivilopediaScreen.kt +++ b/core/src/com/unciv/ui/CivilopediaScreen.kt @@ -80,7 +80,7 @@ class CivilopediaScreen(ruleset: Ruleset) : CameraStageBaseScreen() { .map { CivilopediaEntry(it.name,it.getDescription(ruleset), ImageGetter.getTechIconGroup(it.name,50f)) } categoryToEntries["Promotions"] = ruleset.unitPromotions.values - .map { CivilopediaEntry(it.name,it.getDescription(ruleset.unitPromotions.values, true), + .map { CivilopediaEntry(it.name,it.getDescription(ruleset.unitPromotions.values, true, ruleset), Table().apply { add(ImageGetter.getPromotionIcon(it.name)) }) } categoryToEntries["Tutorials"] = tutorialController.getCivilopediaTutorials()