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
+7 -6
View File
@@ -10,7 +10,7 @@ import {
} from '../../types/domain'
import { BUILDINGS, bonusOf, buildingById } from '../../data/buildings'
import { itemById, pillRecipeByOutput, forgeRecipeByOutput } from '../../data/items'
import { itemById as defById, pillRecipeByOutput, forgeRecipeByOutput } from '../../data/items'
import { POSTS } from '../../data/posts'
import { aspirationById as aspirationOf } from '../../data/aspirations'
import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount, LegacyArch } from '../narrative/legacy'
@@ -405,14 +405,12 @@ export class World {
}
this.state.chronicle.push(entry)
if (this.state.chronicle.length > 520) this.state.chronicle.splice(0, this.state.chronicle.length - 520)
if (this.state.chronicle.length > 520) this.state.chronicle.splice(0, this.state.chronicle.length - 520)
this.out.forEach((o) => o.onChronicle(entry, important))
}
battle(log: BattleLog): void {
this.state.battles.push(log)
if (this.state.battles.length > 220) this.state.battles.splice(0, this.state.battles.length - 220)
if (this.state.battles.length > 220) this.state.battles.splice(0, this.state.battles.length - 220)
this.out.forEach((o) => o.onBattle(log))
}
@@ -480,8 +478,10 @@ export class World {
const fam = this.state.family
const cutoff = this.state.year - 3
for (const key of Object.keys(fam.flag)) {
const m = /^(auction-|prayerDone-|echoDone-|recruitDone-)(\d+)$/.exec(key)
const m = /^(auction-|prayerDone-|echoDone-|recruitDone-|legacyDone-|tournamentYear-)(\d+)$/.exec(key)
if (m && Number(m[2]) < cutoff) delete fam.flag[key]
// tauntCD-<npcId> 非年份键:随目标家族消亡删除(防长线膨胀)
if (key.startsWith('tauntCD-') && !this.state.npcFamilies[key.slice('tauntCD-'.length)]) delete fam.flag[key]
}
}
@@ -616,10 +616,10 @@ export class World {
const fam = this.state.family
const ws = this.state.worldSim as { distress?: { id: string } } | undefined
if (!ws?.distress || ws.distress.id !== npcId) return false
if (fam.stones < cost) return false
fam.stones -= cost
const npc = this.state.npcFamilies[npcId]
if (!npc) return false
if (fam.stones < cost) return false
fam.stones -= cost
npc.power = Math.min(900, npc.power + 15)
npc.relation = Math.min(100, npc.relation + 8)
fam.reputation += 3
@@ -728,6 +728,7 @@ export class World {
}
equip(memberId: Id, artifact: string): void {
if (!defById(artifact)) return
const c = this.memberById(memberId)
if (!c.alive) return
c.equipment = artifact