v0.1.7: 仙门之钥(门面化/能力注册表/数据包/开发者面板)

- GameFacade 统一门面:act(23 种动作白名单)/query(6 类只读快照)/subscribe(七大事件协议)/
  about(版本+模块清单+数据包指纹);UI store 接入门面(act 直达,散装调用收口)
- CapabilityRegistry:12 张能力卡(id/name/version/desc/hooks),world.systems 启停即拔插,
  时钟按能力开关过滤(禁修炼则无人精进…沙盒玩法);sysChanged 广播
- DataPackRegistry:默认包与静态数据同引用(金钟罩零漂移),override/reset/fingerprint,
  高频读口 6 处迁移 pack()——未来 MOD=注入数据包覆写
- 开发者面板:设置页系统仪表盘(清单+启停开关+警示文案)
- 测试 225→239(能力清单/拔插分殊四路/广播幂等/包覆盖物价/act 目录/query/协议退订/about/
  金钟罩复验零漂移)
This commit is contained in:
2026-08-23 09:32:21 +08:00
parent a7ee125866
commit 9e0b06e898
11 changed files with 543 additions and 29 deletions
+5 -4
View File
@@ -2,11 +2,12 @@ import type { World } from '../world'
import { Character } from '../../types/domain'
import { Cond, EffectDef, EventDef, EVENTS, MemberEffect } from '../../data/events'
import { MAJOR_ORDER } from '../../data/realms'
import { TECHNIQUES } from '../../data/techniques'
import { MISSIONS } from '../../data/secrets'
import { npcById } from '../../data/npcs'
import { resolveRaid } from './combat'
import { sendMission } from './missions'
import { pack } from '../../data/registry'
import { findInheritor } from '../creation'
import { resolveTribulation } from './tribulation'
import { nextRealm, describeRealm } from '../../data/realms'
@@ -378,7 +379,7 @@ export function applyEffect(w: World, eff: EffectDef, squad?: string[]): void {
Object.assign(fam.flag, eff.flag)
}
if (eff.techniqueChance && w.rng.chance(eff.techniqueChance)) {
const t = w.rng.pick(TECHNIQUES)
const t = w.rng.pick(pack().techniques)
if (!fam.techniques.includes(t.id)) {
fam.techniques.push(t.id)
w.log('good', `得《${t.name}》残篇,录入藏书阁。`)
@@ -495,7 +496,7 @@ export function applyEffect(w: World, eff: EffectDef, squad?: string[]): void {
}
}
if (eff.mission) {
const def = MISSIONS.find((m) => m.id === eff.mission)
const def = pack().missions.find((m) => m.id === eff.mission)
if (def) {
const squad = w
.aliveMembers()