Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/entity.js
Show First 20 Lines • Show All 744 Lines • ▼ Show 20 Lines | m.Entity = m.Class({ | ||||
garrisoned: function() { return this._entity.garrisoned; }, | garrisoned: function() { return this._entity.garrisoned; }, | ||||
canGarrisonInside: function() { return this._entity.garrisoned.length < this.garrisonMax(); }, | canGarrisonInside: function() { return this._entity.garrisoned.length < this.garrisonMax(); }, | ||||
"canCapture": function() { return this.get("Attack/Capture") !== undefined; }, | "canCapture": function() { return this.get("Attack/Capture") !== undefined; }, | ||||
"isCapturable": function() { return this.get("Capturable") !== undefined; }, | "isCapturable": function() { return this.get("Capturable") !== undefined; }, | ||||
"canGuard": function() { return this.get("UnitAI/CanGuard") === "true"; }, | "canGuard": function() { return this.get("UnitAI/CanGuard") === "true"; }, | ||||
"canGarrison": function() { return this.get("Garrisonable") !== undefined; }, | |||||
move: function(x, z, queued = false) { | move: function(x, z, queued = false) { | ||||
Engine.PostCommand(PlayerID,{"type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued }); | Engine.PostCommand(PlayerID,{"type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued }); | ||||
return this; | return this; | ||||
}, | }, | ||||
moveToRange: function(x, z, min, max, queued = false) { | moveToRange: function(x, z, min, max, queued = false) { | ||||
Engine.PostCommand(PlayerID,{"type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued }); | Engine.PostCommand(PlayerID,{"type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued }); | ||||
return this; | return this; | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator