Files

365 lines
12 KiB
TypeScript

import { NEST } from './LevelData';
import { RELEASE_LEVELS } from './ReleaseLevels';
import type { LevelDef } from './Types';
export interface ValidationSampleEntry {
key: '026a' | '026b' | '038a' | '039' | '051';
shortLabel: string;
headerTitle: string;
hypothesis: string;
level: LevelDef;
}
const base026 = RELEASE_LEVELS[25];
/** 样板 026A:对照基准(现行 026 水田双桥,2 格线碗 + 三列竖栈) */
const sample026A: LevelDef = {
...base026,
id: 'sample-026a',
name: '水田双桥 · 2碗对照',
difficulty: 'A对照',
goal: 'A对照组:2 格碗 + 三列单栈。感受开局腾格压力与双桥顺序。',
ruleTag: '2碗 · 竖栈对照',
unspool: {
...base026.unspool!,
storyTitle: '026A · 2碗竖栈',
storyNote: '对照组:两格线碗、三列互不交叉的竖向压层。',
},
};
/**
* 样板 026B:实验组(同盘面目标/双桥/交叉锁,改为 3 格线碗 + 真交叉压层)
* - 底层绿 b 被「左粉 a + 中拱浅杏 e」双压(2 压 1)
* - 底层蓝 d 被「右金 c + 中拱浅杏 e」双压(2 压 1)
* - 中拱浅杏 e 同时压住绿 b 与蓝 d(1 压 2)
* - 验证重点:小屏能否一眼读出「先拆中拱 e 配任意一侧」,且 3 碗下仍保留误拆 a+c 满碗的真实张力
*/
const sample026B: LevelDef = {
...base026,
id: 'sample-026b',
name: '水田双桥 · 3碗交叉',
difficulty: 'B实验',
goal: 'B实验组:3 格碗 + 交叉压层。中拱浅杏线同时压着左右底层,读清压层再拆!',
ruleTag: '3碗 · 交叉压层',
unspool: {
storyTitle: '026B · 3碗交叉',
storyNote: '实验组:中拱浅杏同时压住绿、蓝两缕底层线,左粉与右金各压一侧。',
slots: [
{ x: 176, y: 474 },
{ x: 300, y: 458 },
{ x: 424, y: 474 },
],
strands: [
// 底层左:绿 b(被 a 与 e 双压;线头在最左,距其他线头 > 100px)
{
id: 'unspool-release-26-b',
color: 'green',
coveredBy: ['unspool-release-26-a', 'unspool-release-26-e'],
points: [[246, 84], [190, 76], [124, 78], [58, 86]],
},
// 底层右:蓝 d(被 c 与 e 双压;线头在最右)
{
id: 'unspool-release-26-d',
color: 'sky',
coveredBy: ['unspool-release-26-c', 'unspool-release-26-e'],
points: [[314, 84], [370, 76], [436, 78], [502, 86]],
},
// 上层左斜:粉 a(压住绿 b,线头在左上)
{
id: 'unspool-release-26-a',
color: 'rose',
coveredBy: [],
points: [[96, 114], [114, 82], [134, 50], [152, 22]],
},
// 上层右斜:金 c(压住蓝 d,线头在右上)
{
id: 'unspool-release-26-c',
color: 'gold',
coveredBy: [],
points: [[464, 114], [446, 82], [426, 50], [408, 22]],
},
// 上层中拱:浅杏 e(同时压住绿 b 与蓝 d,1 压 2 关键线,线头在右下拱脚)
{
id: 'unspool-release-26-e',
color: 'coral',
coveredBy: [],
points: [[212, 112], [234, 72], [280, 32], [326, 72], [348, 112]],
},
],
},
};
/**
* 样板 038A:039 前置极简教学(双巢 + 不交叉,10 秒读懂「留一条外路」)
* - 两个全露头线(金左、绿右)落入对应左右碗,但目标交叉在右上/左上
* - 直觉斜穿正中会挡住另一色,需一笔走顺路、另一笔顺外侧弧线绕开
*/
const sample038A: LevelDef = {
id: 'sample-038a',
chapter: 3,
name: '双巢让路 · 教学',
difficulty: '前置教',
lesson: '本关毛线不可交叉!先画的一笔会占路,试着给另一只蚂蚁留出绕行通道。',
goal: '两巢不交叉:给另一色留一条外侧走廊,两笔成画。',
ruleTag: '不交叉 · 前置教学',
motif: 'custom',
noCross: true,
maxDispatches: 2,
nests: [
{ x: 148, y: 472 },
{ x: 452, y: 472 },
],
balls: [],
targets: [
{ id: 's38a-gold', color: 'gold', x: 396, y: 234, rx: 32, ry: 31, patch: 'flower' },
{ id: 's38a-green', color: 'green', x: 204, y: 234, rx: 32, ry: 31, patch: 'leaf' },
],
ponds: [],
spools: [],
buttons: [],
dyes: [],
gates: [],
roughZones: [],
threeStar: 1120,
twoStar: 1320,
demo: [],
unspool: {
storyTitle: '038A · 让路教学',
storyNote: '拆下金、绿两缕线,体验不交叉条件下的双巢避让。',
slots: [
{ x: 184, y: 400 },
{ x: 416, y: 400 },
],
strands: [
{
id: 's38a-gold',
color: 'gold',
coveredBy: [],
slotIndex: 0,
points: [[72, 92], [134, 52], [218, 74]],
},
{
id: 's38a-green',
color: 'green',
coveredBy: [],
slotIndex: 1,
points: [[488, 92], [426, 52], [342, 74]],
},
],
},
};
/**
* 样板 039:三巢让路(调近双解耗线差版本)
* - 三巢、两格容量(三处空间供线位、同时最多占 2 格)、不交叉、最多 3 笔
* - 方案 A(3 笔直达):左右巢分送双金,中巢直达绿叶(省线)
* - 方案 B(2 笔串双金 + 绕外路):两格装双金后左巢一笔串送两金,再取绿球由中巢绕外侧避让(省笔)
*/
const sample039: LevelDef = {
id: 'sample-039',
chapter: 3,
name: '三巢让路 · 双解',
difficulty: 'D4样板',
lesson: '同时最多暂存 2 团线,且毛线不可交叉!比较「三笔直达」与「两笔串双金 + 外圈让路」。',
goal: '不交叉三巢:可用 3 笔分送省线,或 2 笔串双金留外路。',
ruleTag: '三巢 · 不交叉双解',
motif: 'custom',
noCross: true,
maxDispatches: 3,
nests: [
{ x: 152, y: 462 },
{ x: 300, y: 504 },
{ x: 448, y: 462 },
],
balls: [],
targets: [
{ id: 's39-gold-l', color: 'gold', x: 204, y: 244, rx: 30, ry: 30, patch: 'flower' },
{ id: 's39-green', color: 'green', x: 300, y: 176, rx: 30, ry: 30, patch: 'leaf' },
{ id: 's39-gold-r', color: 'gold', x: 396, y: 244, rx: 30, ry: 30, patch: 'flower' },
],
ponds: [],
spools: [],
buttons: [],
dyes: [],
gates: [],
roughZones: [],
threeStar: 1180,
twoStar: 1460,
demo: [],
unspool: {
storyTitle: '039 · 三巢让路',
storyNote: '三缕全露头线按左/中/右落入近巢供线碗,同时最多暂存 2 团。',
capacity: 2,
slots: [
{ x: 176, y: 386 },
{ x: 300, y: 446 },
{ x: 424, y: 386 },
],
strands: [
{
id: 's39-gold-l',
color: 'gold',
coveredBy: [],
slotIndex: 0,
points: [[44, 88], [94, 48], [154, 78]],
},
{
id: 's39-green',
color: 'green',
coveredBy: [],
slotIndex: 1,
points: [[224, 96], [280, 44], [336, 92]],
},
{
id: 's39-gold-r',
color: 'gold',
coveredBy: [],
slotIndex: 2,
points: [[516, 88], [466, 48], [406, 78]],
},
],
},
};
/**
* 样板 051:新针开旧夹(验证「织一针松开右片旧布,是否让玩家主动改变取线顺序」)
* - 左片(开放):露头「金甲」(压着「粉甲」) 与露头「绿叶」(对应右片绿叶木夹)
* - 右片(被绿叶木夹夹住):「金乙」与「粉乙」
* - 策略对照:
* 1) 朴素起手(先拆左片金甲→粉甲,后开夹):5 笔全分送,也能顺畅过关(1–2★)
* 2) 读夹变序(先抽绿叶开夹 → 双金串送 → 双粉串送):仅需 3 笔,狂省线拿 3★!
*/
const sample051: LevelDef = {
id: 'sample-051',
chapter: 5,
name: '拼布开旧夹 · 样板',
difficulty: 'D4样板',
lesson: '右片旧布被绿叶木夹夹住了!先绣左片金花也能过,但先绣绿叶开夹能凑齐同色串双球省大线!',
goal: '观察右片木夹:先绣带绿叶夹标的针位开夹,再巧用同色串双球!',
ruleTag: '新针开旧夹 · 2碗',
motif: 'custom',
nests: [{ ...NEST }],
balls: [],
targets: [
{ id: 's51-green', color: 'green', x: 296, y: 332, rx: 32, ry: 29, patch: 'leaf' },
{ id: 's51-gold-a', color: 'gold', x: 214, y: 214, rx: 31, ry: 31, patch: 'flower' },
{ id: 's51-gold-b', color: 'gold', x: 280, y: 186, rx: 31, ry: 31, patch: 'flower' },
{ id: 's51-rose-a', color: 'rose', x: 356, y: 236, rx: 31, ry: 31, patch: 'flower' },
{ id: 's51-rose-b', color: 'rose', x: 416, y: 192, rx: 31, ry: 31, patch: 'flower' },
],
ponds: [],
spools: [],
buttons: [],
dyes: [],
gates: [],
roughZones: [],
threeStar: 1740,
twoStar: 2120,
demo: [],
unspool: {
storyTitle: '051 · 新针开旧夹',
storyNote: '两片拼布:左片开放,右片被绿叶木夹夹住。先开夹就能和左片凑双金、双粉!',
patchDividerX: 278,
clips: [
{
id: 'clip-right',
x: 286,
y: 10,
w: 264,
h: 116,
unlockSectionId: 's51-green',
badgeColor: 'green',
badgeShape: 'leaf',
label: '绿叶开',
},
],
slots: [
{ x: 186, y: 472 },
{ x: 414, y: 472 },
],
strands: [
// 左片底层:粉甲(被金甲压住)
{
id: 's51-rose-a',
color: 'rose',
coveredBy: ['s51-gold-a'],
points: [[36, 94], [88, 76], [148, 86]],
},
// 左片上层左:金甲(露头,直接可绣,但先拆会失去和右片金乙串双球机会)
{
id: 's51-gold-a',
color: 'gold',
coveredBy: [],
points: [[68, 22], [90, 68], [108, 114]],
},
// 左片上层右:绿叶(露头,绣完即咔哒松开右片木夹)
{
id: 's51-green',
color: 'green',
coveredBy: [],
points: [[182, 108], [210, 64], [244, 30]],
},
// 右片(木夹内):金乙(开夹即露头)
{
id: 's51-gold-b',
color: 'gold',
coveredBy: [],
clipId: 'clip-right',
points: [[342, 92], [380, 48], [418, 34]],
},
// 右片(木夹内):粉乙(开夹即露头)
{
id: 's51-rose-b',
color: 'rose',
coveredBy: [],
clipId: 'clip-right',
points: [[442, 106], [486, 84], [520, 44]],
},
],
},
};
export const VALIDATION_SAMPLES: ValidationSampleEntry[] = [
{
key: '026a',
shortLabel: '026A 2碗',
headerTitle: '样板 026A · 2碗竖栈',
hypothesis: '对照组:2 格碗 + 三列单栈(8 种两抽开局 6 种卡住)',
level: sample026A,
},
{
key: '026b',
shortLabel: '026B 3碗交叉',
headerTitle: '样板 026B · 3碗交叉',
hypothesis: '实验组:3 格碗 + 中拱 1 压 2 交叉压层,测小屏可读性与取舍感',
level: sample026B,
},
{
key: '038a',
shortLabel: '038A 让路教',
headerTitle: '样板 038A · 让路教学',
hypothesis: '039 前置极简教学:2 巢 2 色不交叉,先建立“留外路”直觉',
level: sample038A,
},
{
key: '039',
shortLabel: '039 三巢让路',
headerTitle: '样板 039 · 三巢让路',
hypothesis: '拉近 3 笔分送与 2 笔串双金让路的耗线差,测走线是否多出一套策略',
level: sample039,
},
{
key: '051',
shortLabel: '051 开旧夹',
headerTitle: '样板 051 · 新针开旧夹',
hypothesis: '测“绣绿叶松开右片木夹”是否让玩家主动改变取线顺序(5 笔→3 笔)',
level: sample051,
},
];
export function findValidationSample(rawKey: string | null): ValidationSampleEntry | null {
if (!rawKey) return null;
const norm = rawKey.trim().toLowerCase();
return VALIDATION_SAMPLES.find(item => item.key === norm) ?? null;
}