Open Borders is now only available with Civil Service, as per Civ V

This commit is contained in:
Yair Morgenstern 2019-04-24 11:31:50 +03:00
parent c81c81fe8f
commit 07a8b97ed2
11 changed files with 26 additions and 21 deletions

View File

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

View File

@ -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!"
@ -4843,6 +4838,11 @@ Simplified_Chinese:"[adjective]帝国的[leaderName]"
French:"Adieu."
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"

View File

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

View File

@ -24,12 +24,12 @@ open class SpecialConstruction(override var name: String, override val descripti
fun getSpecialConstructions(): List<SpecialConstruction> {
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."){

View File

@ -63,7 +63,7 @@ class TechManager {
return GameBasics.Technologies[TechName]!!.prerequisites.all { isResearched(it) }
}
fun getUniques() = researchedTechUniques
fun getTechUniques() = researchedTechUniques
//endregion

View File

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

View File

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

View File

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

View File

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

View File

@ -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")
}