mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Readded city state select box
This commit is contained in:
parent
365cb6f1b9
commit
9a4722b6b9
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 285
|
versionCode 286
|
||||||
versionName "2.19.4"
|
versionName "2.19.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -8,6 +8,7 @@ import com.unciv.models.gamebasics.tech.Technology
|
|||||||
import com.unciv.models.stats.NamedStats
|
import com.unciv.models.stats.NamedStats
|
||||||
import com.unciv.models.stats.Stat
|
import com.unciv.models.stats.Stat
|
||||||
import com.unciv.models.stats.Stats
|
import com.unciv.models.stats.Stats
|
||||||
|
import kotlin.math.pow
|
||||||
|
|
||||||
class Building : NamedStats(), IConstruction{
|
class Building : NamedStats(), IConstruction{
|
||||||
|
|
||||||
@ -18,20 +19,20 @@ class Building : NamedStats(), IConstruction{
|
|||||||
|
|
||||||
var cost: Int = 0
|
var cost: Int = 0
|
||||||
var maintenance = 0
|
var maintenance = 0
|
||||||
var percentStatBonus: Stats? = null
|
private var percentStatBonus: Stats? = null
|
||||||
var specialistSlots: Stats? = null
|
var specialistSlots: Stats? = null
|
||||||
var greatPersonPoints: Stats? = null
|
var greatPersonPoints: Stats? = null
|
||||||
/** Extra cost percentage when purchasing */
|
/** Extra cost percentage when purchasing */
|
||||||
var hurryCostModifier: Int = 0
|
private var hurryCostModifier = 0
|
||||||
var isWonder = false
|
var isWonder = false
|
||||||
var isNationalWonder = false
|
var isNationalWonder = false
|
||||||
var requiredBuilding: String? = null
|
private var requiredBuilding: String? = null
|
||||||
var requiredBuildingInAllCities: String? = null
|
var requiredBuildingInAllCities: String? = null
|
||||||
/** A strategic resource that will be consumed by this building */
|
/** A strategic resource that will be consumed by this building */
|
||||||
var requiredResource: String? = null
|
var requiredResource: String? = null
|
||||||
/** City can only be built if one of these resources is nearby - it must be improved! */
|
/** City can only be built if one of these resources is nearby - it must be improved! */
|
||||||
var requiredNearbyImprovedResources: List<String>? = null
|
private var requiredNearbyImprovedResources: List<String>? = null
|
||||||
var cannotBeBuiltWith: String? = null
|
private var cannotBeBuiltWith: String? = null
|
||||||
var cityStrength=0
|
var cityStrength=0
|
||||||
var cityHealth=0
|
var cityHealth=0
|
||||||
var xpForNewUnits=0
|
var xpForNewUnits=0
|
||||||
@ -39,7 +40,7 @@ class Building : NamedStats(), IConstruction{
|
|||||||
var uniqueTo:String?=null
|
var uniqueTo:String?=null
|
||||||
|
|
||||||
// Uniques
|
// Uniques
|
||||||
var providesFreeBuilding: String? = null
|
private var providesFreeBuilding: String? = null
|
||||||
var freeTechs: Int = 0
|
var freeTechs: Int = 0
|
||||||
var uniques = ArrayList<String>()
|
var uniques = ArrayList<String>()
|
||||||
|
|
||||||
@ -123,7 +124,7 @@ class Building : NamedStats(), IConstruction{
|
|||||||
return stringBuilder.toString().trim()
|
return stringBuilder.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
val cultureBuildings = hashSetOf("Monument", "Temple", "Monastery")
|
private val cultureBuildings = hashSetOf("Monument", "Temple", "Monastery")
|
||||||
|
|
||||||
fun getStats(civInfo: CivilizationInfo?): Stats {
|
fun getStats(civInfo: CivilizationInfo?): Stats {
|
||||||
val stats = this.clone()
|
val stats = this.clone()
|
||||||
@ -196,8 +197,7 @@ class Building : NamedStats(), IConstruction{
|
|||||||
|
|
||||||
override fun getGoldCost(civInfo: CivilizationInfo): Int {
|
override fun getGoldCost(civInfo: CivilizationInfo): Int {
|
||||||
// https://forums.civfanatics.com/threads/rush-buying-formula.393892/
|
// https://forums.civfanatics.com/threads/rush-buying-formula.393892/
|
||||||
var cost: Double
|
var cost = (30 * getProductionCost(civInfo)).toDouble().pow(0.75) * (1 + hurryCostModifier / 100)
|
||||||
cost = Math.pow((30 * getProductionCost(civInfo)).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
|
||||||
if (civInfo.policies.isAdopted("Mercantilism")) cost *= 0.75
|
if (civInfo.policies.isAdopted("Mercantilism")) cost *= 0.75
|
||||||
if (civInfo.containsBuildingUnique("-15% to purchasing items in cities")) cost *= 0.85
|
if (civInfo.containsBuildingUnique("-15% to purchasing items in cities")) cost *= 0.85
|
||||||
if (civInfo.policies.isAdopted("Patronage")
|
if (civInfo.policies.isAdopted("Patronage")
|
||||||
|
@ -21,6 +21,7 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters): Table(Ca
|
|||||||
addMapTypeSizeAndFile()
|
addMapTypeSizeAndFile()
|
||||||
addDifficultySelectBox()
|
addDifficultySelectBox()
|
||||||
addGameSpeedSelectBox()
|
addGameSpeedSelectBox()
|
||||||
|
addCityStatesSelectBox()
|
||||||
addVictoryTypeCheckboxes()
|
addVictoryTypeCheckboxes()
|
||||||
addBarbariansCheckbox()
|
addBarbariansCheckbox()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user