fix(0.1.22): 姓氏选择假功能修复——文档化传递链贯通
根因:GameEngine 构造硬编码 surname:'林'/familyName:'林氏', NewGame 输入的姓氏从未传入引擎(startNewGame 只传 seed) 修复:GameEngineOptions 增加 surname/familyName/motto/difficulty 透传; store.startNewGame 全参传递;createWorldState 按 opts 建档(缺省林氏兜底) 验证:慕容家/慕容临渊 贯通(tsx 实证)+ 新增 2 例防回归测试 测试:1020 全绿(43+1 套件);build 通过
This commit is contained in:
@@ -120,3 +120,18 @@ describe('Sim 与外层联动', () => {
|
||||
expect(before).toBeLessThan(1.4)
|
||||
})
|
||||
})
|
||||
|
||||
describe('GameEngine 建档参数', () => {
|
||||
it('姓氏透传:新档用玩家输入的姓氏/家号(0.1.22 修复)', () => {
|
||||
const e = new GameEngine({ seed: 'name-fix', surname: '慕容', familyName: '慕容家', motto: '铁血丹心', difficulty: 'normal' })
|
||||
expect(e.world.state.family.name).toBe('慕容家')
|
||||
const head = Object.values(e.world.state.members).find((c) => c.isHead)
|
||||
expect(head?.name.startsWith('慕容')).toBe(true)
|
||||
expect(e.world.state.family.motto ?? '').toBeTruthy()
|
||||
})
|
||||
|
||||
it('缺省建档仍为林氏(兜底不破)', () => {
|
||||
const e = new GameEngine({ seed: 'name-default' })
|
||||
expect(e.world.state.family.name).toBe('林氏')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user