City states now get free techs from major civs. (#1175)
This commit is contained in:
parent
222e4ad4b5
commit
362184e515
1 changed files with 14 additions and 11 deletions
|
@ -29,6 +29,8 @@ class NextTurnAutomation{
|
|||
exchangeLuxuries(civInfo)
|
||||
issueRequests(civInfo)
|
||||
adoptPolicy(civInfo)
|
||||
} else {
|
||||
getFreeTechForCityStates(civInfo)
|
||||
}
|
||||
|
||||
chooseTechToResearch(civInfo)
|
||||
|
@ -117,17 +119,6 @@ class NextTurnAutomation{
|
|||
|
||||
private fun exchangeTechs(civInfo: CivilizationInfo) {
|
||||
if(!civInfo.gameInfo.getDifficulty().aisExchangeTechs) return
|
||||
if (civInfo.isCityState()) { //City states automatically get all invented techs
|
||||
for (otherCiv in civInfo.getKnownCivs().filterNot { it.isCityState() }) {
|
||||
for (entry in otherCiv.tech.techsResearched
|
||||
.filterNot { civInfo.tech.isResearched(it) }
|
||||
.filter { civInfo.tech.canBeResearched(it) }) {
|
||||
civInfo.tech.addTechnology(entry)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
val otherCivList = civInfo.getKnownCivs()
|
||||
.filter { it.playerType == PlayerType.AI && it.isMajorCiv() }
|
||||
.sortedBy { it.tech.techsResearched.size }
|
||||
|
@ -166,6 +157,18 @@ class NextTurnAutomation{
|
|||
}
|
||||
}
|
||||
|
||||
private fun getFreeTechForCityStates(civInfo: CivilizationInfo) {
|
||||
//City states automatically get all invented techs
|
||||
for (otherCiv in civInfo.getKnownCivs().filterNot { it.isCityState() }) {
|
||||
for (entry in otherCiv.tech.techsResearched
|
||||
.filterNot { civInfo.tech.isResearched(it) }
|
||||
.filter { civInfo.tech.canBeResearched(it) }) {
|
||||
civInfo.tech.addTechnology(entry)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
private fun chooseTechToResearch(civInfo: CivilizationInfo) {
|
||||
if (civInfo.tech.techsToResearch.isEmpty()) {
|
||||
val researchableTechs = GameBasics.Technologies.values.filter { !civInfo.tech.isResearched(it.name) && civInfo.tech.canBeResearched(it.name) }
|
||||
|
|
Loading…
Reference in a new issue