Merge remote-tracking branch 'upstream/master'

update
This commit is contained in:
YueR 2019-10-05 11:42:12 +08:00
commit 6477e85795
9 changed files with 68 additions and 55 deletions

View file

@ -58,8 +58,8 @@
greatPersonPoints:{science:1},
isWonder:true,
providesFreeBuilding: "Library",
freeTechs:1,
requiredTech:"Writing"
uniques:["Free Technology"],
quote:"'Libraries are as the shrine where all the relics of the ancient saints, full of true virtue, and all that without delusion or imposture are preserved and reposed.' - Sir Francis Bacon"
},
{
@ -429,10 +429,10 @@
name:"Oxford University",
science:3,
culture:1,
freeTechs:1,
isNationalWonder:true,
percentStatBonus:{science:50},
requiredBuildingInAllCities:"University",
uniques:["Free Technology"],
requiredTech:"Education"
},
/*

View file

@ -151,6 +151,9 @@
German:"Die Große Bibliothek"
Polish:"Wielka Biblioteka"
}
"Free Technology":{
}
"'Libraries are as the shrine where all the relics of the ancient saints, full of true virtue, and all that without delusion or imposture are preserved and reposed.' - Sir Francis Bacon":{
Italian:"'Le biblioteche sono come una cappella in cui sono conservate e protette tutte le reliquie dei santi antichi, colme di vera virtù, e tutto ciò che è privo di illusione e inganno' - Sir Francis Bacon"

View file

@ -689,7 +689,7 @@
German:"Der Verhandlungstisch ist leer"
}
"Peace treaty":{
"Peace Treaty":{//Corrected
Italian:"Trattato di pace"
Russian:"Мирный договор"
French:"Traité de paix"
@ -762,6 +762,10 @@
Russian:"Представиться [nation]"
}
"Declare war on [nation]":{
Italian:"Dichiara guerra a [nation]"
}
"Luxury resources":{
Italian:"Risorse di lusso"
French:"Ressources de luxes"

View file

@ -604,7 +604,7 @@
}
"+33% culture in all cities with a world wonder, immediately enter a golden age":{
Italian:"+33% Cultura in tutte le città con una Meraviglia Mondiale, e avvio di un'Età dell'Oro"
Italian:"+33% Cultura in tutte le città con una Meraviglia Mondiale, e avvio immediato di un'Età dell'Oro"
Russian:"+33% культуры во всех городах с чудом света, начинает в державе золотой век"
Romanian:"+33% cultură în toate orașele cu minuni, intră imediat în epoca de aur"
Spanish:"+33% cultura en todas las ciudades con una Maravilla. Inmediatamente entras en una Edad de Oro"
@ -757,7 +757,7 @@
}
"Maintenance on roads & railroads reduced by 33%, +2 gold from all trade routes":{
Italian:"-33% mantenimento in Oro su strade e ferrovie, +2 oro per ogni rotta commerciale"//you forgot to translate this
Italian:"-33% mantenimento in Oro per strade e ferrovie, +2 oro per ogni rotta commerciale"
Russian:"Стоимость содержания дорог и железных дорог уменьшена на 33%, +2 золота от всех торговых маршрутов"
Romanian:"Întreținerea drumurilor și a căilor ferate redusă cu 33%, +2 aur din toate rutele comerciale"
Spanish:"Mantenimiento de carreteras y líneas de ferrocarril reducido un 33%, +2 oro de todas las rutas comerciales"
@ -823,7 +823,7 @@
}
"Cost of purchasing culture buildings reduced by 50%":{
Italian:"-50% costi di per l'acquisto delle strutture culturali"
Italian:"-50% costi per l'acquisto degli edifici culturali"
Russian:"Цена покупки культурных строений уменьшена на 50%"
Romanian:"Costul clădirilor de cultură redus cu 50%"
Spanish:"Coste de comprar edificios de cultura reducido un 50%"
@ -1001,7 +1001,7 @@
}
"Gain 2 free technologies":{
Italian:"Consente di scoprite due Tecnologie gratuite"
Italian:"Consente di scoprire due Tecnologie gratuite"
Russian:"Даёт 2 бесплатные технологии"
Romanian:"Obține 2 tehnologii gratuite"
Spanish:"Ganas 2 tecnologías gratis"
@ -1270,7 +1270,7 @@
"Quantity of strategic resources produced by the empire increased by 100%":{
Spanish:"El imperio produce un +100% de recursos estrategicos"
Italian:"L'impero incrementa del 100% la quantità delle risorse strategiche possedute, raddoppiandole"
Italian:"L'impero raddoppia la quantità delle risorse strategiche che possiede"
Romanian:"Resursele strategice produse de imperiu crescute cu 100%"
Simplified_Chinese:"帝国生产的战略资源+100%"
Portuguese:"Quantidade de recursos estratégicos produzidos pelo império incrementado em 100%"

View file

@ -222,6 +222,15 @@ class GameInfo {
// As of 2.16.1, changed Colloseum to 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()

View file

@ -122,8 +122,7 @@ class TradeEvaluation{
* civInfo.gameInfo.gameParameters.gameSpeed.getModifier()).toInt()*20
TradeType.Introduction -> return 250
TradeType.WarDeclaration -> {
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(offer.name)
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
if(civInfo.isAtWarWith(civToDeclareWarOn)){
@ -193,8 +192,7 @@ class TradeEvaluation{
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
TradeType.Introduction -> return 250
TradeType.WarDeclaration -> {
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(offer.name)
val threatToUs = Automation().threatAssessment(civInfo, civToDeclareWarOn)
when (threatToUs) {

View file

@ -55,7 +55,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
.filter { !otherCivilization.diplomacy.containsKey(it.civName) && !it.isDefeated() }
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()) {
@ -64,7 +64,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
val civsWeArentAtWarWith = civsWeBothKnow
.filter { civInfo.getDiplomacyManager(it).diplomaticStatus == DiplomaticStatus.Peace }
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) {
to.tech.addTechnology(offer.name)
}
if(offer.type== TradeType.City){
val city = from.cities.first { it.name==offer.name }
if (offer.type == TradeType.City) {
val city = from.cities.first { it.name == offer.name }
city.moveToCiv(to)
city.getCenterTile().getUnits().forEach { it.movement.teleportToClosestMoveableTile() }
to.updateViewableTiles()
from.updateViewableTiles()
}
if(offer.type== TradeType.Treaty){
if(offer.name==Constants.peaceTreaty) to.getDiplomacyManager(from).makePeace()
if (offer.type == TradeType.Treaty) {
if (offer.name == Constants.peaceTreaty) to.getDiplomacyManager(from).makePeace()
}
if(offer.type==TradeType.Introduction)
to.meetCivilization(to.gameInfo.getCivilization(offer.name.removePrefix("Introduction to " )))
if (offer.type == TradeType.Introduction)
to.meetCivilization(to.gameInfo.getCivilization(offer.name))
if(offer.type==TradeType.WarDeclaration){
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
if (offer.type == TradeType.WarDeclaration) {
val nameOfCivToDeclareWarOn = offer.name
from.getDiplomacyManager(nameOfCivToDeclareWarOn).declareWar()
}
}
@ -113,8 +113,8 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
to.updateDetailedCivResources()
}
transferTrade(ourCivilization,otherCivilization,currentTrade)
transferTrade(otherCivilization,ourCivilization,currentTrade.reverse())
transferTrade(ourCivilization, otherCivilization, currentTrade)
transferTrade(otherCivilization, ourCivilization, currentTrade.reverse())
}
}

View file

@ -15,8 +15,12 @@ data class TradeOffer(var name:String, var type: TradeType,
fun getOfferText(): String {
var offerText = name.tr()
if (type !in tradesToNotHaveNumbers) offerText += " (" + amount + ")"
var offerText = when(type){
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()
return offerText
}

View file

@ -39,10 +39,7 @@ class Building : NamedStats(), IConstruction{
var replaces:String?=null
var uniqueTo:String?=null
var quote:String=""
// Uniques
private var providesFreeBuilding: String? = null
var freeTechs: Int = 0
var uniques = ArrayList<String>()
@ -338,34 +335,32 @@ class Building : NamedStats(), IConstruction{
construction.addBuilding(buildingToAdd)
}
when {
"Empire enters golden age" in uniques -> civInfo.goldenAges.enterGoldenAge()
"Free Great Artist Appears" in uniques -> civInfo.addGreatPerson("Great Artist", construction.cityInfo)
"Free great scientist appears" in uniques -> civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
"2 free great scientists appear" in uniques -> {
civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
}
"Provides 2 free workers" in uniques -> {
civInfo.placeUnitNearTile(construction.cityInfo.location, Constants.worker)
civInfo.placeUnitNearTile(construction.cityInfo.location, Constants.worker)
}
"Free Social Policy" in uniques -> civInfo.policies.freePolicies++
"Free Great Person" in uniques -> {
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
else civInfo.addGreatPerson(GameBasics.Units.keys.filter { it.startsWith("Great") }.random())
}
"+1 population in each city" in uniques -> {
for(city in civInfo.cities){
city.population.population += 1
city.population.autoAssignPopulation()
}
}
"Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)" in uniques ->
civInfo.updateHasActiveGreatWall()
if ("Empire enters golden age" in uniques) civInfo.goldenAges.enterGoldenAge()
if ("Free Great Artist Appears" in uniques) civInfo.addGreatPerson("Great Artist", construction.cityInfo)
if ("Free great scientist appears" in uniques) civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
if ("2 free great scientists appear" in uniques) {
civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
civInfo.addGreatPerson("Great Scientist", construction.cityInfo)
}
if ("Provides 2 free workers" in uniques) {
civInfo.placeUnitNearTile(construction.cityInfo.location, Constants.worker)
civInfo.placeUnitNearTile(construction.cityInfo.location, Constants.worker)
}
if ("Free Social Policy" in uniques) civInfo.policies.freePolicies++
if ("Free Great Person" in uniques) {
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
else civInfo.addGreatPerson(GameBasics.Units.keys.filter { it.startsWith("Great") }.random())
}
if ("+1 population in each city" in uniques) {
for(city in civInfo.cities){
city.population.population += 1
city.population.autoAssignPopulation()
}
}
if ("Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)" in uniques)
civInfo.updateHasActiveGreatWall()
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs
if("Free Technology" in uniques) civInfo.tech.freeTechs += 1
}
fun isStatRelated(stat: Stat): Boolean {