v0.1.3: 深度审计修复(兼容/血缘/联姻/远征/数值)
- 旧档兼容:<0.1.1 存档缺 finance/yearStats/yearlyReports 字段加载归一化(防运行期崩溃) - 血缘防护:同母异父兄妹也禁止婚配(指婚/媒人/联姻三路齐封) - 联姻修正:一家一姻亲(allied 锁),再娶再嫁不再无限刷;男儿娶亲也子孙来归 - 和约语义:议和强推关系至 +30(真停战),不再打完一场还是仇雠 - 远征收队:任务完成/召回自动释放队员闲居;重伤者当月离队疗伤、不足定员提前撤队(修复人员永久困远征/卡状态) - 数值:婴儿夭折率 2%→0.8%;劫掠队强度 0.9→0.78;事件负资源钳制不为负灵石 - UI:丹药按钮显示持有并禁点;点将模式支持取消重选;设置页移除摆设项 - 新增 audit 套件:8 项(含 600 月长跑耐力)总测试 38→46 全绿
This commit is contained in:
@@ -38,19 +38,18 @@ export function yearStartMarriage(w: World): void {
|
||||
w.log('good', `${fam.surname}家诞下新丁:${first.name}。`)
|
||||
}
|
||||
|
||||
// 联姻外孙来投
|
||||
// 联姻外孙来投(男方娶亲:妻室携子来归;或女儿携子回门)
|
||||
for (const member of Object.values(s.members)) {
|
||||
if (!member.alive || !member.spouseHouse) continue
|
||||
if (member.gender !== 'female') continue
|
||||
const age = w.ageOf(member)
|
||||
if (age < 18 || age > 44) continue
|
||||
if (!w.rng.chance(0.16)) continue
|
||||
if (!w.rng.chance(0.15)) continue
|
||||
const gen = member.generation + 1
|
||||
const house = member.spouseHouse
|
||||
const child = produceOffspring(w, { father: null, mother: null, generation: gen, bornYear: s.year, surname: fam.surname })
|
||||
child.spouseHouse = house
|
||||
w.addMember(child)
|
||||
w.chronicle('birth', `${member.name}自${house}携幼子归来,名唤${child.name}。`, child.id, true)
|
||||
w.chronicle('birth', `${member.name}自${house}携幼子归庄,名唤${child.name}。`, child.id, true)
|
||||
w.state.yearStats.births += 1
|
||||
w.log('info', `${member.name} 领着小辈回门投亲。`)
|
||||
}
|
||||
@@ -78,7 +77,12 @@ export function yearStartMarriage(w: World): void {
|
||||
for (const m of men) {
|
||||
if (w.rng.chance(0.28) && women.length > 0) {
|
||||
const candidate = women.filter(
|
||||
(x) => !(x.fatherId && x.fatherId === m.fatherId) && x !== m && !x.children.includes(m.id) && !m.children.includes(x.id)
|
||||
(x) =>
|
||||
!(x.fatherId && x.fatherId === m.fatherId) &&
|
||||
!(x.motherId && x.motherId === m.motherId) &&
|
||||
x !== m &&
|
||||
!x.children.includes(m.id) &&
|
||||
!m.children.includes(x.id)
|
||||
)
|
||||
if (candidate.length === 0) continue
|
||||
const bride = w.rng.pick(candidate)
|
||||
|
||||
Reference in New Issue
Block a user