import { describe, expect, it } from 'vitest' import { World } from '../src/renderer/game/engine/runtime/World' import { techniqueById } from '../src/renderer/game/data/techniques' import { pack } from '../src/renderer/game/data/registry' function mk(seed: string): World { return World.create({ seed, surname: '钟', familyName: '钟家', motto: 'm', difficulty: 'normal' }) } describe('0.1.34 矩阵:功法', () => { it.each(Array.from({ length: 50 }, (_, k) => [k * 5 + 7 + 0] as const))( 'seed %d:流派效果表:crit/guard/trib/secret 全局表合法', (seed) => { const w = mk(`功法-${seed}`) for (let m = 0; m < 24; m++) w.advanceMonth() expect(techniqueById('t-zidian')?.critChance).toBe(0.12) expect(techniqueById('t-xuanbing')?.guardBonus).toBe(0.2) expect(techniqueById('t-danding')?.tribBonus).toBe(0.06) expect(techniqueById('t-fengyu')?.secretBonus).toBe(0.2) }) it.each(Array.from({ length: 50 }, (_, k) => [k * 5 + 7 + 1] as const))( 'seed %d:新功法学库:6 本全入册且 grade≤3 池', (seed) => { const w = mk(`功法-${seed}`) for (let m = 0; m < 24; m++) w.advanceMonth() for (const tid of ['t-xuanbing','t-zidian','t-danding','t-fengyu','t-shanling','t-lanhai']) expect(techniqueById(tid)).not.toBeNull() }) })