Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | if (template.GarrisonHolder) | ||||
ret.garrisonHolder = { | ret.garrisonHolder = { | ||||
"buffHeal": getEntityValue("GarrisonHolder/BuffHeal") | "buffHeal": getEntityValue("GarrisonHolder/BuffHeal") | ||||
}; | }; | ||||
if (template.GarrisonHolder.Max) | if (template.GarrisonHolder.Max) | ||||
ret.garrisonHolder.capacity = getEntityValue("GarrisonHolder/Max"); | ret.garrisonHolder.capacity = getEntityValue("GarrisonHolder/Max"); | ||||
} | } | ||||
if (template.TerritoryInfluence) | |||||
// See also CCmpTerritoryInfluence. | |||||
ret.territoryInfluenceRoot = template.TerritoryInfluence.Root === "true"; | |||||
if (template.Heal) | if (template.Heal) | ||||
wraitii: By convention we use `!!template.TerritoryInfluence.Root` | |||||
Done Inline ActionsThis is not a boolean comparison, it's a string comparison :) Krinkle: This is not a boolean comparison, it's a string comparison :) | |||||
Done Inline Actionscomments unneeded, first one is true for all template objects, second one is true for all(?) data returned here. Until more than 1 property exists, one can avoid creating the otherwise unused object for performance benefit. elexis: comments unneeded, first one is true for all template objects, second one is true for all(?)… | |||||
ret.heal = { | ret.heal = { | ||||
"hp": getEntityValue("Heal/HP"), | "hp": getEntityValue("Heal/HP"), | ||||
"range": getEntityValue("Heal/Range"), | "range": getEntityValue("Heal/Range"), | ||||
"rate": getEntityValue("Heal/Rate") | "rate": getEntityValue("Heal/Rate") | ||||
}; | }; | ||||
if (template.ResourceGatherer) | if (template.ResourceGatherer) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
By convention we use !!template.TerritoryInfluence.Root