Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | for (let type in template.Attack) | ||||
"maxRange": getAttackStat("MaxRange"), | "maxRange": getAttackStat("MaxRange"), | ||||
"elevationBonus": getAttackStat("ElevationBonus"), | "elevationBonus": getAttackStat("ElevationBonus"), | ||||
}; | }; | ||||
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].Projectile) | |||||
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) | ||||
{ | { | ||||
ret.attack[type].splash = { | ret.attack[type].splash = { | ||||
// 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, | ||||
}; | }; | ||||
Object.assign(ret.attack[type].splash, getAttackEffects(template.Attack[type].Splash, "Attack/" + type + "/Splash")); | Object.assign(ret.attack[type].splash, getAttackEffects(template.Attack[type].Splash, "Attack/" + type + "/Splash")); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator