From 805fc5c7395692bce9a0b5c391c1b8a09cb114e7 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 25 Jun 2018 23:11:22 +0300 Subject: [PATCH] Oligarchy policy now works as intended More translation stuff --- android/assets/jsons/Policies.json | 2 +- android/assets/jsons/Translations.json | 4 ++-- core/src/com/unciv/logic/city/CityStats.kt | 2 +- core/src/com/unciv/logic/civilization/CivilizationInfo.kt | 4 +++- core/src/com/unciv/models/gamebasics/Building.kt | 4 ++-- core/src/com/unciv/models/gamebasics/unit/Unit.kt | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/android/assets/jsons/Policies.json b/android/assets/jsons/Policies.json index 56183010f6..f24f2c09f0 100644 --- a/android/assets/jsons/Policies.json +++ b/android/assets/jsons/Policies.json @@ -18,7 +18,7 @@ }, { name:"Oligarchy", - description:"Improves garrisons in cities - useless at this time, change to what?", + description:"Units in cities cost no maintainance", row:1, column:5 }, diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index b247814fae..5665d384b7 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -783,7 +783,7 @@ "Desert":{ Italian:"Deserto" - Russian:"Пустынный" + Russian:"Пустыня" French:"Désert" Romanian:"Deşert" German:"Wüste" @@ -799,7 +799,7 @@ "Hill":{ Italian:"Collina" - Russian:"Bозвышенность" + Russian:"Холм" French:"Colline" German:"Hügel" } diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index afe5ec15ae..51884f43b2 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -104,7 +104,7 @@ class CityStats { unhappinessFromCitizens -= cityInfo.population.getNumberOfSpecialists() * 0.5f if (civInfo.buildingUniques.contains("Unhappiness from population decreased by 10%")) unhappinessFromCitizens *= 0.9f - if (civInfo.policies.isAdopted("Aristocracy")) + if (civInfo.policies.isAdopted("Meritocracy")) unhappinessFromCitizens *= 0.95f happinessList["Population"]=-unhappinessFromCitizens diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index f767c96d78..5cf74f6758 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -72,7 +72,9 @@ class CivilizationInfo { private fun getUnitUpkeep(): Int { val baseUnitCost = 0.5f val freeUnits = 3 - val totalPaidUnits = max(0,getCivUnits().count()-freeUnits) + var unitsToPayFor = getCivUnits() + if(policies.isAdopted("Oligarchy")) unitsToPayFor = unitsToPayFor.filterNot { it.getTile().isCityCenter() } + val totalPaidUnits = max(0,unitsToPayFor.count()-freeUnits) val gameProgress = gameInfo.turns/400f // as game progresses maintainance cost rises val cost = baseUnitCost*totalPaidUnits*(1+gameProgress) val finalCost = cost.pow(1+gameProgress/3) // Why 3? No reason. diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 32ad35eb11..3987e34a2f 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -108,7 +108,7 @@ class Building : NamedStats(), IConstruction{ stringBuilder.appendln("Requires a $requiredBuildingInAllCities to be built in all cities") if (providesFreeBuilding != null) stringBuilder.appendln("Provides a free $providesFreeBuilding in this city") - if(baseDescription!=null) stringBuilder.appendln(baseDescription) + if(unique!=null) stringBuilder.appendln(unique!!.tr()) if (stats.toString() != "") stringBuilder.appendln(stats) if (this.percentStatBonus != null) { @@ -127,7 +127,7 @@ class Building : NamedStats(), IConstruction{ } if (resourceBonusStats != null) { val resources = GameBasics.TileResources.values.filter { name == it.building }.joinToString { it.name.tr() } - stringBuilder.appendln("$resources {provide} $resourceBonusStats") + stringBuilder.appendln("$resources {provide} $resourceBonusStats".tr()) } if(cityStrength!=0) stringBuilder.appendln("{City strength} +".tr() + cityStrength) diff --git a/core/src/com/unciv/models/gamebasics/unit/Unit.kt b/core/src/com/unciv/models/gamebasics/unit/Unit.kt index f20840cf53..19d260018b 100644 --- a/core/src/com/unciv/models/gamebasics/unit/Unit.kt +++ b/core/src/com/unciv/models/gamebasics/unit/Unit.kt @@ -86,8 +86,8 @@ class Unit : INamed, IConstruction, ICivilopedia { if (unbuildable) return false if (requiredTech!=null && !civInfo.tech.isResearched(requiredTech!!)) return false if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return false - if(uniqueTo!=null && uniqueTo!=civInfo.civName) return false - if(GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return false + if (uniqueTo!=null && uniqueTo!=civInfo.civName) return false + if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return false if (requiredResource!=null && !civInfo.getCivResources().keys.any { it.name == requiredResource }) return false return true } @@ -102,4 +102,4 @@ class Unit : INamed, IConstruction, ICivilopedia { } override fun toString(): String = name -} // for json parsing, we need to have a default constructor +}