Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | function GetTemplateDataHelper(template, player, auraTemplates, resources, damageTypes, modifiers={}) | ||||
if (template.Attack) | if (template.Attack) | ||||
{ | { | ||||
ret.attack = {}; | ret.attack = {}; | ||||
for (let type in template.Attack) | for (let type in template.Attack) | ||||
{ | { | ||||
let getAttackStat = function(stat) { | let getAttackStat = function(stat) { | ||||
return getEntityValue("Attack/" + type + "/" + stat); | return getEntityValue("Attack/" + type + "/" + stat); | ||||
}; | }; | ||||
if (type == "Capture") | if (type == "Capture") | ||||
ret.attack.Capture = { | ret.attack.Capture = { | ||||
"value": getAttackStat("Value") | "value": getAttackStat("Value") | ||||
}; | }; | ||||
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("Projectile/ElevationBonus"), | ||||
"damage": {} | "damage": {} | ||||
}; | }; | ||||
for (let damageType of damageTypes.GetTypes()) | for (let damageType of damageTypes.GetTypes()) | ||||
ret.attack[type].damage[damageType] = getAttackStat("Damage/" + damageType); | ret.attack[type].damage[damageType] = getAttackStat("Damage/" + damageType); | ||||
nani: The new non scalar origin now can have negative values meaning this function can return a… | |||||
Not Done Inline ActionsTo be fair it is not extra range. Silier: To be fair it is not extra range.
As far as i remember, It says how high is launching point of… | |||||
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) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 342 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
The new non scalar origin now can have negative values meaning this function can return a negative value to Math.sqrt which will return NaN.
Also from my point of view origin is more confusing than elevationBonus, it implies a position instead of a distance vector (absolute values) and doesn't give you any info on what it really does (too generic). Does it change the attack position, is a displacement or a position, relative to what, etc
I'm more in favour to give it a name like "bonusRange" or "extraRange".