From 7453ee637fdf760717d61ed137a1bf2793747203 Mon Sep 17 00:00:00 2001 From: lishaoxia1985 <49801619+lishaoxia1985@users.noreply.github.com> Date: Mon, 25 Nov 2019 18:03:20 +0800 Subject: [PATCH] 1. overflow science when finishing and starting research. 2. in the cityscreen unit should be not visible. 3. modifier the policy "Commerce Complete" according to original game. 4. the action of "Great Merchant" now is the same as original game. 5. translation update. (#1355) * update * update * update * update * update * update --- android/assets/jsons/Policies.json | 2 +- .../assets/jsons/Translations/Buildings.json | 6 +++--- android/assets/jsons/Translations/Other.json | 19 +++++------------- .../assets/jsons/Translations/Policies.json | 20 ++++++------------- .../jsons/Translations/Units,Promotions.json | 18 +++++------------ android/assets/jsons/Units.json | 2 +- core/src/com/unciv/logic/city/CityStats.kt | 1 - .../unciv/logic/civilization/TechManager.kt | 14 +++++++++++-- core/src/com/unciv/logic/map/TileInfo.kt | 2 ++ .../src/com/unciv/ui/cityscreen/CityScreen.kt | 2 +- .../unciv/ui/worldscreen/unit/UnitActions.kt | 15 ++++++++++---- 11 files changed, 47 insertions(+), 54 deletions(-) diff --git a/android/assets/jsons/Policies.json b/android/assets/jsons/Policies.json index bce67261..76b43a71 100644 --- a/android/assets/jsons/Policies.json +++ b/android/assets/jsons/Policies.json @@ -255,7 +255,7 @@ }, { name:"Commerce Complete", - description:"+1 gold from each specialist" + description:"+1 gold from every trading post, double gold from Great Merchant trade missions" } ] }, diff --git a/android/assets/jsons/Translations/Buildings.json b/android/assets/jsons/Translations/Buildings.json index 468193ce..02570b03 100644 --- a/android/assets/jsons/Translations/Buildings.json +++ b/android/assets/jsons/Translations/Buildings.json @@ -1569,7 +1569,7 @@ French:"+5% de production pour chaque routes commerciales connectées à une Cité état" Polish:"+5% do produkcji za każdy szlak handlowy z państwem-miastem" Simplified_Chinese:"每条通往城邦的贸易路线+5%产能" - Traditional_Chinese:"每調通往城邦的貿易路線+5%產能" + Traditional_Chinese:"每條通往城邦的貿易路線+5%產能" Russian:"+5% Производство за каждый торговый маршрут с городом-государством" Czech:"+5% produkce pro každou obchodní stezku s hlavním městem říše" German:"+5% Produktion für jeden Handelsweg mit einem Stadtstaat innerhalb des Imperiums" @@ -2064,8 +2064,8 @@ German:"Neue Sozialpolitiken erfordern 10% weniger Kultur" Dutch:"Aanschaffingskosten nieuwe sociaal beleiden verlaagd met 10%" Spanish:"Coste de cultura para adoptar nuevas políticas se reduce 10%" - Simplified_Chinese:"推行新的社会政策所需的文化点数-10%" - Traditional_Chinese:"推行新的社會政策所需的文化點數-10%" + Simplified_Chinese:"推行新的社会政策所需的文化-10%" + Traditional_Chinese:"推行新的社會政策所需的文化-10%" Portuguese:"Custo cultural de adotar novas políticas reduzido em 10%" Polish:"Wdrożenie nowych ustrojów społecznych zmniejszone o 10% kultury" Czech:"Počet Kulturních bodů na získání nové sociální politiky se sníží o 10%" diff --git a/android/assets/jsons/Translations/Other.json b/android/assets/jsons/Translations/Other.json index 66d574a7..ee413a11 100644 --- a/android/assets/jsons/Translations/Other.json +++ b/android/assets/jsons/Translations/Other.json @@ -1848,8 +1848,8 @@ Italian:"Conduci missione commerciale" Romanian:"Dirijează misiunea comercială" Spanish:"Tomar mision De Comercio" - Simplified_Chinese:"开展贸易" - Traditional_Chinese:"發展貿易" + Simplified_Chinese:"拓展贸易" + Traditional_Chinese:"拓展貿易" German:"Handelsmission durchführen" French:"Faire une mission commerciale" Portuguese:"Realizar uma missão comercial" @@ -1859,18 +1859,9 @@ } // for unit action button - "Your trade mission has earned you [goldGained] gold!":{ - Italian:"La tua missione commerciale ti ha fruttato [goldGained] Oro!" - Romanian:"Misuiunea comercială ți-a adus [goldGained] aur!" - Spanish:"¡La mision de comercio ha generado [goldGained] de oro!" - Simplified_Chinese:"您开展贸易赚了[goldGained]金钱" - Traditional_Chinese:"您發展貿易賺了[goldGained]金錢" - Portuguese:"Sua missão comercial deu-lhe [goldGained] ouro!" - German:"Die Handelsmission hat [goldGained] Gold eingebracht!" - French:"Votre mission commerciale vous a rapporté [goldGained] ors" - Russian:"Ваша торговая сделка принесла вам [goldGained] золота!", - Czech:"Obchodní mise vynesla [goldGained] zlata!" - Ukrainian:"Ваша угода принесла вам [goldGained] золота" + "Your trade mission to [civName] has earned you [goldAmount] gold and [influenceAmount] influence!":{ + Simplified_Chinese:"您与[civName]拓展贸易获得[goldAmount]金钱和[influenceAmount]影响力!" + Traditional_Chinese:"您與[civName]拓展貿易獲得[goldAmount]金錢和[influenceAmount]影響力!" } "Hurry Wonder":{ diff --git a/android/assets/jsons/Translations/Policies.json b/android/assets/jsons/Translations/Policies.json index f47571e3..1f33f4ae 100644 --- a/android/assets/jsons/Translations/Policies.json +++ b/android/assets/jsons/Translations/Policies.json @@ -1044,17 +1044,9 @@ Czech:"Kompletní Kupectví" } - "+1 gold from each specialist":{ - Italian:"+1 Oro per ogni specialista" - Russian:"+1 золота от каждого специалиста" - Romanian:"+1 aur de la fiecare specialist" - Spanish:"+1 oro por cada especialista" - Simplified_Chinese:"每个专业人员+1金钱" - Traditional_Chinese:"每個專業人員+1金錢" - Portuguese:"+1 ouro por cada especialista" - German:"+1 Gold für jede(n) Spezialistin" - French:"+1 or pour chaque spécialiste" - Czech:"+1 zlato za každého specialistu" + "+1 gold from every trading post, double gold from Great Merchant trade missions":{ + Simplified_Chinese:"每处贸易站+1金钱,大商业家拓展贸易获得的金钱加倍" + Traditional_Chinese:"每處貿易站+1金錢,大商業家拓展貿易獲得的金錢加倍" } //////Rationalism branch @@ -1156,7 +1148,7 @@ Romanian:"+1 știință de la fiecare punct comercial, +17% știință de la universități" Spanish:"+1 ciencia por cada puesto comercial, +17% ciencia de las universidades" Simplified_Chinese:"每处贸易站+1科研,大学+17%科研产出" - Traditional_Chinese:"每個貿易站+1科研,大學+17%科研產出" + Traditional_Chinese:"每處貿易站+1科研,大學+17%科研產出" Portuguese:"+1 ciência por cada posto mercantil, +17% ciência de todas as universidades" German:"+1 Wissenschaft durch jeden Handelsposten; +17% Wissenschaft von Universitäten" French:"Comptoirs commerciaux : science +1 et science +17% grâce aux universités", @@ -1650,8 +1642,8 @@ Spanish:"+15% a la produccion cuando se esta construyendo unidades militares, las unidades militares comienzan con 15 de PX" Italian:"+15% Produzione per le unità militari, e +15 esperienza per le nuove unità militari" Romanian:"+15% producție când se construiesc unități militare, iar noile unități militare au 15 experiență din start" - Simplified_Chinese:"组建军事单位时产能积累速率+15%,新的军事单位初始有15点经验值" - Traditional_Chinese:"訓練軍事單位時產能累積速率+15%,新的軍事單位初始經驗值為15點" + Simplified_Chinese:"组建军事单位时产能积累速率+15%,新的军事单位初始经验值为15" + Traditional_Chinese:"訓練軍事單位時產能累積速率+15%,新的軍事單位初始經驗值為15" Portuguese:"+15% produção ao construir unidades militares e novas unidades militares começam com 15 experiencia" Russian:"+15% К производству военных юнитов, Военные юниты создаются с 15 опыта" German:"+15% Produktion beim Bauen von Militäreinheiten; neue Militäreinheiten starten mit 15 Erfahrung (EP)" diff --git a/android/assets/jsons/Translations/Units,Promotions.json b/android/assets/jsons/Translations/Units,Promotions.json index 8fe65a72..e410ad9e 100644 --- a/android/assets/jsons/Translations/Units,Promotions.json +++ b/android/assets/jsons/Translations/Units,Promotions.json @@ -939,8 +939,8 @@ Italian:"Cura [amountHealed] PF quando uccide un'unità nemica" French:"Soigne [amountHealed] dégâts si il tue une unité" Russian:"Восстаналивает [amountHealed] здоровья при уничтожении юнита" - Simplified_Chinese:"消灭敌方单位后回复[amountHealed]点生命值", - Traditional_Chinese:"消滅敵方單位後回復[amountHealed]點生命值", + Simplified_Chinese:"消灭敌方单位后回复[amountHealed]生命值", + Traditional_Chinese:"消滅敵方單位後回復[amountHealed]生命值", Czech:"Léčí [amountHealed] zranění pokud zabije jednotku" German:"Heilt [amountHealed] Schaden beim Töten einer Einheit" } @@ -1663,17 +1663,9 @@ Czech:"Velký Obchodník" } - "Can undertake a trade mission, giving a large sum of gold":{ - Spanish:"Puede tomar una mision de comercio, generando una gran suma de Oro" - Italian:"Può compiere missioni commerciali, donando grandi quantità di Oro" - French:"Peut entreprendre une mission commerciale qui donne une large somme en or" - Romanian:"Poate iniția o misiune comercială, oferind o sumă considerabilă de aur" - Simplified_Chinese:"可以开展贸易获得大笔金钱", - Traditional_Chinese:"可以開展貿易獲得大筆金錢", - Portuguese:"Pode entrar em uma missão comercial, dando grande quantidades de ouro" - German:"Kann eine Handelsmission durchführen, die viel Gold einbringt" - Russian:"Может провести торговую сделку, получив много золота" - Czech:"Může být vyslán na obchodní misi, která přinese velké množství zlata" + "Can undertake a trade mission with City-State, giving a large sum of gold and [influenceAmount] Influence":{ + Simplified_Chinese:"可以拓展与城邦的贸易,获得大笔金钱和[influenceAmount]影响力", + Traditional_Chinese:"可以拓展與城邦的貿易,獲得大筆金錢和[influenceAmount]影響力", } "Can build improvement: Customs house":{ diff --git a/android/assets/jsons/Units.json b/android/assets/jsons/Units.json index 459404e4..9a274ab4 100644 --- a/android/assets/jsons/Units.json +++ b/android/assets/jsons/Units.json @@ -1275,7 +1275,7 @@ name:"Great Merchant", unbuildable:true, unitType:"Civilian", - uniques:["Can undertake a trade mission, giving a large sum of gold","Can build improvement: Customs house"] + uniques:["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence","Can build improvement: Customs house"] movement:2 }, { diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index bcf6b5b9..0ea74b5f 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -239,7 +239,6 @@ class CityStats { if (stat == Stat.Culture || stat == Stat.Science) stats.add(stat, 3f) else stats.add(stat, 2f) // science and gold specialists - if (policies.contains("Commerce Complete")) stats.gold += 1 if (policies.contains("Secularism")) stats.science += 2 if (cityInfo.civInfo.containsBuildingUnique("+1 Production from specialists")) stats.production += 1 diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index d930f5f8..6ff7b88f 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -12,6 +12,7 @@ import com.unciv.ui.utils.withItem import java.util.* import kotlin.collections.ArrayList import kotlin.math.ceil +import kotlin.math.max class TechManager { @Transient lateinit var civInfo: CivilizationInfo @@ -30,6 +31,7 @@ class TechManager { /* When moving towards a certain tech, the user doesn't have to manually pick every one. */ var techsToResearch = ArrayList() private var techsInProgress = HashMap() + var overflowScience = 0 //region state-changing functions fun clone(): TechManager { @@ -79,8 +81,7 @@ class TechManager { fun remainingScienceToTech(techName: String) = costOfTech(techName) - researchOfTech(techName) fun turnsToTech(techName: String): Int { - return ceil( remainingScienceToTech(techName).toDouble() - / civInfo.statsForNextTurn.science).toInt() + return max(1, ceil( remainingScienceToTech(techName).toDouble() / civInfo.statsForNextTurn.science).toInt()) } fun isResearched(TechName: String): Boolean = techsResearched.contains(TechName) @@ -118,10 +119,19 @@ class TechManager { val currentTechnology = currentTechnologyName() if (currentTechnology == null) return techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + scienceForNewTurn + if (overflowScience != 0){ // https://forums.civfanatics.com/threads/the-mechanics-of-overflow-inflation.517970/ + val techsResearchedKnownCivs = civInfo.getKnownCivs().count { it.isMajorCiv() && it.tech.isResearched(currentTechnologyName()!!) } + val undefeatedCivs = UncivGame.Current.gameInfo.civilizations.count { it.isMajorCiv() && !it.isDefeated() } + techsInProgress[currentTechnology] = techsInProgress[currentTechnology]!! + ((1 + techsResearchedKnownCivs / undefeatedCivs.toFloat() * 0.3f)* overflowScience).toInt() + } if (techsInProgress[currentTechnology]!! < costOfTech(currentTechnology)) return // We finished it! + // http://www.civclub.net/bbs/forum.php?mod=viewthread&tid=123976 + overflowScience = techsInProgress[currentTechnology]!! - costOfTech(currentTechnology) + if(overflowScience > max(scienceForNewTurn * 5, GameBasics.Technologies[currentTechnology]!!.cost)) + overflowScience = max(scienceForNewTurn * 5, GameBasics.Technologies[currentTechnology]!!.cost) addTechnology(currentTechnology) } diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index f483ce44..b9e0be07 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -186,6 +186,8 @@ open class TileInfo { if (improvement.improvingTech != null && observingCiv.tech.isResearched(improvement.improvingTech!!)) stats.add(improvement.improvingTechStats!!) // eg Chemistry for mines if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Free Thought")) stats.science += 1f + if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Commerce Complete")) + stats.gold += 1f if (containsGreatImprovement() && observingCiv.policies.isAdopted("Freedom Complete")) stats.add(improvement) // again, for the double effect if (containsGreatImprovement() && city != null && city.civInfo.nation.unique == "+2 Science for all specialists and Great Person tile improvements") diff --git a/core/src/com/unciv/ui/cityscreen/CityScreen.kt b/core/src/com/unciv/ui/cityscreen/CityScreen.kt index 0c343306..fca698aa 100644 --- a/core/src/com/unciv/ui/cityscreen/CityScreen.kt +++ b/core/src/com/unciv/ui/cityscreen/CityScreen.kt @@ -205,7 +205,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() { val tileSetStrings = TileSetStrings() val cityTileGroups = cityInfo.getCenterTile().getTilesInDistance(5) .filter { city.civInfo.exploredTiles.contains(it.position) } - .map { CityTileGroup(cityInfo, it, tileSetStrings) } + .map { CityTileGroup(cityInfo, it, tileSetStrings).apply { unitLayerGroup.isVisible = false } } for (tileGroup in cityTileGroups) { val tileInfo = tileGroup.tileInfo diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index 6b3089b4..9e2b9230 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -232,12 +232,19 @@ class UnitActions { } if (unit.name == "Great Merchant" && !unit.isEmbarked()) { - actionList += UnitAction("Conduct Trade Mission", unit.currentMovement >0 + val canConductTradeMission = tile.owningCity?.civInfo?.isCityState()== true + && tile.owningCity?.civInfo?.isAtWarWith(unit.civInfo)== false + && unit.currentMovement >0 + actionList += UnitAction("Conduct Trade Mission", canConductTradeMission ) { // http://civilization.wikia.com/wiki/Great_Merchant_(Civ5) - val goldGained = 350 + 50 * unit.civInfo.getEra().ordinal - unit.civInfo.gold += goldGained - unit.civInfo.addNotification("Your trade mission has earned you [$goldGained] gold!",null, Color.GOLD) + var goldEarned = (350 + 50 * unit.civInfo.getEra().ordinal) * unit.civInfo.gameInfo.gameParameters.gameSpeed.getModifier() + if (unit.civInfo.policies.isAdopted("Commerce Complete")) + goldEarned *= 2 + unit.civInfo.gold += goldEarned.toInt() + val influenceEarned=Regex("\\d+").find(unit.getUniques()[0])!!.value.toInt() + tile.owningCity!!.civInfo.getDiplomacyManager(unit.civInfo).influence += influenceEarned + unit.civInfo.addNotification("Your trade mission to [${tile.owningCity!!.civInfo}] has earned you [${goldEarned.toInt()}] gold and [$influenceEarned] influence!",null, Color.GOLD) unit.destroy() }.sound("chimes") }