Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | |||||
m.EntityCollection.prototype.moveToRange = function(x, z, min, max, queued = false) | m.EntityCollection.prototype.moveToRange = function(x, z, min, max, queued = false) | ||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": this.toIdArray(), "x": x, "z": z, | Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": this.toIdArray(), "x": x, "z": z, | ||||
"min": min, "max": max, "queued": queued }); | "min": min, "max": max, "queued": queued }); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.attackMove = function(x, z, targetClasses, allowCapture = true, queued = false) | m.EntityCollection.prototype.attackMove = function(x, z, targetClasses, prefAttackTypes = ["Capture"], queued = false) | ||||
bb: this line needs change | |||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": this.toIdArray(), "x": x, "z": z, | Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": this.toIdArray(), "x": x, "z": z, | ||||
"targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued }); | "targetClasses": targetClasses, "prefAttackTypes": prefAttackTypes, "queued": queued }); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.moveIndiv = function(x, z, queued = false) | m.EntityCollection.prototype.moveIndiv = function(x, z, queued = false) | ||||
{ | { | ||||
for (let id of this._entities.keys()) | for (let id of this._entities.keys()) | ||||
Engine.PostCommand(PlayerID, { "type": "walk", "entities": [id], "x": x, "z": z, "queued": queued }); | Engine.PostCommand(PlayerID, { "type": "walk", "entities": [id], "x": x, "z": z, "queued": queued }); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.garrison = function(target) | m.EntityCollection.prototype.garrison = function(target) | ||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "garrison", "entities": this.toIdArray(), "target": target.id() }); | Engine.PostCommand(PlayerID, { "type": "garrison", "entities": this.toIdArray(), "target": target.id() }); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.destroy = function() | m.EntityCollection.prototype.destroy = function() | ||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "delete-entities", "entities": this.toIdArray() }); | Engine.PostCommand(PlayerID, { "type": "delete-entities", "entities": this.toIdArray() }); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.attack = function(unitId) | m.EntityCollection.prototype.attack = function(unitId, prefAttackTypes) | ||||
Done Inline Actionsadd some arguments bb: add some arguments | |||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "attack", "entities": this.toIdArray(), "target": unitId, "queued": false }); | Engine.PostCommand(PlayerID, { "type": "attack", "entities": this.toIdArray(), "target": unitId, "prefAttackTypes": prefAttackTypes, "queued": false }); | ||||
Done Inline Actionsnuke bb: nuke | |||||
return this; | return this; | ||||
}; | }; | ||||
/** violent, aggressive, defensive, passive, standground */ | /** violent, aggressive, defensive, passive, standground */ | ||||
m.EntityCollection.prototype.setStance = function(stance) | m.EntityCollection.prototype.setStance = function(stance) | ||||
{ | { | ||||
Engine.PostCommand(PlayerID, { "type": "stance", "entities": this.toIdArray(), "name": stance, "queued": false }); | Engine.PostCommand(PlayerID, { "type": "stance", "entities": this.toIdArray(), "name": stance, "queued": false }); | ||||
return this; | return this; | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
this line needs change