Readded city state select box

This commit is contained in:
Yair Morgenstern 2019-08-15 20:41:28 +03:00
parent 365cb6f1b9
commit 9a4722b6b9
3 changed files with 12 additions and 11 deletions

View File

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

View File

@ -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<String>? = null
var cannotBeBuiltWith: String? = null
private var requiredNearbyImprovedResources: List<String>? = 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<String>()
@ -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")

View File

@ -21,6 +21,7 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters): Table(Ca
addMapTypeSizeAndFile()
addDifficultySelectBox()
addGameSpeedSelectBox()
addCityStatesSelectBox()
addVictoryTypeCheckboxes()
addBarbariansCheckbox()