mlogjs 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Compiler.d.ts +39 -0
- package/dist/CompilerError.d.ts +33 -0
- package/dist/Scope.d.ts +24 -0
- package/dist/assertions.d.ts +28 -0
- package/dist/bin.cjs +7 -14
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.d.ts +1 -0
- package/dist/handlers/BlockStatement.d.ts +2 -0
- package/dist/handlers/CallExpression.d.ts +4 -0
- package/dist/handlers/File.d.ts +2 -0
- package/dist/handlers/ForStatement.d.ts +2 -0
- package/dist/handlers/Function.d.ts +5 -0
- package/dist/handlers/Identifier.d.ts +2 -0
- package/dist/handlers/IfStatement.d.ts +2 -0
- package/dist/handlers/Literal.d.ts +5 -0
- package/dist/handlers/Object.d.ts +6 -0
- package/dist/handlers/OperationExpressions.d.ts +8 -0
- package/dist/handlers/Program.d.ts +2 -0
- package/dist/handlers/Statements.d.ts +5 -0
- package/dist/handlers/SwitchStatement.d.ts +2 -0
- package/dist/handlers/TemplateExpression.d.ts +2 -0
- package/dist/handlers/Typescript.d.ts +7 -0
- package/dist/handlers/VariableDeclaration.d.ts +3 -0
- package/dist/handlers/WhileStatement.d.ts +3 -0
- package/dist/handlers/index.d.ts +17 -0
- package/dist/index.cjs +1037 -315
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +1037 -315
- package/dist/index.mjs.map +1 -1
- package/dist/initScope.d.ts +5 -0
- package/dist/instructions/AddressResolver.d.ts +12 -0
- package/dist/instructions/ControlInstructions.d.ts +10 -0
- package/dist/instructions/EndInstruction.d.ts +4 -0
- package/dist/instructions/InstructionBase.d.ts +14 -0
- package/dist/instructions/JumpInstruction.d.ts +16 -0
- package/dist/instructions/OperationInstruction.d.ts +5 -0
- package/dist/instructions/SetCounterInstruction.d.ts +5 -0
- package/dist/instructions/SetInstruction.d.ts +6 -0
- package/dist/instructions/ZeroSpaceInstruction.d.ts +4 -0
- package/dist/instructions/index.d.ts +9 -0
- package/dist/{types/macros/RawValue.d.ts → macros/Asm.d.ts} +1 -1
- package/dist/macros/Function.d.ts +13 -0
- package/dist/macros/GetGlobal.d.ts +5 -0
- package/dist/macros/Math.d.ts +5 -0
- package/dist/macros/Memory.d.ts +5 -0
- package/dist/macros/Namespace.d.ts +13 -0
- package/dist/macros/Other.d.ts +5 -0
- package/dist/macros/commands/ApplyStatus.d.ts +5 -0
- package/dist/macros/commands/Control.d.ts +5 -0
- package/dist/macros/commands/Cutscene.d.ts +5 -0
- package/dist/macros/commands/Draw.d.ts +5 -0
- package/dist/macros/commands/DrawFlush.d.ts +5 -0
- package/dist/macros/commands/End.d.ts +5 -0
- package/dist/macros/commands/Explosion.d.ts +5 -0
- package/dist/macros/commands/Fetch.d.ts +5 -0
- package/dist/macros/commands/FlushMessage.d.ts +5 -0
- package/dist/macros/commands/GetBlock.d.ts +5 -0
- package/dist/macros/commands/GetFlag.d.ts +5 -0
- package/dist/macros/commands/GetLink.d.ts +5 -0
- package/dist/macros/commands/Lookup.d.ts +5 -0
- package/dist/macros/commands/PackColor.d.ts +5 -0
- package/dist/macros/commands/Print.d.ts +5 -0
- package/dist/macros/commands/PrintFlush.d.ts +5 -0
- package/dist/macros/commands/Radar.d.ts +7 -0
- package/dist/macros/commands/Sensor.d.ts +5 -0
- package/dist/macros/commands/SetBlock.d.ts +5 -0
- package/dist/macros/commands/SetFlag.d.ts +5 -0
- package/dist/macros/commands/SetRate.d.ts +5 -0
- package/dist/macros/commands/SetRule.d.ts +5 -0
- package/dist/macros/commands/SpawnUnit.d.ts +5 -0
- package/dist/macros/commands/SpawnWave.d.ts +5 -0
- package/dist/macros/commands/Stop.d.ts +5 -0
- package/dist/macros/commands/UnitBind.d.ts +5 -0
- package/dist/macros/commands/UnitControl.d.ts +5 -0
- package/dist/macros/commands/UnitLocate.d.ts +5 -0
- package/dist/macros/commands/UnitRadar.d.ts +5 -0
- package/dist/macros/commands/Wait.d.ts +5 -0
- package/dist/macros/commands/index.d.ts +30 -0
- package/dist/macros/index.d.ts +6 -0
- package/dist/macros/util.d.ts +18 -0
- package/dist/operators.d.ts +25 -0
- package/dist/types/Compiler.d.ts +17 -4
- package/dist/types/CompilerError.d.ts +28 -4
- package/dist/types/assertions.d.ts +28 -0
- package/dist/types/handlers/CallExpression.d.ts +1 -0
- package/dist/types/handlers/SwitchStatement.d.ts +2 -0
- package/dist/types/handlers/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/instructions/ControlInstructions.d.ts +3 -1
- package/dist/types/instructions/InstructionBase.d.ts +5 -1
- package/dist/types/instructions/JumpInstruction.d.ts +1 -0
- package/dist/types/macros/Asm.d.ts +5 -0
- package/dist/types/macros/Namespace.d.ts +0 -3
- package/dist/types/macros/commands/ApplyStatus.d.ts +5 -0
- package/dist/types/macros/commands/Control.d.ts +2 -2
- package/dist/types/macros/commands/Cutscene.d.ts +5 -0
- package/dist/types/macros/commands/Draw.d.ts +2 -2
- package/dist/types/macros/commands/Explosion.d.ts +5 -0
- package/dist/types/macros/commands/Fetch.d.ts +5 -0
- package/dist/types/macros/commands/FlushMessage.d.ts +5 -0
- package/dist/types/macros/commands/GetBlock.d.ts +5 -0
- package/dist/types/macros/commands/GetFlag.d.ts +5 -0
- package/dist/types/macros/commands/Lookup.d.ts +2 -2
- package/dist/types/macros/commands/PackColor.d.ts +5 -0
- package/dist/types/macros/commands/Radar.d.ts +2 -2
- package/dist/types/macros/commands/SetBlock.d.ts +5 -0
- package/dist/types/macros/commands/SetFlag.d.ts +5 -0
- package/dist/types/macros/commands/SetRate.d.ts +5 -0
- package/dist/types/macros/commands/SetRule.d.ts +5 -0
- package/dist/types/macros/commands/SpawnUnit.d.ts +5 -0
- package/dist/types/macros/commands/SpawnWave.d.ts +5 -0
- package/dist/types/macros/commands/Stop.d.ts +5 -0
- package/dist/types/macros/commands/UnitControl.d.ts +3 -3
- package/dist/types/macros/commands/UnitLocate.d.ts +2 -2
- package/dist/types/macros/commands/index.d.ts +15 -0
- package/dist/types/macros/util.d.ts +18 -0
- package/dist/types/types.d.ts +14 -0
- package/dist/types/utils.d.ts +19 -2
- package/dist/types/values/BaseValue.d.ts +2 -0
- package/dist/types/values/FunctionValue.d.ts +1 -1
- package/dist/types/values/ObjectValue.d.ts +1 -1
- package/dist/types.d.ts +238 -0
- package/dist/utils.d.ts +47 -0
- package/dist/values/BaseValue.d.ts +9 -0
- package/dist/values/DestructuringValue.d.ts +17 -0
- package/dist/values/FunctionValue.d.ts +47 -0
- package/dist/values/LiteralValue.d.ts +13 -0
- package/dist/values/ObjectValue.d.ts +23 -0
- package/dist/values/SenseableValue.d.ts +23 -0
- package/dist/{types/values/StackValue.d.ts → values/StoreValue.d.ts} +5 -6
- package/dist/values/ValueOwner.d.ts +27 -0
- package/dist/values/VoidValue.d.ts +16 -0
- package/dist/values/index.d.ts +7 -0
- package/lib/commands.d.ts +849 -418
- package/lib/eslib/lib.es2015.core.d.ts +3 -0
- package/lib/globals.d.ts +331 -19
- package/lib/helpers.d.ts +14 -0
- package/lib/kinds.d.ts +3 -2
- package/lib/memory.d.ts +1 -1
- package/lib/traits.d.ts +6 -0
- package/lib/util.d.ts +16 -0
- package/package.json +15 -16
- package/build/Compiler.js +0 -105
- package/build/Compiler.js.map +0 -1
- package/build/CompilerError.js +0 -11
- package/build/CompilerError.js.map +0 -1
- package/build/Scope.js +0 -71
- package/build/Scope.js.map +0 -1
- package/build/bin.js +0 -75
- package/build/bin.js.map +0 -1
- package/build/handlers/BlockStatement.js +0 -14
- package/build/handlers/BlockStatement.js.map +0 -1
- package/build/handlers/CallExpression.js +0 -20
- package/build/handlers/CallExpression.js.map +0 -1
- package/build/handlers/File.js +0 -9
- package/build/handlers/File.js.map +0 -1
- package/build/handlers/ForStatement.js +0 -32
- package/build/handlers/ForStatement.js.map +0 -1
- package/build/handlers/Function.js +0 -47
- package/build/handlers/Function.js.map +0 -1
- package/build/handlers/Identifier.js +0 -8
- package/build/handlers/Identifier.js.map +0 -1
- package/build/handlers/IfStatement.js +0 -25
- package/build/handlers/IfStatement.js.map +0 -1
- package/build/handlers/Literal.js +0 -15
- package/build/handlers/Literal.js.map +0 -1
- package/build/handlers/Object.js +0 -55
- package/build/handlers/Object.js.map +0 -1
- package/build/handlers/OperationExpressions.js +0 -38
- package/build/handlers/OperationExpressions.js.map +0 -1
- package/build/handlers/Program.js +0 -9
- package/build/handlers/Program.js.map +0 -1
- package/build/handlers/Statements.js +0 -30
- package/build/handlers/Statements.js.map +0 -1
- package/build/handlers/TemplateExpression.js +0 -18
- package/build/handlers/TemplateExpression.js.map +0 -1
- package/build/handlers/VariableDeclaration.js +0 -72
- package/build/handlers/VariableDeclaration.js.map +0 -1
- package/build/handlers/WhileStatement.js +0 -23
- package/build/handlers/WhileStatement.js.map +0 -1
- package/build/handlers/index.js +0 -32
- package/build/handlers/index.js.map +0 -1
- package/build/index.js +0 -8
- package/build/index.js.map +0 -1
- package/build/initScope.js +0 -40
- package/build/initScope.js.map +0 -1
- package/build/instructions/AddressResolver.js +0 -31
- package/build/instructions/AddressResolver.js.map +0 -1
- package/build/instructions/ControlInstructions.js +0 -23
- package/build/instructions/ControlInstructions.js.map +0 -1
- package/build/instructions/EndInstruction.js +0 -11
- package/build/instructions/EndInstruction.js.map +0 -1
- package/build/instructions/InstructionBase.js +0 -21
- package/build/instructions/InstructionBase.js.map +0 -1
- package/build/instructions/JumpInstruction.js +0 -22
- package/build/instructions/JumpInstruction.js.map +0 -1
- package/build/instructions/OperationInstruction.js +0 -11
- package/build/instructions/OperationInstruction.js.map +0 -1
- package/build/instructions/SetCounterInstruction.js +0 -11
- package/build/instructions/SetCounterInstruction.js.map +0 -1
- package/build/instructions/SetInstruction.js +0 -11
- package/build/instructions/SetInstruction.js.map +0 -1
- package/build/instructions/ZeroSpaceInstruction.js +0 -11
- package/build/instructions/ZeroSpaceInstruction.js.map +0 -1
- package/build/instructions/index.js +0 -26
- package/build/instructions/index.js.map +0 -1
- package/build/macros/Building.js +0 -89
- package/build/macros/Building.js.map +0 -1
- package/build/macros/Function.js +0 -20
- package/build/macros/Function.js.map +0 -1
- package/build/macros/Math.js +0 -62
- package/build/macros/Math.js.map +0 -1
- package/build/macros/Memory.js +0 -63
- package/build/macros/Memory.js.map +0 -1
- package/build/macros/Namespace.js +0 -111
- package/build/macros/Namespace.js.map +0 -1
- package/build/macros/Other.js +0 -21
- package/build/macros/Other.js.map +0 -1
- package/build/macros/RawValue.js +0 -17
- package/build/macros/RawValue.js.map +0 -1
- package/build/macros/commands/Control.js +0 -26
- package/build/macros/commands/Control.js.map +0 -1
- package/build/macros/commands/Draw.js +0 -40
- package/build/macros/commands/Draw.js.map +0 -1
- package/build/macros/commands/DrawFlush.js +0 -18
- package/build/macros/commands/DrawFlush.js.map +0 -1
- package/build/macros/commands/GetLink.js +0 -25
- package/build/macros/commands/GetLink.js.map +0 -1
- package/build/macros/commands/Lookup.js +0 -25
- package/build/macros/commands/Lookup.js.map +0 -1
- package/build/macros/commands/Print.js +0 -18
- package/build/macros/commands/Print.js.map +0 -1
- package/build/macros/commands/PrintFlush.js +0 -18
- package/build/macros/commands/PrintFlush.js.map +0 -1
- package/build/macros/commands/Radar.js +0 -65
- package/build/macros/commands/Radar.js.map +0 -1
- package/build/macros/commands/Sensor.js +0 -21
- package/build/macros/commands/Sensor.js.map +0 -1
- package/build/macros/commands/UnitBind.js +0 -18
- package/build/macros/commands/UnitBind.js.map +0 -1
- package/build/macros/commands/UnitControl.js +0 -73
- package/build/macros/commands/UnitControl.js.map +0 -1
- package/build/macros/commands/UnitLocate.js +0 -76
- package/build/macros/commands/UnitLocate.js.map +0 -1
- package/build/macros/commands/UnitRadar.js +0 -48
- package/build/macros/commands/UnitRadar.js.map +0 -1
- package/build/macros/commands/Wait.js +0 -19
- package/build/macros/commands/Wait.js.map +0 -1
- package/build/macros/commands/index.js +0 -33
- package/build/macros/commands/index.js.map +0 -1
- package/build/macros/index.js +0 -40
- package/build/macros/index.js.map +0 -1
- package/build/operators.js +0 -102
- package/build/operators.js.map +0 -1
- package/build/types.js +0 -28
- package/build/types.js.map +0 -1
- package/build/utils.js +0 -18
- package/build/utils.js.map +0 -1
- package/build/values/BaseValue.js +0 -112
- package/build/values/BaseValue.js.map +0 -1
- package/build/values/FunctionValue.js +0 -116
- package/build/values/FunctionValue.js.map +0 -1
- package/build/values/LiteralValue.js +0 -89
- package/build/values/LiteralValue.js.map +0 -1
- package/build/values/ObjectValue.js +0 -55
- package/build/values/ObjectValue.js.map +0 -1
- package/build/values/StoreValue.js +0 -32
- package/build/values/StoreValue.js.map +0 -1
- package/build/values/TempValue.js +0 -78
- package/build/values/TempValue.js.map +0 -1
- package/build/values/VoidValue.js +0 -32
- package/build/values/VoidValue.js.map +0 -1
- package/build/values/index.js +0 -23
- package/build/values/index.js.map +0 -1
- package/dist/types/macros/Building.d.ts +0 -10
- package/dist/types/macros/Entities.d.ts +0 -11
- package/dist/types/values/TempValue.d.ts +0 -19
package/lib/commands.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import "./kind";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TRadarFilter,
|
|
4
|
+
TRadarSort,
|
|
5
|
+
TUnitEffect,
|
|
6
|
+
TUnitLocateBuildingGroup,
|
|
7
|
+
} from "./util";
|
|
3
8
|
declare global {
|
|
4
9
|
/**
|
|
5
10
|
* Appends the items to the print buffer, calling this function
|
|
@@ -8,163 +13,186 @@ declare global {
|
|
|
8
13
|
* To print the contents of the print buffer and empty it call `printFlush`.
|
|
9
14
|
*
|
|
10
15
|
* @param items The items to be added to the print buffer.
|
|
11
|
-
*/
|
|
12
|
-
function print(...items: unknown[]): void;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Fills the screen with a color.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Sets the color for the next drawing operations.
|
|
17
|
+
* ```js
|
|
18
|
+
* // call normally
|
|
19
|
+
* print("a + b = ", left, " + ", right, " = ", left + right)
|
|
23
20
|
*
|
|
24
|
-
*
|
|
21
|
+
* // call with tagged string templates
|
|
22
|
+
* print`a + b = ${left} + ${right} = ${left + right}`
|
|
23
|
+
* ```
|
|
25
24
|
*/
|
|
26
|
-
function
|
|
27
|
-
mode: "color",
|
|
28
|
-
r: number,
|
|
29
|
-
g: number,
|
|
30
|
-
b: number,
|
|
31
|
-
a?: number
|
|
32
|
-
): void;
|
|
25
|
+
function print(...items: unknown[]): void;
|
|
33
26
|
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
/** Contains the multiple variants of the `draw` instruction */
|
|
28
|
+
namespace draw {
|
|
29
|
+
/**
|
|
30
|
+
* Fills the screen with a color.
|
|
31
|
+
*
|
|
32
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
33
|
+
*/
|
|
34
|
+
function clear(r: number, g: number, b: number): void;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the color for the next drawing operations.
|
|
37
|
+
*
|
|
38
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
39
|
+
*/
|
|
40
|
+
function color(r: number, g: number, b: number, a?: number): void;
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
mode: "line",
|
|
48
|
-
x1: number,
|
|
49
|
-
y1: number,
|
|
50
|
-
x2: number,
|
|
51
|
-
y2: number
|
|
52
|
-
): void;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the width of the next lines to be drawn.
|
|
44
|
+
*
|
|
45
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
46
|
+
*/
|
|
47
|
+
function stroke(width: number): void;
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
): void;
|
|
49
|
+
/**
|
|
50
|
+
* Draws a line between two points.
|
|
51
|
+
*
|
|
52
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
53
|
+
*/
|
|
54
|
+
function line(options: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
x2: number;
|
|
58
|
+
y2: number;
|
|
59
|
+
}): void;
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
): void;
|
|
61
|
+
/**
|
|
62
|
+
* Draws a filled rectangle.
|
|
63
|
+
*
|
|
64
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
65
|
+
*/
|
|
66
|
+
function rect(options: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
}): void;
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
y: number,
|
|
92
|
-
sides: number,
|
|
93
|
-
radius: number,
|
|
94
|
-
rotation: number
|
|
95
|
-
): void;
|
|
73
|
+
/**
|
|
74
|
+
* Draws a rectangle outline.
|
|
75
|
+
*
|
|
76
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
77
|
+
*/
|
|
78
|
+
function lineRect(options: {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
}): void;
|
|
96
84
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Draws a filled, regular polygon.
|
|
87
|
+
* @param options.sides The number of sides the polygon should have
|
|
88
|
+
* @param options.radius The smallest distance between a line and the center of the polygon
|
|
89
|
+
* @param options.rotation The rotation of the polygon in degrees
|
|
90
|
+
*
|
|
91
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
92
|
+
*/
|
|
93
|
+
function poly(options: {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
/** The number of sides the polygon should have */
|
|
97
|
+
sides: number;
|
|
98
|
+
/** The smallest distance between a line and the center of the polygon */
|
|
99
|
+
radius: number;
|
|
100
|
+
/** The rotation of the polygon in degrees */
|
|
101
|
+
rotation: number;
|
|
102
|
+
}): void;
|
|
114
103
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Draws the outline of a regular polygon.
|
|
106
|
+
* @param options.sides The number of sides the polygon should have
|
|
107
|
+
* @param options.radius The smallest distance between a line and the center of the polygon
|
|
108
|
+
* @param options.rotation The rotation of the polygon in degrees
|
|
109
|
+
*
|
|
110
|
+
*
|
|
111
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
112
|
+
*/
|
|
113
|
+
function linePoly(options: {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
/** The number of sides the polygon should have */
|
|
117
|
+
sides: number;
|
|
118
|
+
/** The smallest distance between a line and the center of the polygon */
|
|
119
|
+
radius: number;
|
|
120
|
+
/** The rotation of the polygon in degrees */
|
|
121
|
+
rotation: number;
|
|
122
|
+
}): void;
|
|
129
123
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Draws a filled triangle.
|
|
126
|
+
*
|
|
127
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
128
|
+
*/
|
|
129
|
+
function triangle(options: {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
x2: number;
|
|
133
|
+
y2: number;
|
|
134
|
+
x3: number;
|
|
135
|
+
y3: number;
|
|
136
|
+
}): void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Draws an image of the respective content. (like `Units.dagger` and `Blocks.router`)
|
|
140
|
+
*
|
|
141
|
+
* Warning: nothing is drawn until `drawFlush` is called.
|
|
142
|
+
* @param options.image The symbol for the image to be drawn.
|
|
143
|
+
* @param options.rotation The rotation of the image in degrees.
|
|
144
|
+
*
|
|
145
|
+
* Example:
|
|
146
|
+
* ```js
|
|
147
|
+
* // draw a router
|
|
148
|
+
* draw({
|
|
149
|
+
* mode: "image",
|
|
150
|
+
* x: 30,
|
|
151
|
+
* y: 30,
|
|
152
|
+
* image: Blocks.router,
|
|
153
|
+
* size: 15,
|
|
154
|
+
* rotation: 0
|
|
155
|
+
* });
|
|
156
|
+
*
|
|
157
|
+
* // draw the unit bound to the processor
|
|
158
|
+
* draw({
|
|
159
|
+
* mode: "image",
|
|
160
|
+
* x: 60,
|
|
161
|
+
* y: 60,
|
|
162
|
+
* image: Vars.unit.type,
|
|
163
|
+
* size: 15,
|
|
164
|
+
* rotation: 0
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
function image(options: {
|
|
169
|
+
x: number;
|
|
170
|
+
y: number;
|
|
171
|
+
/** The symbol for the image to be drawn. */
|
|
172
|
+
image: symbol;
|
|
173
|
+
size: number;
|
|
174
|
+
/** The rotation of the image in degrees. */
|
|
175
|
+
rotation: number;
|
|
176
|
+
}): void;
|
|
177
|
+
}
|
|
154
178
|
|
|
155
179
|
/**
|
|
156
180
|
* Writes the contents of the print buffer into the target message
|
|
157
181
|
* and clears the buffer afterwards.
|
|
158
|
-
* @param target
|
|
182
|
+
* @param target The message building to write to. Writes to `message1` by default.
|
|
183
|
+
*
|
|
184
|
+
* Note that the default value only applies if you don't pass any parameter to this function.
|
|
159
185
|
*/
|
|
160
|
-
function printFlush(target
|
|
186
|
+
function printFlush(target?: BasicBuilding): void;
|
|
161
187
|
|
|
162
188
|
/**
|
|
163
189
|
* Writes the contents of the draw buffer into the target display
|
|
164
190
|
* and clears the buffer afterwards.
|
|
165
|
-
* @param target
|
|
191
|
+
* @param target The display building to write to. Writes to `display1` by default.
|
|
192
|
+
*
|
|
193
|
+
* Note that the default value only applies if you don't pass any parameter to this function.
|
|
166
194
|
*/
|
|
167
|
-
function drawFlush(target
|
|
195
|
+
function drawFlush(target?: BasicBuilding): void;
|
|
168
196
|
|
|
169
197
|
/**
|
|
170
198
|
* Gets a block link by its index.
|
|
@@ -182,86 +210,89 @@ declare global {
|
|
|
182
210
|
*/
|
|
183
211
|
function getLink<T extends BasicBuilding = AnyBuilding>(index: number): T;
|
|
184
212
|
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
building: BasicBuilding,
|
|
191
|
-
value: boolean
|
|
192
|
-
): void;
|
|
213
|
+
/** Contains the multiple variants of the `control` instruction */
|
|
214
|
+
namespace control {
|
|
215
|
+
/**
|
|
216
|
+
* Sets whether the building is enabled or disabled.
|
|
217
|
+
*/
|
|
218
|
+
function enabled(building: BasicBuilding, value: boolean): void;
|
|
193
219
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Makes the building shoot or aim at the given position
|
|
222
|
+
* @param options.building The shooting building
|
|
223
|
+
* @param options.shoot `true` to shoot, `false` to just aim at the position
|
|
224
|
+
*/
|
|
225
|
+
function shoot(options: {
|
|
226
|
+
/** The shooting building */
|
|
227
|
+
building: BasicBuilding & Shooting;
|
|
228
|
+
x: number;
|
|
229
|
+
y: number;
|
|
230
|
+
/** `true` to shoot, `false` to just aim at the position */
|
|
231
|
+
shoot: boolean;
|
|
232
|
+
}): void;
|
|
206
233
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
234
|
+
/**
|
|
235
|
+
* Shoot at an unit with velocity prediction
|
|
236
|
+
* @param options.building The shooting building
|
|
237
|
+
* @param options.unit The target unit
|
|
238
|
+
* @param options.shoot `true` to shoot, `false` to just aim
|
|
239
|
+
*/
|
|
240
|
+
function shootp(options: {
|
|
241
|
+
/** The shooting building */
|
|
242
|
+
building: BasicBuilding & Shooting;
|
|
243
|
+
/** The target unit */
|
|
244
|
+
unit: BasicUnit;
|
|
245
|
+
/** `true` to shoot, `false` to just aim */
|
|
246
|
+
shoot: boolean;
|
|
247
|
+
}): void;
|
|
219
248
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
kind: "config",
|
|
225
|
-
building: BasicBuilding,
|
|
226
|
-
value: symbol
|
|
227
|
-
): void;
|
|
249
|
+
/**
|
|
250
|
+
* Sets the config of a block (like the item of a sorter)
|
|
251
|
+
*/
|
|
252
|
+
function config(building: BasicBuilding, value: symbol): void;
|
|
228
253
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
254
|
+
/**
|
|
255
|
+
* Sets the color of an illuminator
|
|
256
|
+
*/
|
|
257
|
+
function color(
|
|
258
|
+
building: BasicBuilding,
|
|
259
|
+
r: number,
|
|
260
|
+
g: number,
|
|
261
|
+
b: number
|
|
262
|
+
): void;
|
|
263
|
+
}
|
|
239
264
|
|
|
240
265
|
/**
|
|
241
266
|
* Detects an unit nearby this `building`.
|
|
242
|
-
* @param building The building used to detect potential targets
|
|
243
|
-
* @param
|
|
244
|
-
* @param
|
|
245
|
-
* @param filter3 Third filter for selecting a target. Setting it to "any" ignores it
|
|
246
|
-
* @param order The n th unit that fits these requirements based on the sorting method
|
|
267
|
+
* @param options.building The building used to detect potential targets
|
|
268
|
+
* @param options.filters The filters for selecting a target. Use "any" for any target.
|
|
269
|
+
* @param options.order The n th unit that fits these requirements based on the sorting method
|
|
247
270
|
* (1 => first unit, 2 => second unit and so on)
|
|
248
|
-
* @param sort The method on which the results should be sorted
|
|
271
|
+
* @param options.sort The method on which the results should be sorted
|
|
249
272
|
*
|
|
250
273
|
* Example:
|
|
251
274
|
* ```js
|
|
252
275
|
* const turret = getBuilding("cyclone1")
|
|
253
276
|
* // returns the second nearest enemy unit
|
|
254
|
-
* const result = radar(
|
|
277
|
+
* const result = radar({
|
|
278
|
+
* building: turret,
|
|
279
|
+
* filters: ["enemy", "any", "any"],
|
|
280
|
+
* order: 2,
|
|
281
|
+
* sort: "distance"
|
|
282
|
+
* });
|
|
255
283
|
* ```
|
|
256
284
|
*/
|
|
257
|
-
function radar<T extends BasicUnit = AnyUnit>(
|
|
258
|
-
building
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
285
|
+
function radar<T extends BasicUnit = AnyUnit>(options: {
|
|
286
|
+
/** The building used to detect potential targets */
|
|
287
|
+
building: BasicBuilding;
|
|
288
|
+
/** The filters for selecting a target. Use "any" for any target. */
|
|
289
|
+
filters: [TRadarFilter, TRadarFilter, TRadarFilter];
|
|
290
|
+
/** The n th unit that fits these requirements based on the sorting method
|
|
291
|
+
* (1 => first unit, 2 => second unit and so on) */
|
|
292
|
+
order: number;
|
|
293
|
+
/** The method on which the results should be sorted */
|
|
294
|
+
sort: TRadarSort;
|
|
295
|
+
}): T;
|
|
265
296
|
|
|
266
297
|
/**
|
|
267
298
|
* Alternate way to access special properties on objects.
|
|
@@ -287,246 +318,646 @@ declare global {
|
|
|
287
318
|
*/
|
|
288
319
|
function wait(seconds: number): void;
|
|
289
320
|
|
|
321
|
+
namespace lookup {
|
|
322
|
+
/**
|
|
323
|
+
* Looks up a block symbol by it's index on the content registry.
|
|
324
|
+
*
|
|
325
|
+
* Use `Vars.blockCount` to check the maximum index allowed.
|
|
326
|
+
*
|
|
327
|
+
* Example:
|
|
328
|
+
* ```js
|
|
329
|
+
* if(index < Vars.blockCount) {
|
|
330
|
+
* let blockKind = lookup.block(index);
|
|
331
|
+
* }
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
function block(index: number): BlockSymbol;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Looks up an unit symbol by it's index on the content registry.
|
|
338
|
+
*
|
|
339
|
+
* Use `Vars.unitCount` to check the maximum index allowed.
|
|
340
|
+
*
|
|
341
|
+
* Example:
|
|
342
|
+
* ```js
|
|
343
|
+
* if(index < Vars.unitCount) {
|
|
344
|
+
* let unitKind = lookup.unit(index);
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
function unit(index: number): UnitSymbol | null;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Looks up an item symbol by it's index on the content registry.
|
|
352
|
+
*
|
|
353
|
+
* Use `Vars.itemCount` to check the maximum index allowed.
|
|
354
|
+
*
|
|
355
|
+
* Example:
|
|
356
|
+
* ```js
|
|
357
|
+
* if(index < Vars.itemCount) {
|
|
358
|
+
* let itemKind = lookup.item(index);
|
|
359
|
+
* }
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
function item(index: number): ItemSymbol | null;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Looks up a liquid symbol by it's index on the content registry.
|
|
366
|
+
*
|
|
367
|
+
* Use `Vars.liquidCount` to check the maximum index allowed.
|
|
368
|
+
*
|
|
369
|
+
* Example:
|
|
370
|
+
* ```js
|
|
371
|
+
* if(index < Vars.liquidCount) {
|
|
372
|
+
* let liquidKind = lookup.liquid(index);
|
|
373
|
+
* }
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
function liquid(index: number): LiquidSymbol | null;
|
|
377
|
+
}
|
|
378
|
+
|
|
290
379
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
* Use `Vars.blockCount` to check the maximum index allowed.
|
|
294
|
-
*
|
|
295
|
-
* Example:
|
|
296
|
-
* ```js
|
|
297
|
-
* if(index < Vars.blockCount) {
|
|
298
|
-
* let blockKind = lookup("block", index);
|
|
299
|
-
* }
|
|
300
|
-
* ```
|
|
301
|
-
*/
|
|
302
|
-
function lookup(kind: "block", index: number): BlockSymbol;
|
|
303
|
-
/**
|
|
304
|
-
* Looks up an unit symbol by it's index on the content registry.
|
|
305
|
-
*
|
|
306
|
-
* Use `Vars.unitCount` to check the maximum index allowed.
|
|
307
|
-
*
|
|
308
|
-
* Example:
|
|
309
|
-
* ```js
|
|
310
|
-
* if(index < Vars.unitCount) {
|
|
311
|
-
* let unitKind = lookup("unit", index);
|
|
312
|
-
* }
|
|
313
|
-
* ```
|
|
314
|
-
*/
|
|
315
|
-
function lookup(kind: "unit", index: number): UnitSymbol | null;
|
|
316
|
-
/**
|
|
317
|
-
* Looks up an item symbol by it's index on the content registry.
|
|
318
|
-
*
|
|
319
|
-
* Use `Vars.itemCount` to check the maximum index allowed.
|
|
320
|
-
*
|
|
321
|
-
* Example:
|
|
322
|
-
* ```js
|
|
323
|
-
* if(index < Vars.itemCount) {
|
|
324
|
-
* let itemKind = lookup("item", index);
|
|
325
|
-
* }
|
|
326
|
-
* ```
|
|
327
|
-
*/
|
|
328
|
-
function lookup(kind: "item", index: number): ItemSymbol | null;
|
|
329
|
-
/**
|
|
330
|
-
* Looks up a liquid symbol by it's index on the content registry.
|
|
380
|
+
* Packs RGBA color information into a single number.
|
|
331
381
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* Example:
|
|
335
|
-
* ```js
|
|
336
|
-
* if(index < Vars.liquidCount) {
|
|
337
|
-
* let liquidKind = lookup("liquid", index);
|
|
338
|
-
* }
|
|
339
|
-
* ```
|
|
382
|
+
* Each paremeter must range from `0` to `1`.
|
|
340
383
|
*/
|
|
341
|
-
function
|
|
384
|
+
function packColor(r: number, g: number, b: number, a: number): number;
|
|
342
385
|
|
|
343
386
|
/**
|
|
344
387
|
* Binds an unit to the this processor. The unit is accessible at `Vars.unit`
|
|
345
388
|
*/
|
|
346
389
|
function unitBind(type: UnitSymbol): void;
|
|
347
390
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
391
|
+
namespace unitControl {
|
|
392
|
+
/**
|
|
393
|
+
* Makes the unit bound to this processor stop moving but
|
|
394
|
+
* allows it to keep doing it's action (like mining or building)
|
|
395
|
+
*/
|
|
396
|
+
function idle(): void;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Makes the unit bound to this processor stop mining, building and moving
|
|
400
|
+
*/
|
|
401
|
+
function stop(): void;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Makes the unit bound to this processor move to the given position
|
|
405
|
+
*/
|
|
406
|
+
function move(x: number, y: number): void;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Makes the unit bound to this processor approach the given position at the given radius
|
|
410
|
+
* @param options.radius How distant to the position the unit can be
|
|
411
|
+
*/
|
|
412
|
+
function approach(options: {
|
|
413
|
+
x: number;
|
|
414
|
+
y: number;
|
|
415
|
+
/** How distant to the position the unit can be */
|
|
416
|
+
radius: number;
|
|
417
|
+
}): void;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Whether the unit bound to this processor should be boosted (floating)
|
|
421
|
+
*/
|
|
422
|
+
function boost(enable: boolean): void;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Makes the unit bound to this processor move to the enemy spawn
|
|
426
|
+
*/
|
|
427
|
+
function pathfind(): void;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Makes the unit bound to this processor shoot/aim at the given position
|
|
431
|
+
* @param options.shoot `true` to shoot, `false` to just aim
|
|
432
|
+
*/
|
|
433
|
+
function target(options: {
|
|
434
|
+
x: number;
|
|
435
|
+
y: number;
|
|
436
|
+
/** `true` to shoot, `false` to just aim */
|
|
437
|
+
shoot: boolean;
|
|
438
|
+
}): void;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Makes the unit bound to this processor target an unit with velocity prediction
|
|
442
|
+
* @param options.unit The shoot target
|
|
443
|
+
* @param options.shoot `true` to shoot, `false` to just aim
|
|
444
|
+
*/
|
|
445
|
+
function targetp(options: {
|
|
446
|
+
/** The shoot target */
|
|
447
|
+
unit: BasicUnit;
|
|
448
|
+
/** `true` to shoot, `false` to just aim */
|
|
449
|
+
shoot: boolean;
|
|
450
|
+
}): void;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Makes the unit bound to this processor drop it's held items onto the given target
|
|
454
|
+
* @param target Where to drop the items, if `EnvBlocks.air`, the unit will throw it's items away
|
|
455
|
+
* @param amount How many items should be dropped
|
|
456
|
+
*/
|
|
457
|
+
function itemDrop(
|
|
458
|
+
target: BasicBuilding | typeof Blocks.air,
|
|
459
|
+
amount: number
|
|
460
|
+
): void;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Makes the unit bound to this processor take items from a building
|
|
464
|
+
* @param target The building that will have it's items taken
|
|
465
|
+
* @param item The kind of item to take
|
|
466
|
+
* @param amount How many items should be taken
|
|
467
|
+
*/
|
|
468
|
+
function itemTake(
|
|
469
|
+
target: BasicBuilding,
|
|
470
|
+
item: ItemSymbol,
|
|
471
|
+
amount: number
|
|
472
|
+
): void;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Makes the unit bound to this processor drop one entity from it's payload
|
|
476
|
+
*/
|
|
477
|
+
function payDrop(): void;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Makes the unit bound to this processor take an entity into it's payload
|
|
481
|
+
* @param options.takeUnits Whether to take units or buildings
|
|
482
|
+
*/
|
|
483
|
+
function payTake(options: {
|
|
484
|
+
/** Whether to take units or buildings */
|
|
485
|
+
takeUnits: boolean;
|
|
486
|
+
}): void;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Makes the unit bound to this processor enter/land on the
|
|
490
|
+
* payload block the unit is on
|
|
491
|
+
*/
|
|
492
|
+
function payEnter(): void;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Makes the unit bound to this processor mine at the given position
|
|
496
|
+
*/
|
|
497
|
+
function mine(x: number, y: number): void;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Sets the numeric flag of the unit bound to this processor
|
|
501
|
+
*/
|
|
502
|
+
function flag(value: number): void;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Makes the unit bound to this processor build a building with the
|
|
506
|
+
* given properties
|
|
507
|
+
* @param options.block The kind of building to build
|
|
508
|
+
* @param options.rotation The rotation of the building, ranges from 0 to 3
|
|
509
|
+
* @param options.config The config of the building
|
|
510
|
+
*/
|
|
511
|
+
function build(options: {
|
|
512
|
+
x: number;
|
|
513
|
+
y: number;
|
|
514
|
+
block: BuildingSymbol;
|
|
515
|
+
rotation: number;
|
|
516
|
+
config?: unknown;
|
|
517
|
+
}): void;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Makes the unit bound to this processor data about a block at the given position
|
|
521
|
+
*/
|
|
522
|
+
function getBlock<T extends BasicBuilding = AnyBuilding>(
|
|
523
|
+
x: number,
|
|
524
|
+
y: number
|
|
525
|
+
): [type: BlockSymbol | null, building: T | null];
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Checks if the unit bound to this processor is within a radius of a given position.
|
|
529
|
+
*/
|
|
530
|
+
function within(options: { x: number; y: number; radius: number }): boolean;
|
|
531
|
+
}
|
|
471
532
|
|
|
472
533
|
/**
|
|
473
534
|
* Finds an unit near the unit bound to this processor
|
|
474
|
-
* @param
|
|
475
|
-
* @param
|
|
476
|
-
* @param filter3 Third filter for selecting a target. Setting it to "any" ignores it
|
|
477
|
-
* @param order The n th unit that fits these requirements based on the sorting method
|
|
535
|
+
* @param options.filters The filters for selecting a target. Use "any" for any target.
|
|
536
|
+
* @param options.order The n th unit that fits these requirements based on the sorting method
|
|
478
537
|
* (1 => first unit, 2 => second unit and so on)
|
|
479
|
-
* @param sort The method on which the results should be sorted
|
|
538
|
+
* @param options.sort The method on which the results should be sorted
|
|
480
539
|
*
|
|
481
540
|
* Example:
|
|
482
541
|
* ```js
|
|
483
542
|
* // returns the second nearest enemy unit
|
|
484
|
-
* const result = unitRadar(
|
|
543
|
+
* const result = unitRadar({
|
|
544
|
+
* filters: ["enemy", "any", "any"],
|
|
545
|
+
* order: 2,
|
|
546
|
+
* sort: "distance",
|
|
547
|
+
* });
|
|
485
548
|
* ```
|
|
486
549
|
*/
|
|
487
|
-
function unitRadar<T extends BasicUnit = AnyUnit>(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
550
|
+
function unitRadar<T extends BasicUnit = AnyUnit>(options: {
|
|
551
|
+
/** The filters for selecting a target. Use "any" for any target. */
|
|
552
|
+
filters: [TRadarFilter, TRadarFilter, TRadarFilter];
|
|
553
|
+
/** The n th unit that fits these requirements based on the sorting method
|
|
554
|
+
* (1 => first unit, 2 => second unit and so on) */
|
|
555
|
+
order: number;
|
|
556
|
+
/** The method on which the results should be sorted */
|
|
557
|
+
sort: TRadarSort;
|
|
558
|
+
}): T;
|
|
559
|
+
|
|
560
|
+
namespace unitLocate {
|
|
561
|
+
/**
|
|
562
|
+
* Uses the unit bound to this processor to find an ore vein anywhere on the map
|
|
563
|
+
* @param ore The kind of item the ore should contain
|
|
564
|
+
*/
|
|
565
|
+
function ore(
|
|
566
|
+
ore: ItemSymbol
|
|
567
|
+
): [found: false] | [found: true, x: number, y: number];
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Uses the unit bound to this processor to find a building anywhere on the map
|
|
571
|
+
* @param options.group The group that the building belongs to
|
|
572
|
+
* @param options.enemy Whether it should be an enemy building or an ally one
|
|
573
|
+
*/
|
|
574
|
+
function building<T extends BasicBuilding = AnyBuilding>(options: {
|
|
575
|
+
/** The group that the building belongs to */
|
|
576
|
+
group: TUnitLocateBuildingGroup;
|
|
577
|
+
/** Whether it should be an enemy building or an ally one */
|
|
578
|
+
enemy: boolean;
|
|
579
|
+
}): [found: false] | [found: true, x: number, y: number, building: T];
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Uses the unit bound to this processor to find an enemy spawn anywhere on the map.
|
|
583
|
+
*
|
|
584
|
+
* May return a building (a core) or a position
|
|
585
|
+
*/
|
|
586
|
+
function spawn<T extends BasicBuilding = AnyBuilding>():
|
|
587
|
+
| [found: false]
|
|
588
|
+
| [found: true, x: number, y: number, building: T];
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Uses the unit bound to this processor to find a damaged ally buildings anywhere on the map
|
|
592
|
+
*/
|
|
593
|
+
function damaged<T extends BasicBuilding = AnyBuilding>():
|
|
594
|
+
| [found: false]
|
|
595
|
+
| [found: true, x: number, y: number, building: T];
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**Jumps to the top of the instruction stack*/
|
|
599
|
+
function endScript(): never;
|
|
600
|
+
|
|
601
|
+
/** Halts the execution of this processor */
|
|
602
|
+
function stopScript(): never;
|
|
603
|
+
|
|
604
|
+
/** Gets block data from the map. Available ONLY for world processors. */
|
|
605
|
+
namespace getBlock {
|
|
606
|
+
/** Gets the floor type on the given location */
|
|
607
|
+
function floor(x: number, y: number): EnvBlockSymbol;
|
|
608
|
+
|
|
609
|
+
/** Gets the ore type on the given location. `Blocks.air` if there is no ore */
|
|
610
|
+
function ore(x: number, y: number): OreSymbol | typeof Blocks.air;
|
|
611
|
+
|
|
612
|
+
/** Gets the block type on the give location. `Blocks.air` if there is no block. */
|
|
613
|
+
function block(x: number, y: number): BlockSymbol;
|
|
614
|
+
|
|
615
|
+
/** Gets the building on the given location. `null` if there is no building. */
|
|
616
|
+
function building<T extends BasicBuilding = AnyBuilding>(
|
|
617
|
+
x: number,
|
|
618
|
+
y: number
|
|
619
|
+
): T | null;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
namespace setBlock {
|
|
623
|
+
// TODO: maybe have a separate floor symbol type?
|
|
624
|
+
/** Sets the floor of the tile at the given location. */
|
|
625
|
+
function floor(x: number, y: number, to: EnvBlockSymbol): void;
|
|
626
|
+
|
|
627
|
+
/** Sets the ore at the given location. Use `Blocks.air` to remove any ore. */
|
|
628
|
+
function ore(x: number, y: number, to: OreSymbol | typeof Blocks.air): void;
|
|
629
|
+
|
|
630
|
+
/** Sets the block at a given location, it can be a regular building or an environment block. */
|
|
631
|
+
function block(options: {
|
|
632
|
+
x: number;
|
|
633
|
+
y: number;
|
|
634
|
+
to: EnvBlockSymbol | BuildingSymbol;
|
|
635
|
+
team: TeamSymbol;
|
|
636
|
+
rotation: number;
|
|
637
|
+
}): void;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/** Spawns an unit at the given location */
|
|
641
|
+
function spawnUnit<T extends BasicUnit = AnyUnit>(options: {
|
|
642
|
+
type: UnitSymbol;
|
|
643
|
+
x: number;
|
|
644
|
+
y: number;
|
|
645
|
+
team: TeamSymbol;
|
|
646
|
+
rotation?: number;
|
|
647
|
+
}): T;
|
|
648
|
+
|
|
649
|
+
/** Contains the variants for the `applyStatus` instruction. World processor ONLY. */
|
|
650
|
+
namespace applyStatus {
|
|
651
|
+
/**
|
|
652
|
+
* Applies a status effect to the given unit.
|
|
653
|
+
*
|
|
654
|
+
* The only status effects that don't require a duration are `overdrive` and `boss`.
|
|
655
|
+
*/
|
|
656
|
+
function apply(
|
|
657
|
+
status: Exclude<TUnitEffect, "overdrive" | "boss">,
|
|
658
|
+
unit: BasicUnit,
|
|
659
|
+
duration: number
|
|
660
|
+
): void;
|
|
661
|
+
|
|
662
|
+
function apply(status: "overdrive" | "boss", unit: BasicUnit): void;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Removes a status effect to the given unit.
|
|
666
|
+
*/
|
|
667
|
+
function clear(status: TUnitEffect, unit: BasicUnit): void;
|
|
668
|
+
}
|
|
494
669
|
|
|
495
670
|
/**
|
|
496
|
-
*
|
|
497
|
-
* @param ore The kind of item the ore should contain
|
|
498
|
-
*/
|
|
499
|
-
function unitLocate(
|
|
500
|
-
find: "ore",
|
|
501
|
-
ore: ItemSymbol
|
|
502
|
-
): [found: false] | [found: true, x: number, y: number];
|
|
503
|
-
/**
|
|
504
|
-
* Uses the unit bound to this processor to find a building anywhere on the map
|
|
505
|
-
* @param group The group that the building belongs to
|
|
506
|
-
* @param enemy Whether it should be an enemy building or an ally one
|
|
507
|
-
*/
|
|
508
|
-
function unitLocate<T extends BasicBuilding = AnyBuilding>(
|
|
509
|
-
find: "building",
|
|
510
|
-
group: TUnitLocateBuildingGroup,
|
|
511
|
-
enemy: boolean
|
|
512
|
-
): [found: false] | [found: true, x: number, y: number, building: T];
|
|
513
|
-
/**
|
|
514
|
-
* Uses the unit bound to this processor to find an enemy spawn anywhere on the map.
|
|
671
|
+
* Spawns an enemy wave, can be used even if there is an already active wave.
|
|
515
672
|
*
|
|
516
|
-
*
|
|
517
|
-
* @param find
|
|
673
|
+
* World processor ONLY.
|
|
518
674
|
*/
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
675
|
+
function spawnWave(natural: true): void;
|
|
676
|
+
function spawnWave(natural: false, x: number, y: number): void;
|
|
677
|
+
|
|
678
|
+
/** Contains the multiple variants of the `set rule` instruction. World processor ONLY. */
|
|
679
|
+
namespace setRule {
|
|
680
|
+
/** Sets the wave countdown in seconds. */
|
|
681
|
+
function currentWaveTime(seconds: number): void;
|
|
682
|
+
|
|
683
|
+
/** Enables/disables the wave timer. */
|
|
684
|
+
function waveTimer(enabled: boolean): void;
|
|
685
|
+
|
|
686
|
+
/** Allows or prevents waves from spawning. */
|
|
687
|
+
function waves(enabled: boolean): void;
|
|
688
|
+
|
|
689
|
+
/** Sets the current wave number. */
|
|
690
|
+
function wave(number: number): void;
|
|
691
|
+
|
|
692
|
+
/** Sets the time between waves in seconds. */
|
|
693
|
+
function waveSpacing(seconds: number): void;
|
|
694
|
+
|
|
695
|
+
/** Sets wether waves can be manually summoned by pressing the play button. */
|
|
696
|
+
function waveSending(enabled: boolean): void;
|
|
697
|
+
|
|
698
|
+
/** Sets wether the gamemode is the attack mode */
|
|
699
|
+
function attackMode(enabled: boolean): void;
|
|
700
|
+
|
|
701
|
+
/** Sets the radius of the no-build zone around enemy cores. */
|
|
702
|
+
function enemyCoreBuildRadius(radius: number): void;
|
|
703
|
+
|
|
704
|
+
/** Sets the radius around enemy wave drop zones. */
|
|
705
|
+
function dropZoneRadius(radius: number): void;
|
|
706
|
+
|
|
707
|
+
/** Sets the base unit cap. */
|
|
708
|
+
function unitCap(cap: number): void;
|
|
709
|
+
|
|
710
|
+
/** Sets the playable map area. Blocks that are out of the new bounds will be removed. */
|
|
711
|
+
function mapArea(options: {
|
|
712
|
+
x: number;
|
|
713
|
+
y: number;
|
|
714
|
+
width: number;
|
|
715
|
+
height: number;
|
|
716
|
+
}): void;
|
|
717
|
+
|
|
718
|
+
/** Sets wether ambient lighting is enabled */
|
|
719
|
+
function lighting(enabled: boolean): void;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Sets the ambient light color.
|
|
723
|
+
*
|
|
724
|
+
* `packColor` can be used to get the rgba data recevied by this function.
|
|
725
|
+
*
|
|
726
|
+
*
|
|
727
|
+
* ```js
|
|
728
|
+
* // enables lighting and sets the color to gray
|
|
729
|
+
* setRule("lighting", true);
|
|
730
|
+
* setRule("ambientLight", packColor(0.5, 0.5, 0.5, 1));
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
733
|
+
function ambientLight(rgbaData: number): void;
|
|
734
|
+
|
|
735
|
+
/** Sets the multiplier for the energy output of solar panels. */
|
|
736
|
+
function solarMultiplier(multiplier: number): void;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Sets the build speed multiplier of a team.
|
|
740
|
+
* The multiplier will always be clamped between `0.001` and `50`.
|
|
741
|
+
*/
|
|
742
|
+
function buildSpeed(team: TeamSymbol, multiplier: number): void;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Sets the speed multiplier for unit factories.
|
|
746
|
+
* The multiplier will always be clamped between `0` and `50`.
|
|
747
|
+
*/
|
|
748
|
+
function unitBuildSpeed(team: TeamSymbol, multiplier: number): void;
|
|
749
|
+
|
|
750
|
+
/** Sets the damage multiplier for units on a given team. */
|
|
751
|
+
|
|
752
|
+
function unitDamage(team: TeamSymbol, multiplier: number): void;
|
|
753
|
+
/** Sets the block health multiplier for a given team. */
|
|
754
|
+
|
|
755
|
+
function blockHealth(team: TeamSymbol, multiplier: number): void;
|
|
756
|
+
|
|
757
|
+
/** Sets the block damage multiplier for a given team. */
|
|
758
|
+
function blockDamage(team: TeamSymbol, multiplier: number): void;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Sets the Real Time Strategy minimum weight for a team.
|
|
762
|
+
*
|
|
763
|
+
* In other words it, sets the minimum "advantage" needed for a squad to attack.
|
|
764
|
+
* The higher the value, the more cautious the squad is.
|
|
765
|
+
*/
|
|
766
|
+
|
|
767
|
+
function rtsMinWeight(team: TeamSymbol, value: number): void;
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Sets the Real Time Strategy minimum size of attack squads of a team.
|
|
771
|
+
*
|
|
772
|
+
* The higher the value, the more units are required before a squad attacks.
|
|
773
|
+
*/
|
|
774
|
+
function rtsMinSquad(team: TeamSymbol, value: number): void;
|
|
775
|
+
}
|
|
776
|
+
|
|
522
777
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
778
|
+
* Writes the contents of the print buffer in the selected mode
|
|
779
|
+
* and clears the buffer afterwards. World processor ONLY.
|
|
780
|
+
*
|
|
781
|
+
* ```js
|
|
782
|
+
* print("Hello");
|
|
783
|
+
* flushMessage.announce(4); // lasts 4 seconds
|
|
784
|
+
* wait(5);
|
|
785
|
+
* print("World");
|
|
786
|
+
* flushMessage.toast(4);
|
|
787
|
+
* wait(5);
|
|
788
|
+
* ```
|
|
525
789
|
*/
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
790
|
+
namespace flushMessage {
|
|
791
|
+
/** Shows a nofication at the top of the screen */
|
|
792
|
+
function notify(): void;
|
|
793
|
+
/** Puts the content on the top left corner of the screen */
|
|
794
|
+
function mission(): void;
|
|
795
|
+
/**
|
|
796
|
+
* Puts the content on the middle of the screen
|
|
797
|
+
*
|
|
798
|
+
* @param duration The duration, in seconds
|
|
799
|
+
*/
|
|
800
|
+
function announce(duration: number): void;
|
|
801
|
+
/**
|
|
802
|
+
* Puts the content on the middle top of the screen
|
|
803
|
+
*
|
|
804
|
+
* @param duration The duration, in seconds
|
|
805
|
+
*/
|
|
806
|
+
function toast(duration: number): void;
|
|
807
|
+
}
|
|
529
808
|
|
|
530
|
-
|
|
531
|
-
|
|
809
|
+
namespace cutscene {
|
|
810
|
+
/** Moves the player's camera to the given location. */
|
|
811
|
+
function pan(options: { x: number; y: number; speed: number }): void;
|
|
812
|
+
/** Zooms the player camera to the desired level */
|
|
813
|
+
function zoom(level: number): void;
|
|
814
|
+
/** Gives the camera control back to the player */
|
|
815
|
+
function stop(): void;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/** Creates an explosion */
|
|
819
|
+
function explosion(options: {
|
|
820
|
+
team: TeamSymbol;
|
|
821
|
+
x: number;
|
|
822
|
+
y: number;
|
|
823
|
+
radius: number;
|
|
824
|
+
damage: number;
|
|
825
|
+
air: boolean;
|
|
826
|
+
ground: boolean;
|
|
827
|
+
pierce: boolean;
|
|
828
|
+
}): void;
|
|
829
|
+
|
|
830
|
+
/** Sets the speed of this world processor in instructions per tick. */
|
|
831
|
+
function setRate(ipt: number): void;
|
|
832
|
+
|
|
833
|
+
/** Contains the variants of the `fetch` instruction. World processor ONLY. */
|
|
834
|
+
namespace fetch {
|
|
835
|
+
/**
|
|
836
|
+
* Gets an unit from the given team
|
|
837
|
+
*
|
|
838
|
+
* The index starts at 0.
|
|
839
|
+
*
|
|
840
|
+
* ```js
|
|
841
|
+
* const count = fetch.unitCount();
|
|
842
|
+
* for(let i = 0; i < count; i++) {
|
|
843
|
+
* const unit = fetch.unit(Teams.sharded, i);
|
|
844
|
+
* print`x: ${unit.x}, y: ${unit.y}\n`;
|
|
845
|
+
* }
|
|
846
|
+
* printFlush();
|
|
847
|
+
* ```
|
|
848
|
+
*/
|
|
849
|
+
function unit<T extends BasicUnit = AnyUnit>(
|
|
850
|
+
team: TeamSymbol,
|
|
851
|
+
index: number
|
|
852
|
+
): T;
|
|
853
|
+
/**
|
|
854
|
+
* Gets the amount of units existing on a given team.
|
|
855
|
+
*
|
|
856
|
+
* ```js
|
|
857
|
+
* const count = fetch.unitCount();
|
|
858
|
+
* for(let i = 0; i < count; i++) {
|
|
859
|
+
* const unit = fetch.unit(Teams.sharded, i);
|
|
860
|
+
* print`x: ${unit.x}, y: ${unit.y}\n`;
|
|
861
|
+
* }
|
|
862
|
+
* printFlush();
|
|
863
|
+
* ```
|
|
864
|
+
*/
|
|
865
|
+
function unitCount(team: TeamSymbol): number;
|
|
866
|
+
/**
|
|
867
|
+
* Gets a player from a team.
|
|
868
|
+
*
|
|
869
|
+
* The index starts at 0.
|
|
870
|
+
*
|
|
871
|
+
* ```js
|
|
872
|
+
* const count = fetch.playerCount();
|
|
873
|
+
* for(let i = 0; i < count; i++) {
|
|
874
|
+
* const player = fetch.player(Teams.sharded, i);
|
|
875
|
+
* print`x: ${player.x}, y: ${player.y}\n`;
|
|
876
|
+
* }
|
|
877
|
+
* printFlush();
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
function player<T extends BasicUnit = AnyUnit>(
|
|
881
|
+
team: TeamSymbol,
|
|
882
|
+
index: number
|
|
883
|
+
): T;
|
|
884
|
+
/**
|
|
885
|
+
* Gets the amount of players existing on a given team.
|
|
886
|
+
*
|
|
887
|
+
* ```js
|
|
888
|
+
* const count = fetch.playerCount();
|
|
889
|
+
* for(let i = 0; i < count; i++) {
|
|
890
|
+
* const player = fetch.player(Teams.sharded, i);
|
|
891
|
+
* print`x: ${player.x}, y: ${player.y}\n`;
|
|
892
|
+
* }
|
|
893
|
+
* printFlush();
|
|
894
|
+
* ```
|
|
895
|
+
*/
|
|
896
|
+
function playerCount(team: TeamSymbol): number;
|
|
897
|
+
/**
|
|
898
|
+
* Gets a core from a team.
|
|
899
|
+
*
|
|
900
|
+
* The index of the starts at 0.
|
|
901
|
+
*
|
|
902
|
+
* ```js
|
|
903
|
+
* const count = fetch.coreCount();
|
|
904
|
+
* for(let i = 0; i < count; i++) {
|
|
905
|
+
* const core = fetch.core(Teams.sharded, i);
|
|
906
|
+
* print`x: ${core.x}, y: ${core.y}\n`;
|
|
907
|
+
* }
|
|
908
|
+
* printFlush();
|
|
909
|
+
* ```
|
|
910
|
+
*/
|
|
911
|
+
function core(team: TeamSymbol, index: number): AnyBuilding;
|
|
912
|
+
/**
|
|
913
|
+
* Gets the amount of cores existing on a given team.
|
|
914
|
+
* ```js
|
|
915
|
+
* const count = fetch.coreCount();
|
|
916
|
+
* for(let i = 0; i < count; i++) {
|
|
917
|
+
* const core = fetch.core(Teams.sharded, i);
|
|
918
|
+
* print`x: ${core.x}, y: ${core.y}\n`;
|
|
919
|
+
* }
|
|
920
|
+
* printFlush();
|
|
921
|
+
* ```
|
|
922
|
+
*/
|
|
923
|
+
function coreCount(team: TeamSymbol): number;
|
|
924
|
+
/**
|
|
925
|
+
* Gets a building from a team.
|
|
926
|
+
*
|
|
927
|
+
* The index starts at 0.
|
|
928
|
+
*
|
|
929
|
+
* ```js
|
|
930
|
+
* const count = fetch.buildCount();
|
|
931
|
+
* for(let i = 0; i < count; i++) {
|
|
932
|
+
* const router = fetch.build(Teams.sharded, i, Blocks.router);
|
|
933
|
+
* print`x: ${router.x}, y: ${router.y}\n`;
|
|
934
|
+
* }
|
|
935
|
+
* printFlush();
|
|
936
|
+
* ```
|
|
937
|
+
*/
|
|
938
|
+
function build<T extends BasicBuilding = AnyBuilding>(
|
|
939
|
+
team: TeamSymbol,
|
|
940
|
+
index: number,
|
|
941
|
+
block: BuildingSymbol
|
|
942
|
+
): T;
|
|
943
|
+
/**
|
|
944
|
+
* Gets the amount of buildings existing on a given team.
|
|
945
|
+
*
|
|
946
|
+
* ```js
|
|
947
|
+
* const count = fetch.buildCount();
|
|
948
|
+
* for(let i = 0; i < count; i++) {
|
|
949
|
+
* const router = fetch.build(Teams.sharded, i, Blocks.router)
|
|
950
|
+
* print`x: ${router.x}, y: ${router.y}\n`
|
|
951
|
+
* }
|
|
952
|
+
* printFlush()
|
|
953
|
+
* ```
|
|
954
|
+
*/
|
|
955
|
+
function buildCount(team: TeamSymbol, block: BuildingSymbol): number;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
/** Checks if a global flag is set. World processor ONLY. */
|
|
959
|
+
function getFlag(flag: string): boolean;
|
|
960
|
+
|
|
961
|
+
/** Sets a global flag. World processor ONLY. */
|
|
962
|
+
function setFlag(flag: string, value: boolean): void;
|
|
532
963
|
}
|