From 9a4722b6b92ec74ed3dbb9435578e2181b2ef4c4 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 15 Aug 2019 20:41:28 +0300 Subject: [PATCH] Readded city state select box --- android/build.gradle | 4 ++-- .../com/unciv/models/gamebasics/Building.kt | 18 +++++++++--------- .../newgamescreen/NewGameScreenOptionsTable.kt | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index f3651aa430..efc23dfc93 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 285 - versionName "2.19.4" + versionCode 286 + versionName "2.19.5" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 4544903748..3f282ded28 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -8,6 +8,7 @@ import com.unciv.models.gamebasics.tech.Technology import com.unciv.models.stats.NamedStats import com.unciv.models.stats.Stat import com.unciv.models.stats.Stats +import kotlin.math.pow class Building : NamedStats(), IConstruction{ @@ -18,20 +19,20 @@ class Building : NamedStats(), IConstruction{ var cost: Int = 0 var maintenance = 0 - var percentStatBonus: Stats? = null + private var percentStatBonus: Stats? = null var specialistSlots: Stats? = null var greatPersonPoints: Stats? = null /** Extra cost percentage when purchasing */ - var hurryCostModifier: Int = 0 + private var hurryCostModifier = 0 var isWonder = false var isNationalWonder = false - var requiredBuilding: String? = null + private var requiredBuilding: String? = null var requiredBuildingInAllCities: String? = null /** A strategic resource that will be consumed by this building */ var requiredResource: String? = null /** City can only be built if one of these resources is nearby - it must be improved! */ - var requiredNearbyImprovedResources: List? = null - var cannotBeBuiltWith: String? = null + private var requiredNearbyImprovedResources: List? = null + private var cannotBeBuiltWith: String? = null var cityStrength=0 var cityHealth=0 var xpForNewUnits=0 @@ -39,7 +40,7 @@ class Building : NamedStats(), IConstruction{ var uniqueTo:String?=null // Uniques - var providesFreeBuilding: String? = null + private var providesFreeBuilding: String? = null var freeTechs: Int = 0 var uniques = ArrayList() @@ -123,7 +124,7 @@ class Building : NamedStats(), IConstruction{ return stringBuilder.toString().trim() } - val cultureBuildings = hashSetOf("Monument", "Temple", "Monastery") + private val cultureBuildings = hashSetOf("Monument", "Temple", "Monastery") fun getStats(civInfo: CivilizationInfo?): Stats { val stats = this.clone() @@ -196,8 +197,7 @@ class Building : NamedStats(), IConstruction{ override fun getGoldCost(civInfo: CivilizationInfo): Int { // https://forums.civfanatics.com/threads/rush-buying-formula.393892/ - var cost: Double - cost = Math.pow((30 * getProductionCost(civInfo)).toDouble(), 0.75) * (1 + hurryCostModifier / 100) + var cost = (30 * getProductionCost(civInfo)).toDouble().pow(0.75) * (1 + hurryCostModifier / 100) if (civInfo.policies.isAdopted("Mercantilism")) cost *= 0.75 if (civInfo.containsBuildingUnique("-15% to purchasing items in cities")) cost *= 0.85 if (civInfo.policies.isAdopted("Patronage") diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt index 175d642b99..c982721b08 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt @@ -21,6 +21,7 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters): Table(Ca addMapTypeSizeAndFile() addDifficultySelectBox() addGameSpeedSelectBox() + addCityStatesSelectBox() addVictoryTypeCheckboxes() addBarbariansCheckbox()