Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | for (let type in template.Attack) | ||||
ret.attack[type] = { | ret.attack[type] = { | ||||
"attackName": { | "attackName": { | ||||
"name": template.Attack[type].AttackName._string || template.Attack[type].AttackName, | "name": template.Attack[type].AttackName._string || template.Attack[type].AttackName, | ||||
"context": template.Attack[type].AttackName["@context"] | "context": template.Attack[type].AttackName["@context"] | ||||
}, | }, | ||||
"minRange": getAttackStat("MinRange"), | "minRange": getAttackStat("MinRange"), | ||||
"maxRange": getAttackStat("MaxRange"), | "maxRange": getAttackStat("MaxRange"), | ||||
"elevationBonus": getAttackStat("ElevationBonus") | "yOrigin": getAttackStat("Origin/Y") | ||||
}; | }; | ||||
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].yOrigin + ret.attack[type].maxRange)); | ||||
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].repeatTime = getAttackStat("RepeatTime"); | ret.attack[type].repeatTime = getAttackStat("RepeatTime"); | ||||
if (template.Attack[type].Projectile) | if (template.Attack[type].Projectile) | ||||
ret.attack[type].friendlyFire = template.Attack[type].Projectile.FriendlyFire == "true"; | ret.attack[type].friendlyFire = template.Attack[type].Projectile.FriendlyFire == "true"; | ||||
Object.assign(ret.attack[type], getAttackEffects(template.Attack[type], "Attack/" + type)); | Object.assign(ret.attack[type], getAttackEffects(template.Attack[type], "Attack/" + type)); | ||||
if (template.Attack[type].Splash) | if (template.Attack[type].Splash) | ||||
▲ Show 20 Lines • Show All 391 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".