Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Commands.js
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | if (g_DebugCommands && !allowCapture && | ||||
!(IsOwnedByEnemyOfPlayer(player, cmd.target) || IsOwnedByNeutralOfPlayer(player, cmd.target))) | !(IsOwnedByEnemyOfPlayer(player, cmd.target) || IsOwnedByNeutralOfPlayer(player, cmd.target))) | ||||
warn("Invalid command: attack target is not owned by enemy of player "+player+": "+uneval(cmd)); | warn("Invalid command: attack target is not owned by enemy of player "+player+": "+uneval(cmd)); | ||||
GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { | GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { | ||||
cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued); | cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued); | ||||
}); | }); | ||||
}, | }, | ||||
"attack-ground": function(player, cmd, data) | |||||
{ | |||||
let entities = []; | |||||
let target = new Vector3D(cmd.target.x, cmd.target.y, cmd.target.z); | |||||
for (let ent of data.entities) | |||||
{ | |||||
let cmpAttack = Engine.QueryInterface(ent, IID_Attack); | |||||
if (cmpAttack && cmpAttack.CanAttackGround()) | |||||
entities.push(ent); | |||||
Stan: Dead code. | |||||
Done Inline ActionsYep, if I can't get the formations working this should be the case. Freagarach: Yep, if I can't get the formations working this should be the case. | |||||
} | |||||
GetFormationUnitAIs(entities, player).forEach(cmpUnitAI => { | |||||
cmpUnitAI.AttackGround(target, cmd.radius, cmd.queued); | |||||
}); | |||||
}, | |||||
"patrol": function(player, cmd, data) | "patrol": function(player, cmd, data) | ||||
{ | { | ||||
let allowCapture = cmd.allowCapture || cmd.allowCapture == null; | let allowCapture = cmd.allowCapture || cmd.allowCapture == null; | ||||
GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => | GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => | ||||
cmpUnitAI.Patrol(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued) | cmpUnitAI.Patrol(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued) | ||||
); | ); | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 1,514 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Dead code.