Clearer free promotions, nicer Maori Warrior, missing new UnitType translations (#2210)

This commit is contained in:
rh-github-2015 2020-03-21 19:19:50 +01:00 committed by GitHub
parent 8767342810
commit 27c0aedbbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 48 additions and 6 deletions

View File

@ -2722,6 +2722,10 @@ Scout =
Armor =
# Requires translation!
City =
# Requires translation!
Missile =
WaterAircraftCarrier = Water Aircraft Carrier
WaterMissileCarrier = Water Missile Carrier
# Units

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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<String>() // The json parser woulddn't agree to deserialize this as a list of UnitTypes. =(
fun getDescription(promotionsForUnitType: Collection<Promotion>, forCivilopedia:Boolean=false):String {
fun getDescription(promotionsForUnitType: Collection<Promotion>, 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()
}

View File

@ -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()