0.1.41 天命·兑现:天命flag全量接线15+项即时兑现 + NPC演化种子派生零主rng消耗 + pushNews/purgeNpc确定性修复 + 族史卷叙事层chronicle-scroll.ts + 时效flag自动清理 + UI建筑专精加成预览 + LegacyPanel族史卷视图 + 金钟罩重算
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user