Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Attack.js
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | "<element>" + | ||||
"</element>" + | "</element>" + | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='EffectDelay' a:help='Delay of applying the effects, in milliseconds after the attack has landed. Defaults to 0.'><ref name='nonNegativeDecimal'/></element>" + | "<element name='EffectDelay' a:help='Delay of applying the effects, in milliseconds after the attack has landed. Defaults to 0.'><ref name='nonNegativeDecimal'/></element>" + | ||||
"</optional>" + | "</optional>" + | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='Splash'>" + | "<element name='Splash'>" + | ||||
"<interleave>" + | "<interleave>" + | ||||
"<element name='Shape' a:help='Shape of the splash damage, can be circular or linear'><text/></element>" + | "<element name='Shape' a:help='Shape of the splash damage, can be circular or linear'><text/></element>" + | ||||
"<element name='Range' a:help='Size of the area affected by the splash'><ref name='nonNegativeDecimal'/></element>" + | "<optional>" + | ||||
"<element name='MinRange' a:help='Size of the inner area not affected by the splash (in meters). Defaults to 0.'><ref name='nonNegativeDecimal'/></element>" + | |||||
"</optional>" + | |||||
"<element name='MaxRange' a:help='Size of the area affected by the splash (in meters).'><ref name='nonNegativeDecimal'/></element>" + | |||||
"<element name='FriendlyFire' a:help='Whether the splash damage can hurt non enemy units'><data type='boolean'/></element>" + | "<element name='FriendlyFire' a:help='Whether the splash damage can hurt non enemy units'><data type='boolean'/></element>" + | ||||
AttackHelper.BuildAttackEffectsSchema() + | AttackHelper.BuildAttackEffectsSchema() + | ||||
"</interleave>" + | "</interleave>" + | ||||
"</element>" + | "</element>" + | ||||
"</optional>" + | "</optional>" + | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='Projectile'>" + | "<element name='Projectile'>" + | ||||
"<interleave>" + | "<interleave>" + | ||||
▲ Show 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | |||||
Attack.prototype.GetSplashData = function(type) | Attack.prototype.GetSplashData = function(type) | ||||
{ | { | ||||
if (!this.template[type].Splash) | if (!this.template[type].Splash) | ||||
return undefined; | return undefined; | ||||
return { | return { | ||||
"attackData": this.GetAttackEffectsData(type, true), | "attackData": this.GetAttackEffectsData(type, true), | ||||
"friendlyFire": this.template[type].Splash.FriendlyFire == "true", | "friendlyFire": this.template[type].Splash.FriendlyFire == "true", | ||||
"radius": ApplyValueModificationsToEntity("Attack/" + type + "/Splash/Range", +this.template[type].Splash.Range, this.entity), | "minRange": ApplyValueModificationsToEntity("Attack/" + type + "/Splash/MinRange", +(this.template[type].Splash.MinRange || 0), this.entity), | ||||
"maxRange": ApplyValueModificationsToEntity("Attack/" + type + "/Splash/MaxRange", +this.template[type].Splash.MaxRange, this.entity), | |||||
wraitii: meh for inconsistency here | |||||
"shape": this.template[type].Splash.Shape, | "shape": this.template[type].Splash.Shape, | ||||
}; | }; | ||||
}; | }; | ||||
Attack.prototype.GetRange = function(type) | Attack.prototype.GetRange = function(type) | ||||
{ | { | ||||
if (!type) | if (!type) | ||||
return this.GetFullAttackRange(); | return this.GetFullAttackRange(); | ||||
▲ Show 20 Lines • Show All 335 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
meh for inconsistency here