Implement scene-based chapter quest progression
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {isRecord, readStoredJson, writeStoredJson} from '../persistence/storage';
|
||||
import {generateWorldAttributeSchema} from '../services/attributeSchemaGenerator';
|
||||
import { buildFallbackCustomWorldCampScene } from '../services/customWorldCamp';
|
||||
import {
|
||||
buildCustomWorldAnchorPackFromIntent,
|
||||
deriveCustomWorldLockStateFromIntent,
|
||||
@@ -514,6 +515,26 @@ function normalizeLandmark(value: unknown, index: number): CustomWorldLandmark |
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeCampScene(
|
||||
value: unknown,
|
||||
fallbackProfile: Pick<
|
||||
CustomWorldProfile,
|
||||
'name' | 'summary' | 'tone' | 'playerGoal' | 'settingText' | 'templateWorldType'
|
||||
>,
|
||||
) {
|
||||
const fallback = buildFallbackCustomWorldCampScene(fallbackProfile);
|
||||
if (!isRecord(value)) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return {
|
||||
name: toText(value.name, fallback.name),
|
||||
description: toText(value.description, fallback.description),
|
||||
dangerLevel: toText(value.dangerLevel, fallback.dangerLevel),
|
||||
imageSrc: toText(value.imageSrc) || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeLandmarkDraft(
|
||||
value: unknown,
|
||||
index: number,
|
||||
@@ -569,6 +590,14 @@ function normalizeProfile(value: unknown): CustomWorldProfile | null {
|
||||
const summary = toText(value.summary);
|
||||
const tone = toText(value.tone);
|
||||
const playerGoal = toText(value.playerGoal);
|
||||
const camp = normalizeCampScene(value.camp, {
|
||||
name,
|
||||
summary,
|
||||
tone,
|
||||
playerGoal,
|
||||
settingText,
|
||||
templateWorldType,
|
||||
});
|
||||
const generatedAttributeSchema = generateWorldAttributeSchema({
|
||||
worldType: WorldType.CUSTOM,
|
||||
worldName: name,
|
||||
@@ -613,6 +642,7 @@ function normalizeProfile(value: unknown): CustomWorldProfile | null {
|
||||
.map((entry, index) => normalizeItem(entry, index))
|
||||
.filter((entry): entry is CustomWorldItem => Boolean(entry))
|
||||
: [],
|
||||
camp,
|
||||
landmarks: normalizeCustomWorldLandmarks({
|
||||
landmarks: landmarkDrafts,
|
||||
storyNpcs,
|
||||
|
||||
Reference in New Issue
Block a user