Genericified 'free [unit] appears]

This commit is contained in:
Yair Morgenstern
2020-07-24 00:34:39 +03:00
parent 548e107504
commit d7bac9ed3e
25 changed files with 46 additions and 52 deletions

View File

@ -366,13 +366,14 @@ class Building : NamedStats(), IConstruction{
}
if ("Empire enters golden age" in uniques) civInfo.goldenAges.enterGoldenAge()
if ("Free Great Artist Appears" in uniques) civInfo.addGreatPerson("Great Artist", cityConstructions.cityInfo)
for(unique in uniques) if(unique.equalsPlaceholderText("Free [] appears")){
val unitName = unique.getPlaceholderParameters()[0]
civInfo.addGreatPerson(unitName, cityConstructions.cityInfo)
}
if ("2 free Great Artists appear" in uniques) {
civInfo.addGreatPerson("Great Artist", cityConstructions.cityInfo)
civInfo.addGreatPerson("Great Artist", cityConstructions.cityInfo)
}
if ("Free Great General appears near the Capital" in uniques) civInfo.addGreatPerson("Great General", civInfo.getCapital())
if ("Free great scientist appears" in uniques) civInfo.addGreatPerson("Great Scientist", cityConstructions.cityInfo)
if ("2 free great scientists appear" in uniques) {
civInfo.addGreatPerson("Great Scientist", cityConstructions.cityInfo)
civInfo.addGreatPerson("Great Scientist", cityConstructions.cityInfo)

View File

@ -201,6 +201,7 @@ object TranslationFileWriter {
val parameterName = when{
parameter.toIntOrNull() != null -> "amount"
RulesetCache.getBaseRuleset().terrains.containsKey(parameter) -> "terrain"
RulesetCache.getBaseRuleset().units.containsKey(parameter) -> "unit"
else -> "param"
}
stringToTranslate = string.replace(parameters[0], parameterName)