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:
givehub99 2020-09-20 10:29:04 -07:00 committed by GitHub
parent d0d0481f00
commit ef181a4f4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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