0.1.41 天命·兑现:天命flag全量接线15+项即时兑现 + NPC演化种子派生零主rng消耗 + pushNews/purgeNpc确定性修复 + 族史卷叙事层chronicle-scroll.ts + 时效flag自动清理 + UI建筑专精加成预览 + LegacyPanel族史卷视图 + 金钟罩重算

This commit is contained in:
2026-09-13 16:38:24 +08:00
parent beeda036f6
commit 631099fd8c
22 changed files with 745 additions and 80 deletions
+37 -1
View File
@@ -6,6 +6,7 @@ import { buildBiography } from '../../game/engine/narrative/biography'
import { yearAxis, decadeLabel } from '../../game/engine/narrative/yearaxis'
import { buildReport, verdictLine } from '../../game/engine/narrative/legacyreport'
import { buildSaga, sagaKindName, sagaKindClass } from '../../game/engine/narrative/saga'
import { buildChronicleScroll, scrollKindName, scrollKindClass } from '../../game/engine/narrative/chronicle-scroll'
import type { WorldSimState } from '../../game/engine/sim/worldsim-data'
@@ -14,7 +15,7 @@ export default function LegacyPanel() {
const revision = useGameStore((s) => s.revision)
void revision
const [showResolve, setShowResolve] = useState(false)
const [view, setView] = useState<'dims' | 'chronicle' | 'report' | 'scroll' | 'axis' | 'legacy'>('dims')
const [view, setView] = useState<'dims' | 'chronicle' | 'report' | 'scroll' | 'axis' | 'legacy' | 'cscroll'>('dims')
if (!world) return null
const w = world
const s = w.state
@@ -56,6 +57,7 @@ export default function LegacyPanel() {
<button className="btn" onClick={() => setView('report')}></button>
<button className="btn" onClick={() => setView('chronicle')}></button>
<button className="btn" onClick={() => setView('scroll')}></button>
<button className="btn" onClick={() => setView('cscroll')}></button>
<button className="btn" onClick={() => setView('axis')}></button>
<button className="btn" onClick={() => setView('legacy')}></button>
</div>
@@ -120,6 +122,8 @@ export default function LegacyPanel() {
{view === 'scroll' && <ScrollScroll />}
{view === 'cscroll' && <ChronicleScrollView />}
{view === 'chronicle' && (
<div className="card">
<div className="card-title"></div>
@@ -261,6 +265,38 @@ function ScrollScroll() {
)
}
function ChronicleScrollView() {
const world = useGameStore((s) => s.world)
if (!world) return null
const ws = world.state.worldSim as WorldSimState | undefined
const scroll = buildChronicleScroll(world.state, ws)
return (
<div className="card">
<div className="card-title">·· </div>
{scroll.length === 0 ? (
<div className="dim"></div>
) : (
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, maxHeight: 500, overflowY: 'auto' }}>
{scroll.map((e, i) => (
<div key={i} className="ch-item" style={{
padding: '5px 8px',
borderLeft: e.important ? '3px solid #c9a227' : undefined,
paddingLeft: e.important ? 10 : 8
}}>
<span className="ch-month">{e.year}</span>
<span className={`tag ${scrollKindClass(e.kind)}`} style={{ marginRight: 6, fontSize: '0.72rem' }}>{scrollKindName(e.kind)}</span>
<span className={e.important ? 'gold-t' : ''}>{e.text}</span>
</div>
))}
</div>
)}
<div className="dim2" style={{ marginTop: 8 }}>
</div>
</div>
)
}
function dimName(k: string): string {
const map: Record<string, string> = { renXing: '人兴', daoXing: '道兴', weiMing: '威名', xiangHuo: '香火', yinGuo: '因果' }
return map[k] ?? k