0.1.41 天命·兑现:天命flag全量接线15+项即时兑现 + NPC演化种子派生零主rng消耗 + pushNews/purgeNpc确定性修复 + 族史卷叙事层chronicle-scroll.ts + 时效flag自动清理 + UI建筑专精加成预览 + LegacyPanel族史卷视图 + 金钟罩重算
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { BUILDINGS, buildingById, listBuildingDefs, SPECIALTY_MULT } from '../../game/data/buildings'
|
||||
import { BUILDINGS, buildingById, listBuildingDefs, SPECIALTY_MULT, bonusOf, isSpecialty } from '../../game/data/buildings'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
export default function TerritoryPanel() {
|
||||
@@ -44,6 +44,30 @@ export default function TerritoryPanel() {
|
||||
<span className="bld-lv">{built ? `${level}级` : ''}</span>
|
||||
</div>
|
||||
<div className="bld-desc">{def.desc}</div>
|
||||
{/* 0.1.41 建筑专精加成预览 */}
|
||||
{built && def.extra && Object.keys(def.extra).length > 0 && (() => {
|
||||
const specialtyId = fam.flag['buildingSpecialty'] as string | undefined
|
||||
const currentLevel = level
|
||||
const isThisSpecialty = isSpecialty(id, specialtyId)
|
||||
const bonusLabels: { name: string; base: number; specialty: number }[] = []
|
||||
for (const [key, expr] of Object.entries(def.extra)) {
|
||||
void expr
|
||||
const base = bonusOf(id, key, currentLevel, undefined)
|
||||
const spec = bonusOf(id, key, currentLevel, id)
|
||||
bonusLabels.push({ name: extraLabel(key), base, specialty: spec })
|
||||
}
|
||||
return (
|
||||
<div className="bld-prod" style={{ fontSize: '0.72rem', color: '#a89878' }}>
|
||||
{bonusLabels.map((b, i) => (
|
||||
<span key={i} style={{ marginRight: 8 }}>
|
||||
{b.name}: {b.base.toFixed(2)}
|
||||
{isThisSpecialty && <span className="gold"> →x{SPECIALTY_MULT} = {(b.base * SPECIALTY_MULT).toFixed(2)}</span>}
|
||||
{!isThisSpecialty && specialtyId && <span className="dim2"> (设为专精可至 {(b.base * SPECIALTY_MULT).toFixed(2)})</span>}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
})()}
|
||||
{produce && Object.keys(produce).length > 0 && (
|
||||
<div className="bld-prod">
|
||||
{Object.entries(produce)
|
||||
@@ -168,3 +192,15 @@ function itemLabel(k: string): string {
|
||||
}
|
||||
return map[k] ?? k
|
||||
}
|
||||
|
||||
/** 0.1.41 建筑加成属性中文名 */
|
||||
function extraLabel(key: string): string {
|
||||
const map: Record<string, string> = {
|
||||
craftChance: '成丹率',
|
||||
unlockGrade: '解锁品阶',
|
||||
expBonus: '修炼加成',
|
||||
powerBonus: '战力加成',
|
||||
repBonus: '声望'
|
||||
}
|
||||
return map[key] ?? key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user