Differential D1150 Diff 4823 ps/trunk/binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | m.EntityCollection.prototype.forEach = function(callback) | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.hasEntities = function() | m.EntityCollection.prototype.hasEntities = function() | ||||
{ | { | ||||
return this._entities.size !== 0; | return this._entities.size !== 0; | ||||
}; | }; | ||||
m.EntityCollection.prototype.move = function(x, z, queued) | m.EntityCollection.prototype.move = function(x, z, queued = false) | ||||
{ | { | ||||
queued = queued || false; | |||||
Engine.PostCommand(PlayerID,{"type": "walk", "entities": this.toIdArray(), "x": x, "z": z, "queued": queued}); | Engine.PostCommand(PlayerID,{"type": "walk", "entities": this.toIdArray(), "x": x, "z": z, "queued": queued}); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.moveToRange = function(x, z, min, max, queued) | m.EntityCollection.prototype.moveToRange = function(x, z, min, max, queued = false) | ||||
{ | { | ||||
queued = 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, queued) | m.EntityCollection.prototype.attackMove = function(x, z, targetClasses, allowCapture = true, queued = false) | ||||
{ | { | ||||
queued = queued || false; | 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, "queued": queued}); | "targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued}); | ||||
return this; | return this; | ||||
}; | }; | ||||
m.EntityCollection.prototype.moveIndiv = function(x, z, queued) | m.EntityCollection.prototype.moveIndiv = function(x, z, queued = false) | ||||
{ | { | ||||
queued = 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()}); | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator