mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -04:00
Split Strat Balance and Legend Start into its own checkbox (#11081)
This commit is contained in:
parent
d6abd3a941
commit
91400a2298
@ -171,6 +171,8 @@ class MapParameters : IsPartOfGameInfoSerialization {
|
||||
var noRuins = false
|
||||
var noNaturalWonders = false
|
||||
var worldWrap = false
|
||||
var strategicBalance = false
|
||||
var legendaryStart = false
|
||||
|
||||
/** This is used mainly for the map editor, so you can continue editing a map under the same ruleset you started with */
|
||||
var mods = LinkedHashSet<String>()
|
||||
@ -201,6 +203,8 @@ class MapParameters : IsPartOfGameInfoSerialization {
|
||||
it.noRuins = noRuins
|
||||
it.noNaturalWonders = noNaturalWonders
|
||||
it.worldWrap = worldWrap
|
||||
it.strategicBalance = strategicBalance
|
||||
it.legendaryStart = legendaryStart
|
||||
it.mods = LinkedHashSet(mods)
|
||||
it.baseRuleset = baseRuleset
|
||||
it.seed = seed
|
||||
@ -256,6 +260,8 @@ class MapParameters : IsPartOfGameInfoSerialization {
|
||||
yield("{$shape}")
|
||||
yield(" " + displayMapDimensions() + ")")
|
||||
if(mapResources != MapResources.default) yield(" {Resource Setting}: {$mapResources}")
|
||||
if (strategicBalance) yield(" {Strategic Balance}")
|
||||
if (legendaryStart) yield(" {Legendary Start}")
|
||||
if (name.isEmpty()) return@sequence
|
||||
yield("\n")
|
||||
if (type != MapGeneratedMainType.custom && type != MapType.empty) yield("{Map Generation Type}: {$type}, ")
|
||||
|
@ -239,7 +239,8 @@ object LuxuryResourcePlacementLogic {
|
||||
for (region in regions) {
|
||||
val tilesToCheck = tileMap[region.startPosition!!].getTilesInDistanceRange(1..2)
|
||||
val candidateLuxuries = randomLuxuries.shuffled().toMutableList()
|
||||
if (tileMap.mapParameters.mapResources != MapResources.strategicBalance)
|
||||
if (tileMap.mapParameters.mapResources != MapResources.strategicBalance &&
|
||||
!tileMap.mapParameters.strategicBalance)
|
||||
candidateLuxuries += specialLuxuries.shuffled()
|
||||
.map { it.name } // Include marble!
|
||||
candidateLuxuries += cityStateLuxuries.shuffled()
|
||||
@ -381,7 +382,8 @@ object LuxuryResourcePlacementLogic {
|
||||
regions.sumOf { it.totalFertility } / regions.sumOf { it.tiles.size }.toFloat()
|
||||
for (region in regions) {
|
||||
var targetLuxuries = 1
|
||||
if (tileMap.mapParameters.mapResources == MapResources.legendaryStart)
|
||||
if (tileMap.mapParameters.mapResources == MapResources.legendaryStart ||
|
||||
tileMap.mapParameters.legendaryStart)
|
||||
targetLuxuries++
|
||||
if (region.totalFertility / region.tiles.size.toFloat() < averageFertilityDensity) {
|
||||
targetLuxuries++
|
||||
|
@ -29,7 +29,8 @@ object StartNormalizer {
|
||||
}
|
||||
}
|
||||
|
||||
if (tileMap.mapParameters.mapResources == MapResources.strategicBalance)
|
||||
if (tileMap.mapParameters.mapResources == MapResources.strategicBalance ||
|
||||
tileMap.mapParameters.strategicBalance)
|
||||
placeStrategicBalanceResources(startTile, ruleset, tileData)
|
||||
|
||||
normalizeProduction(startTile, isMinorCiv, ruleset, tileData)
|
||||
@ -217,7 +218,8 @@ object StartNormalizer {
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
if (tileMap.mapParameters.mapResources == MapResources.legendaryStart)
|
||||
if (tileMap.mapParameters.mapResources == MapResources.legendaryStart ||
|
||||
tileMap.mapParameters.legendaryStart)
|
||||
bonusesNeeded += 2
|
||||
|
||||
// Attempt to place one grassland at a plains-only spot (nor for minors)
|
||||
|
@ -55,6 +55,8 @@ class MapParametersTable(
|
||||
private lateinit var noRuinsCheckbox: CheckBox
|
||||
private lateinit var noNaturalWondersCheckbox: CheckBox
|
||||
private lateinit var worldWrapCheckbox: CheckBox
|
||||
private lateinit var legendaryStartCheckbox: CheckBox
|
||||
private lateinit var strategicBalanceCheckbox: CheckBox
|
||||
private lateinit var seedTextField: TextField
|
||||
|
||||
private lateinit var mapShapesOptionsValues: HashSet<String>
|
||||
@ -320,11 +322,27 @@ class MapParametersTable(
|
||||
add(worldWrapCheckbox).row()
|
||||
}
|
||||
|
||||
private fun Table.addStrategicBalanceCheckbox() {
|
||||
strategicBalanceCheckbox = "Strategic Balance".toCheckBox(mapParameters.strategicBalance) {
|
||||
mapParameters.strategicBalance = it
|
||||
}
|
||||
add(strategicBalanceCheckbox).row()
|
||||
}
|
||||
|
||||
private fun Table.addLegendaryStartCheckbox() {
|
||||
legendaryStartCheckbox = "LegendaryStart".toCheckBox(mapParameters.legendaryStart) {
|
||||
mapParameters.legendaryStart = it
|
||||
}
|
||||
add(legendaryStartCheckbox).row()
|
||||
}
|
||||
|
||||
private fun addWrappedCheckBoxes() {
|
||||
val worldWrapWarning = "World wrap maps are very memory intensive - creating large world wrap maps on Android can lead to crashes!"
|
||||
if (mapGeneratedMainType == MapGeneratedMainType.randomGenerated) {
|
||||
add(ExpanderTab("{Other Settings}", persistenceID = "NewGameOtherSettings", startsOutOpened = false) {
|
||||
it.defaults().pad(5f,0f)
|
||||
it.addStrategicBalanceCheckbox()
|
||||
it.addLegendaryStartCheckbox()
|
||||
it.addNoRuinsCheckbox()
|
||||
it.addNoNaturalWondersCheckbox()
|
||||
it.addWorldWrapCheckbox()
|
||||
@ -333,6 +351,8 @@ class MapParametersTable(
|
||||
} else {
|
||||
add(Table(skin).apply {
|
||||
defaults().left().pad(2.5f)
|
||||
addStrategicBalanceCheckbox()
|
||||
addLegendaryStartCheckbox()
|
||||
addNoRuinsCheckbox()
|
||||
addNoNaturalWondersCheckbox()
|
||||
addWorldWrapCheckbox()
|
||||
|
Loading…
x
Reference in New Issue
Block a user