cortico-world-buckshot 0.1.0 → 0.2.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 +8 -0
- package/README.md +3 -3
- package/describe.json +471 -0
- package/dist/{console.js → webui.js} +1 -1
- package/package.json +57 -49
- package/src/definition.ts +143 -1
- package/src/{console → webui}/client.ts +3 -3
- package/src/world.ts +5 -5
- /package/src/{console → webui}/panels.ts +0 -0
- /package/src/{console → webui}/types.ts +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- 适配 Cortico 0.2.0(扩展契约 world 6):浏览器界面改名 WebUI,面板源码移到 `src/webui/`,产物为 `dist/webui.js`;需要 Cortico 0.2.0 或更新版本。
|
|
6
|
+
Targets Cortico 0.2.0 (world contract 6): the browser UI is now WebUI, panel sources live in `src/webui/` and build to `dist/webui.js`; requires Cortico 0.2.0 or later.
|
|
7
|
+
- 定义加上自描述,包里附带 `describe.json`,列出全部工具与事件。
|
|
8
|
+
The definition now describes itself; `describe.json` in the package lists every tool and event.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `src/definition.ts`: cortico-world-buckshot
|
|
2
|
-
|
|
3
|
-
> 此乃直播测试验证之后的world,和其他 Persona / 非直播场景的兼容性有待测试。
|
|
2
|
+
|
|
3
|
+
> 此乃直播测试验证之后的world,和其他 Persona / 非直播场景的兼容性有待测试。
|
|
4
4
|
|
|
5
5
|
Buckshot Roulette 的 Cortico World 扩展,契约版本 world 5,支持 Windows Steam v2.2.0.6。
|
|
6
6
|
|
|
@@ -37,7 +37,7 @@ Buckshot Roulette 的 Cortico World 扩展,契约版本 world 5,支持 Windo
|
|
|
37
37
|
|
|
38
38
|
## 验证
|
|
39
39
|
|
|
40
|
-
`pnpm test` 验证本地端口、认证、消息分段、断连、回执超时、二进制资源包、直播描述和扩展声明。`pnpm run typecheck` 检查 TypeScript;`pnpm build:web`
|
|
40
|
+
`pnpm test` 验证本地端口、认证、消息分段、断连、回执超时、二进制资源包、直播描述和扩展声明。`pnpm run typecheck` 检查 TypeScript;`pnpm build:web` 构建 WebUI 面板。
|
|
41
41
|
|
|
42
42
|
`pnpm check:game <exe>` 校验安装,附加 `--launch` 可验证启动与连接;`--mute --screen=1` 选择静音和第二个显示器。`pnpm check:native <exe>` 使用无窗口游戏引擎运行自有场景,验证显示文字、权限、旧版本输入拒绝、公开弹药记录、结算和场景重置。测试套件不启动游戏或 bot。
|
|
43
43
|
|
package/describe.json
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tools": [
|
|
3
|
+
{
|
|
4
|
+
"name": "buckshot_start",
|
|
5
|
+
"description": "启动恶魔轮盘并接入事件桥。",
|
|
6
|
+
"parameters": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {},
|
|
9
|
+
"additionalProperties": false
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"write"
|
|
13
|
+
],
|
|
14
|
+
"summary": {
|
|
15
|
+
"zh": "启动恶魔轮盘并接上游戏事件。",
|
|
16
|
+
"en": "Launches Buckshot Roulette and connects to its game events."
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "buckshot_observe",
|
|
21
|
+
"description": "读取当前可见状态、可操作目标和已经揭示的弹药信息。",
|
|
22
|
+
"parameters": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {},
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
},
|
|
27
|
+
"tags": [
|
|
28
|
+
"read"
|
|
29
|
+
],
|
|
30
|
+
"summary": {
|
|
31
|
+
"zh": "读取当前画面状态、可操作的目标和已揭示的弹药。",
|
|
32
|
+
"en": "Reads the current game state, the targets that can be operated and the shells revealed so far."
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "buckshot_act",
|
|
37
|
+
"description": "操作 buckshot_observe 列出的 target。游戏会按原规则处理;等动画结算到游戏再次可操作后返回,回执包含这期间的事件与最新状态。",
|
|
38
|
+
"parameters": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"target": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
"revision": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"description": "最新状态里的状态版本;版本已变时拒绝输入。"
|
|
47
|
+
},
|
|
48
|
+
"value": {
|
|
49
|
+
"type": "number",
|
|
50
|
+
"description": "滑块的新值。"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"required": [
|
|
54
|
+
"target",
|
|
55
|
+
"revision"
|
|
56
|
+
],
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
},
|
|
59
|
+
"tags": [
|
|
60
|
+
"write"
|
|
61
|
+
],
|
|
62
|
+
"summary": {
|
|
63
|
+
"zh": "操作一个目标(拿枪、开枪、用道具、点菜单等),等动画结算后回执。",
|
|
64
|
+
"en": "Operates one target, such as picking up the shotgun, firing, using an item or pressing a menu button, and reports back once the animation settles."
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "buckshot_input",
|
|
69
|
+
"description": "触发游戏定义的输入动作。名称来自观察列出的输入动作。",
|
|
70
|
+
"parameters": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"name": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
},
|
|
76
|
+
"durationMs": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"minimum": 1,
|
|
79
|
+
"maximum": 5000
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"required": [
|
|
83
|
+
"name"
|
|
84
|
+
],
|
|
85
|
+
"additionalProperties": false
|
|
86
|
+
},
|
|
87
|
+
"tags": [
|
|
88
|
+
"write"
|
|
89
|
+
],
|
|
90
|
+
"summary": {
|
|
91
|
+
"zh": "触发游戏里定义的一个输入动作。",
|
|
92
|
+
"en": "Triggers one of the input actions the game defines."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "buckshot_key",
|
|
97
|
+
"description": "发送键盘按键,可用于重绑键位和界面导航。key 使用 Enter、Escape、Space、A、F1 等键名。",
|
|
98
|
+
"parameters": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"key": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"durationMs": {
|
|
105
|
+
"type": "integer",
|
|
106
|
+
"minimum": 1,
|
|
107
|
+
"maximum": 5000
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"required": [
|
|
111
|
+
"key"
|
|
112
|
+
],
|
|
113
|
+
"additionalProperties": false
|
|
114
|
+
},
|
|
115
|
+
"tags": [
|
|
116
|
+
"write"
|
|
117
|
+
],
|
|
118
|
+
"summary": {
|
|
119
|
+
"zh": "按键盘按键,可用于界面导航和改键。",
|
|
120
|
+
"en": "Presses a keyboard key, for menu navigation or rebinding keys."
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "buckshot_pointer",
|
|
125
|
+
"description": "在游戏视口内移动鼠标、点击或滚动。坐标按观察列出的视口尺寸;自由观察使用 relativeX、relativeY。",
|
|
126
|
+
"parameters": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"x": {
|
|
130
|
+
"type": "number",
|
|
131
|
+
"minimum": 0
|
|
132
|
+
},
|
|
133
|
+
"y": {
|
|
134
|
+
"type": "number",
|
|
135
|
+
"minimum": 0
|
|
136
|
+
},
|
|
137
|
+
"button": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"enum": [
|
|
140
|
+
"move",
|
|
141
|
+
"left",
|
|
142
|
+
"right",
|
|
143
|
+
"middle",
|
|
144
|
+
"wheel up",
|
|
145
|
+
"wheel down"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"relativeX": {
|
|
149
|
+
"type": "number"
|
|
150
|
+
},
|
|
151
|
+
"relativeY": {
|
|
152
|
+
"type": "number"
|
|
153
|
+
},
|
|
154
|
+
"durationMs": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"minimum": 1,
|
|
157
|
+
"maximum": 5000
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"required": [
|
|
161
|
+
"x",
|
|
162
|
+
"y"
|
|
163
|
+
],
|
|
164
|
+
"additionalProperties": false
|
|
165
|
+
},
|
|
166
|
+
"tags": [
|
|
167
|
+
"write"
|
|
168
|
+
],
|
|
169
|
+
"summary": {
|
|
170
|
+
"zh": "在游戏画面里移动鼠标、点击或滚动。",
|
|
171
|
+
"en": "Moves, clicks or scrolls the mouse inside the game view."
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "buckshot_controller",
|
|
176
|
+
"description": "发送游戏手柄输入。按钮编号 0–20,pressed 控制按下或松开;轴编号 0–5,value 为 -1–1。",
|
|
177
|
+
"parameters": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"button": {
|
|
181
|
+
"type": "integer",
|
|
182
|
+
"minimum": 0,
|
|
183
|
+
"maximum": 20
|
|
184
|
+
},
|
|
185
|
+
"pressed": {
|
|
186
|
+
"type": "boolean"
|
|
187
|
+
},
|
|
188
|
+
"axis": {
|
|
189
|
+
"type": "integer",
|
|
190
|
+
"minimum": 0,
|
|
191
|
+
"maximum": 5
|
|
192
|
+
},
|
|
193
|
+
"value": {
|
|
194
|
+
"type": "number",
|
|
195
|
+
"minimum": -1,
|
|
196
|
+
"maximum": 1
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"oneOf": [
|
|
200
|
+
{
|
|
201
|
+
"required": [
|
|
202
|
+
"button"
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"required": [
|
|
207
|
+
"axis",
|
|
208
|
+
"value"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"additionalProperties": false
|
|
213
|
+
},
|
|
214
|
+
"tags": [
|
|
215
|
+
"write"
|
|
216
|
+
],
|
|
217
|
+
"summary": {
|
|
218
|
+
"zh": "发送手柄按钮或摇杆输入。",
|
|
219
|
+
"en": "Sends gamepad button or stick input."
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "buckshot_type",
|
|
224
|
+
"description": "填写获得焦点的文字框,或把文本写入剪贴板供游戏粘贴大厅编号。签名机使用其字母按钮。",
|
|
225
|
+
"parameters": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"properties": {
|
|
228
|
+
"text": {
|
|
229
|
+
"type": "string"
|
|
230
|
+
},
|
|
231
|
+
"destination": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"enum": [
|
|
234
|
+
"field",
|
|
235
|
+
"clipboard"
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"required": [
|
|
240
|
+
"text"
|
|
241
|
+
],
|
|
242
|
+
"additionalProperties": false
|
|
243
|
+
},
|
|
244
|
+
"tags": [
|
|
245
|
+
"write"
|
|
246
|
+
],
|
|
247
|
+
"summary": {
|
|
248
|
+
"zh": "往输入框里填文字,或把文字放进剪贴板(如多人大厅编号)。",
|
|
249
|
+
"en": "Types text into the focused field, or puts text on the clipboard, such as a multiplayer lobby id."
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "buckshot_glance",
|
|
254
|
+
"description": "截取游戏当前画面。",
|
|
255
|
+
"parameters": {
|
|
256
|
+
"type": "object",
|
|
257
|
+
"properties": {},
|
|
258
|
+
"additionalProperties": false
|
|
259
|
+
},
|
|
260
|
+
"tags": [
|
|
261
|
+
"read"
|
|
262
|
+
],
|
|
263
|
+
"summary": {
|
|
264
|
+
"zh": "截取游戏当前画面。",
|
|
265
|
+
"en": "Takes a screenshot of the game."
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "buckshot_close",
|
|
270
|
+
"description": "关闭本 World 启动的游戏进程。",
|
|
271
|
+
"parameters": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"properties": {},
|
|
274
|
+
"additionalProperties": false
|
|
275
|
+
},
|
|
276
|
+
"tags": [
|
|
277
|
+
"write"
|
|
278
|
+
],
|
|
279
|
+
"summary": {
|
|
280
|
+
"zh": "关闭本 World 启动的游戏。",
|
|
281
|
+
"en": "Closes the game this World launched."
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"events": [
|
|
286
|
+
{
|
|
287
|
+
"type": "buckshot.ready",
|
|
288
|
+
"description": {
|
|
289
|
+
"zh": "World 已挂载,游戏还没启动。",
|
|
290
|
+
"en": "The World is mounted and the game has not been launched yet."
|
|
291
|
+
},
|
|
292
|
+
"trigger": "debounce"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"type": "buckshot.connected",
|
|
296
|
+
"description": {
|
|
297
|
+
"zh": "游戏已启动并接上事件。",
|
|
298
|
+
"en": "The game is running and its events are connected."
|
|
299
|
+
},
|
|
300
|
+
"trigger": "debounce"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"type": "buckshot.disconnected",
|
|
304
|
+
"description": {
|
|
305
|
+
"zh": "与游戏的事件连接断开。",
|
|
306
|
+
"en": "The event connection to the game dropped."
|
|
307
|
+
},
|
|
308
|
+
"trigger": "debounce"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"type": "buckshot.closed",
|
|
312
|
+
"description": {
|
|
313
|
+
"zh": "游戏进程已退出。",
|
|
314
|
+
"en": "The game process exited."
|
|
315
|
+
},
|
|
316
|
+
"trigger": "debounce"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"type": "buckshot.error",
|
|
320
|
+
"description": {
|
|
321
|
+
"zh": "与游戏的连接出错。",
|
|
322
|
+
"en": "The connection to the game failed."
|
|
323
|
+
},
|
|
324
|
+
"trigger": "debounce"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"type": "buckshot.state",
|
|
328
|
+
"description": {
|
|
329
|
+
"zh": "可操作的目标、场景、轮次或回合变化,只列出与上次告知不同的内容。",
|
|
330
|
+
"en": "The available targets, scene, round or turn changed; only what differs from the last report is listed."
|
|
331
|
+
},
|
|
332
|
+
"trigger": "flush"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"type": "buckshot.victory",
|
|
336
|
+
"description": {
|
|
337
|
+
"zh": "赢下对局,附奖金。",
|
|
338
|
+
"en": "The game was won, with the prize money."
|
|
339
|
+
},
|
|
340
|
+
"trigger": "flush"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"type": "buckshot.frame",
|
|
344
|
+
"description": {
|
|
345
|
+
"zh": "开枪、揭示弹药等关键时刻后的游戏截图;可在配置里关掉。",
|
|
346
|
+
"en": "A screenshot after key moments such as a shot or a revealed shell; can be turned off in the configuration."
|
|
347
|
+
},
|
|
348
|
+
"trigger": "debounce"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"type": "buckshot.load",
|
|
352
|
+
"description": {
|
|
353
|
+
"zh": "霰弹枪重新装填,公开实弹与空包弹的数量。",
|
|
354
|
+
"en": "The shotgun was reloaded, showing how many live and blank shells went in."
|
|
355
|
+
},
|
|
356
|
+
"trigger": "debounce"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"type": "buckshot.reveal",
|
|
360
|
+
"description": {
|
|
361
|
+
"zh": "道具揭示了剩余弹药中某一发是实弹还是空包弹。",
|
|
362
|
+
"en": "An item revealed whether one of the remaining shells is live or blank."
|
|
363
|
+
},
|
|
364
|
+
"trigger": "debounce"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"type": "buckshot.ejection",
|
|
368
|
+
"description": {
|
|
369
|
+
"zh": "退出一发弹壳,并显示它是实弹还是空包弹。",
|
|
370
|
+
"en": "A shell was ejected, showing whether it was live or blank."
|
|
371
|
+
},
|
|
372
|
+
"trigger": "debounce"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"type": "buckshot.inversion",
|
|
376
|
+
"description": {
|
|
377
|
+
"zh": "有人用逆转器反转了膛内这一发。",
|
|
378
|
+
"en": "Someone used the inverter to flip the chambered shell."
|
|
379
|
+
},
|
|
380
|
+
"trigger": "debounce"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"type": "buckshot.shot",
|
|
384
|
+
"description": {
|
|
385
|
+
"zh": "有人开枪,打出的是实弹还是空包弹。",
|
|
386
|
+
"en": "Someone fired, and whether the shell was live or blank."
|
|
387
|
+
},
|
|
388
|
+
"trigger": "debounce"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"type": "buckshot.item",
|
|
392
|
+
"description": {
|
|
393
|
+
"zh": "玩家或庄家使用了一件道具。",
|
|
394
|
+
"en": "The player or the dealer used an item."
|
|
395
|
+
},
|
|
396
|
+
"trigger": "debounce"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "buckshot.health",
|
|
400
|
+
"description": {
|
|
401
|
+
"zh": "生命计数器的读数变化。",
|
|
402
|
+
"en": "The health counters changed."
|
|
403
|
+
},
|
|
404
|
+
"trigger": "debounce"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"type": "buckshot.revival",
|
|
408
|
+
"description": {
|
|
409
|
+
"zh": "玩家被除颤器救回,对局继续。",
|
|
410
|
+
"en": "The player was revived by the defibrillator and the game goes on."
|
|
411
|
+
},
|
|
412
|
+
"trigger": "debounce"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"type": "buckshot.dialogue",
|
|
416
|
+
"description": {
|
|
417
|
+
"zh": "画面上的一段字幕显示完整。",
|
|
418
|
+
"en": "A line of on-screen dialogue finished displaying."
|
|
419
|
+
},
|
|
420
|
+
"trigger": "debounce"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"type": "buckshot.round",
|
|
424
|
+
"description": {
|
|
425
|
+
"zh": "新一轮开始。",
|
|
426
|
+
"en": "A new round began."
|
|
427
|
+
},
|
|
428
|
+
"trigger": "debounce"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"type": "buckshot.turn",
|
|
432
|
+
"description": {
|
|
433
|
+
"zh": "多人对局里轮到某个座位行动。",
|
|
434
|
+
"en": "In multiplayer, a seat got the turn."
|
|
435
|
+
},
|
|
436
|
+
"trigger": "debounce"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "buckshot.turnorder",
|
|
440
|
+
"description": {
|
|
441
|
+
"zh": "多人对局的行动方向(顺时针或逆时针)。",
|
|
442
|
+
"en": "The direction of play in multiplayer, clockwise or counterclockwise."
|
|
443
|
+
},
|
|
444
|
+
"trigger": "debounce"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"type": "buckshot.result",
|
|
448
|
+
"description": {
|
|
449
|
+
"zh": "对局结算画面:单人胜利的奖金,或多人对局的结果。",
|
|
450
|
+
"en": "The results screen: the prize money for a single-player win, or the multiplayer result."
|
|
451
|
+
},
|
|
452
|
+
"trigger": "debounce"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"type": "buckshot.clipboard",
|
|
456
|
+
"description": {
|
|
457
|
+
"zh": "游戏把多人大厅编号复制到了剪贴板。",
|
|
458
|
+
"en": "The game copied the multiplayer lobby id to the clipboard."
|
|
459
|
+
},
|
|
460
|
+
"trigger": "debounce"
|
|
461
|
+
}
|
|
462
|
+
],
|
|
463
|
+
"prompts": [
|
|
464
|
+
{
|
|
465
|
+
"key": "worlds.buckshot.envPrompt",
|
|
466
|
+
"title": "恶魔轮盘 · 环境提示词",
|
|
467
|
+
"role": "envPrompt",
|
|
468
|
+
"content": "你通过此 World 操作《恶魔轮盘》。游戏执行规则、动画、随机数和对手行为。事件、观察与截图提供游戏中已经公开的信息。\r\n\r\n场景从俱乐部厕所与走廊推进到后室:庄家坐在对局桌对面,桌上有霰弹枪、道具和生命计数器。先签免责书,随后在三个轮次中对局,胜出后打开奖金手提箱并领取奖金。剧情通关解锁 Double or Nothing;药瓶进入无尽模式,阶段结算时可加倍继续或收款退出。死亡、除颤器复苏、重开及结算由原版场景推进。\r\n\r\n事件描述当前画面环境、镜头转向、枪声、道具动作、计数器、完整字幕和结算,并补充对应场景与道具的风味措辞。环境段落描述场景背景;即时表情、灯光和动画进展通过截图确认。buckshot.frame 附带实际渲染帧。需要补看当前画面时调用 buckshot_glance,截图不会产生游戏输入。直播中的反应、评价和解说由你决定。\r\n\r\n调用 buckshot_start 启动,buckshot_observe 读取完整状态。回执和事件里的状态只列与上一次告知相比变化的行,并以「其余同版本 N」标明未列出的行仍是版本 N 时的内容;变为空的行写「无」。每个目标有 id、标签及可选的画面 caption;同名按钮以 caption 区分。把 id 与最新的状态版本传给 buckshot_act;版本已变或目标失效时输入不执行,回执附带最新的状态变化。操作类工具等游戏结算到再次可操作后才返回,回执包含这期间的枪声、道具、字幕等事件、最新状态和结算后的画面;超过结算期限时先返回,之后的变化作为事件送达。没有目标时可能正在播放动画,截图仍可查看。\r\n\r\n签名机最多六个字母,通过字母目标输入并按 enter;游戏保留禁用名字的规则。领取道具时操作 briefcase intake,再选择空槽。单人选择 shotgun 后选择 text you 或 text dealer。胜利后打开左右锁扣和箱盖,等结算后继续。Double or Nothing 的 double yes 加倍继续,double no 收款。\r\n\r\n桌上道具带所属方和槽位。手锯加倍下一枪伤害;放大镜揭示膛内弹药;啤酒弹出一发;香烟恢复生命;手铐跳过对方行动;过期药有随机损益;逆转器反转膛内弹药;电话揭示后续一发;肾上腺素让你选择对手的一件道具并使用。可用权限由游戏决定。多人还可用干扰器选座后按 jam confirm;观察包含已选座位和确认灯色,绿灯可确认,红灯表示当前选择无效。换向遥控器反转回合方向。\r\n\r\n弹药行列出本次装填公开的实弹、空包数,按顺序列出已退出的弹壳,以及逆转过的位置、当前是第几发和你看到的揭示;位置都是本次装填从一开始的序号。退出的弹壳是逆转后的实际类型;未知弹药发生反转后,不能继续用初始实弹数减去已退出的实弹来代表剩余实弹数。庄家及其他玩家的私人放大镜、电话结果不会提供给你。生命是最近公开显示的值;计数器损坏或被遮蔽时为未知。\r\n\r\n菜单设置、语言、音量、控制器、键位、排行榜、多人大厅及自定义对局通过当前目标操作。多人座位从零开始,玩家行标出你的座位,回合行给出当前行动的座位和方向。道具和射击目标携带座位编号。自由观察期间不会提供桌面点击目标。\r\n\r\nbuckshot_input 的名称来自观察列出的输入动作。ui_cancel 返回界面;单人 exit game 按住超过两秒返回菜单,多人使用该输入打开局内大厅界面;free look toggle 切换自由观察。buckshot_key 发送实际键名,支持重绑。buckshot_pointer 使用观察列出的视口内坐标,relativeX、relativeY 控制自由观察,支持点击、按住和滚轮。buckshot_controller 的按钮可按下或松开,轴使用 -1 到 1;结束移动后将轴设为 0。buckshot_type 填写有焦点的输入框;destination=clipboard 可设置大厅编号,再操作游戏的粘贴加入按钮。游戏复制的大厅编号由 clipboard 事件提供。Steam 邀请窗口在游戏渲染器之外,需要在线 Steam 客户端。\r\n\r\n当前状态:\r\n{{buckshot.status}}\r\n"
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
}
|
package/package.json
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cortico-world-buckshot",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Buckshot Roulette game events and player actions for Cortico. 此乃直播测试验证之后的world,和其他 Persona / 非直播场景的兼容性有待测试。",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Phantivia/cortico-world-buckshot.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/Phantivia/cortico-world-buckshot#readme",
|
|
12
|
-
"keywords": [
|
|
13
|
-
"cortico-world",
|
|
14
|
-
"cortico",
|
|
15
|
-
"buckshot-roulette"
|
|
16
|
-
],
|
|
17
|
-
"engines": {
|
|
18
|
-
"node": ">=22"
|
|
19
|
-
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"check:game": "tsx scripts/check-game.ts",
|
|
47
|
-
"check:native": "tsx scripts/check-native.ts"
|
|
48
|
-
}
|
|
49
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "cortico-world-buckshot",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Buckshot Roulette game events and player actions for Cortico. 此乃直播测试验证之后的world,和其他 Persona / 非直播场景的兼容性有待测试。",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Phantivia/cortico-world-buckshot.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Phantivia/cortico-world-buckshot#readme",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"cortico-world",
|
|
14
|
+
"cortico",
|
|
15
|
+
"buckshot-roulette"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=22"
|
|
19
|
+
},
|
|
20
|
+
"os": [
|
|
21
|
+
"win32"
|
|
22
|
+
],
|
|
23
|
+
"packageManager": "pnpm@11.5.0",
|
|
24
|
+
"main": "./src/index.ts",
|
|
25
|
+
"cortico": {
|
|
26
|
+
"kind": "world",
|
|
27
|
+
"api": 6,
|
|
28
|
+
"displayName": "恶魔轮盘",
|
|
29
|
+
"webUiClient": "dist/webui.js",
|
|
30
|
+
"describe": "describe.json"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"src",
|
|
34
|
+
"scripts",
|
|
35
|
+
"dist",
|
|
36
|
+
"describe.json",
|
|
37
|
+
"CHANGELOG.md",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"build:web": "esbuild src/webui/client.ts --bundle --format=esm --platform=browser --outfile=dist/webui.js",
|
|
45
|
+
"prepack": "pnpm build:web",
|
|
46
|
+
"check:game": "tsx scripts/check-game.ts",
|
|
47
|
+
"check:native": "tsx scripts/check-native.ts"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.10.0",
|
|
51
|
+
"cortico": "^0.2.0",
|
|
52
|
+
"esbuild": "^0.28.2",
|
|
53
|
+
"tsx": "^4.19.2",
|
|
54
|
+
"typescript": "^5.7.2",
|
|
55
|
+
"vitest": "^2.1.8"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/definition.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { describeTools, type WorldDefinition } from 'cortico/world.ts';
|
|
2
2
|
import { BUCKSHOT_DEFAULTS, type BuckshotConfigSection } from './config.ts';
|
|
3
|
+
import { BUCKSHOT_TOOL_DECLS } from './tools.ts';
|
|
3
4
|
import { BuckshotWorld } from './world.ts';
|
|
4
5
|
|
|
5
6
|
export const BUCKSHOT: WorldDefinition<BuckshotConfigSection> = {
|
|
@@ -9,4 +10,145 @@ export const BUCKSHOT: WorldDefinition<BuckshotConfigSection> = {
|
|
|
9
10
|
if (process.platform !== 'win32') throw new Error('恶魔轮盘 World 当前支持 Windows。');
|
|
10
11
|
},
|
|
11
12
|
create: (ctx) => new BuckshotWorld(ctx),
|
|
13
|
+
describe: {
|
|
14
|
+
tools: describeTools(BUCKSHOT_TOOL_DECLS, {
|
|
15
|
+
buckshot_start: { zh: '启动恶魔轮盘并接上游戏事件。', en: 'Launches Buckshot Roulette and connects to its game events.' },
|
|
16
|
+
buckshot_observe: {
|
|
17
|
+
zh: '读取当前画面状态、可操作的目标和已揭示的弹药。',
|
|
18
|
+
en: 'Reads the current game state, the targets that can be operated and the shells revealed so far.',
|
|
19
|
+
},
|
|
20
|
+
buckshot_act: {
|
|
21
|
+
zh: '操作一个目标(拿枪、开枪、用道具、点菜单等),等动画结算后回执。',
|
|
22
|
+
en: 'Operates one target, such as picking up the shotgun, firing, using an item or pressing a menu button, and reports back once the animation settles.',
|
|
23
|
+
},
|
|
24
|
+
buckshot_input: { zh: '触发游戏里定义的一个输入动作。', en: 'Triggers one of the input actions the game defines.' },
|
|
25
|
+
buckshot_key: { zh: '按键盘按键,可用于界面导航和改键。', en: 'Presses a keyboard key, for menu navigation or rebinding keys.' },
|
|
26
|
+
buckshot_pointer: { zh: '在游戏画面里移动鼠标、点击或滚动。', en: 'Moves, clicks or scrolls the mouse inside the game view.' },
|
|
27
|
+
buckshot_controller: { zh: '发送手柄按钮或摇杆输入。', en: 'Sends gamepad button or stick input.' },
|
|
28
|
+
buckshot_type: {
|
|
29
|
+
zh: '往输入框里填文字,或把文字放进剪贴板(如多人大厅编号)。',
|
|
30
|
+
en: 'Types text into the focused field, or puts text on the clipboard, such as a multiplayer lobby id.',
|
|
31
|
+
},
|
|
32
|
+
buckshot_glance: { zh: '截取游戏当前画面。', en: 'Takes a screenshot of the game.' },
|
|
33
|
+
buckshot_close: { zh: '关闭本 World 启动的游戏。', en: 'Closes the game this World launched.' },
|
|
34
|
+
}),
|
|
35
|
+
events: [
|
|
36
|
+
{
|
|
37
|
+
type: 'buckshot.ready',
|
|
38
|
+
description: { zh: 'World 已挂载,游戏还没启动。', en: 'The World is mounted and the game has not been launched yet.' },
|
|
39
|
+
trigger: 'debounce',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: 'buckshot.connected',
|
|
43
|
+
description: { zh: '游戏已启动并接上事件。', en: 'The game is running and its events are connected.' },
|
|
44
|
+
trigger: 'debounce',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'buckshot.disconnected',
|
|
48
|
+
description: { zh: '与游戏的事件连接断开。', en: 'The event connection to the game dropped.' },
|
|
49
|
+
trigger: 'debounce',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'buckshot.closed',
|
|
53
|
+
description: { zh: '游戏进程已退出。', en: 'The game process exited.' },
|
|
54
|
+
trigger: 'debounce',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'buckshot.error',
|
|
58
|
+
description: { zh: '与游戏的连接出错。', en: 'The connection to the game failed.' },
|
|
59
|
+
trigger: 'debounce',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'buckshot.state',
|
|
63
|
+
description: {
|
|
64
|
+
zh: '可操作的目标、场景、轮次或回合变化,只列出与上次告知不同的内容。',
|
|
65
|
+
en: 'The available targets, scene, round or turn changed; only what differs from the last report is listed.',
|
|
66
|
+
},
|
|
67
|
+
trigger: 'flush',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'buckshot.victory',
|
|
71
|
+
description: { zh: '赢下对局,附奖金。', en: 'The game was won, with the prize money.' },
|
|
72
|
+
trigger: 'flush',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'buckshot.frame',
|
|
76
|
+
description: {
|
|
77
|
+
zh: '开枪、揭示弹药等关键时刻后的游戏截图;可在配置里关掉。',
|
|
78
|
+
en: 'A screenshot after key moments such as a shot or a revealed shell; can be turned off in the configuration.',
|
|
79
|
+
},
|
|
80
|
+
trigger: 'debounce',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'buckshot.load',
|
|
84
|
+
description: { zh: '霰弹枪重新装填,公开实弹与空包弹的数量。', en: 'The shotgun was reloaded, showing how many live and blank shells went in.' },
|
|
85
|
+
trigger: 'debounce',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'buckshot.reveal',
|
|
89
|
+
description: { zh: '道具揭示了剩余弹药中某一发是实弹还是空包弹。', en: 'An item revealed whether one of the remaining shells is live or blank.' },
|
|
90
|
+
trigger: 'debounce',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'buckshot.ejection',
|
|
94
|
+
description: { zh: '退出一发弹壳,并显示它是实弹还是空包弹。', en: 'A shell was ejected, showing whether it was live or blank.' },
|
|
95
|
+
trigger: 'debounce',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'buckshot.inversion',
|
|
99
|
+
description: { zh: '有人用逆转器反转了膛内这一发。', en: 'Someone used the inverter to flip the chambered shell.' },
|
|
100
|
+
trigger: 'debounce',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'buckshot.shot',
|
|
104
|
+
description: { zh: '有人开枪,打出的是实弹还是空包弹。', en: 'Someone fired, and whether the shell was live or blank.' },
|
|
105
|
+
trigger: 'debounce',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'buckshot.item',
|
|
109
|
+
description: { zh: '玩家或庄家使用了一件道具。', en: 'The player or the dealer used an item.' },
|
|
110
|
+
trigger: 'debounce',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'buckshot.health',
|
|
114
|
+
description: { zh: '生命计数器的读数变化。', en: 'The health counters changed.' },
|
|
115
|
+
trigger: 'debounce',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'buckshot.revival',
|
|
119
|
+
description: { zh: '玩家被除颤器救回,对局继续。', en: 'The player was revived by the defibrillator and the game goes on.' },
|
|
120
|
+
trigger: 'debounce',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: 'buckshot.dialogue',
|
|
124
|
+
description: { zh: '画面上的一段字幕显示完整。', en: 'A line of on-screen dialogue finished displaying.' },
|
|
125
|
+
trigger: 'debounce',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: 'buckshot.round',
|
|
129
|
+
description: { zh: '新一轮开始。', en: 'A new round began.' },
|
|
130
|
+
trigger: 'debounce',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'buckshot.turn',
|
|
134
|
+
description: { zh: '多人对局里轮到某个座位行动。', en: 'In multiplayer, a seat got the turn.' },
|
|
135
|
+
trigger: 'debounce',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: 'buckshot.turnorder',
|
|
139
|
+
description: { zh: '多人对局的行动方向(顺时针或逆时针)。', en: 'The direction of play in multiplayer, clockwise or counterclockwise.' },
|
|
140
|
+
trigger: 'debounce',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'buckshot.result',
|
|
144
|
+
description: { zh: '对局结算画面:单人胜利的奖金,或多人对局的结果。', en: 'The results screen: the prize money for a single-player win, or the multiplayer result.' },
|
|
145
|
+
trigger: 'debounce',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'buckshot.clipboard',
|
|
149
|
+
description: { zh: '游戏把多人大厅编号复制到了剪贴板。', en: 'The game copied the multiplayer lobby id to the clipboard.' },
|
|
150
|
+
trigger: 'debounce',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
12
154
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebUiClientBundle, WebUiPanel } from 'cortico/web/shared/client-panel.ts';
|
|
2
2
|
import type { BuckshotGameState } from './types.ts';
|
|
3
3
|
|
|
4
|
-
const game:
|
|
4
|
+
const game: WebUiPanel = {
|
|
5
5
|
mount(ctx) {
|
|
6
6
|
const { ui } = ctx;
|
|
7
7
|
const card = ui.sheet({ title: '游戏' });
|
|
@@ -53,4 +53,4 @@ const game: ConsolePanel = {
|
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export default { panels: { game } } satisfies
|
|
56
|
+
export default { panels: { game } } satisfies WebUiClientBundle;
|
package/src/world.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { mkdir } from 'node:fs/promises';
|
|
|
3
3
|
import { createWriteStream, existsSync, statSync } from 'node:fs';
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import type { BlobInput, ToolDef, ToolOutcome, World, WorldHost,
|
|
6
|
+
import type { BlobInput, ToolDef, ToolOutcome, World, WorldHost, WorldWebUiDecl } from 'cortico/core/types.ts';
|
|
7
7
|
import type { WorldContext } from 'cortico/world.ts';
|
|
8
8
|
import { nowIso } from 'cortico/core/util.ts';
|
|
9
9
|
import { BuckshotBridge } from './bridge.ts';
|
|
@@ -12,8 +12,8 @@ import { prepareImplant } from './implant.ts';
|
|
|
12
12
|
import { renderSnapshot, StateNarrator } from './render.ts';
|
|
13
13
|
import { BUCKSHOT_TOOL_DECLS } from './tools.ts';
|
|
14
14
|
import type { BuckshotObservation, BuckshotSnapshot } from './protocol.ts';
|
|
15
|
-
import { BUCKSHOT_PANEL_DECLS } from './
|
|
16
|
-
import type { BuckshotGameState } from './
|
|
15
|
+
import { BUCKSHOT_PANEL_DECLS } from './webui/panels.ts';
|
|
16
|
+
import type { BuckshotGameState } from './webui/types.ts';
|
|
17
17
|
import { describeObservation, frameKey } from './events.ts';
|
|
18
18
|
import { Settlement } from './settle.ts';
|
|
19
19
|
|
|
@@ -76,7 +76,7 @@ export class BuckshotWorld implements World {
|
|
|
76
76
|
} }));
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
webUi(): WorldWebUiDecl {
|
|
80
80
|
return {
|
|
81
81
|
label: '恶魔轮盘', config: [BUCKSHOT_CONFIG_GROUP], panels: [...BUCKSHOT_PANEL_DECLS],
|
|
82
82
|
invoke: async (panel, method) => {
|
|
@@ -190,7 +190,7 @@ export class BuckshotWorld implements World {
|
|
|
190
190
|
this.state = 'loading';
|
|
191
191
|
const executableFile = normalizeExecutableFile(this.ctx.cfg.executableFile);
|
|
192
192
|
if (!executableFile || !existsSync(executableFile) || !statSync(executableFile).isFile()) {
|
|
193
|
-
throw new Error(executableFile ? `找不到游戏程序: ${executableFile}` : '
|
|
193
|
+
throw new Error(executableFile ? `找不到游戏程序: ${executableFile}` : '未配置游戏程序。在 WebUI 恶魔轮盘页的配置里选择 Buckshot Roulette.exe。');
|
|
194
194
|
}
|
|
195
195
|
const runtimeDir = this.ctx.cfg.runtimeDir || join(this.ctx.botDir, 'runtimes', 'buckshot');
|
|
196
196
|
const packFile = await prepareImplant(executableFile, runtimeDir);
|
|
File without changes
|
|
File without changes
|