From 07a8b97ed2efab575b19628a2232a4547bd43151 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 24 Apr 2019 11:31:50 +0300 Subject: [PATCH] Open Borders is now only available with Civil Service, as per Civ V --- android/assets/jsons/Nations.json | 2 +- android/assets/jsons/Techs.json | 3 ++- android/assets/jsons/Translations.json | 20 +++++++++---------- core/src/com/unciv/logic/city/CityStats.kt | 2 +- .../src/com/unciv/logic/city/IConstruction.kt | 4 ++-- .../unciv/logic/civilization/TechManager.kt | 2 +- core/src/com/unciv/logic/map/MapUnit.kt | 2 +- .../unciv/logic/map/UnitMovementAlgorithms.kt | 2 +- core/src/com/unciv/logic/trade/TradeLogic.kt | 6 +++++- .../com/unciv/ui/worldscreen/TradePopup.kt | 2 +- .../com/unciv/ui/worldscreen/WorldScreen.kt | 2 +- 11 files changed, 26 insertions(+), 21 deletions(-) diff --git a/android/assets/jsons/Nations.json b/android/assets/jsons/Nations.json index 7d56677891..6d5e9a38f0 100644 --- a/android/assets/jsons/Nations.json +++ b/android/assets/jsons/Nations.json @@ -24,7 +24,7 @@ hateYes:["Yes!"], afterPeace:"Foolish, foolish – letting me live.", - tradeRequest:" It appears that you do have a reason for existing – to make this deal with me.", + tradeRequest:"It appears that you do have a reason for existing – to make this deal with me.", mainColor:[27,53,63], secondaryColor:[213,249,255], diff --git a/android/assets/jsons/Techs.json b/android/assets/jsons/Techs.json index c8e83db5af..03130bf066 100644 --- a/android/assets/jsons/Techs.json +++ b/android/assets/jsons/Techs.json @@ -156,7 +156,8 @@ { name:"Civil Service", row:5, - prerequisites:["Currency","Horseback Riding","Philosophy"] + prerequisites:["Currency","Horseback Riding","Philosophy"], + uniques:["Enables Open Borders agreements"] }, { name:"Guilds", diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index b409ac299e..88e2c769dd 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -2850,6 +2850,8 @@ Simplified_Chinese:"文官制度" Portuguese:"Serviço cívil" } + "Enables Open Borders agreements":{} + "Guilds":{ Italian:"Gilde" Russian:"Гильдии" @@ -4815,13 +4817,6 @@ Romanian:"[leaderName] de [nation]" } - /* - "[leaderName] of [adjective] Empire":{ // e.g. Ramesses of Egyptian Empire, Napoleon of French Empire (so it should be [adjective] instead of [nation] - Italian:"[leaderName] dell'Impero [adjective]" //es. Ramses II dell'Impero egiziano, Napoleone dell'Impero francese - French:"[leaderName] de l'Empire [adjective]" -Simplified_Chinese:"[adjective]帝国的[leaderName]" - } - */ "You'll pay for this!":{ Italian:"Pagherai caro questo affronto!" @@ -4836,17 +4831,22 @@ Simplified_Chinese:"[adjective]帝国的[leaderName]" "Very well.":{ Italian:"Molto bene." French:"Très bien." - Simplified_Chinese:"很好." + Simplified_Chinese:"很好." } "Farewell.":{ Italian:"Addio." French:"Adieu." - Simplified_Chinese:"再见." + Simplified_Chinese:"再见." } + + "Not this time.":{} // declining trade text + "Excellent!":{} // AI statement after we accept a trade they proposed + "How about something else...":{} // Counteroffer to AI offer + "A pleasure to meet you.":{ Italian:"Lieto di incontrarvi." French:"Un plaisir de vous rencontrez" - Simplified_Chinese:"很高兴见到你." + Simplified_Chinese:"很高兴见到你." } // Overview screen diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index bd13e552e7..6ecef72323 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -84,7 +84,7 @@ class CityStats { private fun getStatPercentBonusesFromComputers(): Stats { val stats = Stats() - if (cityInfo.civInfo.tech.getUniques().contains("+10% science and production in all cities")) { + if (cityInfo.civInfo.tech.getTechUniques().contains("+10% science and production in all cities")) { stats.production += 10f stats.science += 10f } diff --git a/core/src/com/unciv/logic/city/IConstruction.kt b/core/src/com/unciv/logic/city/IConstruction.kt index e73e85e4f5..d10c18deaa 100644 --- a/core/src/com/unciv/logic/city/IConstruction.kt +++ b/core/src/com/unciv/logic/city/IConstruction.kt @@ -24,12 +24,12 @@ open class SpecialConstruction(override var name: String, override val descripti fun getSpecialConstructions(): List { val science = object:SpecialConstruction("Science", "Convert production to science at a rate of 4 to 1"){ override fun isBuildable(construction: CityConstructions): Boolean { - return construction.cityInfo.civInfo.tech.getUniques().contains("Enables conversion of city production to science") + return construction.cityInfo.civInfo.tech.getTechUniques().contains("Enables conversion of city production to science") } } val gold = object:SpecialConstruction("Gold", "Convert production to gold at a rate of 4 to 1"){ override fun isBuildable(construction: CityConstructions): Boolean { - return construction.cityInfo.civInfo.tech.getUniques().contains("Enables conversion of city production to gold") + return construction.cityInfo.civInfo.tech.getTechUniques().contains("Enables conversion of city production to gold") } } val idle = object:SpecialConstruction("Nothing", "The city will not produce anything."){ diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index f80995729e..85fdb663a6 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -63,7 +63,7 @@ class TechManager { return GameBasics.Technologies[TechName]!!.prerequisites.all { isResearched(it) } } - fun getUniques() = researchedTechUniques + fun getTechUniques() = researchedTechUniques //endregion diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 9ff5c86c10..b5ddd8dc21 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -209,7 +209,7 @@ class MapUnit { fun getEmbarkedMovement(): Int { var movement=2 - movement += civInfo.tech.getUniques().count { it == "Increases embarked movement +1" } + movement += civInfo.tech.getTechUniques().count { it == "Increases embarked movement +1" } return movement } diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index de8577499e..7edc2a4b85 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -25,7 +25,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) { if (from.roadStatus !== RoadStatus.None && to.roadStatus !== RoadStatus.None) //Road { - if (unit.civInfo.tech.getUniques().contains("Improves movement speed on roads")) return 1 / 3f + if (unit.civInfo.tech.getTechUniques().contains("Improves movement speed on roads")) return 1 / 3f else return 1 / 2f } if (unit.ignoresTerrainCost) return 1f diff --git a/core/src/com/unciv/logic/trade/TradeLogic.kt b/core/src/com/unciv/logic/trade/TradeLogic.kt index 605ce545a1..c666c1cbff 100644 --- a/core/src/com/unciv/logic/trade/TradeLogic.kt +++ b/core/src/com/unciv/logic/trade/TradeLogic.kt @@ -16,8 +16,12 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci val offers = TradeOffersList() if(civInfo.isAtWarWith(otherCivilization)) offers.add(TradeOffer("Peace Treaty", TradeType.Treaty, 20)) - if(!otherCivilization.getDiplomacyManager(civInfo).hasOpenBorders()) + + if(!otherCivilization.getDiplomacyManager(civInfo).hasOpenBorders() + && civInfo.tech.getTechUniques().contains("Enables Open Borders agreements") + && otherCivilization.tech.getTechUniques().contains("Enables Open Borders agreements")) offers.add(TradeOffer("Open Borders", TradeType.Agreement, 30)) + for(entry in civInfo.getCivResources().filterNot { it.key.resourceType == ResourceType.Bonus }) { val resourceTradeType = if(entry.key.resourceType== ResourceType.Luxury) TradeType.Luxury_Resource else TradeType.Strategic_Resource diff --git a/core/src/com/unciv/ui/worldscreen/TradePopup.kt b/core/src/com/unciv/ui/worldscreen/TradePopup.kt index 1caf2d1e86..ebef676267 100644 --- a/core/src/com/unciv/ui/worldscreen/TradePopup.kt +++ b/core/src/com/unciv/ui/worldscreen/TradePopup.kt @@ -46,7 +46,7 @@ class TradePopup(worldScreen: WorldScreen): PopupTable(worldScreen){ add(otherCivLeaderName.toLabel()).colspan(2) addSeparator() addGoodSizedLabel("Excellent!").row() - addButton("Goodbye."){ + addButton("Farewell."){ this.remove() worldScreen.shouldUpdate=true // in all cases, worldScreen.shouldUpdate should be set to true when we remove the last of the popups diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 216ee1992a..717d263742 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -324,7 +324,7 @@ class WorldScreen : CameraStageBaseScreen() { displayTutorials("ApolloProgram") if(currentPlayerCiv.getCivUnits().any { it.type == UnitType.Siege }) displayTutorials("SiegeUnitTrained") - if(currentPlayerCiv.tech.getUniques().contains("Enables embarkation for land units")) + if(currentPlayerCiv.tech.getTechUniques().contains("Enables embarkation for land units")) displayTutorials("CanEmbark") }