Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/entity.js
Show First 20 Lines • Show All 762 Lines • ▼ Show 20 Lines | "canCapture": function(target) | ||||
let restrictedClasses = this.get("Attack/Capture/RestrictedClasses/_string"); | let restrictedClasses = this.get("Attack/Capture/RestrictedClasses/_string"); | ||||
return !restrictedClasses || !MatchesClassList(target.classes(), restrictedClasses); | return !restrictedClasses || !MatchesClassList(target.classes(), restrictedClasses); | ||||
}, | }, | ||||
"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") !== "false"; }, | |||||
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