City-states get all civs known by at least half of major civs, not 'by any civ'

This commit is contained in:
Yair Morgenstern 2021-05-28 14:54:02 +03:00
parent d7941924be
commit 4df083197b
2 changed files with 7 additions and 8 deletions

View File

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

View File

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