Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Attacking.js
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | |||||
* @param {number} data.radius - The radius of the splash damage. | * @param {number} data.radius - The radius of the splash damage. | ||||
* @param {string} data.shape - The shape of the radius. | * @param {string} data.shape - The shape of the radius. | ||||
* @param {Vector3D} [data.direction] - The unit vector defining the direction. Needed for linear splash damage. | * @param {Vector3D} [data.direction] - The unit vector defining the direction. Needed for linear splash damage. | ||||
* @param {boolean} data.friendlyFire - A flag indicating if allied entities also ought to be damaged. | * @param {boolean} data.friendlyFire - A flag indicating if allied entities also ought to be damaged. | ||||
*/ | */ | ||||
Attacking.prototype.CauseDamageOverArea = function(data) | Attacking.prototype.CauseDamageOverArea = function(data) | ||||
{ | { | ||||
let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, | let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, | ||||
this.GetPlayersToDamage(data.attackerOwner, data.friendlyFire)); | this.GetPlayersToDamage(data.attackerOwner, data.friendlyFire), IID_Attackable); | ||||
let damageMultiplier = 1; | let damageMultiplier = 1; | ||||
let cmpObstructionManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ObstructionManager); | let cmpObstructionManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ObstructionManager); | ||||
// Cycle through all the nearby entities and damage it appropriately based on its distance from the origin. | // Cycle through all the nearby entities and damage it appropriately based on its distance from the origin. | ||||
for (let ent of nearEnts) | for (let ent of nearEnts) | ||||
{ | { | ||||
// Correct somewhat for the entity's obstruction radius. | // Correct somewhat for the entity's obstruction radius. | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator