@kradle/challenges-sdk 0.10.0 → 0.11.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/CHANGELOG.md +32 -1
- package/LLM_README.md +235 -2333
- package/README.md +151 -570
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/runtime/examples/capture-the-flag.d.ts +33 -0
- package/dist/runtime/examples/capture-the-flag.d.ts.map +1 -0
- package/dist/runtime/examples/capture-the-flag.js +79 -0
- package/dist/runtime/examples/capture-the-flag.js.map +1 -0
- package/dist/runtime/examples/climb.d.ts +34 -0
- package/dist/runtime/examples/climb.d.ts.map +1 -0
- package/dist/runtime/examples/climb.js +54 -0
- package/dist/runtime/examples/climb.js.map +1 -0
- package/dist/runtime/examples/four-bridges.d.ts +107 -0
- package/dist/runtime/examples/four-bridges.d.ts.map +1 -0
- package/dist/runtime/examples/four-bridges.js +294 -0
- package/dist/runtime/examples/four-bridges.js.map +1 -0
- package/dist/runtime/examples/herding.d.ts +59 -0
- package/dist/runtime/examples/herding.d.ts.map +1 -0
- package/dist/runtime/examples/herding.js +181 -0
- package/dist/runtime/examples/herding.js.map +1 -0
- package/dist/runtime/examples/skywars.d.ts +116 -0
- package/dist/runtime/examples/skywars.d.ts.map +1 -0
- package/dist/runtime/examples/skywars.js +253 -0
- package/dist/runtime/examples/skywars.js.map +1 -0
- package/dist/runtime/harness.d.ts +176 -0
- package/dist/runtime/harness.d.ts.map +1 -0
- package/dist/runtime/harness.js +441 -0
- package/dist/runtime/harness.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +18 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/sandbox-registry.d.ts +7 -0
- package/dist/runtime/sandbox-registry.d.ts.map +1 -0
- package/dist/runtime/sandbox-registry.js +16 -0
- package/dist/runtime/sandbox-registry.js.map +1 -0
- package/dist/runtime/sandbox.d.ts +29 -0
- package/dist/runtime/sandbox.d.ts.map +1 -0
- package/dist/runtime/sandbox.js +70 -0
- package/dist/runtime/sandbox.js.map +1 -0
- package/dist/runtime/sdk.d.ts +1038 -0
- package/dist/runtime/sdk.d.ts.map +1 -0
- package/dist/runtime/sdk.js +1271 -0
- package/dist/runtime/sdk.js.map +1 -0
- package/dist/runtime/world.d.ts +141 -0
- package/dist/runtime/world.d.ts.map +1 -0
- package/dist/runtime/world.js +344 -0
- package/dist/runtime/world.js.map +1 -0
- package/package.json +76 -40
- package/dist/actions.d.ts +0 -901
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js +0 -1155
- package/dist/actions.js.map +0 -1
- package/dist/api_utils.d.ts +0 -25
- package/dist/api_utils.d.ts.map +0 -1
- package/dist/api_utils.js +0 -48
- package/dist/api_utils.js.map +0 -1
- package/dist/challenge.d.ts +0 -58
- package/dist/challenge.d.ts.map +0 -1
- package/dist/challenge.js +0 -582
- package/dist/challenge.js.map +0 -1
- package/dist/commands.d.ts +0 -57
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -200
- package/dist/commands.js.map +0 -1
- package/dist/constants.d.ts +0 -78
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -109
- package/dist/constants.js.map +0 -1
- package/dist/testmode.d.ts +0 -3
- package/dist/testmode.d.ts.map +0 -1
- package/dist/testmode.js +0 -19
- package/dist/testmode.js.map +0 -1
- package/dist/types.d.ts +0 -195
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -17
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -22
- package/dist/utils.js.map +0 -1
package/dist/commands.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { type JSONTextComponent, type Score, type SelectorClass } from "sandstone";
|
|
2
|
-
/**
|
|
3
|
-
* Commands for interacting with Kradle's Watcher.
|
|
4
|
-
*/
|
|
5
|
-
export declare const Commands: {
|
|
6
|
-
/**
|
|
7
|
-
* Raw command - sends a command to Kradle's Watcher.
|
|
8
|
-
*
|
|
9
|
-
* Arguments are passed as a JSON object.
|
|
10
|
-
* @param command The command to send.
|
|
11
|
-
* @param args The JSON Text Component arguments to send with the command.
|
|
12
|
-
*
|
|
13
|
-
* @warning
|
|
14
|
-
* The arguments must resolve to a JSON-serializable object. This cannot be verified at compile time.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* Commands.raw("start_challenge", { name: "My Challenge" });
|
|
18
|
-
* // The watcher will receive the following payload::
|
|
19
|
-
* // {"type":"kradle_command","command":"start_challenge","arguments":{"name":"My Challenge"}}
|
|
20
|
-
*
|
|
21
|
-
* Commands.raw("fetch", {url: "https://goldprice.org", "target_score": "gold_price", callback: "kradle:on_gold_price_fetched"})
|
|
22
|
-
* // The watcher will receive the following payload:
|
|
23
|
-
* // {"type":"kradle_command","command":"fetch","arguments":{"url":"https://goldprice.org","target_score":"gold_price","callback":"kradle:on_gold_price_fetched"}}
|
|
24
|
-
*/
|
|
25
|
-
raw: (command: string, args: Record<string, JSONTextComponent>) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Game over command - sends a command to Kradle's Watcher to end the challenge.
|
|
28
|
-
* This will also announce the winners and the end state.
|
|
29
|
-
*
|
|
30
|
-
* The `winners` argument of the payload will be a JSON list of player names.
|
|
31
|
-
* Ex: { "winners": ["player1", "player2"] }
|
|
32
|
-
*
|
|
33
|
-
* If no winners are selected, an empty array will be sent.
|
|
34
|
-
* Ex: { "winners": [] }
|
|
35
|
-
*
|
|
36
|
-
* The `end_state` argument of the payload will be a JSON string that represents the end state of the challenge.
|
|
37
|
-
* Ex: { "end_state": "win" }
|
|
38
|
-
*
|
|
39
|
-
* If no end state is selected, an empty string will be sent.
|
|
40
|
-
* Ex: { "end_state": "" }
|
|
41
|
-
*/
|
|
42
|
-
gameOver: () => void;
|
|
43
|
-
logVariable: (message: string, variable: Score, store: boolean) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Force-move command — tells Kradle's Watcher to interrupt the target
|
|
46
|
-
* player(s) and walk them to absolute coordinates. Server-initiated.
|
|
47
|
-
*
|
|
48
|
-
* Targets are sent as a JSON array of resolved player names, coordinates as
|
|
49
|
-
* JSON numbers:
|
|
50
|
-
* { "targets": ["player1","player2"], "x": 10, "y": -60, "z": 12 }
|
|
51
|
-
*
|
|
52
|
-
* The `_.if` guard suppresses the command when the selector matches nobody
|
|
53
|
-
* (selectorToJSONArray would otherwise emit `[""]`).
|
|
54
|
-
*/
|
|
55
|
-
forceMoveTo: (targetSelector: SelectorClass<any, any>, x: number, y: number, z: number) => void;
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=commands.d.ts.map
|
package/dist/commands.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,iBAAiB,EAAE,KAAK,KAAK,EAAY,KAAK,aAAa,EAAW,MAAM,WAAW,CAAC;AAuEzG;;GAEG;AACH,eAAO,MAAM,QAAQ;IACpB;;;;;;;;;;;;;;;;;;OAkBG;mBACY,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;IA4C9D;;;;;;;;;;;;;;;OAeG;;2BAmBoB,MAAM,YAAY,KAAK,SAAS,OAAO;IAgB9D;;;;;;;;;;OAUG;kCAC2B,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;CAUtF,CAAC"}
|
package/dist/commands.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Commands = void 0;
|
|
4
|
-
const sandstone_1 = require("sandstone");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
/**
|
|
7
|
-
* Converts a Sandstone Selector to a JSON Text Component that will be displayed like a JSON array in the chat.
|
|
8
|
-
* This is used to send selectors as part of JSON messages.
|
|
9
|
-
*
|
|
10
|
-
* @warning
|
|
11
|
-
* This does NOT work with empty selectors (they will be represented as `[""]`).
|
|
12
|
-
* Make sure to check if the selector matches any entities before using this function.
|
|
13
|
-
*
|
|
14
|
-
* @param selector The selector to convert.
|
|
15
|
-
* @returns An array of JSON Text Components that will be displayed as a JSON array in the chat.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* const selector = Selector("@a", { tag: "kradle_participant" });
|
|
19
|
-
* const jsonArray = selectorToJSONArray(selector);
|
|
20
|
-
* tellraw("@a", selectorToJSONArray(selector));
|
|
21
|
-
*
|
|
22
|
-
* // Everyone will see this in the chat:
|
|
23
|
-
* // ["Player1","Player2","Player3"]
|
|
24
|
-
*/
|
|
25
|
-
function selectorToJSONArray(selector) {
|
|
26
|
-
return ['["', { selector: selector.toString(), separator: '","' }, '"]'];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Converts a Sandstone Selector to a JSON string that will be displayed like a JSON string in the chat.
|
|
30
|
-
* If the selector matches several entities, it will display a comma-separated list of their names.
|
|
31
|
-
*
|
|
32
|
-
* @param selector The selector to convert.
|
|
33
|
-
* @returns A JSON string that will be displayed like a JSON string in the chat.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* const selector = Selector("@s");
|
|
37
|
-
* const jsonString = selectorToJSONString(selector);
|
|
38
|
-
* tellraw("@a", jsonString);
|
|
39
|
-
*
|
|
40
|
-
* // Everyone will see this in the chat:
|
|
41
|
-
* // "Player1"
|
|
42
|
-
*/
|
|
43
|
-
function selectorToJSONString(selector) {
|
|
44
|
-
return ['"', { selector: selector.toString(), separator: "," }, '"'];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Converts a storage to a JSON string that will be displayed like a JSON string in the chat.
|
|
48
|
-
* @param storage The storage holding the value to convert.
|
|
49
|
-
* @param storageKey The key of the value to convert in the storage.
|
|
50
|
-
* @returns A JSON string that will be displayed like a JSON string in the chat.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* If the value is found in the storage, it will be sent as a JSON string.
|
|
54
|
-
* Ex: { "end_state": "win" }
|
|
55
|
-
*
|
|
56
|
-
* If the value is not found in the storage, an empty string will be sent.
|
|
57
|
-
* Ex: { "end_state": "" }
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
function storageToJSONString(storage, storageKey) {
|
|
61
|
-
return [
|
|
62
|
-
'"',
|
|
63
|
-
{
|
|
64
|
-
storage: storage,
|
|
65
|
-
nbt: storageKey,
|
|
66
|
-
},
|
|
67
|
-
'"',
|
|
68
|
-
];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Commands for interacting with Kradle's Watcher.
|
|
72
|
-
*/
|
|
73
|
-
exports.Commands = {
|
|
74
|
-
/**
|
|
75
|
-
* Raw command - sends a command to Kradle's Watcher.
|
|
76
|
-
*
|
|
77
|
-
* Arguments are passed as a JSON object.
|
|
78
|
-
* @param command The command to send.
|
|
79
|
-
* @param args The JSON Text Component arguments to send with the command.
|
|
80
|
-
*
|
|
81
|
-
* @warning
|
|
82
|
-
* The arguments must resolve to a JSON-serializable object. This cannot be verified at compile time.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* Commands.raw("start_challenge", { name: "My Challenge" });
|
|
86
|
-
* // The watcher will receive the following payload::
|
|
87
|
-
* // {"type":"kradle_command","command":"start_challenge","arguments":{"name":"My Challenge"}}
|
|
88
|
-
*
|
|
89
|
-
* Commands.raw("fetch", {url: "https://goldprice.org", "target_score": "gold_price", callback: "kradle:on_gold_price_fetched"})
|
|
90
|
-
* // The watcher will receive the following payload:
|
|
91
|
-
* // {"type":"kradle_command","command":"fetch","arguments":{"url":"https://goldprice.org","target_score":"gold_price","callback":"kradle:on_gold_price_fetched"}}
|
|
92
|
-
*/
|
|
93
|
-
raw: (command, args) => {
|
|
94
|
-
const basePayload = JSON.stringify({
|
|
95
|
-
command,
|
|
96
|
-
type: "kradle_command",
|
|
97
|
-
arguments: {},
|
|
98
|
-
});
|
|
99
|
-
// We need to insert our arguments into the "arguments" field of the base payload.
|
|
100
|
-
const splitIndex = basePayload.indexOf("}");
|
|
101
|
-
const leftText = basePayload.slice(0, splitIndex);
|
|
102
|
-
const rightText = basePayload.slice(splitIndex);
|
|
103
|
-
function parseValue(value) {
|
|
104
|
-
if (typeof value === "boolean") {
|
|
105
|
-
return value.toString();
|
|
106
|
-
}
|
|
107
|
-
// A bare number is not a valid JSON text component, so stringify it —
|
|
108
|
-
// the rendered text (e.g. `-59`) is still a valid JSON number once the
|
|
109
|
-
// watcher parses the payload. Mirrors the boolean case above.
|
|
110
|
-
if (typeof value === "number") {
|
|
111
|
-
return value.toString();
|
|
112
|
-
}
|
|
113
|
-
if (typeof value === "string") {
|
|
114
|
-
try {
|
|
115
|
-
JSON.parse(value);
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
throw new Error(`When using Commands.raw with string values, they must represent a valid JSON object. Invalid JSON string: ${value}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return value;
|
|
122
|
-
}
|
|
123
|
-
const argumentsPayload = Object.entries(args).flatMap(([key, value], index) => {
|
|
124
|
-
const result = [`"${key}":`, parseValue(value)];
|
|
125
|
-
if (index > 0) {
|
|
126
|
-
return [",", ...result];
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
});
|
|
130
|
-
(0, sandstone_1.tellraw)(constants_1.WATCHER, [leftText, argumentsPayload, rightText]);
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* Game over command - sends a command to Kradle's Watcher to end the challenge.
|
|
134
|
-
* This will also announce the winners and the end state.
|
|
135
|
-
*
|
|
136
|
-
* The `winners` argument of the payload will be a JSON list of player names.
|
|
137
|
-
* Ex: { "winners": ["player1", "player2"] }
|
|
138
|
-
*
|
|
139
|
-
* If no winners are selected, an empty array will be sent.
|
|
140
|
-
* Ex: { "winners": [] }
|
|
141
|
-
*
|
|
142
|
-
* The `end_state` argument of the payload will be a JSON string that represents the end state of the challenge.
|
|
143
|
-
* Ex: { "end_state": "win" }
|
|
144
|
-
*
|
|
145
|
-
* If no end state is selected, an empty string will be sent.
|
|
146
|
-
* Ex: { "end_state": "" }
|
|
147
|
-
*/
|
|
148
|
-
gameOver: () => {
|
|
149
|
-
const selector = (0, sandstone_1.Selector)("@a", { tag: constants_1.WINNER_TAG });
|
|
150
|
-
// If no winners are selected, we send them as a JSON array.
|
|
151
|
-
sandstone_1._.if(selector, () => {
|
|
152
|
-
exports.Commands.raw("game_over", {
|
|
153
|
-
winners: selectorToJSONArray(selector),
|
|
154
|
-
end_state: storageToJSONString(constants_1.KRADLE_STORAGE, constants_1.END_STATE_KEY),
|
|
155
|
-
});
|
|
156
|
-
}).else(() => {
|
|
157
|
-
// Else, we send an empty array.
|
|
158
|
-
exports.Commands.raw("game_over", {
|
|
159
|
-
winners: JSON.stringify([]),
|
|
160
|
-
end_state: storageToJSONString(constants_1.KRADLE_STORAGE, constants_1.END_STATE_KEY),
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
logVariable: (message, variable, store) => {
|
|
165
|
-
const objectiveName = variable.objective.name;
|
|
166
|
-
const variableName = variable.target.toString();
|
|
167
|
-
return exports.Commands.raw("log_variable", {
|
|
168
|
-
message: JSON.stringify(message),
|
|
169
|
-
store,
|
|
170
|
-
variable: JSON.stringify({
|
|
171
|
-
objective: objectiveName,
|
|
172
|
-
selector: variableName,
|
|
173
|
-
}),
|
|
174
|
-
value: variable,
|
|
175
|
-
targets: selectorToJSONString((0, sandstone_1.Selector)(variableName)),
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
/**
|
|
179
|
-
* Force-move command — tells Kradle's Watcher to interrupt the target
|
|
180
|
-
* player(s) and walk them to absolute coordinates. Server-initiated.
|
|
181
|
-
*
|
|
182
|
-
* Targets are sent as a JSON array of resolved player names, coordinates as
|
|
183
|
-
* JSON numbers:
|
|
184
|
-
* { "targets": ["player1","player2"], "x": 10, "y": -60, "z": 12 }
|
|
185
|
-
*
|
|
186
|
-
* The `_.if` guard suppresses the command when the selector matches nobody
|
|
187
|
-
* (selectorToJSONArray would otherwise emit `[""]`).
|
|
188
|
-
*/
|
|
189
|
-
forceMoveTo: (targetSelector, x, y, z) => {
|
|
190
|
-
sandstone_1._.if(targetSelector, () => {
|
|
191
|
-
exports.Commands.raw("force_move", {
|
|
192
|
-
targets: selectorToJSONArray(targetSelector),
|
|
193
|
-
x,
|
|
194
|
-
y,
|
|
195
|
-
z,
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
//# sourceMappingURL=commands.js.map
|
package/dist/commands.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":";;;AAAA,yCAAyG;AAEzG,2CAAiF;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,mBAAmB,CAAC,QAAiC;IAC7D,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAS,EAAE,IAAI,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,oBAAoB,CAAC,QAAiC;IAC9D,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,GAAG,EAAS,EAAE,GAAG,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,mBAAmB,CAAC,OAAe,EAAE,UAAkB;IAC/D,OAAO;QACN,GAAG;QACH;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CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEhD,OAAO,gBAAQ,CAAC,GAAG,CAAC,cAAc,EAAE;YACnC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAChC,KAAK;YACL,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;gBACxB,SAAS,EAAE,aAAa;gBACxB,QAAQ,EAAE,YAAY;aACtB,CAAC;YACF,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,oBAAoB,CAAC,IAAA,oBAAQ,EAAC,YAAmB,CAAC,CAAC;SAC5D,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,EAAE,CAAC,cAAuC,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE;QACzF,aAAC,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;YACzB,gBAAQ,CAAC,GAAG,CAAC,YAAY,EAAE;gBAC1B,OAAO,EAAE,mBAAmB,CAAC,cAAc,CAAC;gBAC5C,CAAC;gBACD,CAAC;gBACD,CAAC;aACD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
|
package/dist/constants.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { type Score } from "sandstone";
|
|
2
|
-
/**
|
|
3
|
-
* All possible events that can be defined in a challenge.
|
|
4
|
-
*
|
|
5
|
-
* `init_participants` is DEPRECATED: it now runs in the same tick as
|
|
6
|
-
* `start_challenge`, immediately after it. All per-player state
|
|
7
|
-
* (player_number, individual variable defaults, inventory clear) is already
|
|
8
|
-
* initialized before `start_challenge` fires, so put setup — including
|
|
9
|
-
* per-player setup via `forEveryPlayer()` — directly in `start_challenge`.
|
|
10
|
-
*/
|
|
11
|
-
export type POSSIBLE_SCENARIO_EVENTS = "start_challenge" | "init_participants" | "end_challenge" | "on_tick";
|
|
12
|
-
export declare const VISIBLE_OBJECTIVE: import("sandstone").ObjectiveInstance<string | undefined>;
|
|
13
|
-
export declare const HIDDEN_OBJECTIVE: import("sandstone").ObjectiveInstance<string | undefined>;
|
|
14
|
-
export declare const WATCHER = "watcher";
|
|
15
|
-
export declare const WEB_VIEWER = "KradleWebViewer";
|
|
16
|
-
export declare const KRADLE_PARTICIPANT_TAG = "kradle_participant";
|
|
17
|
-
export declare const WINNER_TAG = "kradle_winner";
|
|
18
|
-
export declare const DISPLAY_TAG = "***KRADLE***";
|
|
19
|
-
export declare const KRADLE_STORAGE = "kradle_storage";
|
|
20
|
-
export declare const END_STATE_KEY = "end_state";
|
|
21
|
-
export declare const MAX_DURATION: number;
|
|
22
|
-
export declare const ALL: import("sandstone").SelectorClass<false, true>;
|
|
23
|
-
export declare const GAME_STATES: {
|
|
24
|
-
readonly CREATED: 0;
|
|
25
|
-
readonly ON: 2;
|
|
26
|
-
readonly OFF: 1;
|
|
27
|
-
};
|
|
28
|
-
export declare const BUILTIN_VARIABLES: {
|
|
29
|
-
death_count: {
|
|
30
|
-
type: "individual";
|
|
31
|
-
objective_type: "deathCount";
|
|
32
|
-
default: number;
|
|
33
|
-
};
|
|
34
|
-
has_never_died: {
|
|
35
|
-
type: "individual";
|
|
36
|
-
updater: (value: Score, { death_count }: Record<string, Score<string | undefined>>) => void;
|
|
37
|
-
};
|
|
38
|
-
alive_players: {
|
|
39
|
-
type: "global";
|
|
40
|
-
updater: (value: Score, { has_never_died }: Record<string, Score<string | undefined>>) => void;
|
|
41
|
-
};
|
|
42
|
-
main_score: {
|
|
43
|
-
type: "individual";
|
|
44
|
-
default: number;
|
|
45
|
-
updater: (value: Score) => void;
|
|
46
|
-
};
|
|
47
|
-
game_timer: {
|
|
48
|
-
type: "global";
|
|
49
|
-
default: number;
|
|
50
|
-
updater: (value: Score) => void;
|
|
51
|
-
};
|
|
52
|
-
game_state: {
|
|
53
|
-
type: "global";
|
|
54
|
-
default: 0;
|
|
55
|
-
};
|
|
56
|
-
player_count: {
|
|
57
|
-
type: "global";
|
|
58
|
-
default: number;
|
|
59
|
-
};
|
|
60
|
-
player_number: {
|
|
61
|
-
type: "individual";
|
|
62
|
-
objective_type: "dummy";
|
|
63
|
-
default: number;
|
|
64
|
-
updater: (value: Score, { player_count }: Record<string, Score<string | undefined>>) => void;
|
|
65
|
-
};
|
|
66
|
-
death_event: {
|
|
67
|
-
type: "individual";
|
|
68
|
-
objective_type: "deathCount";
|
|
69
|
-
updater: (value: Score) => void;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export type BUILTIN_VARIABLE_NAMES = keyof typeof BUILTIN_VARIABLES;
|
|
73
|
-
export declare const BUILTIN_SCORE_EVENTS: (variables: Record<BUILTIN_VARIABLE_NAMES, Score>) => {
|
|
74
|
-
mode: "repeatable";
|
|
75
|
-
score: Score<string | undefined>;
|
|
76
|
-
actions: () => void;
|
|
77
|
-
}[];
|
|
78
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,KAAK,EAAY,MAAM,WAAW,CAAC;AAIxE;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAAC;AAE7G,eAAO,MAAM,iBAAiB,2DAAuF,CAAC;AACtH,eAAO,MAAM,gBAAgB,2DAAoC,CAAC;AAElE,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAC5C,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAC1C,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,QAAc,CAAC;AAGxC,eAAO,MAAM,GAAG,gDAAkD,CAAC;AACnE,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAKX,eAAO,MAAM,iBAAiB;;;;;;;;yBAQX,KAAK;;;;yBASL,KAAK;;;;;yBAUL,KAAK;;;;;yBAOL,KAAK;;;;;;;;;;;;;;yBAiBL,KAAK;;;;;yBAYL,KAAK;;CAS8B,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAEpE,eAAO,MAAM,oBAAoB,GAAI,WAAW,MAAM,CAAC,sBAAsB,EAAE,KAAK,CAAC;;;;GASjD,CAAC"}
|
package/dist/constants.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BUILTIN_SCORE_EVENTS = exports.BUILTIN_VARIABLES = exports.GAME_STATES = exports.ALL = exports.MAX_DURATION = exports.END_STATE_KEY = exports.KRADLE_STORAGE = exports.DISPLAY_TAG = exports.WINNER_TAG = exports.KRADLE_PARTICIPANT_TAG = exports.WEB_VIEWER = exports.WATCHER = exports.HIDDEN_OBJECTIVE = exports.VISIBLE_OBJECTIVE = void 0;
|
|
4
|
-
const sandstone_1 = require("sandstone");
|
|
5
|
-
const types_1 = require("./types");
|
|
6
|
-
exports.VISIBLE_OBJECTIVE = sandstone_1.Objective.create("kradle.board", "dummy", [{ text: "Kradle Board", color: "gold" }]);
|
|
7
|
-
exports.HIDDEN_OBJECTIVE = sandstone_1.Objective.create("kradle.hidden");
|
|
8
|
-
exports.WATCHER = "watcher";
|
|
9
|
-
exports.WEB_VIEWER = "KradleWebViewer";
|
|
10
|
-
exports.KRADLE_PARTICIPANT_TAG = "kradle_participant";
|
|
11
|
-
exports.WINNER_TAG = "kradle_winner";
|
|
12
|
-
exports.DISPLAY_TAG = "***KRADLE***";
|
|
13
|
-
exports.KRADLE_STORAGE = "kradle_storage";
|
|
14
|
-
exports.END_STATE_KEY = "end_state";
|
|
15
|
-
exports.MAX_DURATION = 5 * 60 * 20; // 5 minutes in ticks
|
|
16
|
-
/// The selector that targets all participants in the game.
|
|
17
|
-
exports.ALL = (0, sandstone_1.Selector)("@a", { tag: exports.KRADLE_PARTICIPANT_TAG });
|
|
18
|
-
exports.GAME_STATES = {
|
|
19
|
-
CREATED: 0,
|
|
20
|
-
ON: 2,
|
|
21
|
-
OFF: 1,
|
|
22
|
-
};
|
|
23
|
-
/// The variables that are builtin by default in every challenge.
|
|
24
|
-
/// These variables are used to track the state of the game and the players.
|
|
25
|
-
/// They can be used in the challenge definition to create end conditions, win conditions, and events.
|
|
26
|
-
exports.BUILTIN_VARIABLES = {
|
|
27
|
-
death_count: {
|
|
28
|
-
type: "individual",
|
|
29
|
-
objective_type: "deathCount",
|
|
30
|
-
default: 0,
|
|
31
|
-
},
|
|
32
|
-
has_never_died: {
|
|
33
|
-
type: "individual",
|
|
34
|
-
updater: (value, { death_count }) => {
|
|
35
|
-
value.set(0);
|
|
36
|
-
sandstone_1._.if(death_count.equalTo(0), () => {
|
|
37
|
-
value.set(1);
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
alive_players: {
|
|
42
|
-
type: "global",
|
|
43
|
-
updater: (value, { has_never_died }) => {
|
|
44
|
-
// We use this optimized version of the alive_players variable to avoid sending unecessary scoreboard update packets.
|
|
45
|
-
sandstone_1.execute.store.result
|
|
46
|
-
.score(value)
|
|
47
|
-
.if.entity((0, sandstone_1.Selector)("@a", { tag: exports.KRADLE_PARTICIPANT_TAG, scores: { [has_never_died.objective.name]: "1.." } }));
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
main_score: {
|
|
51
|
-
type: "individual",
|
|
52
|
-
default: 0,
|
|
53
|
-
updater: (value) => {
|
|
54
|
-
(0, exports.VISIBLE_OBJECTIVE)("@s").set(value);
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
game_timer: {
|
|
58
|
-
type: "global",
|
|
59
|
-
default: 0,
|
|
60
|
-
updater: (value) => {
|
|
61
|
-
value.add(1);
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
game_state: {
|
|
65
|
-
type: "global",
|
|
66
|
-
default: exports.GAME_STATES.CREATED,
|
|
67
|
-
},
|
|
68
|
-
player_count: {
|
|
69
|
-
type: "global",
|
|
70
|
-
default: 0,
|
|
71
|
-
},
|
|
72
|
-
/// This variable is used to assign a unique number to each player, starting from 1.
|
|
73
|
-
player_number: {
|
|
74
|
-
type: "individual",
|
|
75
|
-
objective_type: "dummy",
|
|
76
|
-
default: 0,
|
|
77
|
-
updater: (value, { player_count }) => {
|
|
78
|
-
sandstone_1._.if(value.equalTo(0), () => {
|
|
79
|
-
player_count.add(1);
|
|
80
|
-
value.set(player_count);
|
|
81
|
-
//tellraw("@a", [`${DISPLAY_TAG}`, { selector: "@s" }, "@s is player number ", value]);
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
/// This variable is used to announce in-game deaths
|
|
86
|
-
death_event: {
|
|
87
|
-
type: "individual",
|
|
88
|
-
objective_type: "deathCount",
|
|
89
|
-
updater: (value) => {
|
|
90
|
-
sandstone_1._.if(value.greaterThan(0), () => {
|
|
91
|
-
types_1.Actions.announce({
|
|
92
|
-
message: [(0, sandstone_1.Selector)("@s"), " has died!"],
|
|
93
|
-
});
|
|
94
|
-
value.set(0); // Reset the death count after announcing
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
const BUILTIN_SCORE_EVENTS = (variables) => [
|
|
100
|
-
{
|
|
101
|
-
mode: "repeatable",
|
|
102
|
-
score: variables.main_score,
|
|
103
|
-
actions: () => {
|
|
104
|
-
(0, exports.VISIBLE_OBJECTIVE)("@s").set(variables.main_score);
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
];
|
|
108
|
-
exports.BUILTIN_SCORE_EVENTS = BUILTIN_SCORE_EVENTS;
|
|
109
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AAExE,mCAAuF;AAa1E,QAAA,iBAAiB,GAAG,qBAAS,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AACzG,QAAA,gBAAgB,GAAG,qBAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAErD,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,UAAU,GAAG,iBAAiB,CAAC;AAC/B,QAAA,sBAAsB,GAAG,oBAAoB,CAAC;AAC9C,QAAA,UAAU,GAAG,eAAe,CAAC;AAC7B,QAAA,WAAW,GAAG,cAAc,CAAC;AAE7B,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,aAAa,GAAG,WAAW,CAAC;AAE5B,QAAA,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,qBAAqB;AAE9D,2DAA2D;AAC9C,QAAA,GAAG,GAAG,IAAA,oBAAQ,EAAC,IAAI,EAAE,EAAE,GAAG,EAAE,8BAAsB,EAAE,CAAC,CAAC;AACtD,QAAA,WAAW,GAAG;IAC1B,OAAO,EAAE,CAAC;IACV,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,CAAC;CACG,CAAC;AAEX,iEAAiE;AACjE,4EAA4E;AAC5E,sGAAsG;AACzF,QAAA,iBAAiB,GAAG;IAChC,WAAW,EAAE;QACZ,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,YAAY;QAC5B,OAAO,EAAE,CAAC;KACV;IACD,cAAc,EAAE;QACf,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,CAAC,KAAY,E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mode.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAIvC,eAAO,MAAM,gBAAgB,YAS5B,CAAC"}
|
package/dist/testmode.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.set_up_test_mode = exports.test_mode_enabled = void 0;
|
|
4
|
-
const sandstone_1 = require("sandstone");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
//set to true to enable test mode
|
|
7
|
-
exports.test_mode_enabled = false;
|
|
8
|
-
//set the minecraft name of the tester player
|
|
9
|
-
const tester_minecraft_name = "";
|
|
10
|
-
const set_up_test_mode = () => {
|
|
11
|
-
// 1. Tag the tester player if they're going to be participating
|
|
12
|
-
(0, sandstone_1.tag)(tester_minecraft_name).add(constants_1.KRADLE_PARTICIPANT_TAG);
|
|
13
|
-
// 2. Set the tester player's gamemode, e.g. survival
|
|
14
|
-
(0, sandstone_1.raw)(`gamemode survival ${tester_minecraft_name}`);
|
|
15
|
-
// 3. Set the gamerule sendCommandFeedback to true
|
|
16
|
-
(0, sandstone_1.raw)("gamerule sendCommandFeedback true");
|
|
17
|
-
};
|
|
18
|
-
exports.set_up_test_mode = set_up_test_mode;
|
|
19
|
-
//# sourceMappingURL=testmode.js.map
|
package/dist/testmode.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testmode.js","sourceRoot":"","sources":["../src/testmode.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,2CAAqD;AAErD,iCAAiC;AACpB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AACvC,6CAA6C;AAC7C,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAE1B,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,gEAAgE;IAChE,IAAA,eAAG,EAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,kCAAsB,CAAC,CAAC;IAEvD,qDAAqD;IACrD,IAAA,eAAG,EAAC,qBAAqB,qBAAqB,EAAE,CAAC,CAAC;IAElD,kDAAkD;IAClD,IAAA,eAAG,EAAC,mCAAmC,CAAC,CAAC;AAC1C,CAAC,CAAC;AATW,QAAA,gBAAgB,oBAS3B"}
|