v0.1.5: 人物志(志向/渡劫/列传/契合/回声)

- 志向系统:七向(求道/镇族/承宗/商略/兵略/耕读/云游)成年礼自动定志,
  量化加成入修炼/战力/坊市/灵田/添丁/声望,云游减修但际遇更频
- 大境界渡劫:炼气→筑基起,晋升改走劫难事件三选——硬渡/请护法(100灵石)/
  压制来年;护法失败或受牵连;渡劫成败与心性、气血挂勾,高阶有小陨落率
- 灵根本命契合:功法元素×主灵根,契合者修炼+6%/战力+4%,详情页「本命」徽章
- 人物列传:自动列传生成器(生平/修行脉络/历险/姻缘/子嗣/大比/墓志铭),
  成员详情小传分页 + 春秋原列传长卷
- 四邻回声:每两年一桩——友好赠礼/敌视暗桩/中立传闻三态动态事件
- 修复:回声事件 npcId 解析错误、事件优先级(惯例>传闻)
- 测试 176→197(志向加成/契合/渡劫三轨/压制通道/列传结构/回声三态)
This commit is contained in:
2026-08-23 09:08:16 +08:00
parent 98b60076f0
commit 106db18017
17 changed files with 791 additions and 7 deletions
+92
View File
@@ -0,0 +1,92 @@
import { Element } from '../types/domain'
import { Character } from '../types/domain'
import { techniqueById } from './techniques'
export type AspirationEffectType = 'cult' | 'battle' | 'market' | 'field' | 'offspring' | 'rep'
export interface AspirationDef {
id: string
name: string
desc: string
icon: string
effect: { type: AspirationEffectType; value: number }
}
export const ASPIRATIONS: Record<string, AspirationDef> = {
dao: {
id: 'dao',
name: '求道',
desc: '一心通天:修炼速度 +2%。',
icon: '道',
effect: { type: 'cult', value: 0.02 }
},
zhen: {
id: 'zhen',
name: '镇族',
desc: '守土传家:家族声望年增 +0.3。',
icon: '镇',
effect: { type: 'rep', value: 0.3 }
},
cheng: {
id: 'cheng',
name: '承宗',
desc: '开枝散叶:家宅添丁概率 +5%。',
icon: '承',
effect: { type: 'offspring', value: 0.05 }
},
shang: {
id: 'shang',
name: '商略',
desc: '市井谙熟:坊市进项 +3%。',
icon: '商',
effect: { type: 'market', value: 0.03 }
},
bing: {
id: 'bing',
name: '兵略',
desc: '韬略在胸:战力 +3%。',
icon: '兵',
effect: { type: 'battle', value: 0.03 }
},
geng: {
id: 'geng',
name: '耕读',
desc: '稼穑不辍:灵田产出 +5%。',
icon: '耕',
effect: { type: 'field', value: 0.05 }
},
yun: {
id: 'yun',
name: '云游',
desc: '天地为庐:修炼 -3%,但多见奇景(际遇更频)。',
icon: '云',
effect: { type: 'cult', value: -0.03 }
}
}
export const ASPIRATION_IDS = Object.keys(ASPIRATIONS)
export function aspirationById(id: string | undefined): AspirationDef | null {
if (!id) return null
return ASPIRATIONS[id] ?? null
}
export function countAspiration(type: AspirationEffectType, members: Character[]): number {
let n = 0
for (const c of members) {
const def = aspirationById(c.aspiration)
if (def?.effect.type === type) n++
}
return n
}
export function fitBonusOf(c: Character): { cult: boolean; battle: boolean } {
const tech = techniqueById(c.techniqueId)
if (!tech) return { cult: false, battle: false }
const fit = tech.element === c.roots.primary
return { cult: fit, battle: fit }
}
export function isFit(techElement: Element, primary: Element): boolean {
return techElement === primary
}
+1
View File
@@ -43,6 +43,7 @@ export interface EffectDef {
feisheng?: { stay: boolean }
tournament?: boolean
apprentice?: { build: boolean }
trib?: { memberId: string; mode: 'rash' | 'guard' | 'delay' }
}
export interface EventOptionDef {