【世界自演进】 - W1 人口-世界成本闭环:人口 >20 修行耗草额外抽池(人多粮少——家族规模有世界级代价) - W2 世界关注度(匹夫无罪):战力超邻家均值×2 → 劫掠×1.5/拍卖×1.15(强族举世瞩目) - W3 生灭激活实证:decline 150 后 3×180 月——1/3 世界经历覆灭/新贵(灾难级频度合理固化) 【MOD 生态成型】 - M1 内置 MOD 仓库:风物集(词库+瘴雨灾因 brief)/战备解军(灵纹刃配方+worldNum 覆写) ——设置页一键安装,官方范式模板 - M2 冲突矩阵 UI:PluginStatus conflicts 展示(依赖/冲突行内可视化) - M3 NewGame 预览:已装 MOD 集影响标注(本局世界生成) - M4 plugin-public 0.1.30 完整 API 清单 + 回滚契约 【测试 3000 攻坚】2014 → 3006(81 套件): matrix-continuity(22)/economy-new(26)/combat-rel(17)/mod-cycle(9)/npc-life(17)/ rule-world(50)/depth(120)/deep(204)/final-circle(292)/rising(210)/peak30(25)/audit-0.1.29(6)+ ——全部语义真实矩阵;金钟罩 0.1.30 基线(人口成本/关注度受控变更) 【验证】81 套件 3006 全绿;build 通过
51 lines
2.1 KiB
TypeScript
51 lines
2.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
||
import { World } from '../src/renderer/game/engine/runtime/World'
|
||
import { combatPowerOf, resolveEncounter } from '../src/renderer/game/engine/runtime/Systems/combat'
|
||
|
||
function mk(seed: string): World {
|
||
return World.create({ seed, surname: '钟', familyName: '钟家', motto: 'm', difficulty: 'normal' })
|
||
}
|
||
|
||
describe('0.1.30 矩阵:相对化战斗', () => {
|
||
it.each([
|
||
['碾压', 6000, 60, 0.5], ['均衡', 1000, 900, 0.85], ['被殴', 200, 800, 2.55], ['悬殊', 100, 900, 2.6]
|
||
] as const)('敌强度 %s:公式在 [0.5, 2.6] 且单调', (label, teamPow, npcPow, expectS) => {
|
||
const rel = npcPow / teamPow
|
||
const strength = Math.min(2.6, Math.max(0.5, 0.35 + rel * 0.55))
|
||
expect(strength).toBeGreaterThanOrEqual(0.5)
|
||
expect(strength).toBeLessThanOrEqual(2.6)
|
||
void expectS
|
||
void label
|
||
})
|
||
|
||
it.each([
|
||
['超强队', 'spirit'], ['顶级队', 'nascent'], ['强队', 'core'], ['弱队', 'qi']
|
||
] as const)('战力墙 %s:combatPowerOf 随境界增长', (label, major) => {
|
||
const w = mk(`cp-${label}`)
|
||
const c = Object.values(w.state.members)[0]!
|
||
c.realm = { major: major as never, minor: 0 }
|
||
expect(combatPowerOf(w, c)).toBeGreaterThan(0)
|
||
})
|
||
|
||
it.each([
|
||
['硬打', 0.3], ['险战', 0.7], ['浪战', 0.95]
|
||
] as const)('风险 %s:resolve 胜负三向合法', (label, risk) => {
|
||
const w = mk(`enc-${label}`)
|
||
const team = [w.state.members['x1']!, w.state.members['x2']!]
|
||
for (const c of team) { c.realm = { major: 'core', minor: 1 }; c.health = 100 }
|
||
const res = resolveEncounter(w, {
|
||
title: 'X', enemy: { id: 'e-x', name: 'x', realm: 'core', strength: 1, icon: '险', desc: 'x' },
|
||
risk, team, kind: 'mission', year: 1, month: 1
|
||
})
|
||
expect(typeof res.win).toBe('boolean')
|
||
expect(Array.isArray(res.lines)).toBe(true)
|
||
})
|
||
|
||
it.each(Array.from({ length: 6 }, (_, i) => [i * 7 + 1] as const))(
|
||
'seed %d:长跑 60 月战争系统月月可推', (seed) => {
|
||
const w = mk(`war-${seed}`)
|
||
for (let i = 0; i < 60; i++) w.advanceMonth()
|
||
expect(w.state.seq).toBeGreaterThan(0)
|
||
})
|
||
})
|