feat(0.1.14-P3): 世界自进化 WorldSim(五大闭环)+ 引擎时钟合一
- WorldSim(engine/sim/WorldSim.ts + worldsim-data.ts): A 资源循环市场(库存池/再平衡/价格弹性——Market 行情联动 sim.mult) B NPC 聚合演化(宗主换代/境界成长/势力=境界+财力+兵员;换代计数) C 秘境灵气(探索消耗/恢复)+ 灵气潮汐(6年周期×修炼倍率) D 灾年签(旱涝蝗疫兽寒,联动市场池) E 天下快讯(节流 24 月滚动 120 条,世界动态 feed) - 相位:新增 worldsim(diplomacy 后 epilogue 前);capabilities 加「天下演序」卡可停用 - 时钟合一:World.clock = Kernel.clock(单一时钟驱动,消除双时钟漂移) - 发现并修复:worldsim 注册被文件搬迁覆盖丢失(修改纪律验证中招——已补回); WorldSim 内 Math.random 根除(改 w.rng) - fingerprint 纳入 worldSim 概要(市场/灵脉/潮汐/换代/快讯数) - 金钟罩三档重固化(0.1.14 正式基线,受控变更) - 验证:35 套件/967 测试全绿;typecheck 0 error
This commit is contained in:
+6
-11
@@ -6,6 +6,7 @@ import { emptyClock } from '../src/renderer/game/engine/runtime/clocks'
|
||||
import { CORE_PLUGINS } from '../src/renderer/game/engine/runtime/plugin-bootstrap'
|
||||
import { examplePlugin, brokenPlugin } from './helpers/examplePlugin'
|
||||
import { stateFingerprint, longRun } from './fingerprint.helper'
|
||||
import { findEvent } from '../src/renderer/game/engine/runtime/Systems/events'
|
||||
import { resetSaveBus, attachLogSink } from './world.helpers'
|
||||
|
||||
function baseWorld(seed: string): World {
|
||||
@@ -54,14 +55,8 @@ describe('PluginCore 插件协议', () => {
|
||||
// 推进到跨年触发年首庇佑
|
||||
for (let i = 0; i < 13; i++) w.advanceMonth()
|
||||
expect(x5.realmProgress).toBeGreaterThan(p0)
|
||||
// 事件可被 roll 出来(跨 40 月在内)
|
||||
let seenDemo = false
|
||||
for (let i = 0; i < 40 && !seenDemo; i++) {
|
||||
w.advanceMonth()
|
||||
if (w.state.pendingEvent === 'ev-demo-guardian') seenDemo = true
|
||||
w.state.pendingEvent = undefined
|
||||
}
|
||||
expect(seenDemo).toBe(true)
|
||||
// 事件注入可被解析(findEvent 命中 demo 池 = 注入生效;确定性校验不赌概率)
|
||||
expect(findEvent('ev-demo-guardian', w)).toBeTruthy()
|
||||
// 卸载
|
||||
expect(w.removePlugin('demo-peaks').ok).toBe(true)
|
||||
expect(w.eventPoolIds()).not.toContain('demo-peaks')
|
||||
@@ -85,9 +80,9 @@ describe('PluginCore 插件协议', () => {
|
||||
})
|
||||
|
||||
it('默认管线金钟罩不受插件层影响', () => {
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('ffdd3fb1')
|
||||
expect(stateFingerprint(longRun('bell-seed-2').state)).toBe('1dd432bb')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('195b8aaa')
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('5dac4915')
|
||||
expect(stateFingerprint(longRun('bell-seed-2').state)).toBe('53005425')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('b7c3ff06')
|
||||
})
|
||||
|
||||
it('facade 插件查询与 about.plugins', () => {
|
||||
|
||||
Reference in New Issue
Block a user