0.1.37 天人感应·因果织锦:功德系统+飞升试炼+世界奇观+MOD扩展口

This commit is contained in:
2026-09-10 23:37:57 +08:00
parent 2984d05647
commit 87cd71ad21
24 changed files with 1062 additions and 43 deletions
+31
View File
@@ -44,6 +44,29 @@ export default function FamilyPanel() {
<span className="dim"> <b className="gold">{s.family.generation}</b></span>
</div>
</div>
{/* 0.1.37 因果条带 */}
<div className="karma-strip" style={{
marginBottom: 12, padding: '8px 14px', borderRadius: 6,
display: 'flex', alignItems: 'center', gap: 12,
background: karmaBg(s.family.karma),
}}>
<span className="dim" style={{ whiteSpace: 'nowrap' }}></span>
<div style={{ flex: 1, position: 'relative', height: 8, borderRadius: 4, background: 'rgba(60,50,35,0.6)' }}>
<div style={{
position: 'absolute', top: 0, bottom: 0,
left: '50%', width: `${Math.min(50, Math.abs(s.family.karma ?? 0) * 0.5)}%`,
transform: s.family.karma < 0 ? 'translateX(-100%)' : 'none',
borderRadius: 4,
background: s.family.karma > 0 ? 'linear-gradient(90deg,#5a7a3a,#8fae6a)' : s.family.karma < 0 ? 'linear-gradient(90deg,#8b3a2a,#c05a41)' : 'transparent',
}} />
</div>
<b style={{ color: s.family.karma > 30 ? '#8fae6a' : s.family.karma < -20 ? '#c05a41' : '#c9a227', minWidth: 50, textAlign: 'right' }}>
{s.family.karma > 0 ? '+' : ''}{Math.round((s.family.karma ?? 0) * 10) / 10}
</b>
<span className="dim2" style={{ whiteSpace: 'nowrap' }}>
{(s.family.karma ?? 0) > 30 ? '积善余庆' : (s.family.karma ?? 0) < -20 ? '因果缠身' : '平淡无功'}
</span>
</div>
{marriageReady.length >= 2 && (
<div
className="matchmaker-strip"
@@ -71,3 +94,11 @@ export default function FamilyPanel() {
</div>
)
}
/** 0.1.37 karma 条带背景色 */
function karmaBg(k: number | undefined): string {
const v = k ?? 0
if (v > 30) return 'rgba(80,100,50,0.15)'
if (v < -20) return 'rgba(120,50,40,0.15)'
return 'rgba(50,45,35,0.1)'
}
+14 -3
View File
@@ -81,7 +81,7 @@ export default function LegacyPanel() {
<b className="gold">{dims.total}</b>
</div>
<div className="dim2" style={{ marginTop: 8 }}>
=· · =· · =· · =·
=· · =· · =· · =· · =
</div>
</div>
)}
@@ -216,9 +216,20 @@ function ScrollScroll() {
<div className="card-title"></div>
{mem.slice(0, 40).map((c) => {
const bio = buildBiography(world.state, c.id)
const isAscended = c.deathCause === '飞升太虚' || c.deathCause === '云游飞升'
const isAscensionFall = c.deathCause === '飞升劫陨'
const isFengxian = c.traits.includes('fengxian') && c.alive
return (
<div key={c.id} className="bio-row">
<div key={c.id} className="bio-row" style={
isAscended ? { borderLeft: '3px solid #c9a227', paddingLeft: 8 }
: isAscensionFall ? { borderLeft: '3px solid #c05a41', paddingLeft: 8 }
: isFengxian ? { borderLeft: '3px solid #8fae6a', paddingLeft: 8 }
: undefined
}>
<b>{c.name}</b>
{isAscended && <span className="tag head-t" style={{ marginLeft: 6 }}></span>}
{isAscensionFall && <span className="tag bad-t-bg" style={{ marginLeft: 6 }}></span>}
{isFengxian && <span className="tag good-t-bg" style={{ marginLeft: 6 }}></span>}
<span className="dim" style={{ marginLeft: 8 }}>
{bio.map((l) => l.text).join(' ').slice(0, 90)}{bio.map((l) => l.text).join(' ').length > 90 ? '……' : ''}
</span>
@@ -230,7 +241,7 @@ function ScrollScroll() {
}
function dimName(k: string): string {
const map: Record<string, string> = { renXing: '人兴', daoXing: '道兴', weiMing: '威名', xiangHuo: '香火' }
const map: Record<string, string> = { renXing: '人兴', daoXing: '道兴', weiMing: '威名', xiangHuo: '香火', yinGuo: '因果' }
return map[k] ?? k
}
+2 -1
View File
@@ -84,8 +84,9 @@ export default function WorldPanel() {
onClick={() => {
const npc = w.state.npcFamilies[ws.distress!.id]
if (npc) npc.relation = Math.max(0, npc.relation - 10)
w.state.family.karma -= 6
ws.distress = undefined
w.log('info', `${npc?.name ?? '盟友'} 见吾族坐视,失望而返。`)
w.log('info', `${npc?.name ?? '盟友'} 见吾族坐视,失望而返。(功德-6`)
bump()
}}
></button>