Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Attack.js
function Attack() {} | function Attack() {} | ||||
var g_AttackTypes = ["Melee", "Ranged", "Capture"]; | var g_AttackTypes = ["Melee", "Ranged", "Capture"]; | ||||
Attack.prototype.statusEffectsSchema = | |||||
"<optional>" + | |||||
"<element name='StatusEffects' a:help='Effects like poisioning or burning a unit.'>" + | |||||
"<oneOrMore>" + | |||||
"<element>" + | |||||
"<anyName/>" + | |||||
"<interleave>" + | |||||
"<element name='Duration' a:help='The duration of the status while the effect occurs.'><ref name='nonNegativeDecimal'/></element>" + | |||||
"<element name='Interval' a:help='Interval between the occurances of the effect.'><ref name='nonNegativeDecimal'/></element>" + | |||||
"<element name='Damage' a:help='Damage caused by the effect.'><ref name='nonNegativeDecimal'/></element>" + | |||||
"</interleave>" + | |||||
"</element>" + | |||||
"</oneOrMore>" + | |||||
"</element>" + | |||||
"</optional>"; | |||||
Attack.prototype.bonusesSchema = | Attack.prototype.bonusesSchema = | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='Bonuses'>" + | "<element name='Bonuses'>" + | ||||
"<zeroOrMore>" + | "<zeroOrMore>" + | ||||
"<element>" + | "<element>" + | ||||
"<anyName/>" + | "<anyName/>" + | ||||
"<interleave>" + | "<interleave>" + | ||||
"<optional>" + | "<optional>" + | ||||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | "<element name='Ranged'>" + | ||||
"<text/>" + | "<text/>" + | ||||
"</element>" + | "</element>" + | ||||
"<element name='ImpactAnimationLifetime' a:help='length of the projectile impact animation.'>" + | "<element name='ImpactAnimationLifetime' a:help='length of the projectile impact animation.'>" + | ||||
"<ref name='positiveDecimal'/>" + | "<ref name='positiveDecimal'/>" + | ||||
"</element>" + | "</element>" + | ||||
"</optional>" + | "</optional>" + | ||||
"</interleave>" + | "</interleave>" + | ||||
"</element>" + | "</element>" + | ||||
Attack.prototype.statusEffectsSchema + | |||||
Attack.prototype.bonusesSchema + | Attack.prototype.bonusesSchema + | ||||
Attack.prototype.preferredClassesSchema + | Attack.prototype.preferredClassesSchema + | ||||
Attack.prototype.restrictedClassesSchema + | Attack.prototype.restrictedClassesSchema + | ||||
"</interleave>" + | "</interleave>" + | ||||
"</element>" + | "</element>" + | ||||
"</optional>" + | "</optional>" + | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='Capture'>" + | "<element name='Capture'>" + | ||||
▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | let data = { | ||||
"target": target, | "target": target, | ||||
"strengths": this.GetAttackStrengths(type), | "strengths": this.GetAttackStrengths(type), | ||||
"position": realTargetPosition, | "position": realTargetPosition, | ||||
"direction": missileDirection, | "direction": missileDirection, | ||||
"projectileId": id, | "projectileId": id, | ||||
"bonus": this.GetBonusTemplate(type), | "bonus": this.GetBonusTemplate(type), | ||||
"isSplash": false, | "isSplash": false, | ||||
"attackerOwner": attackerOwner, | "attackerOwner": attackerOwner, | ||||
"attackImpactSound": attackImpactSound | "attackImpactSound": attackImpactSound, | ||||
"statusEffects": this.template[type].StatusEffects | |||||
}; | }; | ||||
if (this.template[type].Splash) | if (this.template[type].Splash) | ||||
{ | { | ||||
data.friendlyFire = this.template[type].Splash.FriendlyFire != "false"; | data.friendlyFire = this.template[type].Splash.FriendlyFire != "false"; | ||||
data.radius = +this.template[type].Splash.Range; | data.radius = +this.template[type].Splash.Range; | ||||
data.shape = this.template[type].Splash.Shape; | data.shape = this.template[type].Splash.Shape; | ||||
data.isSplash = true; | data.isSplash = true; | ||||
data.splashStrengths = this.GetAttackStrengths(type + ".Splash"); | data.splashStrengths = this.GetAttackStrengths(type + ".Splash"); | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator