This commit is contained in:
2026-04-26 17:53:31 +08:00
46 changed files with 1027 additions and 626 deletions

View File

@@ -1609,34 +1609,29 @@ export function createStoryNpcEncounterActions({
const closingDialogue = [
...nextDialogue,
];
const progressionResult = buildPostNpcChatProgressionOptions(
encounter,
playerCharacter,
);
const shouldUseHostileClosureOptions =
shouldUseHostileNpcChatClosureOptions(
resolvedChatDirective,
Math.min(npcState.affinity, nextAffinity),
);
const progressionResult = shouldUseHostileClosureOptions
? null
: buildPostNpcChatProgressionOptions(encounter, playerCharacter);
setCurrentStory({
text: closingDialogue.map((turn) => turn.text).join('\n'),
options: buildNpcChatClosureOptions(
encounter,
playerCharacter,
resolvedChatDirective,
nextAffinity,
Math.min(npcState.affinity, nextAffinity),
),
displayMode: 'dialogue',
dialogue: closingDialogue,
streaming: false,
npcAffinityEffect: latestAffinityEffect,
deferredOptions: shouldUseHostileNpcChatClosureOptions(
resolvedChatDirective,
nextAffinity,
)
? undefined
: progressionResult.options,
deferredRuntimeState: shouldUseHostileNpcChatClosureOptions(
resolvedChatDirective,
nextAffinity,
)
? undefined
: (progressionResult.deferredRuntimeState ?? undefined),
deferredOptions: progressionResult?.options,
deferredRuntimeState:
progressionResult?.deferredRuntimeState ?? undefined,
});
return true;
}