mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
City states now get free techs from major civs. (#1175)
This commit is contained in:
parent
222e4ad4b5
commit
362184e515
@ -29,6 +29,8 @@ class NextTurnAutomation{
|
|||||||
exchangeLuxuries(civInfo)
|
exchangeLuxuries(civInfo)
|
||||||
issueRequests(civInfo)
|
issueRequests(civInfo)
|
||||||
adoptPolicy(civInfo)
|
adoptPolicy(civInfo)
|
||||||
|
} else {
|
||||||
|
getFreeTechForCityStates(civInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
chooseTechToResearch(civInfo)
|
chooseTechToResearch(civInfo)
|
||||||
@ -117,17 +119,6 @@ class NextTurnAutomation{
|
|||||||
|
|
||||||
private fun exchangeTechs(civInfo: CivilizationInfo) {
|
private fun exchangeTechs(civInfo: CivilizationInfo) {
|
||||||
if(!civInfo.gameInfo.getDifficulty().aisExchangeTechs) return
|
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()
|
val otherCivList = civInfo.getKnownCivs()
|
||||||
.filter { it.playerType == PlayerType.AI && it.isMajorCiv() }
|
.filter { it.playerType == PlayerType.AI && it.isMajorCiv() }
|
||||||
.sortedBy { it.tech.techsResearched.size }
|
.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) {
|
private fun chooseTechToResearch(civInfo: CivilizationInfo) {
|
||||||
if (civInfo.tech.techsToResearch.isEmpty()) {
|
if (civInfo.tech.techsToResearch.isEmpty()) {
|
||||||
val researchableTechs = GameBasics.Technologies.values.filter { !civInfo.tech.isResearched(it.name) && civInfo.tech.canBeResearched(it.name) }
|
val researchableTechs = GameBasics.Technologies.values.filter { !civInfo.tech.isResearched(it.name) && civInfo.tech.canBeResearched(it.name) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user