v0.1.18: 时代绘卷 + 特效入引擎(双主线完成,1002 测试破千)
【主线一:世界自演进深化《时代绘卷》】 - 世纪弧 era 状态机:盛世/平世/乱世/末法四态(ERA_CONF 全参数化)。 灾年概率×0.5~1.6、世界供需×0.7~1.25、拍卖概率×0.6~1.3、tide 偏置 ±0.09; ERA_DURA 控制转换节奏(15~45年),转移时史官快讯+log。世界有大节律了 - NPC 景气仓廪:npcDyn.prosperity(8~100)月结余——买卖+0.5~0.8、断供-2、灾年-3; >75 景气 power+1、<30 衰闷 power-1;换代焕新(55~75)。NPC 在过日子 - 蝴蝶效应:互攻胜率 power 加权(强者恒强)、打残广播(败家邻望-8/胜家+4); 玩家劫掠胜利/结盟直接写 NPC·NPC 关系网(-6/-3)——玩家行动推进世界历史 - 天下十年一鉴:每十年史官综述(灾/换代/行情/灵潮聚合,kind='annal') - 灾年↔秘境:灾年灵脉恢复减半(末法感) - WorldPanel 天下志:era 徽标(悬停描述)/史官十年鉴/群雄势衡柱状图/衰微标注 【主线二:特效系统并入引擎(架构升级)】 - WorldEventBus.onFx + Kernel 转发 + World.emitFx 语义发射(零 rng 消耗) - 12 个语义发射点:突破/化神/渡劫/劫掠胜负/遭遇战/拍卖/大比/灾年起散/换代 —— 取代 UI log 文本正则猜测(spark/blade 双源锁死) - makeBus 桥接 FxGate(kind→gate.emit),gate 挡位/密度/reduced 逻辑保留在 UI 【测试】1002 全绿(40 套件):fxqueue-semantic 3 例 + era-world 5 例; 金钟罩 0.1.18 基线固化(era/prosperity/蝴蝶效应受控变更)
This commit is contained in:
@@ -32,6 +32,9 @@ import { combatPowerOf } from './Systems/combat'
|
||||
|
||||
export type LogKind = LogItem['kind']
|
||||
|
||||
/** 特效出口(引擎语义发射;参数仅为语义锚点,随机散布归渲染层) */
|
||||
export type FxEmit = { kind: 'spark' | 'blade' | 'pulse' | 'ripple'; source?: string }
|
||||
|
||||
export interface WorldEventBus {
|
||||
onLog(kind: LogKind, text: string): void
|
||||
onChronicle(entry: ChronicleEntry, important: boolean): void
|
||||
@@ -41,6 +44,7 @@ export interface WorldEventBus {
|
||||
onYearPaper?(entry: YearlyReport): void
|
||||
onSystemChange?(id: string, enabled: boolean): void
|
||||
onPluginChange?(id: string, action: string): void
|
||||
onFx?(em: FxEmit): void
|
||||
}
|
||||
|
||||
import { WorldSim } from '../sim/WorldSim'
|
||||
@@ -455,6 +459,12 @@ export class World {
|
||||
npc.allied = true
|
||||
npc.alliedSinceYear = this.state.year
|
||||
npc.power = Math.min(900, npc.power + 10)
|
||||
// 1-3 扰动:盟约惹眼——邻家对此家略生嫌隙
|
||||
for (const dyn of Object.values(this.state.worldSim?.npcDyn ?? {})) {
|
||||
if (dyn && dyn.relationsWithOthers && npcId in dyn.relationsWithOthers) {
|
||||
dyn.relationsWithOthers[npcId] = Math.max(-100, (dyn.relationsWithOthers[npcId] ?? 0) - 3)
|
||||
}
|
||||
}
|
||||
this.log('good', `与${npc.name}结成同盟——盟誓既立,互不犯边。`)
|
||||
this.chronicle('diplomacy', `本族与${npc.name}缔结同盟。`, undefined, true)
|
||||
return true
|
||||
@@ -652,6 +662,12 @@ export class World {
|
||||
return true
|
||||
}
|
||||
|
||||
/** 语义特效发射(零随机消耗——渲染自由派生出随机分布) */
|
||||
emitFx(kind: 'spark' | 'blade' | 'pulse' | 'ripple', source?: string): void {
|
||||
const em: FxEmit = { kind, source }
|
||||
this.out.forEach((o) => o.onFx?.(em))
|
||||
}
|
||||
|
||||
postBonus(type: string): number {
|
||||
let sum = 0
|
||||
for (const c of this.aliveMembers()) {
|
||||
|
||||
Reference in New Issue
Block a user