Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/Templates.js
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | for (let type in template.Attack) | ||||
}; | }; | ||||
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); | ||||
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 != "false"; | |||||
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, | ||||
"damage": {} | "damage": {} | ||||
}; | }; | ||||
for (let damageType of damageTypes.GetTypes()) | for (let damageType of damageTypes.GetTypes()) | ||||
ret.attack[type].splash.damage[damageType] = getAttackStat("Splash/Damage/" + damageType); | ret.attack[type].splash.damage[damageType] = getAttackStat("Splash/Damage/" + damageType); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 331 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.