Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Attack.js
Show First 20 Lines • Show All 569 Lines • ▼ Show 20 Lines | if (cmpVisual) | ||||
actorName = cmpVisual.GetProjectileActor(); | actorName = cmpVisual.GetProjectileActor(); | ||||
let visualActorLaunchPoint = cmpVisual.GetProjectileLaunchPoint(); | let visualActorLaunchPoint = cmpVisual.GetProjectileLaunchPoint(); | ||||
if (visualActorLaunchPoint.length() > 0) | if (visualActorLaunchPoint.length() > 0) | ||||
launchPoint = visualActorLaunchPoint; | launchPoint = visualActorLaunchPoint; | ||||
} | } | ||||
let id = cmpProjectileManager.LaunchProjectileAtPoint(launchPoint, realTargetPosition, horizSpeed, gravity, actorName, impactActorName, impactAnimationLifetime); | let id = cmpProjectileManager.LaunchProjectileAtPoint(launchPoint, realTargetPosition, horizSpeed, gravity, actorName, impactActorName, impactAnimationLifetime); | ||||
let attackImpactSound = ""; | |||||
let cmpSound = Engine.QueryInterface(this.entity, IID_Sound); | |||||
if (cmpSound) | |||||
attackImpactSound = cmpSound.GetSoundGroup("attack_impact_" + type.toLowerCase()); | |||||
let data = { | let data = { | ||||
"type": type, | "type": type, | ||||
"attackData": this.GetAttackEffectsData(type), | "attackData": this.GetAttackEffectsData(type), | ||||
"target": target, | "target": target, | ||||
"attacker": this.entity, | "attacker": this.entity, | ||||
Freagarach: Why add this? | |||||
"attackerOwner": attackerOwner, | "attackerOwner": attackerOwner, | ||||
"position": realTargetPosition, | "position": realTargetPosition, | ||||
"direction": missileDirection, | "direction": missileDirection, | ||||
"projectileId": id, | "projectileId": id, | ||||
"attackImpactSound": attackImpactSound, | |||||
"splash": this.GetSplashData(type), | "splash": this.GetSplashData(type), | ||||
"friendlyFire": this.template[type].Projectile.FriendlyFire == "true", | "friendlyFire": this.template[type].Projectile.FriendlyFire == "true", | ||||
}; | }; | ||||
cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_DelayedDamage, "MissileHit", +this.template[type].Delay + timeToTarget * 1000, data); | cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_DelayedDamage, "MissileHit", +this.template[type].Delay + timeToTarget * 1000, data); | ||||
} | } | ||||
else | else | ||||
Attacking.HandleAttackEffects(target, type, this.GetAttackEffectsData(type), this.entity, attackerOwner); | Attacking.HandleAttackEffects(target, type, this.GetAttackEffectsData(type), this.entity, attackerOwner); | ||||
Show All 35 Lines |
Wildfire Games · Phabricator
Why add this?