Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | function GetTemplateDataHelper(template, player, auraTemplates, modifiers = {}) | ||||
} | } | ||||
if (template.Cost) | if (template.Cost) | ||||
{ | { | ||||
ret.cost = {}; | ret.cost = {}; | ||||
for (let resCode in template.Cost.Resources) | for (let resCode in template.Cost.Resources) | ||||
ret.cost[resCode] = getEntityValue("Cost/Resources/" + resCode); | ret.cost[resCode] = getEntityValue("Cost/Resources/" + resCode); | ||||
if (template.Cost.Population) | |||||
ret.cost.population = getEntityValue("Cost/Population"); | |||||
if (template.Cost.BuildTime) | if (template.Cost.BuildTime) | ||||
ret.cost.time = getEntityValue("Cost/BuildTime"); | ret.cost.time = getEntityValue("Cost/BuildTime"); | ||||
} | } | ||||
if (template.Footprint) | if (template.Footprint) | ||||
{ | { | ||||
ret.footprint = { "height": template.Footprint.Height }; | ret.footprint = { "height": template.Footprint.Height }; | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | function GetTemplateDataHelper(template, player, auraTemplates, modifiers = {}) | ||||
if (template.Pack) | if (template.Pack) | ||||
ret.pack = { | ret.pack = { | ||||
"state": template.Pack.State, | "state": template.Pack.State, | ||||
"time": getEntityValue("Pack/Time"), | "time": getEntityValue("Pack/Time"), | ||||
}; | }; | ||||
if (template.Population && template.Population.Bonus) | if (template.Population && template.Population.Bonus) | ||||
ret.population = { | ret.population = { | ||||
"bonus": getEntityValue("Population/Bonus") | "bonus": getEntityValue("Population/Bonus"), | ||||
"cost": getEntityValue("Population/Cost") | |||||
}; | }; | ||||
if (template.Health) | if (template.Health) | ||||
ret.health = Math.round(getEntityValue("Health/Max")); | ret.health = Math.round(getEntityValue("Health/Max")); | ||||
if (template.Identity) | if (template.Identity) | ||||
{ | { | ||||
ret.selectionGroupName = template.Identity.SelectionGroupName; | ret.selectionGroupName = template.Identity.SelectionGroupName; | ||||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator