@@ -1,4 +1,4 @@
|
||||
import { getCharacterHomeSceneId, getCharacterNpcSceneIds, PRESET_CHARACTERS } from '../src/data/characterPresets.ts';
|
||||
import { getCharacterHomeSceneId, getCharacterNpcSceneIds, ROLE_TEMPLATE_CHARACTERS } from '../src/data/characterPresets.ts';
|
||||
import { MONSTER_PRESETS_BY_WORLD } from '../src/data/hostileNpcPresets.ts';
|
||||
import { getSceneHostileNpcPresetIds, getScenePresetsByWorld } from '../src/data/scenePresets.ts';
|
||||
import { buildStateFunctionDefinitions } from '../src/data/stateFunctions.ts';
|
||||
@@ -45,7 +45,7 @@ function validateScenes(errors: string[]) {
|
||||
}
|
||||
npcIds.add(npc.id);
|
||||
|
||||
if (npc.characterId && !PRESET_CHARACTERS.some(character => character.id === npc.characterId)) {
|
||||
if (npc.characterId && !ROLE_TEMPLATE_CHARACTERS.some(character => character.id === npc.characterId)) {
|
||||
addError(errors, `[scene] ${scene.id} npc "${npc.id}" references unknown character "${npc.characterId}"`);
|
||||
}
|
||||
});
|
||||
@@ -57,7 +57,7 @@ function validateCharacters(errors: string[]) {
|
||||
for (const worldType of [WorldType.WUXIA, WorldType.XIANXIA]) {
|
||||
const sceneIdSet = new Set(getScenePresetsByWorld(worldType).map(scene => scene.id));
|
||||
|
||||
PRESET_CHARACTERS.forEach(character => {
|
||||
ROLE_TEMPLATE_CHARACTERS.forEach(character => {
|
||||
const homeSceneId = getCharacterHomeSceneId(worldType, character.id);
|
||||
if (homeSceneId && !sceneIdSet.has(homeSceneId)) {
|
||||
addError(errors, `[character] ${character.id} homeSceneId "${homeSceneId}" not found in ${worldType}`);
|
||||
@@ -110,7 +110,7 @@ function main() {
|
||||
const monsterCount = MONSTER_PRESETS_BY_WORLD[WorldType.WUXIA].length + MONSTER_PRESETS_BY_WORLD[WorldType.XIANXIA].length;
|
||||
const functionCount = buildStateFunctionDefinitions().length;
|
||||
|
||||
console.log(`Content validation passed. scenes=${sceneCount} monsters=${monsterCount} characters=${PRESET_CHARACTERS.length} functions=${functionCount}`);
|
||||
console.log(`Content validation passed. scenes=${sceneCount} monsters=${monsterCount} characters=${ROLE_TEMPLATE_CHARACTERS.length} functions=${functionCount}`);
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user