Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Attack.js
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | |||||
* Get the list of players affected by the damage. | * Get the list of players affected by the damage. | ||||
* @param {number} attackerOwner - The player id of the attacker. | * @param {number} attackerOwner - The player id of the attacker. | ||||
* @param {boolean} friendlyFire - A flag indicating if allied entities are also damaged. | * @param {boolean} friendlyFire - A flag indicating if allied entities are also damaged. | ||||
* @return {number[]} The ids of players need to be damaged. | * @return {number[]} The ids of players need to be damaged. | ||||
*/ | */ | ||||
AttackHelper.prototype.GetPlayersToDamage = function(attackerOwner, friendlyFire) | AttackHelper.prototype.GetPlayersToDamage = function(attackerOwner, friendlyFire) | ||||
{ | { | ||||
if (!friendlyFire) | if (!friendlyFire) | ||||
return QueryPlayerIDInterface(attackerOwner).GetEnemies(); | return QueryPlayerIDInterface(attackerOwner, IID_Diplomacy).GetEnemies(); | ||||
return Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetAllPlayers(); | return Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetAllPlayers(); | ||||
}; | }; | ||||
/** | /** | ||||
* Damages units around a given origin. | * Damages units around a given origin. | ||||
* @param {Object} data - The data sent by the caller. | * @param {Object} data - The data sent by the caller. | ||||
* @param {string} data.type - The type of damage. | * @param {string} data.type - The type of damage. | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator