mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 13:49:54 +07:00
"Introduction to X" and "Declare war on X" trade items are now only X, adding the extra text on UI display - this makes them translatable
This commit is contained in:
@ -222,6 +222,15 @@ class GameInfo {
|
|||||||
// As of 2.16.1, changed Colloseum to Colosseum
|
// As of 2.16.1, changed Colloseum to Colosseum
|
||||||
changeBuildingName(cityConstructions, "Colloseum", "Colosseum")
|
changeBuildingName(cityConstructions, "Colloseum", "Colosseum")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This doesn't HAVE to go here, but why not.
|
||||||
|
// As of version 3.1.3, trade offers of "Declare war on X" and "Introduction to X" were changed to X,
|
||||||
|
// with the extra text being added only on UI display (solved a couple of problems).
|
||||||
|
for(trade in civInfo.tradeRequests.map { it.trade })
|
||||||
|
for(offer in trade.theirOffers.union(trade.ourOffers)){
|
||||||
|
offer.name = offer.name.removePrefix("Declare war on ")
|
||||||
|
offer.name = offer.name.removePrefix("Introduction to ")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (civInfo in civilizations) civInfo.setNationTransient()
|
for (civInfo in civilizations) civInfo.setNationTransient()
|
||||||
|
@ -122,8 +122,7 @@ class TradeEvaluation{
|
|||||||
* civInfo.gameInfo.gameParameters.gameSpeed.getModifier()).toInt()*20
|
* civInfo.gameInfo.gameParameters.gameSpeed.getModifier()).toInt()*20
|
||||||
TradeType.Introduction -> return 250
|
TradeType.Introduction -> return 250
|
||||||
TradeType.WarDeclaration -> {
|
TradeType.WarDeclaration -> {
|
||||||
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
|
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(offer.name)
|
||||||
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
|
||||||
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
|
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
|
||||||
|
|
||||||
if(civInfo.isAtWarWith(civToDeclareWarOn)){
|
if(civInfo.isAtWarWith(civToDeclareWarOn)){
|
||||||
@ -193,8 +192,7 @@ class TradeEvaluation{
|
|||||||
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
||||||
TradeType.Introduction -> return 250
|
TradeType.Introduction -> return 250
|
||||||
TradeType.WarDeclaration -> {
|
TradeType.WarDeclaration -> {
|
||||||
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
|
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(offer.name)
|
||||||
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
|
||||||
val threatToUs = Automation().threatAssessment(civInfo, civToDeclareWarOn)
|
val threatToUs = Automation().threatAssessment(civInfo, civToDeclareWarOn)
|
||||||
|
|
||||||
when (threatToUs) {
|
when (threatToUs) {
|
||||||
|
@ -55,7 +55,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
|||||||
.filter { !otherCivilization.diplomacy.containsKey(it.civName) && !it.isDefeated() }
|
.filter { !otherCivilization.diplomacy.containsKey(it.civName) && !it.isDefeated() }
|
||||||
|
|
||||||
for (thirdCiv in civsWeKnowAndTheyDont) {
|
for (thirdCiv in civsWeKnowAndTheyDont) {
|
||||||
offers.add(TradeOffer("Introduction to " + thirdCiv.civName, TradeType.Introduction, 0))
|
offers.add(TradeOffer(thirdCiv.civName, TradeType.Introduction, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!civInfo.isCityState() && !otherCivilization.isCityState()) {
|
if (!civInfo.isCityState() && !otherCivilization.isCityState()) {
|
||||||
@ -64,7 +64,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
|||||||
val civsWeArentAtWarWith = civsWeBothKnow
|
val civsWeArentAtWarWith = civsWeBothKnow
|
||||||
.filter { civInfo.getDiplomacyManager(it).diplomaticStatus == DiplomaticStatus.Peace }
|
.filter { civInfo.getDiplomacyManager(it).diplomaticStatus == DiplomaticStatus.Peace }
|
||||||
for (thirdCiv in civsWeArentAtWarWith) {
|
for (thirdCiv in civsWeArentAtWarWith) {
|
||||||
offers.add(TradeOffer("Declare war on " + thirdCiv.civName, TradeType.WarDeclaration, 0))
|
offers.add(TradeOffer(thirdCiv.civName, TradeType.WarDeclaration, 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,21 +91,21 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
|||||||
if (offer.type == TradeType.Technology) {
|
if (offer.type == TradeType.Technology) {
|
||||||
to.tech.addTechnology(offer.name)
|
to.tech.addTechnology(offer.name)
|
||||||
}
|
}
|
||||||
if(offer.type== TradeType.City){
|
if (offer.type == TradeType.City) {
|
||||||
val city = from.cities.first { it.name==offer.name }
|
val city = from.cities.first { it.name == offer.name }
|
||||||
city.moveToCiv(to)
|
city.moveToCiv(to)
|
||||||
city.getCenterTile().getUnits().forEach { it.movement.teleportToClosestMoveableTile() }
|
city.getCenterTile().getUnits().forEach { it.movement.teleportToClosestMoveableTile() }
|
||||||
to.updateViewableTiles()
|
to.updateViewableTiles()
|
||||||
from.updateViewableTiles()
|
from.updateViewableTiles()
|
||||||
}
|
}
|
||||||
if(offer.type== TradeType.Treaty){
|
if (offer.type == TradeType.Treaty) {
|
||||||
if(offer.name==Constants.peaceTreaty) to.getDiplomacyManager(from).makePeace()
|
if (offer.name == Constants.peaceTreaty) to.getDiplomacyManager(from).makePeace()
|
||||||
}
|
}
|
||||||
if(offer.type==TradeType.Introduction)
|
if (offer.type == TradeType.Introduction)
|
||||||
to.meetCivilization(to.gameInfo.getCivilization(offer.name.removePrefix("Introduction to " )))
|
to.meetCivilization(to.gameInfo.getCivilization(offer.name))
|
||||||
|
|
||||||
if(offer.type==TradeType.WarDeclaration){
|
if (offer.type == TradeType.WarDeclaration) {
|
||||||
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
|
val nameOfCivToDeclareWarOn = offer.name
|
||||||
from.getDiplomacyManager(nameOfCivToDeclareWarOn).declareWar()
|
from.getDiplomacyManager(nameOfCivToDeclareWarOn).declareWar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,8 +113,8 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
|||||||
to.updateDetailedCivResources()
|
to.updateDetailedCivResources()
|
||||||
}
|
}
|
||||||
|
|
||||||
transferTrade(ourCivilization,otherCivilization,currentTrade)
|
transferTrade(ourCivilization, otherCivilization, currentTrade)
|
||||||
transferTrade(otherCivilization,ourCivilization,currentTrade.reverse())
|
transferTrade(otherCivilization, ourCivilization, currentTrade.reverse())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,12 @@ data class TradeOffer(var name:String, var type: TradeType,
|
|||||||
|
|
||||||
|
|
||||||
fun getOfferText(): String {
|
fun getOfferText(): String {
|
||||||
var offerText = name.tr()
|
var offerText = when(type){
|
||||||
if (type !in tradesToNotHaveNumbers) offerText += " (" + amount + ")"
|
TradeType.WarDeclaration -> "Declare war on [$name]"
|
||||||
|
TradeType.Introduction -> "Introduction to [$name]"
|
||||||
|
else -> name
|
||||||
|
}.tr()
|
||||||
|
if (type !in tradesToNotHaveNumbers) offerText += " ($amount)"
|
||||||
if (duration > 0) offerText += "\n" + duration + " {turns}".tr()
|
if (duration > 0) offerText += "\n" + duration + " {turns}".tr()
|
||||||
return offerText
|
return offerText
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,6 @@ class Building : NamedStats(), IConstruction{
|
|||||||
var replaces:String?=null
|
var replaces:String?=null
|
||||||
var uniqueTo:String?=null
|
var uniqueTo:String?=null
|
||||||
var quote:String=""
|
var quote:String=""
|
||||||
|
|
||||||
// Uniques
|
|
||||||
private var providesFreeBuilding: String? = null
|
private var providesFreeBuilding: String? = null
|
||||||
var uniques = ArrayList<String>()
|
var uniques = ArrayList<String>()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user