Adds "Start with [] technology" unique (#3150)
* Adds "Start with [] technology" unique, useful for mods and Hunnic civilization from official CIV 5 DLC Gods and Kings. This unique can be tested with this mod https://cdn.discordapp.com/attachments/670547794951405584/756223352930304140/Test_Start_Technology_Nation_Unique.zip which lets Babylon start with Pottery. * assigning the start technology unique parameter value to variable, changing the unique syntax to 'Starts with []'
This commit is contained in:
parent
d0d0481f00
commit
ef181a4f4c
1 changed files with 10 additions and 0 deletions
|
@ -73,6 +73,16 @@ object GameStarter {
|
|||
for (tech in gameInfo.getDifficulty().aiFreeTechs)
|
||||
civInfo.tech.addTechnology(tech)
|
||||
|
||||
// generic start with technology unique
|
||||
for(unique in civInfo.getMatchingUniques("Starts with []")) {
|
||||
// get the parameter from the unique
|
||||
val techName = unique.params[0]
|
||||
|
||||
// check if the technology is in the ruleset and not already researched
|
||||
if (ruleset.technologies.containsKey(techName) && !civInfo.tech.isResearched(techName))
|
||||
civInfo.tech.addTechnology(techName)
|
||||
}
|
||||
|
||||
// add all techs to spectators
|
||||
if (civInfo.isSpectator())
|
||||
for (tech in ruleset.technologies.values)
|
||||
|
|
Loading…
Reference in a new issue