mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
City-states get all civs known by at least half of major civs, not 'by any civ'
This commit is contained in:
parent
d7941924be
commit
4df083197b
@ -141,13 +141,13 @@ object NextTurnAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getFreeTechForCityStates(civInfo: CivilizationInfo) {
|
private fun getFreeTechForCityStates(civInfo: CivilizationInfo) {
|
||||||
//City-States automatically get all invented techs
|
// City-States automatically get all techs that at least half of the major civs know
|
||||||
for (otherCiv in civInfo.getKnownCivs().filter { it.isMajorCiv() }) {
|
val researchableTechs = civInfo.gameInfo.ruleSet.technologies.keys
|
||||||
for (entry in otherCiv.tech.techsResearched
|
.filter { civInfo.tech.canBeResearched(it) }
|
||||||
.filterNot { civInfo.tech.isResearched(it) }
|
for (tech in researchableTechs) {
|
||||||
.filter { civInfo.tech.canBeResearched(it) }) {
|
val aliveMajorCivs = civInfo.gameInfo.getAliveMajorCivs()
|
||||||
civInfo.tech.addTechnology(entry)
|
if (aliveMajorCivs.count { it.tech.isResearched(tech) } >= aliveMajorCivs.count() / 2)
|
||||||
}
|
civInfo.tech.addTechnology(tech)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import com.unciv.models.stats.Stat
|
|||||||
import com.unciv.models.translations.tr
|
import com.unciv.models.translations.tr
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlin.math.min
|
|
||||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
||||||
|
|
||||||
class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScreen.skin) {
|
class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScreen.skin) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user