v0.1.33b: 引擎止血——白屏/经济/治理 15 项

【白屏】equip() 校验物品存在;MemberModal 空守卫(B1 属 UI 同阶段)
【经济】tribBoost 渡劫成/败/陨落三分支尾部清零(+12% 破境丹不再永久白送);
assistAlly 先校验 NPC 再扣款;giftNpc/makePeace 加 npc 守卫
【治理】about 版本透传(删硬编码 0.1.29);engineFromSnapshot 尊重 noAutoCreate(不再重放创世);
回声事件 npc 空池守卫;squad 陈旧 id 过滤;mission 日志悬空 join 修复;
flag 修剪扩 legacyDone/tournamentYear + tauntCD 随家族消亡删;purgeNpc 删无效 auction 键;
chronicle/battle splice 去重;lifecycle 注释 240→200 一致;worldsim-data 俄语注释中文化;
maxRealmIdx 占位 0 且 normalize 重算(防虚报);TECH_GRADE_BASE 复用删除(实为局部 const 未动)
【测试】gameengine about 断言修正(0.1.32 透传) 5030 全绿
This commit is contained in:
2026-08-23 21:34:29 +08:00
parent bce50b6e2b
commit 3e4ed4d882
11 changed files with 40 additions and 28 deletions
+15 -9
View File
@@ -43,14 +43,20 @@ export class GameEngine {
this.datapack = PACK
if (opts.datapack) this.datapack.override(opts.datapack)
// 组装World(内核注入→时钟/随机/总线单源)
const state = opts.seed ? createWorldState({
seed: this._seed,
surname: opts.surname?.trim() || '',
familyName: opts.familyName?.trim() || `${opts.surname?.trim() || '林'}`,
motto: opts.motto?.trim() || '耕读传家,术法继世',
difficulty: opts.difficulty ?? 'normal'
}) : (globalThis as never as { __state?: GameState }).__state
this.world = new World(state!, [], this.kernel)
if (opts.noAutoCreate) {
this.world = new World(createWorldState({
seed: this._seed, surname: '占位', familyName: '占位', motto: '', difficulty: 'normal'
}), [], this.kernel)
} else {
const state = opts.seed ? createWorldState({
seed: this._seed,
surname: opts.surname?.trim() || '林',
familyName: opts.familyName?.trim() || `${opts.surname?.trim() || '林'}`,
motto: opts.motto?.trim() || '耕读传家,术法继世',
difficulty: opts.difficulty ?? 'normal'
}) : (globalThis as never as { __state?: GameState }).__state
this.world = new World(state!, [], this.kernel)
}
this.facade = new ApiFacade(this.world, 1)
// Kernel 总线 → World.out 桥接(attached 后同步 feed
this.world.out = this.world.out.concat([])
@@ -92,7 +98,7 @@ export class GameEngine {
about(): { title: string; version: string; modules: number; systems: number; plugins: number; packFingerprint: string } {
const a = this.facade.about()
return { ...a, version: '0.1.29' }
return a
}
installPlugin(p: CotycPlugin): { ok: boolean; reason?: string } {