Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Damage.js
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | Damage.prototype.GetPlayersToDamage = function(attackerOwner, friendlyFire) | ||||
let cmpPlayer = QueryPlayerIDInterface(attackerOwner); | let cmpPlayer = QueryPlayerIDInterface(attackerOwner); | ||||
if (!friendlyFire) | if (!friendlyFire) | ||||
return cmpPlayer.GetEnemies(); | return cmpPlayer.GetEnemies(); | ||||
let playersToDamage = []; | let playersToDamage = []; | ||||
let numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); | let numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); | ||||
for (let i = 0; i < numPlayers; ++i) | for (let i = 0; i < numPlayers; ++i) | ||||
playersToDamage.push(i) | playersToDamage.push(i); | ||||
return playersToDamage; | return playersToDamage; | ||||
} | } | ||||
fatherbushido: missing ; (as bot said) | |||||
/** | /** | ||||
* Handles hit logic after the projectile travel time has passed. | * Handles hit logic after the projectile travel time has passed. | ||||
* @param {Object} data - the data sent by the caller. | * @param {Object} data - the data sent by the caller. | ||||
* @param {number} data.attacker - the entity id of the attacker. | * @param {number} data.attacker - the entity id of the attacker. | ||||
* @param {number} data.target - the entity id of the target. | * @param {number} data.target - the entity id of the target. | ||||
* @param {Vector2D} data.origin - the origin of the projectile hit. | * @param {Vector2D} data.origin - the origin of the projectile hit. | ||||
* @param {Object} data.strengths - data of the form { 'hack': number, 'pierce': number, 'crush': number }. | * @param {Object} data.strengths - data of the form { 'hack': number, 'pierce': number, 'crush': number }. | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
* @param {Object} data - the data sent by the caller. | * @param {Object} data - the data sent by the caller. | ||||
* @param {number} data.attacker - the entity id of the attacker. | * @param {number} data.attacker - the entity id of the attacker. | ||||
* @param {Vector2D} data.origin - the origin of the projectile hit. | * @param {Vector2D} data.origin - the origin of the projectile hit. | ||||
* @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 {Object} data.strengths - data of the form { 'hack': number, 'pierce': number, 'crush': number }. | * @param {Object} data.strengths - data of the form { 'hack': number, 'pierce': number, 'crush': number }. | ||||
* @param {string} data.type - the type of damage. | * @param {string} data.type - the type of damage. | ||||
* @param {number} data.attackerOwner - the player id of the attacker. | * @param {number} data.attackerOwner - the player id of the attacker. | ||||
* @param {Vector3D} data.direction - the unit vector defining the direction. | * @param {Vector3D} [data.direction] - the unit vector defining the direction. | ||||
* @param {number[]} data.playersToDamage - the array of player id's to damage. | * @param {number[]} data.playersToDamage - the array of player id's to damage. | ||||
*/ | */ | ||||
Damage.prototype.CauseSplashDamage = function(data) | Damage.prototype.CauseSplashDamage = function(data) | ||||
{ | { | ||||
// Get nearby entities and define variables | // Get nearby entities and define variables | ||||
let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, data.playersToDamage); | let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, data.playersToDamage); | ||||
let damageMultiplier = 1; | let damageMultiplier = 1; | ||||
let direction = Vector2D.from3D(data.direction); | let direction = Vector2D.from3D(data.direction); | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
missing ; (as bot said)