Simplify custom world result editing controls
This commit is contained in:
@@ -68,9 +68,8 @@ import {
|
||||
type GiftAffinityInsight,
|
||||
} from './npcAttributeInsights';
|
||||
import {
|
||||
buildQuestAcceptDetail,
|
||||
buildQuestForEncounter,
|
||||
buildQuestTurnInDetail,
|
||||
evaluateQuestOpportunity,
|
||||
getQuestForIssuer,
|
||||
} from './questFlow';
|
||||
import {
|
||||
@@ -1379,6 +1378,30 @@ function buildNpcOption(
|
||||
} as StoryOption;
|
||||
}
|
||||
|
||||
function buildQuestAcceptOpportunityDetail(params: {
|
||||
issuerNpcId: string;
|
||||
issuerNpcName: string;
|
||||
roleText: string;
|
||||
scene: Pick<ScenePresetInfo, 'id' | 'name' | 'npcs' | 'treasureHints'> | null;
|
||||
worldType: WorldType | null;
|
||||
currentQuests: QuestLogEntry[];
|
||||
}) {
|
||||
const opportunity = evaluateQuestOpportunity({
|
||||
issuerNpcId: params.issuerNpcId,
|
||||
issuerNpcName: params.issuerNpcName,
|
||||
roleText: params.roleText,
|
||||
scene: params.scene,
|
||||
worldType: params.worldType,
|
||||
currentQuests: params.currentQuests,
|
||||
});
|
||||
|
||||
if (!opportunity.shouldOffer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return `${opportunity.reason} 接取后将由 AI 剧情引擎根据当前局势生成具体目标、步骤与奖励。`;
|
||||
}
|
||||
|
||||
function getPlayerBenefitScore(item: InventoryItem, character: Character) {
|
||||
let score = getInventoryItemValue(item);
|
||||
const customWorldProfile = getRuntimeCustomWorldProfile();
|
||||
@@ -1967,13 +1990,14 @@ export function buildNpcEncounterStoryMoment({
|
||||
})
|
||||
: null;
|
||||
const activeQuest = getQuestForIssuer(activeQuests, npcId);
|
||||
const generatedQuest = buildQuestForEncounter({
|
||||
const questAcceptDetail = !activeQuest ? buildQuestAcceptOpportunityDetail({
|
||||
issuerNpcId: npcId,
|
||||
issuerNpcName: encounter.npcName,
|
||||
roleText: encounter.context,
|
||||
scene,
|
||||
worldType,
|
||||
});
|
||||
currentQuests: activeQuests,
|
||||
}) : null;
|
||||
const options: StoryOption[] = [];
|
||||
const isHostileEncounter =
|
||||
npcState.affinity < 0 ||
|
||||
@@ -2098,15 +2122,14 @@ export function buildNpcEncounterStoryMoment({
|
||||
activeQuest.id,
|
||||
),
|
||||
);
|
||||
} else if (!activeQuest && generatedQuest) {
|
||||
} else if (!activeQuest && questAcceptDetail) {
|
||||
options.push(
|
||||
buildNpcOption(
|
||||
NPC_QUEST_ACCEPT_FUNCTION.id,
|
||||
`接下${encounter.npcName}的委托`,
|
||||
buildQuestAcceptDetail(generatedQuest),
|
||||
questAcceptDetail,
|
||||
npcId,
|
||||
'quest_accept',
|
||||
generatedQuest.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user