koishi-plugin-mcdle 0.3.1 → 0.5.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/README.md +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +159 -137
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Schema, Session } from 'koishi';
|
|
2
2
|
import { MobData, BlockData, ItemData } from './data';
|
|
3
3
|
export declare const name = "mcdle";
|
|
4
|
-
export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `mcdle` \u67E5\u770B\u73A9\u6CD5\u4E0E\u5168\u90E8\u6307\u4EE4\u3002`mcdle.\u731C [\u540D\u79F0]` \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B\u3002\u9996\u6B21\u731C\u6D4B\u7684\u8BCD\u6761\u51B3\u5B9A\u751F\u7269\u3001\u7269\u54C1\u6216\u65B9\u5757\u6A21\u5F0F\uFF0C\u7CFB\u7EDF\u518D\u4ECE\u540C\u7C7B\u8BCD\u5E93\u4E2D\u62BD\u53D6\u7B54\u6848\u3002\n\n## \
|
|
4
|
+
export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `mcdle` \u67E5\u770B\u73A9\u6CD5\u4E0E\u5168\u90E8\u6307\u4EE4\u3002`mcdle.\u731C [\u540D\u79F0]` \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B\u3002\u9996\u6B21\u731C\u6D4B\u7684\u8BCD\u6761\u51B3\u5B9A\u751F\u7269\u3001\u7269\u54C1\u6216\u65B9\u5757\u6A21\u5F0F\uFF0C\u7CFB\u7EDF\u518D\u4ECE\u540C\u7C7B\u8BCD\u5E93\u4E2D\u62BD\u53D6\u7B54\u6848\u3002\n\n## \u6307\u4EE4\n\n| \u6307\u4EE4 | \u8BF4\u660E |\n| --- | --- |\n| `mcdle` | \u73A9\u6CD5\u4E0E\u6307\u4EE4\u8BF4\u660E |\n| `mcdle.\u731C [\u540D\u79F0]` | \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B |\n| `mcdle.\u88F8\u731C [\u5F00/\u5173]` | \u5F00\u5173\u672C\u9891\u9053\u7684\u65E0\u524D\u7F00\u7EED\u731C |\n| `mcdle.\u6392\u884C\u699C` | \u7D2F\u8BA1\u6218\u7EE9 |\n| `mcdle.\u8BCD\u5E93` | \u5168\u90E8\u8BCD\u6761 |\n\n## \u63D0\u793A\n\n| \u7B26\u53F7 | \u542B\u4E49 |\n| --- | --- |\n| \uD83D\uDFE9 | \u5B8C\u5168\u5339\u914D |\n| \uD83D\uDFE8 | \u90E8\u5206\u5339\u914D |\n| \uD83D\uDFE5 | \u4E0D\u5339\u914D |\n| \uD83D\uDFE5\u2B06\uFE0F / \uD83D\uDFE5\u2B07\uFE0F | \u7B54\u6848\u66F4\u5927 / \u66F4\u5C0F |";
|
|
5
5
|
export declare const inject: {
|
|
6
6
|
required: string[];
|
|
7
7
|
optional: string[];
|
|
@@ -9,7 +9,7 @@ export declare const inject: {
|
|
|
9
9
|
export interface Config {
|
|
10
10
|
atReply: boolean;
|
|
11
11
|
quoteReply: boolean;
|
|
12
|
-
|
|
12
|
+
enableDirectInput: boolean;
|
|
13
13
|
addStatusTextAfterEmoji: boolean;
|
|
14
14
|
maxRank: number;
|
|
15
15
|
dailyPlayLimit: number;
|
package/lib/index.js
CHANGED
|
@@ -14804,6 +14804,7 @@ var TYPE = {
|
|
|
14804
14804
|
labelMedium: { size: 12, line: 16, weight: 500, tracking: 0.5 },
|
|
14805
14805
|
labelSmall: { size: 11, line: 16, weight: 500, tracking: 0.5 }
|
|
14806
14806
|
};
|
|
14807
|
+
var EMPHASIZED_WEIGHT = { display: 600, headline: 600, title: 600, label: 600 };
|
|
14807
14808
|
var ELEVATION = [
|
|
14808
14809
|
"none",
|
|
14809
14810
|
"0 1px 2px 0 rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -15461,6 +15462,7 @@ function statusOf(guess, key) {
|
|
|
15461
15462
|
return STATUS_META[v] ? v : "unknown";
|
|
15462
15463
|
}
|
|
15463
15464
|
__name(statusOf, "statusOf");
|
|
15465
|
+
var INK = lch(100, 0, HUE);
|
|
15464
15466
|
var STATUS_TILE = {
|
|
15465
15467
|
hit: lch(42, 44, 142),
|
|
15466
15468
|
half: lch(44, 46, 82),
|
|
@@ -15468,6 +15470,7 @@ var STATUS_TILE = {
|
|
|
15468
15470
|
none: SCHEME.surfaceContainerHigh
|
|
15469
15471
|
};
|
|
15470
15472
|
var FONT_STACK_CJK = `"Minecraft", "Fusion Pixel 12px monospaced", "Fusion Pixel 12px", "Zpix", ` + FONT_STACK;
|
|
15473
|
+
var NUM_FONT = `${MONO_STACK},${FONT_STACK_CJK}`;
|
|
15471
15474
|
var CSS = `
|
|
15472
15475
|
${baseline(SCHEME)}${components()}
|
|
15473
15476
|
body{font-family:${FONT_STACK_CJK};background:transparent}
|
|
@@ -15478,9 +15481,7 @@ html,body{background:transparent}
|
|
|
15478
15481
|
position:relative;
|
|
15479
15482
|
display:inline-block;
|
|
15480
15483
|
overflow:hidden;
|
|
15481
|
-
|
|
15482
|
-
color:var(--md-sys-color-on-surface);
|
|
15483
|
-
border-radius:${SHAPE.extraLarge}px;
|
|
15484
|
+
border-radius:var(--md-sys-shape-corner-extra-large);
|
|
15484
15485
|
}
|
|
15485
15486
|
.pad{padding:24px}
|
|
15486
15487
|
|
|
@@ -15493,24 +15494,25 @@ html,body{background:transparent}
|
|
|
15493
15494
|
/* 顶端那道强调色仍在,但收成一条细的圆头指示条,不再模拟草皮 */
|
|
15494
15495
|
.hd .turf{
|
|
15495
15496
|
position:absolute;left:24px;top:14px;width:56px;height:4px;
|
|
15496
|
-
border-radius
|
|
15497
|
+
border-radius:var(--md-sys-shape-corner-full);background:var(--accent);
|
|
15497
15498
|
}
|
|
15498
15499
|
.hd-row{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-top:18px}
|
|
15499
15500
|
.brand{display:flex;align-items:center;gap:12px}
|
|
15500
15501
|
.brand .mark{color:var(--accent)}
|
|
15501
|
-
.brand .word{font-size
|
|
15502
|
-
.brand .word b{color:var(--accent);font-weight
|
|
15503
|
-
.hd .sub{margin-top:8px;font-size
|
|
15502
|
+
.brand .word{font-size:${TYPE.headlineMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.headline};letter-spacing:.18em;line-height:1}
|
|
15503
|
+
.brand .word b{color:var(--accent);font-weight:${EMPHASIZED_WEIGHT.headline}}
|
|
15504
|
+
.hd .sub{margin-top:8px;font-size:${TYPE.bodySmall.size}px;letter-spacing:.05em;color:var(--md-sys-color-on-surface-variant)}
|
|
15504
15505
|
.hd-meta{text-align:right;flex:none}
|
|
15505
|
-
.hd-meta .big{font-size
|
|
15506
|
-
.hd-meta .cap{font-size
|
|
15506
|
+
.hd-meta .big{font-family:${NUM_FONT};font-size:${TYPE.headlineMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.headline};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15507
|
+
.hd-meta .cap{font-size:${TYPE.labelSmall.size}px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:6px}
|
|
15507
15508
|
|
|
15508
|
-
/*
|
|
15509
|
+
/* 模式徽记:药丸形。底色是每模式各自的 accent(同一套色调板上的色调 80),
|
|
15510
|
+
不是主题容器色,m3-chip 没有对应档位 */
|
|
15509
15511
|
.badge{
|
|
15510
15512
|
display:inline-flex;align-items:center;gap:7px;padding:6px 14px;
|
|
15511
|
-
border-radius
|
|
15513
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15512
15514
|
background:var(--accent);color:var(--md-sys-color-surface);
|
|
15513
|
-
font-size
|
|
15515
|
+
font-size:${TYPE.labelMedium.size}px;letter-spacing:.06em;font-weight:${EMPHASIZED_WEIGHT.label};
|
|
15514
15516
|
}
|
|
15515
15517
|
|
|
15516
15518
|
/* ── 猜测板 ───────────────────────────────────────── */
|
|
@@ -15518,8 +15520,8 @@ table{border-collapse:separate;border-spacing:6px;margin:0 -6px}
|
|
|
15518
15520
|
th{padding:0 0 8px;vertical-align:bottom}
|
|
15519
15521
|
.col{display:flex;flex-direction:column;align-items:center;gap:6px;
|
|
15520
15522
|
min-width:80px;max-width:132px;color:var(--md-sys-color-on-surface-variant)}
|
|
15521
|
-
.col .lb{font-size
|
|
15522
|
-
text-align:center;line-height:1.25;font-weight
|
|
15523
|
+
.col .lb{font-size:${TYPE.labelSmall.size}px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);
|
|
15524
|
+
text-align:center;line-height:1.25;font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15523
15525
|
th.n .col{align-items:flex-start;min-width:150px}
|
|
15524
15526
|
|
|
15525
15527
|
td{padding:0}
|
|
@@ -15528,26 +15530,26 @@ td{padding:0}
|
|
|
15528
15530
|
min-height:60px;min-width:76px;max-width:132px;
|
|
15529
15531
|
padding:9px 10px;
|
|
15530
15532
|
display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
|
|
15531
|
-
border-radius
|
|
15533
|
+
border-radius:var(--md-sys-shape-corner-medium);
|
|
15532
15534
|
background:var(--tile);
|
|
15533
15535
|
}
|
|
15534
15536
|
/* 多标签字段给更宽的上限,否则一列里会折成很高的一坨 */
|
|
15535
15537
|
.tile.list{max-width:168px}
|
|
15536
15538
|
th.list .col{max-width:168px}
|
|
15537
|
-
.tile .v{font-size
|
|
15538
|
-
color
|
|
15539
|
+
.tile .v{font-size:${TYPE.titleSmall.size}px;font-weight:${EMPHASIZED_WEIGHT.title};line-height:1.35;text-align:center;
|
|
15540
|
+
color:${INK};word-break:break-word}
|
|
15539
15541
|
.tile .chips{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}
|
|
15540
15542
|
.chip{
|
|
15541
|
-
font-size
|
|
15542
|
-
border-radius
|
|
15543
|
-
color
|
|
15543
|
+
font-size:${TYPE.labelSmall.size}px;line-height:1.35;padding:2px 8px;
|
|
15544
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15545
|
+
color:${INK};background:color-mix(in srgb, var(--md-sys-color-scrim) 24%, transparent);
|
|
15544
15546
|
}
|
|
15545
15547
|
/* 部分匹配时把真正命中的标签点亮,让「黄」变得可读 */
|
|
15546
|
-
.chip.on{background
|
|
15547
|
-
.tile .flag{position:absolute;top:5px;right:5px;color:
|
|
15548
|
+
.chip.on{background:${INK};color:var(--md-sys-color-surface);font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15549
|
+
.tile .flag{position:absolute;top:5px;right:5px;color:color-mix(in srgb, ${INK} 85%, transparent)}
|
|
15548
15550
|
/* 数值方向不只靠角标:整块的上/下边缘会亮起一条,指向答案所在的一侧 */
|
|
15549
15551
|
.tile.s-up::after,.tile.s-down::after{content:"";position:absolute;left:12px;right:12px;height:4px;
|
|
15550
|
-
border-radius
|
|
15552
|
+
border-radius:var(--md-sys-shape-corner-full);background:color-mix(in srgb, ${INK} 62%, transparent)}
|
|
15551
15553
|
.tile.s-up::after{top:5px}
|
|
15552
15554
|
.tile.s-down::after{bottom:5px}
|
|
15553
15555
|
|
|
@@ -15560,14 +15562,14 @@ th.list .col{max-width:168px}
|
|
|
15560
15562
|
.name{
|
|
15561
15563
|
display:flex;align-items:center;gap:12px;min-height:60px;min-width:150px;
|
|
15562
15564
|
padding:8px 12px 8px 9px;
|
|
15563
|
-
border-radius
|
|
15565
|
+
border-radius:var(--md-sys-shape-corner-medium);
|
|
15564
15566
|
background:var(--md-sys-color-surface-container-high);
|
|
15565
15567
|
}
|
|
15566
15568
|
.name.correct{background:${STATUS_TILE.hit}}
|
|
15567
15569
|
.thumb{
|
|
15568
15570
|
width:44px;height:44px;flex:none;
|
|
15569
15571
|
display:flex;align-items:center;justify-content:center;
|
|
15570
|
-
border-radius
|
|
15572
|
+
border-radius:var(--md-sys-shape-corner-small);
|
|
15571
15573
|
background:var(--md-sys-color-surface-container-lowest);
|
|
15572
15574
|
}
|
|
15573
15575
|
.thumb img{max-width:38px;max-height:38px;display:block}
|
|
@@ -15576,28 +15578,31 @@ th.list .col{max-width:168px}
|
|
|
15576
15578
|
.thumb .fb{display:none;color:var(--md-sys-color-on-surface-variant)}
|
|
15577
15579
|
.thumb.failed .fb{display:block}
|
|
15578
15580
|
.name .txt{min-width:0}
|
|
15579
|
-
.name .cn{font-size
|
|
15580
|
-
.name .en{font-size
|
|
15581
|
+
.name .cn{font-size:${TYPE.titleMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.title};line-height:1.25}
|
|
15582
|
+
.name .en{font-size:${TYPE.labelSmall.size}px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);margin-top:3px;
|
|
15581
15583
|
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
|
|
15582
|
-
.name.correct .cn,.name.correct .en,.name.correct .no{color
|
|
15584
|
+
.name.correct .cn,.name.correct .en,.name.correct .no{color:${INK}}
|
|
15583
15585
|
.name.correct .en,.name.correct .no{opacity:.78}
|
|
15584
|
-
.name .no{font-size
|
|
15586
|
+
.name .no{font-family:${NUM_FONT};font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:3px}
|
|
15585
15587
|
|
|
15586
|
-
/*
|
|
15587
|
-
|
|
15588
|
+
/* 最新一行的强调:外圈一圈 2px 描边 + 行首的圆头标记。
|
|
15589
|
+
这是高亮环不是层高,所以用 outline 而不是 box-shadow */
|
|
15590
|
+
tr.fresh .tile,tr.fresh .name{outline:2px solid var(--accent)}
|
|
15588
15591
|
tr.fresh .name{position:relative}
|
|
15589
15592
|
tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:4px;
|
|
15590
|
-
border-radius
|
|
15593
|
+
border-radius:var(--md-sys-shape-corner-full);background:var(--accent)}
|
|
15591
15594
|
|
|
15592
15595
|
/* ── 进度条 ───────────────────────────────────────── */
|
|
15596
|
+
/* 轨道内嵌填充、宽度按百分比,高度 12px;m3-bar 是「填充与轨道两个全圆角块 +
|
|
15597
|
+
4px 空隙」的 16px 结构,换过去要连 DOM 与高度一起改,故保留本地类名 */
|
|
15593
15598
|
.prog{display:flex;align-items:center;gap:12px;margin-top:20px}
|
|
15594
15599
|
.prog .bar{
|
|
15595
15600
|
flex:1;height:12px;overflow:hidden;
|
|
15596
|
-
border-radius
|
|
15601
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15597
15602
|
background:var(--md-sys-color-surface-container-highest);
|
|
15598
15603
|
}
|
|
15599
|
-
.prog .fill{height:100%;border-radius
|
|
15600
|
-
.prog .num{font-size
|
|
15604
|
+
.prog .fill{height:100%;border-radius:var(--md-sys-shape-corner-full);background:var(--accent)}
|
|
15605
|
+
.prog .num{font-family:${NUM_FONT};font-size:${TYPE.labelMedium.size}px;color:var(--md-sys-color-on-surface-variant);letter-spacing:.04em;flex:none;
|
|
15601
15606
|
font-variant-numeric:tabular-nums}
|
|
15602
15607
|
|
|
15603
15608
|
/* ── 图例 / 页脚 ──────────────────────────────────── */
|
|
@@ -15608,49 +15613,51 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15608
15613
|
}
|
|
15609
15614
|
.lg{
|
|
15610
15615
|
display:flex;align-items:center;gap:6px;padding:5px 12px;
|
|
15611
|
-
border-radius
|
|
15612
|
-
font-size
|
|
15616
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15617
|
+
font-size:${TYPE.labelSmall.size}px;color:${INK};background:var(--tile);
|
|
15613
15618
|
}
|
|
15614
15619
|
.lg.s-none{color:var(--md-sys-color-on-surface-variant)}
|
|
15615
|
-
.tip{margin-left:auto;font-size
|
|
15620
|
+
.tip{margin-left:auto;font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);letter-spacing:.02em}
|
|
15616
15621
|
|
|
15617
15622
|
/* ── 通用区块 ─────────────────────────────────────── */
|
|
15618
15623
|
.sec{margin-top:22px}
|
|
15619
15624
|
.sec:first-child{margin-top:0}
|
|
15620
|
-
.sec-t{display:flex;align-items:center;gap:10px;font-size
|
|
15621
|
-
font-weight
|
|
15625
|
+
.sec-t{display:flex;align-items:center;gap:10px;font-size:${TYPE.labelMedium.size}px;letter-spacing:.1em;
|
|
15626
|
+
font-weight:${EMPHASIZED_WEIGHT.label};color:var(--md-sys-color-on-surface-variant);margin-bottom:12px}
|
|
15622
15627
|
.sec-t::after{content:"";flex:1;height:1px;background:var(--md-sys-color-outline-variant)}
|
|
15623
15628
|
.panel{
|
|
15624
15629
|
padding:16px 18px;
|
|
15625
|
-
border-radius
|
|
15630
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15626
15631
|
background:var(--md-sys-color-surface-container);
|
|
15627
15632
|
}
|
|
15628
15633
|
.rows{display:flex;flex-direction:column;gap:9px}
|
|
15629
|
-
.row{display:flex;align-items:center;gap:10px;font-size
|
|
15634
|
+
.row{display:flex;align-items:center;gap:10px;font-size:${TYPE.bodyMedium.size}px;
|
|
15630
15635
|
color:var(--md-sys-color-on-surface);line-height:1.5}
|
|
15631
|
-
.row .k{color:var(--accent);flex:none;font-weight
|
|
15632
|
-
.row .m{color:var(--md-sys-color-on-surface-variant);font-size
|
|
15636
|
+
.row .k{color:var(--accent);flex:none;font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15637
|
+
.row .m{color:var(--md-sys-color-on-surface-variant);font-size:${TYPE.bodySmall.size}px}
|
|
15633
15638
|
.cmd{
|
|
15634
|
-
font-weight
|
|
15639
|
+
font-weight:${EMPHASIZED_WEIGHT.label};color:var(--md-sys-color-on-surface);
|
|
15635
15640
|
background:var(--md-sys-color-surface-container-highest);
|
|
15636
|
-
padding:2px 9px;border-radius
|
|
15641
|
+
padding:2px 9px;border-radius:var(--md-sys-shape-corner-small);
|
|
15637
15642
|
}
|
|
15638
15643
|
|
|
15639
15644
|
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
|
|
15640
15645
|
.mode-card{
|
|
15641
15646
|
padding:15px 16px;
|
|
15642
|
-
border-radius
|
|
15647
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15643
15648
|
background:var(--md-sys-color-surface-container);
|
|
15644
15649
|
}
|
|
15645
|
-
.mode-card .top{display:flex;align-items:center;gap:9px;font-size
|
|
15646
|
-
.mode-card .cnt{font-size
|
|
15647
|
-
.mode-card .tl{font-size
|
|
15650
|
+
.mode-card .top{display:flex;align-items:center;gap:9px;font-size:${TYPE.titleMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.title}}
|
|
15651
|
+
.mode-card .cnt{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:8px;letter-spacing:.04em}
|
|
15652
|
+
.mode-card .tl{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:6px;line-height:1.5}
|
|
15648
15653
|
|
|
15649
15654
|
.attrs{display:flex;flex-wrap:wrap;gap:8px}
|
|
15655
|
+
/* 配色与 m3-chip 的默认档(secondary-container)一致,但尺寸更小:
|
|
15656
|
+
12px 字、7px/14px 内距、无固定高度,降级要覆盖组件的字号与内距,故留本地类名 */
|
|
15650
15657
|
.attr{
|
|
15651
15658
|
display:flex;align-items:center;gap:7px;padding:7px 14px;
|
|
15652
|
-
border-radius
|
|
15653
|
-
font-size
|
|
15659
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15660
|
+
font-size:${TYPE.labelMedium.size}px;color:var(--md-sys-color-on-secondary-container);
|
|
15654
15661
|
background:var(--md-sys-color-secondary-container);
|
|
15655
15662
|
}
|
|
15656
15663
|
.attr .px{color:var(--accent)}
|
|
@@ -15662,7 +15669,7 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15662
15669
|
.reveal .big-thumb{
|
|
15663
15670
|
width:136px;height:136px;flex:none;
|
|
15664
15671
|
display:flex;align-items:center;justify-content:center;
|
|
15665
|
-
border-radius
|
|
15672
|
+
border-radius:var(--md-sys-shape-corner-extra-large);
|
|
15666
15673
|
background:var(--md-sys-color-surface-container);
|
|
15667
15674
|
}
|
|
15668
15675
|
.reveal .big-thumb img{max-width:112px;max-height:112px;display:block}
|
|
@@ -15670,56 +15677,44 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15670
15677
|
.reveal .big-thumb img.broken{display:none}
|
|
15671
15678
|
.reveal .big-thumb .fb{display:none;color:var(--md-sys-color-on-surface-variant)}
|
|
15672
15679
|
.reveal .big-thumb.failed .fb{display:block}
|
|
15673
|
-
.reveal .cn{font-size
|
|
15674
|
-
.reveal .en{font-size
|
|
15680
|
+
.reveal .cn{font-size:${TYPE.displaySmall.size}px;font-weight:${EMPHASIZED_WEIGHT.display};line-height:1.1}
|
|
15681
|
+
.reveal .en{font-size:${TYPE.bodySmall.size}px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:10px}
|
|
15675
15682
|
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
|
|
15676
15683
|
.stat{
|
|
15677
15684
|
padding:13px 16px;
|
|
15678
|
-
border-radius
|
|
15685
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15679
15686
|
background:var(--md-sys-color-surface-container);
|
|
15680
15687
|
}
|
|
15681
|
-
.stat .n{font-size
|
|
15682
|
-
.stat .c{font-size
|
|
15688
|
+
.stat .n{font-family:${NUM_FONT};font-size:${TYPE.titleLarge.size}px;font-weight:${EMPHASIZED_WEIGHT.title};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15689
|
+
.stat .c{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:7px;letter-spacing:.06em}
|
|
15683
15690
|
|
|
15684
15691
|
/* ── 排行榜 ───────────────────────────────────────── */
|
|
15692
|
+
/* 列用 m3-list、行用 m3-list-item:圆角(首尾项放大到 extraLarge)、容器色与
|
|
15693
|
+
徽章配色都由组件给,本地只补这张卡片自己的行距与内距 */
|
|
15685
15694
|
.rank{display:flex;flex-direction:column;gap:6px}
|
|
15686
|
-
.rk{
|
|
15687
|
-
display:flex;align-items:center;gap:14px;padding:12px 14px;
|
|
15688
|
-
border-radius:${SHAPE.medium}px;
|
|
15689
|
-
background:var(--md-sys-color-surface-container);
|
|
15690
|
-
}
|
|
15691
|
-
.rk:first-child{border-top-left-radius:${SHAPE.extraLarge}px;border-top-right-radius:${SHAPE.extraLarge}px}
|
|
15692
|
-
.rk:last-child{border-bottom-left-radius:${SHAPE.extraLarge}px;border-bottom-right-radius:${SHAPE.extraLarge}px}
|
|
15695
|
+
.rk{gap:14px;padding:12px 14px}
|
|
15693
15696
|
.rk .pos{
|
|
15694
|
-
width:34px;height:34px;
|
|
15695
|
-
|
|
15696
|
-
border-radius:${SHAPE.full}px;
|
|
15697
|
-
font-size:15px;font-weight:600;
|
|
15698
|
-
color:var(--md-sys-color-on-surface-variant);
|
|
15699
|
-
background:var(--md-sys-color-surface-container-highest);
|
|
15697
|
+
width:34px;height:34px;padding:0;
|
|
15698
|
+
font-family:${NUM_FONT};
|
|
15700
15699
|
}
|
|
15701
|
-
.rk.p1
|
|
15702
|
-
.rk.p1 .pos{background:${MEDAL.gold}}
|
|
15703
|
-
.rk.p2 .pos{background:${MEDAL.silver}}
|
|
15704
|
-
.rk.p3 .pos{background:${MEDAL.bronze}}
|
|
15705
|
-
.rk.p1{box-shadow:0 0 0 2px ${MEDAL.gold}}
|
|
15700
|
+
.rk.p1{outline:2px solid ${MEDAL.gold}}
|
|
15706
15701
|
.rk .who{flex:1;min-width:0}
|
|
15707
|
-
.rk .nm{font-size
|
|
15702
|
+
.rk .nm{font-size:${TYPE.titleSmall.size}px;font-weight:${EMPHASIZED_WEIGHT.title};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
|
15708
15703
|
max-width:260px}
|
|
15709
15704
|
.rk .split{display:flex;gap:10px;margin-top:6px}
|
|
15710
|
-
.rk .sp{display:flex;align-items:center;gap:4px;font-size
|
|
15705
|
+
.rk .sp{display:flex;align-items:center;gap:4px;font-size:${TYPE.labelSmall.size}px;font-family:${NUM_FONT};color:var(--md-sys-color-on-surface-variant)}
|
|
15711
15706
|
.rk .tot{flex:none;text-align:right}
|
|
15712
|
-
.rk .tot .n{font-size
|
|
15713
|
-
.rk .tot .c{font-size
|
|
15707
|
+
.rk .tot .n{font-family:${NUM_FONT};font-size:${TYPE.titleLarge.size}px;font-weight:${EMPHASIZED_WEIGHT.title};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15708
|
+
.rk .tot .c{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:5px;letter-spacing:.06em}
|
|
15714
15709
|
|
|
15715
15710
|
.empty{padding:36px 20px;min-width:400px;text-align:center;
|
|
15716
|
-
color:var(--md-sys-color-on-surface-variant);font-size
|
|
15711
|
+
color:var(--md-sys-color-on-surface-variant);font-size:${TYPE.bodyMedium.size}px;line-height:2}
|
|
15717
15712
|
.empty .px{margin:0 auto 14px;color:var(--md-sys-color-on-surface-variant)}
|
|
15718
15713
|
`;
|
|
15719
15714
|
function shell(body, opts) {
|
|
15720
15715
|
const width = opts.width ? `width:${opts.width}px;` : "";
|
|
15721
15716
|
return `<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><style>${CSS}</style></head>
|
|
15722
|
-
<body><div id="card" style="--accent:${opts.accent};${width}">${body}</div></body></html>`;
|
|
15717
|
+
<body><div id="card" class="m3-surface" style="--accent:${opts.accent};${width}">${body}</div></body></html>`;
|
|
15723
15718
|
}
|
|
15724
15719
|
__name(shell, "shell");
|
|
15725
15720
|
function esc(s) {
|
|
@@ -15869,7 +15864,7 @@ function winCard(o) {
|
|
|
15869
15864
|
<div class="sec-t"><span>答 案 档 案</span></div>
|
|
15870
15865
|
<div class="attrs">${attrs}</div>
|
|
15871
15866
|
</div>
|
|
15872
|
-
</div>` + noteRow("mcdle
|
|
15867
|
+
</div>` + noteRow("发送「mcdle.排行榜」查看累计战绩");
|
|
15873
15868
|
return shell(body, { accent: meta.accent, width: 720 });
|
|
15874
15869
|
}
|
|
15875
15870
|
__name(winCard, "winCard");
|
|
@@ -15919,30 +15914,31 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15919
15914
|
<div class="panel"><div class="rows">
|
|
15920
15915
|
<div class="row"><span class="cmd">mcdle</span><span class="m">这份玩法与指令说明</span></div>
|
|
15921
15916
|
<div class="row"><span class="cmd">mcdle.猜 [名称]</span><span class="m">开始一局,或提交猜测</span></div>
|
|
15922
|
-
<div class="row"><span class="cmd">mcdle.猜</span><span class="m"
|
|
15917
|
+
<div class="row"><span class="cmd">mcdle.猜</span><span class="m">局中再次发送可回看当前棋盘</span></div>
|
|
15923
15918
|
<div class="row"><span class="cmd">mcdle.裸猜 [开/关]</span><span class="m">临时切换本频道的无前缀续猜</span></div>
|
|
15924
|
-
<div class="row"><span class="cmd">mcdle.排行榜</span><span class="m"
|
|
15919
|
+
<div class="row"><span class="cmd">mcdle.排行榜</span><span class="m">查看累计战绩</span></div>
|
|
15925
15920
|
<div class="row"><span class="cmd">mcdle.词库</span><span class="m">查阅全部候选词条</span></div>
|
|
15926
15921
|
</div></div>
|
|
15927
15922
|
</div>
|
|
15928
15923
|
<div class="sec">
|
|
15929
15924
|
<div class="sec-t"><span>规 则 细 则</span></div>
|
|
15930
15925
|
<div class="panel"><div class="rows">
|
|
15931
|
-
<div class="row"><span class="k"
|
|
15932
|
-
<div class="row"><span class="k"
|
|
15933
|
-
<div class="row"><span class="k"
|
|
15934
|
-
<div class="row"><span class="k"
|
|
15935
|
-
<div class="row"><span class="k"
|
|
15926
|
+
<div class="row"><span class="k">•</span><span>每个频道每日可开始 <b>${dailyLimit}</b> 局,跨零点重置。</span></div>
|
|
15927
|
+
<div class="row"><span class="k">•</span><span>${allowRepeat ? "允许重复提交已经猜过的词条。" : "同一局内不能重复提交已猜过的词条。"}</span></div>
|
|
15928
|
+
<div class="row"><span class="k">•</span><span>${middleware ? "本频道裸猜已开启:只接受当前模式词库中的完整纯文本词条。" : "本频道裸猜已停用:续猜请用完整指令。"}</span></div>
|
|
15929
|
+
<div class="row"><span class="k">•</span><span>空指令与词库外名称不会开启新局或消耗额度。</span></div>
|
|
15930
|
+
<div class="row"><span class="k">•</span><span>词条与数据来自 Minecraft Wiki,版本号按发布先后比较。</span></div>
|
|
15936
15931
|
</div></div>
|
|
15937
15932
|
</div>
|
|
15938
15933
|
</div>` + noteRow("灵感来自 Wordle 与 mcdle.net");
|
|
15939
15934
|
return shell(body, { accent: accentOf(138), width: 760 });
|
|
15940
15935
|
}
|
|
15941
15936
|
__name(helpCard, "helpCard");
|
|
15937
|
+
var RANK_BADGE = ["m3-badge--gold", "m3-badge--silver", "m3-badge--bronze"];
|
|
15942
15938
|
function rankCard(entries, shown) {
|
|
15943
15939
|
if (!entries.length) {
|
|
15944
15940
|
const body2 = header(null, "排行榜", { big: "0", cap: "上榜人数" }) + `<div class="pad"><div class="empty">${px("trophy", 44)}
|
|
15945
|
-
|
|
15941
|
+
排行榜还空着<br>第一个猜中的人,名字会写在这里。<br><span style="font-size:${TYPE.bodySmall.size}px">用 <span class="cmd">mcdle.猜 苦力怕</span> 开出第一局,成为榜首</span></div></div>`;
|
|
15946
15942
|
return shell(body2, { accent: accentOf(90), width: 560 });
|
|
15947
15943
|
}
|
|
15948
15944
|
const max = Math.max(...entries.map((e) => e.total), 1);
|
|
@@ -15950,18 +15946,18 @@ function rankCard(entries, shown) {
|
|
|
15950
15946
|
const pos = i + 1;
|
|
15951
15947
|
const split = ["mob", "item", "block"].map((m) => {
|
|
15952
15948
|
const n = m === "mob" ? e.mob : m === "item" ? e.item : e.block;
|
|
15953
|
-
return `<span class="sp" style="color:${n ? MODES[m].accent :
|
|
15949
|
+
return `<span class="sp" style="color:${n ? MODES[m].accent : "var(--md-sys-color-on-surface-variant)"}">${px(MODES[m].icon, 10)}<span>${n}</span></span>`;
|
|
15954
15950
|
}).join("");
|
|
15955
15951
|
const w = Math.round(e.total / max * 100);
|
|
15956
|
-
return `<div class="rk p${pos <= 3 ? pos : "n"}">
|
|
15957
|
-
<div class="pos">${pos === 1 ? px("crown", 15) : pos}</div>
|
|
15952
|
+
return `<div class="rk p${pos <= 3 ? pos : "n"} m3-list-item">
|
|
15953
|
+
<div class="pos m3-badge ${RANK_BADGE[pos - 1] || ""}">${pos === 1 ? px("crown", 15) : pos}</div>
|
|
15958
15954
|
<div class="who"><div class="nm">${esc(e.username || e.userId)}</div><div class="split">${split}</div>
|
|
15959
15955
|
<div class="prog" style="margin-top:8px"><div class="bar" style="height:6px"><div class="fill" style="width:${w}%"></div></div></div>
|
|
15960
15956
|
</div>
|
|
15961
15957
|
<div class="tot"><div class="n">${e.total}</div><div class="c">猜 中</div></div>
|
|
15962
15958
|
</div>`;
|
|
15963
15959
|
}).join("");
|
|
15964
|
-
const body = header(null, "
|
|
15960
|
+
const body = header(null, "累计战绩 · 按累计猜中排序", { big: `${shown}`, cap: "上榜人数" }) + `<div class="pad"><div class="rank m3-list">${rows}</div></div>` + noteRow("每猜中一局记一分,按模式分别计数");
|
|
15965
15961
|
return shell(body, { accent: accentOf(90), width: 560 });
|
|
15966
15962
|
}
|
|
15967
15963
|
__name(rankCard, "rankCard");
|
|
@@ -15972,15 +15968,6 @@ var usage = `## 使用
|
|
|
15972
15968
|
|
|
15973
15969
|
发送 \`mcdle\` 查看玩法与全部指令。\`mcdle.猜 [名称]\` 用有效词条开局或猜测。首次猜测的词条决定生物、物品或方块模式,系统再从同类词库中抽取答案。
|
|
15974
15970
|
|
|
15975
|
-
## 提示
|
|
15976
|
-
|
|
15977
|
-
| 符号 | 含义 |
|
|
15978
|
-
| --- | --- |
|
|
15979
|
-
| 🟩 | 完全匹配 |
|
|
15980
|
-
| 🟨 | 部分匹配 |
|
|
15981
|
-
| 🟥 | 不匹配 |
|
|
15982
|
-
| 🟥⬆️ / 🟥⬇️ | 答案更大 / 更小 |
|
|
15983
|
-
|
|
15984
15971
|
## 指令
|
|
15985
15972
|
|
|
15986
15973
|
| 指令 | 说明 |
|
|
@@ -15988,13 +15975,22 @@ var usage = `## 使用
|
|
|
15988
15975
|
| \`mcdle\` | 玩法与指令说明 |
|
|
15989
15976
|
| \`mcdle.猜 [名称]\` | 用有效词条开局或猜测 |
|
|
15990
15977
|
| \`mcdle.裸猜 [开/关]\` | 开关本频道的无前缀续猜 |
|
|
15991
|
-
| \`mcdle.排行榜\` |
|
|
15992
|
-
| \`mcdle.词库\` | 全部词条
|
|
15978
|
+
| \`mcdle.排行榜\` | 累计战绩 |
|
|
15979
|
+
| \`mcdle.词库\` | 全部词条 |
|
|
15980
|
+
|
|
15981
|
+
## 提示
|
|
15982
|
+
|
|
15983
|
+
| 符号 | 含义 |
|
|
15984
|
+
| --- | --- |
|
|
15985
|
+
| 🟩 | 完全匹配 |
|
|
15986
|
+
| 🟨 | 部分匹配 |
|
|
15987
|
+
| 🟥 | 不匹配 |
|
|
15988
|
+
| 🟥⬆️ / 🟥⬇️ | 答案更大 / 更小 |`;
|
|
15993
15989
|
var inject = { required: ["database"], optional: ["puppeteer"] };
|
|
15994
15990
|
var Config = import_koishi.Schema.object({
|
|
15995
15991
|
atReply: import_koishi.Schema.boolean().default(false).description("回复时 @ 用户。"),
|
|
15996
15992
|
quoteReply: import_koishi.Schema.boolean().default(false).description("回复时引用消息。"),
|
|
15997
|
-
|
|
15993
|
+
enableDirectInput: import_koishi.Schema.boolean().default(false).description("对局中直接发送词条名称即可续猜,无需指令前缀。各频道可用「mcdle.裸猜」临时切换。"),
|
|
15998
15994
|
addStatusTextAfterEmoji: import_koishi.Schema.boolean().default(true).description("在状态方块后补一段文字说明。"),
|
|
15999
15995
|
maxRank: import_koishi.Schema.number().default(10).min(0).description("排行榜最多显示的人数。"),
|
|
16000
15996
|
dailyPlayLimit: import_koishi.Schema.number().default(1).min(1).description("每个频道每日可开始的局数,跨零点重置。"),
|
|
@@ -16108,7 +16104,7 @@ function apply(ctx, cfg) {
|
|
|
16108
16104
|
);
|
|
16109
16105
|
const logger = ctx.logger("mcdle");
|
|
16110
16106
|
const middlewareOverrides = /* @__PURE__ */ new Map();
|
|
16111
|
-
const middlewareOn = /* @__PURE__ */ __name((channelId) => channelId === void 0 ? cfg.
|
|
16107
|
+
const middlewareOn = /* @__PURE__ */ __name((channelId) => channelId === void 0 ? cfg.enableDirectInput : middlewareOverrides.get(channelId) ?? cfg.enableDirectInput, "middlewareOn");
|
|
16112
16108
|
ctx.middleware(async (session, next) => {
|
|
16113
16109
|
if (!session.channelId || !middlewareOn(session.channelId)) return await next();
|
|
16114
16110
|
const guess = getMiddlewareGuess(session);
|
|
@@ -16130,11 +16126,11 @@ function apply(ctx, cfg) {
|
|
|
16130
16126
|
ctx.command("mcdle.猜 [guess:string]", "开局或提交一次猜测").action(async ({ session }, guess) => {
|
|
16131
16127
|
await c(session, guess?.trim());
|
|
16132
16128
|
});
|
|
16133
|
-
ctx.command("mcdle.排行榜", "
|
|
16129
|
+
ctx.command("mcdle.排行榜", "查看累计猜中排行榜").action(async ({ session }) => phb(session));
|
|
16134
16130
|
ctx.command("mcdle.词库", "查阅全部候选词条").action(async ({ session }) => ck(session));
|
|
16135
16131
|
ctx.command("mcdle.裸猜 [state:string]", "开关本频道的无前缀续猜").usage("例:mcdle.裸猜(切换)· mcdle.裸猜 开 · mcdle.裸猜 关 · mcdle.裸猜 状态").action(async ({ session }, state) => {
|
|
16136
16132
|
const result = resolveMiddlewareSwitch(
|
|
16137
|
-
cfg.
|
|
16133
|
+
cfg.enableDirectInput,
|
|
16138
16134
|
session.channelId === void 0 ? void 0 : middlewareOverrides.get(session.channelId),
|
|
16139
16135
|
state
|
|
16140
16136
|
);
|
|
@@ -16150,10 +16146,9 @@ function apply(ctx, cfg) {
|
|
|
16150
16146
|
middlewareSwitchText(result.on, result.override !== void 0, result.reverted)
|
|
16151
16147
|
);
|
|
16152
16148
|
});
|
|
16153
|
-
const RULE = "────────────";
|
|
16154
16149
|
function textCard(title, ...sections) {
|
|
16155
16150
|
const body = sections.map((s) => Array.isArray(s) ? s.filter(Boolean).join("\n") : s).filter((s) => !!s && !!s.trim()).join("\n\n");
|
|
16156
|
-
return [`▍${title}`,
|
|
16151
|
+
return [`▍${title}`, body].filter(Boolean).join("\n");
|
|
16157
16152
|
}
|
|
16158
16153
|
__name(textCard, "textCard");
|
|
16159
16154
|
function modeName(mode) {
|
|
@@ -16182,6 +16177,12 @@ function apply(ctx, cfg) {
|
|
|
16182
16177
|
return cfg.addStatusTextAfterEmoji ? `(${label})` : "";
|
|
16183
16178
|
}
|
|
16184
16179
|
__name(statusTag, "statusTag");
|
|
16180
|
+
function guessList(titles) {
|
|
16181
|
+
const recent = titles.slice(-6);
|
|
16182
|
+
const rest = titles.length - recent.length;
|
|
16183
|
+
return recent.join(" › ") + (rest > 0 ? ` …… 另有 ${rest} 个未列` : "");
|
|
16184
|
+
}
|
|
16185
|
+
__name(guessList, "guessList");
|
|
16185
16186
|
function wikiImage(entry) {
|
|
16186
16187
|
if (cfg.disableImages || !entry?.wiki_image_url) return null;
|
|
16187
16188
|
return `${(0, import_koishi.h)("p", "")}${import_koishi.h.image(entry.wiki_image_url)}${(0, import_koishi.h)("p", "")}`;
|
|
@@ -16198,7 +16199,7 @@ function apply(ctx, cfg) {
|
|
|
16198
16199
|
return `${meta.emoji}${statusTag(meta.label)} ${fieldLabel(key)} ${value}`;
|
|
16199
16200
|
});
|
|
16200
16201
|
const locked = fields.filter((k) => statusOf(last, k) === "true").length;
|
|
16201
|
-
const history = titles.length > 1 ? `本局已猜:${titles
|
|
16202
|
+
const history = titles.length > 1 ? `本局已猜:${guessList(titles)}` : null;
|
|
16202
16203
|
return textCard(
|
|
16203
16204
|
`${modeName(mode)}模式 · 第 ${guesses.length} 次猜测`,
|
|
16204
16205
|
wikiImage(last),
|
|
@@ -16216,7 +16217,7 @@ function apply(ctx, cfg) {
|
|
|
16216
16217
|
`${meta.tagline},从 ${meta.total} 个候选中锁定唯一答案。`,
|
|
16217
16218
|
`可推理属性:${FIELDS[mode].map((k) => keyMap[k] || k).join(" / ")}`,
|
|
16218
16219
|
[
|
|
16219
|
-
channelOn ? `直接发送词库中的${meta.name}
|
|
16220
|
+
channelOn ? `直接发送词库中的${meta.name}名称,或发送「mcdle.猜 [名称]」` : `mcdle.猜 [名称] 提交一次猜测`,
|
|
16220
16221
|
`今日进度 ${played}/${cfg.dailyPlayLimit}`
|
|
16221
16222
|
]
|
|
16222
16223
|
);
|
|
@@ -16228,7 +16229,7 @@ function apply(ctx, cfg) {
|
|
|
16228
16229
|
(k) => `${fieldLabel(k)} ${displayValues(k, o.answer[k]).map((v) => v.text).join("、")}`
|
|
16229
16230
|
).join(" · ");
|
|
16230
16231
|
return textCard(
|
|
16231
|
-
"猜中了",
|
|
16232
|
+
"🏆 猜中了",
|
|
16232
16233
|
wikiImage(o.answer),
|
|
16233
16234
|
`答案 ${o.answer.chinese_title}${o.answer.title ? ` ${o.answer.title}` : ""}`,
|
|
16234
16235
|
[
|
|
@@ -16237,7 +16238,7 @@ function apply(ctx, cfg) {
|
|
|
16237
16238
|
`${o.username} 累计猜中 ${o.total} 次`
|
|
16238
16239
|
],
|
|
16239
16240
|
`答案档案:${profile}`,
|
|
16240
|
-
left > 0 ? `今日还剩 ${left} 局 · mcdle
|
|
16241
|
+
left > 0 ? `今日还剩 ${left} 局 · 发送「mcdle.排行榜」看战绩` : "今日额度已用完 · 发送「mcdle.排行榜」看战绩"
|
|
16241
16242
|
);
|
|
16242
16243
|
}
|
|
16243
16244
|
__name(winText, "winText");
|
|
@@ -16284,16 +16285,16 @@ function apply(ctx, cfg) {
|
|
|
16284
16285
|
}
|
|
16285
16286
|
__name(mcdle, "mcdle");
|
|
16286
16287
|
function middlewareSwitchText(on, temporary, reverted) {
|
|
16287
|
-
const mark =
|
|
16288
|
+
const mark = "✅";
|
|
16288
16289
|
const state = on ? "开启" : "停用";
|
|
16289
|
-
const config = cfg.
|
|
16290
|
+
const config = cfg.enableDirectInput ? "开启" : "停用";
|
|
16290
16291
|
if (!temporary) {
|
|
16291
16292
|
return `${mark} 裸猜续局 · ${reverted ? "已复原," : ""}跟随插件配置(${state})`;
|
|
16292
16293
|
}
|
|
16293
|
-
const hint = on ? "仅在已有对局中,直接发送当前模式的完整词条名称才会响应" : "
|
|
16294
|
+
const hint = on ? "仅在已有对局中,直接发送当前模式的完整词条名称才会响应" : "续猜请发送「mcdle.猜 [名称]」";
|
|
16294
16295
|
return [
|
|
16295
16296
|
`${mark} 裸猜续局 · 本频道临时${state}(插件配置:${config})`,
|
|
16296
|
-
`${hint}
|
|
16297
|
+
`${hint};再次发送「mcdle.裸猜」可复原`
|
|
16297
16298
|
].join("\n");
|
|
16298
16299
|
}
|
|
16299
16300
|
__name(middlewareSwitchText, "middlewareSwitchText");
|
|
@@ -16306,7 +16307,6 @@ function apply(ctx, cfg) {
|
|
|
16306
16307
|
if (["red", "onebot"].includes(session.platform)) {
|
|
16307
16308
|
const allContentNodes = sections.map(
|
|
16308
16309
|
([title, words]) => (0, import_koishi.h)("message", { userId: session.userId }, `▍${title}
|
|
16309
|
-
${RULE}
|
|
16310
16310
|
${words.join(" ")}`)
|
|
16311
16311
|
);
|
|
16312
16312
|
try {
|
|
@@ -16319,7 +16319,6 @@ ${words.join(" ")}`)
|
|
|
16319
16319
|
await sendMsg(
|
|
16320
16320
|
session,
|
|
16321
16321
|
sections.map(([title, words]) => `▍${title}
|
|
16322
|
-
${RULE}
|
|
16323
16322
|
${words.join(" ")}`).join("\n\n")
|
|
16324
16323
|
);
|
|
16325
16324
|
}
|
|
@@ -16381,7 +16380,22 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16381
16380
|
return candidates[Math.floor(Math.random() * candidates.length)];
|
|
16382
16381
|
}
|
|
16383
16382
|
__name(pickAnswer, "pickAnswer");
|
|
16383
|
+
const busyChannels = /* @__PURE__ */ new Set();
|
|
16384
16384
|
async function c(session, guess, allowStart = true) {
|
|
16385
|
+
const channelId = session.channelId;
|
|
16386
|
+
if (channelId && busyChannels.has(channelId)) {
|
|
16387
|
+
await sendMsg(session, "⏳ 上一次猜测还在处理,稍等一下。");
|
|
16388
|
+
return true;
|
|
16389
|
+
}
|
|
16390
|
+
if (channelId) busyChannels.add(channelId);
|
|
16391
|
+
try {
|
|
16392
|
+
return await guessOnce(session, guess, allowStart);
|
|
16393
|
+
} finally {
|
|
16394
|
+
if (channelId) busyChannels.delete(channelId);
|
|
16395
|
+
}
|
|
16396
|
+
}
|
|
16397
|
+
__name(c, "c");
|
|
16398
|
+
async function guessOnce(session, guess, allowStart = true) {
|
|
16385
16399
|
const record = await ensureRecord(session);
|
|
16386
16400
|
const now = /* @__PURE__ */ new Date();
|
|
16387
16401
|
await resetDailyIfNeeded(session, record, now);
|
|
@@ -16420,7 +16434,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16420
16434
|
}
|
|
16421
16435
|
return true;
|
|
16422
16436
|
}
|
|
16423
|
-
__name(
|
|
16437
|
+
__name(guessOnce, "guessOnce");
|
|
16424
16438
|
function restoreGuessHistory(record) {
|
|
16425
16439
|
const mode = record.gameMode;
|
|
16426
16440
|
if (!mode || !MODES[mode] || !record.answer) return null;
|
|
@@ -16452,8 +16466,8 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16452
16466
|
await sendMsg(
|
|
16453
16467
|
session,
|
|
16454
16468
|
textCard(
|
|
16455
|
-
"检测到旧版本遗留的一局",
|
|
16456
|
-
"
|
|
16469
|
+
"❌ 检测到旧版本遗留的一局",
|
|
16470
|
+
"这一局是在旧版本下开始的,已有的猜测记录没法用新版图片牌面渲染。",
|
|
16457
16471
|
answerTitle ? `「${answerTitle}」已退回词库,之后仍有机会被抽到。` : null,
|
|
16458
16472
|
allowStart ? "这一局已作废并退还今日额度,马上按这次的完整指令重新开局。" : "这一局已作废并退还今日额度,发送「mcdle.猜 [名称]」重新开局。"
|
|
16459
16473
|
)
|
|
@@ -16481,7 +16495,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16481
16495
|
textCard(
|
|
16482
16496
|
"💡 本频道没有进行中的对局",
|
|
16483
16497
|
"发送完整指令开局,例如「mcdle.猜 苦力怕」。",
|
|
16484
|
-
"
|
|
16498
|
+
"名称必须来自「mcdle.词库」。"
|
|
16485
16499
|
)
|
|
16486
16500
|
);
|
|
16487
16501
|
return;
|
|
@@ -16505,7 +16519,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16505
16519
|
textCard(
|
|
16506
16520
|
`⏳ 今日 ${cfg.dailyPlayLimit} 局已经用完`,
|
|
16507
16521
|
`跨零点后重置,还要等 ${untilReset(now)}。`,
|
|
16508
|
-
"
|
|
16522
|
+
"在那之前可以发送「mcdle.排行榜」或「mcdle.词库」看看。"
|
|
16509
16523
|
)
|
|
16510
16524
|
);
|
|
16511
16525
|
return;
|
|
@@ -16551,7 +16565,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16551
16565
|
);
|
|
16552
16566
|
await sendMsg(
|
|
16553
16567
|
session,
|
|
16554
|
-
textCard("
|
|
16568
|
+
textCard("❌ 这一局的牌面已经无法还原", "已经把它收掉了。发送「mcdle.猜 [名称]」重新开一局。")
|
|
16555
16569
|
);
|
|
16556
16570
|
return;
|
|
16557
16571
|
}
|
|
@@ -16567,7 +16581,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16567
16581
|
if (state.guesses.length) {
|
|
16568
16582
|
await sendCard(
|
|
16569
16583
|
session,
|
|
16570
|
-
boardCard({ mode, guesses: state.guesses, tip: "轮到你了 · mcdle.猜 [名称]" }),
|
|
16584
|
+
boardCard({ mode, guesses: state.guesses, tip: "轮到你了 · 发送「mcdle.猜 [名称]」" }),
|
|
16571
16585
|
boardText(mode, state.guesses, state.titles)
|
|
16572
16586
|
);
|
|
16573
16587
|
} else {
|
|
@@ -16575,7 +16589,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16575
16589
|
session,
|
|
16576
16590
|
textCard(
|
|
16577
16591
|
`轮到你了 · ${modeName(mode)}模式`,
|
|
16578
|
-
`报一个${modeName(mode)}
|
|
16592
|
+
`报一个${modeName(mode)}的名字,比如发送「mcdle.猜 ${POOLS[mode][0].chinese_title}」。`,
|
|
16579
16593
|
`拿不准有哪些词条,发送「mcdle.词库」翻一翻。`
|
|
16580
16594
|
)
|
|
16581
16595
|
);
|
|
@@ -16587,7 +16601,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16587
16601
|
session,
|
|
16588
16602
|
textCard(
|
|
16589
16603
|
`⚠️ 「${guess}」这一局已经猜过了`,
|
|
16590
|
-
`本局已猜 ${state.titles.length} 个:${state.titles
|
|
16604
|
+
`本局已猜 ${state.titles.length} 个:${guessList(state.titles)}`,
|
|
16591
16605
|
"换一个还没试过的词条吧。"
|
|
16592
16606
|
)
|
|
16593
16607
|
);
|
|
@@ -16601,7 +16615,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16601
16615
|
textCard(
|
|
16602
16616
|
`⚠️ 「${guess}」不在${modeName(mode)}词库里`,
|
|
16603
16617
|
near.length ? `是不是想猜:${near.join("、")}?` : null,
|
|
16604
|
-
`本局共有 ${MODES[mode].total} 个${modeName(mode)}
|
|
16618
|
+
`本局共有 ${MODES[mode].total} 个${modeName(mode)}候选,发送「mcdle.词库」可以全部翻看。`
|
|
16605
16619
|
)
|
|
16606
16620
|
);
|
|
16607
16621
|
return;
|
|
@@ -16662,7 +16676,11 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16662
16676
|
);
|
|
16663
16677
|
return textCard(
|
|
16664
16678
|
"MCDLE · 我的世界猜谜",
|
|
16665
|
-
|
|
16679
|
+
[
|
|
16680
|
+
`从 ${total} 个词条里,只凭属性提示锁定唯一答案。`,
|
|
16681
|
+
"每局随机抽一个生物、物品或方块。",
|
|
16682
|
+
"首次猜测的词条属于哪一类,本局就在哪一类里出题。"
|
|
16683
|
+
],
|
|
16666
16684
|
legend,
|
|
16667
16685
|
[
|
|
16668
16686
|
"部分匹配的字段里,【】括起来的就是与答案重合的那几项。",
|
|
@@ -16681,13 +16699,13 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16681
16699
|
[
|
|
16682
16700
|
"mcdle 这份玩法与指令说明",
|
|
16683
16701
|
"mcdle.猜 [名称] 开始一局,或提交猜测",
|
|
16684
|
-
"mcdle.猜
|
|
16702
|
+
"mcdle.猜 局中再次发送可回看当前棋盘",
|
|
16685
16703
|
"mcdle.裸猜 [开/关] 临时切换本频道的无前缀续猜",
|
|
16686
|
-
"mcdle.排行榜
|
|
16704
|
+
"mcdle.排行榜 查看累计战绩",
|
|
16687
16705
|
"mcdle.词库 查阅全部候选词条"
|
|
16688
16706
|
],
|
|
16689
16707
|
[
|
|
16690
|
-
|
|
16708
|
+
`每个频道每日 ${cfg.dailyPlayLimit} 局,跨零点重置。`,
|
|
16691
16709
|
cfg.allowRepeatedGuesses ? "允许重复提交已经猜过的词条。" : "同一局内不能重复提交已猜过的词条。",
|
|
16692
16710
|
channelOn ? "本频道裸猜已开启:仅已有对局、纯文本完整词条、且符合当前模式时响应。" : "本频道裸猜已停用:续猜请用完整指令。",
|
|
16693
16711
|
"空指令和词库外名称不会开启新局或消耗额度。",
|
|
@@ -16714,7 +16732,11 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16714
16732
|
await sendCard(
|
|
16715
16733
|
session,
|
|
16716
16734
|
rankCard([], 0),
|
|
16717
|
-
textCard(
|
|
16735
|
+
textCard(
|
|
16736
|
+
"📋 排行榜还空着",
|
|
16737
|
+
"第一个猜中的人,名字会写在这里。",
|
|
16738
|
+
"发送「mcdle.猜 苦力怕」开一局。"
|
|
16739
|
+
)
|
|
16718
16740
|
);
|
|
16719
16741
|
return;
|
|
16720
16742
|
}
|