Changeset View
Changeset View
Standalone View
Standalone View
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) | |||||
wraitii: If you make it a non-optional element, then you can do `template.Attack[type].FriendlyFire ==… | |||||
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", | ||||
Done Inline Actionsthis is not true anymore, so you or have to give friendlyfire = true to every ranged attack with splash damage in template currently without friendlyFire element or keep this logic, what I do not suggest because current logic if not in template = true is at least strange Silier: this is not true anymore, so you or have to give friendlyfire = true to every ranged attack… | |||||
Done Inline ActionsWe enable Friendly Fire by default - I think we should make it explicit indeed. wraitii: We enable Friendly Fire by default - I think we should make it explicit indeed. | |||||
Done Inline Actionsthis information is redundant and I highly suggest to remove it as it is the same as information at line 199, or if that would cause problems for dealing damage please reuse ret.attack[type].friendlyFire here Silier: this information is redundant and I highly suggest to remove it as it is the same as… | |||||
"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")); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (template.DeathDamage) | if (template.DeathDamage) | ||||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
If you make it a non-optional element, then you can do template.Attack[type].FriendlyFire == "false", which is nicer.