From aa034d73c2eff5368dfbb8b6f555d5a7508305d7 Mon Sep 17 00:00:00 2001 From: r3versi Date: Sat, 28 Dec 2019 22:11:37 +0100 Subject: [PATCH] Fix natural wonders (#1550) * Natural Wonders Uniques * Fix Natural Wonders in Map Editor * Translation files * Terrain uniques test * GBR spawn update Fix #1552 --- android/assets/jsons/Terrains.json | 12 ++++++ .../translationsByLanguage/Czech.properties | 8 ++++ .../translationsByLanguage/Dutch.properties | 8 ++++ .../translationsByLanguage/English.properties | 8 ++++ .../translationsByLanguage/French.properties | 8 ++++ .../translationsByLanguage/German.properties | 8 ++++ .../Indonesian.properties | 8 ++++ .../translationsByLanguage/Italian.properties | 8 +++- .../translationsByLanguage/Korean.properties | 8 ++++ .../translationsByLanguage/Malay.properties | 8 ++++ .../translationsByLanguage/Polish.properties | 8 ++++ .../Portuguese.properties | 8 ++++ .../Romanian.properties | 8 ++++ .../translationsByLanguage/Russian.properties | 8 ++++ .../Simplified_Chinese.properties | 8 ++++ .../translationsByLanguage/Spanish.properties | 8 ++++ .../Traditional_Chinese.properties | 8 ++++ .../Ukrainian.properties | 8 ++++ .../completionPercentages.properties | 3 +- .../template.properties | 6 +++ .../civilization/CivInfoTransientUpdater.kt | 3 +- core/src/com/unciv/logic/map/MapGenerator.kt | 43 +++++++++++-------- core/src/com/unciv/logic/map/MapUnit.kt | 2 +- core/src/com/unciv/logic/map/TileInfo.kt | 3 ++ .../com/unciv/models/ruleset/tile/Terrain.kt | 39 ++++++++++++----- .../ui/mapeditor/TileEditorOptionsTable.kt | 19 +++++++- .../src/com/unciv/testing/TranslationTests.kt | 10 +++++ 27 files changed, 240 insertions(+), 36 deletions(-) diff --git a/android/assets/jsons/Terrains.json b/android/assets/jsons/Terrains.json index 140723dafc..ce32864ac0 100644 --- a/android/assets/jsons/Terrains.json +++ b/android/assets/jsons/Terrains.json @@ -149,6 +149,7 @@ gold: 1, science: 2, occursOn: ["Coast"], + turnsInto: "Coast", impassable: true, unbuildable: true, weight: 10 @@ -159,6 +160,7 @@ science: 2, happiness: 3, occursOn: ["Grassland","Plains","Tundra","Mountain"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 @@ -168,8 +170,10 @@ type: "NaturalWonder", culture: 5, occursOn: ["Plains"], + turnsInto: "Plains", impassable: true, unbuildable: true, + uniques: ["Grants 500 Gold to the first civilization to discover it"], weight: 2 }, { @@ -177,8 +181,10 @@ type: "NaturalWonder", happiness: 10, occursOn: ["Plains"], + turnsInto: "Plains", impassable: true, unbuildable: true, + uniques: ["Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game"], weight: 1 }, { @@ -187,6 +193,7 @@ production: 2, gold: 3, occursOn: ["Plains","Desert","Tundra"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 @@ -197,6 +204,7 @@ gold: 1, culture: 5, occursOn: ["Grassland","Plains"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 @@ -207,6 +215,7 @@ type: "NaturalWonder", science: 5, occursOn: ["Ocean"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 @@ -217,6 +226,7 @@ food: 2, gold: 5, occursOn: ["Grassland"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 @@ -226,6 +236,7 @@ type: "NaturalWonder", gold: 10, occursOn: ["Plains","Mountain"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 5 @@ -236,6 +247,7 @@ gold: 2, science: 3, occursOn: ["Desert","Tundra"], + turnsInto: "Mountain", impassable: true, unbuildable: true, weight: 10 diff --git a/android/assets/jsons/translationsByLanguage/Czech.properties b/android/assets/jsons/translationsByLanguage/Czech.properties index beed53f7fb..5f94c2aa33 100644 --- a/android/assets/jsons/translationsByLanguage/Czech.properties +++ b/android/assets/jsons/translationsByLanguage/Czech.properties @@ -923,6 +923,8 @@ May contain [listOfResources] = Může obsahovat [listOfResources] Upgrades to [upgradedUnit] = Vylepšení na [upgradedUnit] Obsolete with [obsoleteTech] = Zastará (přestane půspbit) s [obsoleteTech] Occurs on [listOfTerrains] = Nalézá se v/na [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Může se objevit v/na Improved by [improvement] = Vylešen(a/o) díky [improvement] Bonus stats for improvement: = Bonusové statistiky pro vylepšení: @@ -1328,6 +1330,12 @@ Cerro de Potosi = El Dorado = Fountain of Youth = Fontána mládí +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Dobytek diff --git a/android/assets/jsons/translationsByLanguage/Dutch.properties b/android/assets/jsons/translationsByLanguage/Dutch.properties index 3e6e04009c..50139ae121 100644 --- a/android/assets/jsons/translationsByLanguage/Dutch.properties +++ b/android/assets/jsons/translationsByLanguage/Dutch.properties @@ -1517,6 +1517,8 @@ Obsolete with [obsoleteTech] = # Requires translation! Occurs on [listOfTerrains] = # Requires translation! +Placed on [terrainType] = + # Requires translation! Can be found on = # Requires translation! Improved by [improvement] = @@ -2159,6 +2161,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Rundvee diff --git a/android/assets/jsons/translationsByLanguage/English.properties b/android/assets/jsons/translationsByLanguage/English.properties index 355e14b4f6..e28623cf30 100644 --- a/android/assets/jsons/translationsByLanguage/English.properties +++ b/android/assets/jsons/translationsByLanguage/English.properties @@ -1672,6 +1672,8 @@ Obsolete with [obsoleteTech] = # Requires translation! Occurs on [listOfTerrains] = # Requires translation! +Placed on [terrainType] = + # Requires translation! Can be found on = # Requires translation! Improved by [improvement] = @@ -2405,6 +2407,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources # Requires translation! diff --git a/android/assets/jsons/translationsByLanguage/French.properties b/android/assets/jsons/translationsByLanguage/French.properties index 82880489f0..8fffaf984e 100644 --- a/android/assets/jsons/translationsByLanguage/French.properties +++ b/android/assets/jsons/translationsByLanguage/French.properties @@ -912,6 +912,8 @@ May contain [listOfResources] = Peut contenir [listOfResources] Upgrades to [upgradedUnit] = Améliorer en [upgradedUnit] Obsolete with [obsoleteTech] = Obsolète avec [obsoleteTech] Occurs on [listOfTerrains] = Doit possèder [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Peut être trouver sur Improved by [improvement] = Amélioré par [improvement] Bonus stats for improvement: = Bonus de case améliorée: @@ -1295,6 +1297,12 @@ Cerro de Potosi = Cerro de Potosi El Dorado = El Dorado Fountain of Youth = Fontaine de Jouvence +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Bétail diff --git a/android/assets/jsons/translationsByLanguage/German.properties b/android/assets/jsons/translationsByLanguage/German.properties index 0958836bd6..f251bc9fcc 100644 --- a/android/assets/jsons/translationsByLanguage/German.properties +++ b/android/assets/jsons/translationsByLanguage/German.properties @@ -926,6 +926,8 @@ May contain [listOfResources] = kann [listOfResources] enthalten Upgrades to [upgradedUnit] = Verbessert sich zu [upgradedUnit] Obsolete with [obsoleteTech] = Überflüssig mit [obsoleteTech] Occurs on [listOfTerrains] = Kommt vor in [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Kann gefunden werden in Improved by [improvement] = Wird verbessert durch [improvement] Bonus stats for improvement: = Boni für Verbesserung: @@ -1336,6 +1338,12 @@ Cerro de Potosi = Cerro de Potosí El Dorado = El Dorado Fountain of Youth = Jungbrunnen +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Rinder diff --git a/android/assets/jsons/translationsByLanguage/Indonesian.properties b/android/assets/jsons/translationsByLanguage/Indonesian.properties index e34d72d16f..8f2cbbd18b 100644 --- a/android/assets/jsons/translationsByLanguage/Indonesian.properties +++ b/android/assets/jsons/translationsByLanguage/Indonesian.properties @@ -1369,6 +1369,8 @@ Obsolete with [obsoleteTech] = # Requires translation! Occurs on [listOfTerrains] = # Requires translation! +Placed on [terrainType] = + # Requires translation! Can be found on = # Requires translation! Improved by [improvement] = @@ -2102,6 +2104,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources # Requires translation! diff --git a/android/assets/jsons/translationsByLanguage/Italian.properties b/android/assets/jsons/translationsByLanguage/Italian.properties index fd6db71713..b92631c543 100644 --- a/android/assets/jsons/translationsByLanguage/Italian.properties +++ b/android/assets/jsons/translationsByLanguage/Italian.properties @@ -910,7 +910,8 @@ Cost = Costo May contain [listOfResources] = Può contenere [listOfResources] Upgrades to [upgradedUnit] = Aggiorna a [upgradedUnit] Obsolete with [obsoleteTech] = Diventa obsoleta con [obsoleteTech] -Occurs on [listOfTerrains] = Può avvenire/avviene su [listOfTerrains] +Occurs on [listOfTerrains] = Si può trovare su [listOfTerrains] +Placed on [terrainType] = Si trova su [terrainType] Can be found on = Può trovarsi su Improved by [improvement] = Può essere migliorato/a da [improvement] Bonus stats for improvement: = Bonus per miglioramento: @@ -1294,6 +1295,11 @@ Cerro de Potosi = Cerro Rico de Potosí El Dorado = El Dorado Fountain of Youth = Fonte della giovinezza +# Natural Wonders Uniques + +Grants 500 Gold to the first civilization to discover it = Fornisce 500 Oro per la prima civiltà a scoprirla +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = Fornisce Ringiovanimento (tutti gli effetti di cura raddoppiati) alle unità militari terrestri adiacenti per il resto della partita + # Resources Cattle = Bestiame diff --git a/android/assets/jsons/translationsByLanguage/Korean.properties b/android/assets/jsons/translationsByLanguage/Korean.properties index 4f4df25389..748f9ad85a 100644 --- a/android/assets/jsons/translationsByLanguage/Korean.properties +++ b/android/assets/jsons/translationsByLanguage/Korean.properties @@ -947,6 +947,8 @@ May contain [listOfResources] = [listOfResources] 자원을 포함할 수 있음 Upgrades to [upgradedUnit] = [upgradedUnit](으)로 업그레이드 가능 Obsolete with [obsoleteTech] = [obsoleteTech] 연구 후 생산 불가 Occurs on [listOfTerrains] = [listOfTerrains]에서 생길 수 있음 + # Requires translation! +Placed on [terrainType] = Can be found on = 발견 가능한 지형 : Improved by [improvement] = [improvement]로 개발 가능 Bonus stats for improvement: = 개발할 경우 추가로 @@ -1360,6 +1362,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = 소 diff --git a/android/assets/jsons/translationsByLanguage/Malay.properties b/android/assets/jsons/translationsByLanguage/Malay.properties index 1043cdbc12..ddd95c299b 100644 --- a/android/assets/jsons/translationsByLanguage/Malay.properties +++ b/android/assets/jsons/translationsByLanguage/Malay.properties @@ -1561,6 +1561,8 @@ Obsolete with [obsoleteTech] = # Requires translation! Occurs on [listOfTerrains] = # Requires translation! +Placed on [terrainType] = + # Requires translation! Can be found on = # Requires translation! Improved by [improvement] = @@ -2212,6 +2214,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources # Requires translation! diff --git a/android/assets/jsons/translationsByLanguage/Polish.properties b/android/assets/jsons/translationsByLanguage/Polish.properties index 1f1ed4a0fe..1e812caea5 100644 --- a/android/assets/jsons/translationsByLanguage/Polish.properties +++ b/android/assets/jsons/translationsByLanguage/Polish.properties @@ -911,6 +911,8 @@ May contain [listOfResources] = Może zawierać [listOfResources] Upgrades to [upgradedUnit] = Ulepsz do [upgradedUnit] Obsolete with [obsoleteTech] = Przestarzałe z [obsoleteTech] Occurs on [listOfTerrains] = Występuje na [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Znajduje się na Improved by [improvement] = Ulepszone przez [improvement] Bonus stats for improvement: = Bonusowe statystyki dla ulepszeń @@ -1294,6 +1296,12 @@ Cerro de Potosi = Cerro de Potosi El Dorado = El Dorado Fountain of Youth = Źródło młodości +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Bydło diff --git a/android/assets/jsons/translationsByLanguage/Portuguese.properties b/android/assets/jsons/translationsByLanguage/Portuguese.properties index 71a3fb9ebf..2587d31e3e 100644 --- a/android/assets/jsons/translationsByLanguage/Portuguese.properties +++ b/android/assets/jsons/translationsByLanguage/Portuguese.properties @@ -1011,6 +1011,8 @@ May contain [listOfResources] = Pode conter [listOfResources] Upgrades to [upgradedUnit] = Melhorar para [upgradedUnit] Obsolete with [obsoleteTech] = Obsoleta(0) com [obsoleteTech] Occurs on [listOfTerrains] = Ocorre em [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Pode ser encontrado em Improved by [improvement] = Melhorado por [improvement] Bonus stats for improvement: = Bonus de estatisticas por melhoria: @@ -1511,6 +1513,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Gado diff --git a/android/assets/jsons/translationsByLanguage/Romanian.properties b/android/assets/jsons/translationsByLanguage/Romanian.properties index 9f76d56f4e..6d594e8394 100644 --- a/android/assets/jsons/translationsByLanguage/Romanian.properties +++ b/android/assets/jsons/translationsByLanguage/Romanian.properties @@ -1348,6 +1348,8 @@ Obsolete with [obsoleteTech] = # Requires translation! Occurs on [listOfTerrains] = # Requires translation! +Placed on [terrainType] = + # Requires translation! Can be found on = # Requires translation! Improved by [improvement] = @@ -1866,6 +1868,12 @@ El Dorado = # Requires translation! Fountain of Youth = +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Vite diff --git a/android/assets/jsons/translationsByLanguage/Russian.properties b/android/assets/jsons/translationsByLanguage/Russian.properties index 703fbe111d..74e90c646c 100644 --- a/android/assets/jsons/translationsByLanguage/Russian.properties +++ b/android/assets/jsons/translationsByLanguage/Russian.properties @@ -912,6 +912,8 @@ May contain [listOfResources] = Может содержать [listOfResources] Upgrades to [upgradedUnit] = Улучшается до [upgradedUnit] Obsolete with [obsoleteTech] = Устаревает после [obsoleteTech] Occurs on [listOfTerrains] = Появляется на [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Может быть найден в Improved by [improvement] = Улучшен [improvement] Bonus stats for improvement: = Бонусы за улучшение: @@ -1295,6 +1297,12 @@ Cerro de Potosi = гора Серро-де-Потоси El Dorado = Эльдорадо Fountain of Youth = Фонтан вечной молодости +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Скот diff --git a/android/assets/jsons/translationsByLanguage/Simplified_Chinese.properties b/android/assets/jsons/translationsByLanguage/Simplified_Chinese.properties index 74f1a1d9f8..9fd957d0b2 100644 --- a/android/assets/jsons/translationsByLanguage/Simplified_Chinese.properties +++ b/android/assets/jsons/translationsByLanguage/Simplified_Chinese.properties @@ -924,6 +924,8 @@ May contain [listOfResources] = 可能拥有下列资源:[listOfResources] Upgrades to [upgradedUnit] = 可升级为[upgradedUnit] Obsolete with [obsoleteTech] = 研发下列科技后过时:[obsoleteTech] Occurs on [listOfTerrains] = 可能出现在以下地形:[listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = 可能发现该资源的地形地貌: Improved by [improvement] = 开发该资源所需设施:[improvement] Bonus stats for improvement: = 开发该资源后设施所获奖励效果: @@ -1326,6 +1328,12 @@ Cerro de Potosi = 富饶山 El Dorado = 黄金国 Fountain of Youth = 青春之泉 +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = 牛群 diff --git a/android/assets/jsons/translationsByLanguage/Spanish.properties b/android/assets/jsons/translationsByLanguage/Spanish.properties index e53b7545a0..633440e1a2 100644 --- a/android/assets/jsons/translationsByLanguage/Spanish.properties +++ b/android/assets/jsons/translationsByLanguage/Spanish.properties @@ -911,6 +911,8 @@ May contain [listOfResources] = Puede contener [listOfResources] Upgrades to [upgradedUnit] = Mejora a [upgradedUnit] Obsolete with [obsoleteTech] = Se hace obsoleto con [obsoleteTech] Occurs on [listOfTerrains] = Ocurre en [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Se puede encontrar en Improved by [improvement] = Mejorado por [improvement] Bonus stats for improvement: = Bonus de atributos por mejora: @@ -1294,6 +1296,12 @@ Cerro de Potosi = Cerro de Potosí El Dorado = El Dorado Fountain of Youth = Fuente de la juventud +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Ganado diff --git a/android/assets/jsons/translationsByLanguage/Traditional_Chinese.properties b/android/assets/jsons/translationsByLanguage/Traditional_Chinese.properties index d4881bb9e9..be9977065d 100644 --- a/android/assets/jsons/translationsByLanguage/Traditional_Chinese.properties +++ b/android/assets/jsons/translationsByLanguage/Traditional_Chinese.properties @@ -924,6 +924,8 @@ May contain [listOfResources] = 可能擁有以下資源:[listOfResources] Upgrades to [upgradedUnit] = 可升級為[upgradedUnit] Obsolete with [obsoleteTech] = 研發下列科技後過時:[obsoleteTech] Occurs on [listOfTerrains] = 可能出現在以下地形:[listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = 可能發現該資源的地形地貌: Improved by [improvement] = 開發該資源所需設施:[improvement] Bonus stats for improvement: = 開發該資源後設施所獲獎勵效果: @@ -1326,6 +1328,12 @@ Cerro de Potosi = 富饒山 El Dorado = 黃金國 Fountain of Youth = 青春之泉 +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = 牛群 diff --git a/android/assets/jsons/translationsByLanguage/Ukrainian.properties b/android/assets/jsons/translationsByLanguage/Ukrainian.properties index cea22f5dd4..8e18029776 100644 --- a/android/assets/jsons/translationsByLanguage/Ukrainian.properties +++ b/android/assets/jsons/translationsByLanguage/Ukrainian.properties @@ -912,6 +912,8 @@ May contain [listOfResources] = Може містити [listOfResources] Upgrades to [upgradedUnit] = Удосконалюється до [upgradedUnit] Obsolete with [obsoleteTech] = Застарілий після [obsoleteTech] Occurs on [listOfTerrains] = З’являється на [listOfTerrains] + # Requires translation! +Placed on [terrainType] = Can be found on = Може бути знайдений в Improved by [improvement] = Удосконалив [improvement] Bonus stats for improvement: = Бонусні характеристики за удосконалення: @@ -1302,6 +1304,12 @@ Cerro de Potosi = Серро-Ріко El Dorado = Ельдорадо Fountain of Youth = Джерело вічної молодості +# Natural Wonders Uniques + # Requires translation! +Grants 500 Gold to the first civilization to discover it = + # Requires translation! +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = Худоба diff --git a/android/assets/jsons/translationsByLanguage/completionPercentages.properties b/android/assets/jsons/translationsByLanguage/completionPercentages.properties index a66412d5c4..23f1e18758 100644 --- a/android/assets/jsons/translationsByLanguage/completionPercentages.properties +++ b/android/assets/jsons/translationsByLanguage/completionPercentages.properties @@ -2,8 +2,9 @@ Traditional_Chinese = 97 Italian = 100 Polish = 99 Russian = 99 +Polish = 99 Romanian = 49 -Korean = 95 +Korean = 94 Simplified_Chinese = 97 German = 96 English = 0 diff --git a/android/assets/jsons/translationsByLanguage/template.properties b/android/assets/jsons/translationsByLanguage/template.properties index 713278f058..e08b1d0cf8 100644 --- a/android/assets/jsons/translationsByLanguage/template.properties +++ b/android/assets/jsons/translationsByLanguage/template.properties @@ -911,6 +911,7 @@ May contain [listOfResources] = Upgrades to [upgradedUnit] = Obsolete with [obsoleteTech] = Occurs on [listOfTerrains] = +Placed on [terrainType] = Can be found on = Improved by [improvement] = Bonus stats for improvement: = @@ -1294,6 +1295,11 @@ Cerro de Potosi = El Dorado = Fountain of Youth = +# Natural Wonders Uniques + +Grants 500 Gold to the first civilization to discover it = +Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game = + # Resources Cattle = diff --git a/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt b/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt index 00acbc99ff..83706c20d0 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt @@ -93,7 +93,8 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo){ var goldGained = 0 val discoveredNaturalWonders = civInfo.gameInfo.civilizations.filter { it != civInfo } .flatMap { it.naturalWonders } - if (tile.naturalWonder == "El Dorado" && !discoveredNaturalWonders.contains(tile.naturalWonder!!)) { + if (tile.containsUnique("Grants 500 Gold to the first civilization to discover it") + && !discoveredNaturalWonders.contains(tile.naturalWonder!!)) { goldGained += 500 } diff --git a/core/src/com/unciv/logic/map/MapGenerator.kt b/core/src/com/unciv/logic/map/MapGenerator.kt index f7ae694e44..5f1af4dc7d 100644 --- a/core/src/com/unciv/logic/map/MapGenerator.kt +++ b/core/src/com/unciv/logic/map/MapGenerator.kt @@ -253,7 +253,7 @@ class MapGenerator { Constants.barringerCrater -> spawnBarringerCrater(mapToReturn, ruleset) Constants.mountFuji -> spawnMountFuji(mapToReturn, ruleset) Constants.grandMesa -> spawnGrandMesa(mapToReturn, ruleset) - Constants.greatBarrierReef -> spawnGreatBarrierReef(mapToReturn, ruleset) + Constants.greatBarrierReef -> spawnGreatBarrierReef(mapToReturn, ruleset, mapRadius) Constants.krakatoa -> spawnKrakatoa(mapToReturn, ruleset) Constants.rockOfGibraltar -> spawnRockOfGibraltar(mapToReturn, ruleset) Constants.oldFaithful -> spawnOldFaithful(mapToReturn, ruleset) @@ -280,7 +280,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -306,7 +306,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -330,7 +330,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -343,29 +343,34 @@ class MapGenerator { Assumption: at least 1 neighbour not water; no tundra; at least 1 neighbour coast; becomes coast TODO: investigate Great Barrier Reef placement requirements */ - private fun spawnGreatBarrierReef(mapToReturn: TileMap, ruleset: Ruleset) { + private fun spawnGreatBarrierReef(mapToReturn: TileMap, ruleset: Ruleset, mapRadius: Int) { val wonder = ruleset.terrains[Constants.greatBarrierReef]!! + val maxLatitude = abs(getLatitude(Vector2(mapRadius.toFloat(), mapRadius.toFloat()))) val suitableLocations = mapToReturn.values.filter { it.resource == null && it.improvement == null && wonder.occursOn!!.contains(it.getLastTerrain().name) - && it.neighbors.none{ neighbor -> neighbor.getBaseTerrain().name == Constants.tundra } - && it.neighbors.any { neighbor -> neighbor.getBaseTerrain().name != Constants.ocean - && neighbor.getBaseTerrain().name != Constants.coast } - && it.neighbors.any { neighbor -> neighbor.getBaseTerrain().name == Constants.coast - && neighbor.resource == null && neighbor.improvement == null} + && abs(getLatitude(it.position)) > maxLatitude * 0.1 + && abs(getLatitude(it.position)) < maxLatitude * 0.7 + && it.neighbors.all {neighbor -> neighbor.isWater} + && it.neighbors.any {neighbor -> + neighbor.resource == null && neighbor.improvement == null + && wonder.occursOn!!.contains(neighbor.getLastTerrain().name) + && neighbor.neighbors.all{ it.isWater } } } if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.coast + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null val location2 = location.neighbors - .filter { it.getBaseTerrain().name == Constants.coast && it.resource == null && it.improvement == null } + .filter { it.resource == null && it.improvement == null + && wonder.occursOn!!.contains(it.getLastTerrain().name) + && it.neighbors.all{ it.isWater } } .random() location2.naturalWonder = wonder.name - location2.baseTerrain = Constants.coast + location2.baseTerrain = wonder.turnsInto!! location2.terrainFeature = null } else { @@ -388,7 +393,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null for (tile in location.neighbors) { @@ -421,7 +426,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null for (tile in location.neighbors) { @@ -458,7 +463,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -479,7 +484,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.mountain + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -500,7 +505,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.plains + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { @@ -519,7 +524,7 @@ class MapGenerator { if (suitableLocations.isNotEmpty()) { val location = suitableLocations.random() location.naturalWonder = wonder.name - location.baseTerrain = Constants.plains + location.baseTerrain = wonder.turnsInto!! location.terrainFeature = null } else { diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index dfc153a8cf..2af412ede9 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -429,7 +429,7 @@ class MapUnit { if(!hasUnique("All healing effects doubled") && type.isLandUnit() && type.isMilitary()) { - val gainDoubleHealPromotion = tile.neighbors.filter{it.naturalWonder == "Fountain of Youth"}.any() + val gainDoubleHealPromotion = tile.neighbors.any{it.containsUnique("Grants Rejuvenation (all healing effects doubled) to adjacent military land units for the rest of the game")} if (gainDoubleHealPromotion) promotions.addPromotion("Rejuvenation", true) } diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 7c2c36d6a1..6c845c8cad 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -68,6 +68,9 @@ open class TileInfo { return false } + fun containsUnique(unique: String): Boolean { + return isNaturalWonder() && getNaturalWonder().uniques.contains(unique) + } //region pure functions /** Returns military, civilian and air units in tile */ diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index f5cb672e7a..ad6f3b64bb 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -10,19 +10,26 @@ class Terrain : NamedStats() { fun getDescription(ruleset: Ruleset): String { val sb = StringBuilder() sb.appendln(this.clone().toString()) - if (occursOn != null) { + if (occursOn != null) sb.appendln("Occurs on [${occursOn.joinToString(", ")}]".tr()) - } - val resourcesFound = ruleset.tileResources.values.filter { it.terrainsCanBeFoundOn.contains(name) } - if (resourcesFound.isNotEmpty()) { - sb.appendln("May contain [${resourcesFound.joinToString(", ") { it.name.tr() }}]".tr()) - } - sb.appendln("{Movement cost}: $movementCost".tr()) - if (defenceBonus != 0f) { - sb.appendln("{Defence bonus}: ".tr() + (defenceBonus * 100).toInt() + "%") - } - if (rough) sb.appendln("Rough Terrain".tr()) + if (turnsInto != null) + sb.appendln("Placed on [${turnsInto.tr()}]".tr()) + + val resourcesFound = ruleset.tileResources.values.filter { it.terrainsCanBeFoundOn.contains(name) } + if (resourcesFound.isNotEmpty()) + sb.appendln("May contain [${resourcesFound.joinToString(", ") { it.name.tr() }}]".tr()) + + if(uniques.isNotEmpty()) + sb.appendln(uniques.joinToString { it.tr() }) + + sb.appendln("{Movement cost}: $movementCost".tr()) + + if (defenceBonus != 0f) + sb.appendln("{Defence bonus}: ".tr() + (defenceBonus * 100).toInt() + "%") + + if (rough) + sb.appendln("Rough Terrain".tr()) return sb.toString() } @@ -47,6 +54,16 @@ class Terrain : NamedStats() { */ val occursOn: Collection? = null + /*** + * Used by Natural Wonders: it is the baseTerrain on top of which the Natural Wonder is placed + */ + val turnsInto: String? = null + + /** + * Uniques (currently used only for Natural Wonders) + */ + val uniques = ArrayList() + /* * Natural Wonder weight: probability to be picked */ diff --git a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt index 5c85bfb134..57ebcae1b4 100644 --- a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt @@ -293,13 +293,19 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera fun updateTileWhenClicked(tileInfo: TileInfo) { when { - clearTerrainFeature -> tileInfo.terrainFeature = null + clearTerrainFeature -> { + tileInfo.terrainFeature = null + tileInfo.naturalWonder = null + } clearResource -> tileInfo.resource = null selectedResource != null -> tileInfo.resource = selectedResource!!.name selectedTerrain != null -> { if (selectedTerrain!!.type == TerrainType.TerrainFeature) tileInfo.terrainFeature = selectedTerrain!!.name - else tileInfo.baseTerrain = selectedTerrain!!.name + else if (selectedTerrain!!.type == TerrainType.NaturalWonder) + tileInfo.naturalWonder = selectedTerrain!!.name + else + tileInfo.baseTerrain = selectedTerrain!!.name } clearImprovement -> { tileInfo.improvement = null @@ -330,6 +336,15 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera } fun normalizeTile(tileInfo: TileInfo){ + /*Natural Wonder superpowers! */ + if (tileInfo.naturalWonder != null) { + val naturalWonder = tileInfo.getNaturalWonder() + tileInfo.baseTerrain = naturalWonder.turnsInto!! + tileInfo.terrainFeature = null + tileInfo.resource = null + tileInfo.improvement = null + } + if(tileInfo.terrainFeature!=null){ val terrainFeature = tileInfo.getTerrainFeature()!! if(terrainFeature.occursOn!=null && !terrainFeature.occursOn.contains(tileInfo.baseTerrain)) diff --git a/tests/src/com/unciv/testing/TranslationTests.kt b/tests/src/com/unciv/testing/TranslationTests.kt index 7fd8c783e5..bbc7b40d4a 100644 --- a/tests/src/com/unciv/testing/TranslationTests.kt +++ b/tests/src/com/unciv/testing/TranslationTests.kt @@ -82,6 +82,16 @@ class TranslationTests { allStringsHaveTranslation) } + @Test + fun allTerrainUniquesHaveTranslation() { + val strings: MutableSet = HashSet() + for (terrain in ruleSet.terrains.values) { + strings.addAll(terrain.uniques) + } + val allStringsHaveTranslation = allStringAreTranslated(strings) + Assert.assertTrue("This test will only pass when there is a translation for all terrain uniques", allStringsHaveTranslation) + } + @Test fun allImprovementsHaveTranslation() { val strings: Set = ruleSet.tileImprovements.keys