Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | for (let type in template.Attack) | ||||
else | else | ||||
{ | { | ||||
ret.attack[type] = { | ret.attack[type] = { | ||||
"minRange": getAttackStat("MinRange"), | "minRange": getAttackStat("MinRange"), | ||||
"maxRange": getAttackStat("MaxRange"), | "maxRange": getAttackStat("MaxRange"), | ||||
"elevationBonus": getAttackStat("ElevationBonus") | "elevationBonus": getAttackStat("ElevationBonus") | ||||
}; | }; | ||||
for (let damageType of damageTypes.GetTypes()) | for (let damageType of damageTypes.GetTypes()) | ||||
ret.attack[type][damageType] = getAttackStat(damageType); | ret.attack[type][damageType] = getAttackStat("Damage/" + damageType); | ||||
ret.attack[type].elevationAdaptedRange = Math.sqrt(ret.attack[type].maxRange * | ret.attack[type].elevationAdaptedRange = Math.sqrt(ret.attack[type].maxRange * | ||||
(2 * ret.attack[type].elevationBonus + ret.attack[type].maxRange)); | (2 * ret.attack[type].elevationBonus + ret.attack[type].maxRange)); | ||||
} | } | ||||
ret.attack[type].repeatTime = getAttackStat("RepeatTime"); | ret.attack[type].repeatTime = getAttackStat("RepeatTime"); | ||||
if (template.Attack[type].Splash) | if (template.Attack[type].Splash) | ||||
{ | { | ||||
ret.attack[type].splash = { | ret.attack[type].splash = { | ||||
// true if undefined | // true if undefined | ||||
"friendlyFire": template.Attack[type].Splash.FriendlyFire != "false", | "friendlyFire": template.Attack[type].Splash.FriendlyFire != "false", | ||||
"shape": template.Attack[type].Splash.Shape | "shape": template.Attack[type].Splash.Shape | ||||
}; | }; | ||||
for (let damageType of damageTypes.GetTypes()) | for (let damageType of damageTypes.GetTypes()) | ||||
ret.attack[type].splash[damageType] = getAttackStat("Splash/" + damageType); | ret.attack[type].splash[damageType] = getAttackStat("Splash/Damage/" + damageType); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (template.DeathDamage) | if (template.DeathDamage) | ||||
{ | { | ||||
ret.deathDamage = { | ret.deathDamage = { | ||||
"friendlyFire": template.DeathDamage.FriendlyFire != "false" | "friendlyFire": template.DeathDamage.FriendlyFire != "false" | ||||
}; | }; | ||||
for (let damageType of damageTypes.GetTypes()) | for (let damageType of damageTypes.GetTypes()) | ||||
ret.deathDamage[damageType] = getEntityValue("DeathDamage/" + damageType); | ret.deathDamage[damageType] = getEntityValue("DeathDamage/Damage/" + damageType); | ||||
} | } | ||||
if (template.Auras && auraTemplates) | if (template.Auras && auraTemplates) | ||||
{ | { | ||||
ret.auras = {}; | ret.auras = {}; | ||||
for (let auraID of template.Auras._string.split(/\s+/)) | for (let auraID of template.Auras._string.split(/\s+/)) | ||||
{ | { | ||||
let aura = auraTemplates[auraID]; | let aura = auraTemplates[auraID]; | ||||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator