mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Starting techs no longer hardcoded - this means that mods can have their own tech trees starting wherever
This commit is contained in:
parent
c764324e81
commit
a3843450bf
@ -8,9 +8,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Agriculture",
|
"name": "Agriculture",
|
||||||
"row": 5,
|
"row": 5,
|
||||||
"quote": "'Where tillage begins, other arts follow. The farmers therefore are the founders of human civilization.' - Daniel Webster"
|
"quote": "'Where tillage begins, other arts follow. The farmers therefore are the founders of human civilization.' - Daniel Webster",
|
||||||
|
"uniques": ["Starting tech"]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ object GameStarter {
|
|||||||
civInfo.tech.addTechnology(tech)
|
civInfo.tech.addTechnology(tech)
|
||||||
|
|
||||||
for (tech in ruleset.technologies.values
|
for (tech in ruleset.technologies.values
|
||||||
.filter { it.era() < newGameParameters.startingEra })
|
.filter { ruleset.getEraNumber(it.era()) < ruleset.getEraNumber(newGameParameters.startingEra) })
|
||||||
if (!civInfo.tech.isResearched(tech.name))
|
if (!civInfo.tech.isResearched(tech.name))
|
||||||
civInfo.tech.addTechnology(tech.name)
|
civInfo.tech.addTechnology(tech.name)
|
||||||
|
|
||||||
@ -70,6 +70,8 @@ object GameStarter {
|
|||||||
else availableCivNames.pop()
|
else availableCivNames.pop()
|
||||||
|
|
||||||
val playerCiv = CivilizationInfo(nationName)
|
val playerCiv = CivilizationInfo(nationName)
|
||||||
|
for(tech in ruleset.technologies.values.filter { it.uniques.contains("Starting tech") })
|
||||||
|
playerCiv.tech.techsResearched.add(tech.name) // can't be .addTechnology because the civInfo isn't assigned yet
|
||||||
playerCiv.playerType = player.playerType
|
playerCiv.playerType = player.playerType
|
||||||
playerCiv.playerId = player.playerId
|
playerCiv.playerId = player.playerId
|
||||||
gameInfo.civilizations.add(playerCiv)
|
gameInfo.civilizations.add(playerCiv)
|
||||||
|
@ -83,7 +83,6 @@ class CivilizationInfo {
|
|||||||
|
|
||||||
constructor(civName: String) {
|
constructor(civName: String) {
|
||||||
this.civName = civName
|
this.civName = civName
|
||||||
tech.techsResearched.add("Agriculture") // can't be .addTechnology because the civInfo isn't assigned yet
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clone(): CivilizationInfo {
|
fun clone(): CivilizationInfo {
|
||||||
|
Loading…
Reference in New Issue
Block a user