Differential D2315 Diff 9911 ps/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | TechnologyManager.prototype.ResearchTechnology = function(tech) | ||||
var modifiedComponents = {}; | var modifiedComponents = {}; | ||||
this.researchedTechs.add(tech); | this.researchedTechs.add(tech); | ||||
// store the modifications in an easy to access structure | // store the modifications in an easy to access structure | ||||
let template = TechnologyTemplates.Get(tech); | let template = TechnologyTemplates.Get(tech); | ||||
if (template.modifications) | if (template.modifications) | ||||
{ | { | ||||
let cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); | let cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); | ||||
let derivedModifiers = DeriveModificationsFromTech(template); | cmpModifiersManager.AddModifiers("tech/" + tech, DeriveModificationsFromTech(template), this.entity); | ||||
for (let modifierPath in derivedModifiers) | |||||
for (let modifier of derivedModifiers[modifierPath]) | |||||
cmpModifiersManager.AddModifier(modifierPath, "tech/" + tech, modifier, this.entity); | |||||
} | } | ||||
if (template.replaces && template.replaces.length > 0) | if (template.replaces && template.replaces.length > 0) | ||||
{ | { | ||||
for (var i of template.replaces) | for (var i of template.replaces) | ||||
{ | { | ||||
if (!i || this.IsTechnologyResearched(i)) | if (!i || this.IsTechnologyResearched(i)) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator