mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Resolved #4671 - Buildings from era are applied before buildings from policies
This commit is contained in:
parent
221f45b966
commit
98eba6a995
@ -3,8 +3,8 @@ package com.unciv.build
|
|||||||
object BuildConfig {
|
object BuildConfig {
|
||||||
const val kotlinVersion = "1.4.30"
|
const val kotlinVersion = "1.4.30"
|
||||||
const val appName = "Unciv"
|
const val appName = "Unciv"
|
||||||
const val appCodeNumber = 597
|
const val appCodeNumber = 598
|
||||||
const val appVersion = "3.15.15"
|
const val appVersion = "3.15.16"
|
||||||
|
|
||||||
const val gdxVersion = "1.10.0"
|
const val gdxVersion = "1.10.0"
|
||||||
const val roboVMVersion = "2.3.1"
|
const val roboVMVersion = "2.3.1"
|
||||||
|
@ -504,9 +504,7 @@ object Battle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Instead of postBattleAction() just destroy the unit, all other functions are not relevant
|
// Instead of postBattleAction() just destroy the unit, all other functions are not relevant
|
||||||
if (attacker.unit.hasUnique("Self-destructs when attacking")) {
|
if (attacker.unit.hasUnique("Self-destructs when attacking")) attacker.unit.destroy()
|
||||||
attacker.unit.destroy()
|
|
||||||
}
|
|
||||||
|
|
||||||
// It's unclear whether using nukes results in a penalty with all civs, or only affected civs.
|
// It's unclear whether using nukes results in a penalty with all civs, or only affected civs.
|
||||||
// For now I'll make it give a diplomatic penalty to all known civs, but some testing for this would be appreciated
|
// For now I'll make it give a diplomatic penalty to all known civs, but some testing for this would be appreciated
|
||||||
|
@ -86,28 +86,10 @@ class CityInfo {
|
|||||||
|
|
||||||
civInfo.cities = civInfo.cities.toMutableList().apply { add(this@CityInfo) }
|
civInfo.cities = civInfo.cities.toMutableList().apply { add(this@CityInfo) }
|
||||||
|
|
||||||
if (civInfo.cities.size == 1) cityConstructions.addBuilding(capitalCityIndicator())
|
|
||||||
|
|
||||||
civInfo.policies.tryToAddPolicyBuildings()
|
|
||||||
|
|
||||||
for (unique in civInfo.getMatchingUniques("Gain a free [] []")) {
|
|
||||||
val freeBuildingName = unique.params[0]
|
|
||||||
if (matchesFilter(unique.params[1])) {
|
|
||||||
if (!cityConstructions.isBuilt(freeBuildingName))
|
|
||||||
cityConstructions.addBuilding(freeBuildingName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add buildings and pop we get from starting in this era
|
|
||||||
val ruleset = civInfo.gameInfo.ruleSet
|
|
||||||
val startingEra = civInfo.gameInfo.gameParameters.startingEra
|
val startingEra = civInfo.gameInfo.gameParameters.startingEra
|
||||||
if (startingEra in ruleset.eras) {
|
|
||||||
for (building in ruleset.eras[startingEra]!!.settlerBuildings) {
|
addStartingBuildings(civInfo, startingEra)
|
||||||
if (ruleset.buildings[building]!!.isBuildable(cityConstructions)) {
|
|
||||||
cityConstructions.addBuilding(civInfo.getEquivalentBuilding(building).name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
expansion.reset()
|
expansion.reset()
|
||||||
|
|
||||||
@ -121,6 +103,7 @@ class CityInfo {
|
|||||||
tile.improvement = null
|
tile.improvement = null
|
||||||
tile.improvementInProgress = null
|
tile.improvementInProgress = null
|
||||||
|
|
||||||
|
val ruleset = civInfo.gameInfo.ruleSet
|
||||||
workedTiles = hashSetOf() //reassign 1st working tile
|
workedTiles = hashSetOf() //reassign 1st working tile
|
||||||
if (startingEra in ruleset.eras)
|
if (startingEra in ruleset.eras)
|
||||||
population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation)
|
population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation)
|
||||||
@ -130,6 +113,30 @@ class CityInfo {
|
|||||||
triggerCitiesSettledNearOtherCiv()
|
triggerCitiesSettledNearOtherCiv()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addStartingBuildings(civInfo: CivilizationInfo, startingEra: String) {
|
||||||
|
val ruleset = civInfo.gameInfo.ruleSet
|
||||||
|
if (civInfo.cities.size == 1) cityConstructions.addBuilding(capitalCityIndicator())
|
||||||
|
|
||||||
|
// Add buildings and pop we get from starting in this era
|
||||||
|
if (startingEra in ruleset.eras) {
|
||||||
|
for (building in ruleset.eras[startingEra]!!.settlerBuildings) {
|
||||||
|
if (ruleset.buildings[building]!!.isBuildable(cityConstructions)) {
|
||||||
|
cityConstructions.addBuilding(civInfo.getEquivalentBuilding(building).name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
civInfo.policies.tryToAddPolicyBuildings()
|
||||||
|
|
||||||
|
for (unique in civInfo.getMatchingUniques("Gain a free [] []")) {
|
||||||
|
val freeBuildingName = unique.params[0]
|
||||||
|
if (matchesFilter(unique.params[1])) {
|
||||||
|
if (!cityConstructions.isBuilt(freeBuildingName))
|
||||||
|
cityConstructions.addBuilding(freeBuildingName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setNewCityName(civInfo: CivilizationInfo) {
|
private fun setNewCityName(civInfo: CivilizationInfo) {
|
||||||
val nationCities = civInfo.nation.cities
|
val nationCities = civInfo.nation.cities
|
||||||
val cityNameIndex = civInfo.citiesCreated % nationCities.size
|
val cityNameIndex = civInfo.citiesCreated % nationCities.size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user