Oligarchy policy now works as intended

More translation stuff
This commit is contained in:
Yair Morgenstern 2018-06-25 23:11:22 +03:00
parent 4bbffe318b
commit 805fc5c739
6 changed files with 12 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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