This commit is contained in:
2026-04-27 22:50:18 +08:00
parent ded6f6ee2a
commit b6c6640548
77 changed files with 5240 additions and 833 deletions

View File

@@ -73,6 +73,51 @@ describe('normalizeCustomWorldProfileRecord role asset descriptions', () => {
expect(profile?.sceneChapterBlueprints?.[0]?.acts).toHaveLength(1);
});
it('把幕配置里的角色名归一到真实角色 id', () => {
const profile = normalizeCustomWorldProfileRecord({
name: '雾港归航',
settingText: '海雾旧案',
playableNpcs: [
{
id: 'playable-cendeng',
name: '岑灯',
title: '返乡守灯人',
role: '主角代理',
},
],
storyNpcs: [
{
id: 'story-luheng',
name: '陆衡',
title: '航运公会审计员',
role: '第一幕主NPC',
},
],
sceneChapterBlueprints: [
{
id: 'scene-chapter-1',
sceneId: 'custom-scene-camp',
title: '开局章节',
acts: [
{
id: 'act-1',
title: '第一幕',
summary: '陆衡先拦住玩家。',
encounterNpcIds: ['陆衡'],
primaryNpcId: '航运公会审计员',
oppositeNpcId: '陆衡',
},
],
},
],
});
const act = profile?.sceneChapterBlueprints?.[0]?.acts[0];
expect(act?.encounterNpcIds).toEqual(['story-luheng']);
expect(act?.primaryNpcId).toBe('story-luheng');
expect(act?.oppositeNpcId).toBe('story-luheng');
});
it('直接读取 Rust 草稿角色字段和形象资源', () => {
const profile = normalizeCustomWorldProfileRecord({
name: '雾港归航',
@@ -121,4 +166,3 @@ describe('normalizeCustomWorldProfileRecord role asset descriptions', () => {
);
});
});