diff --git a/scripts/verify-campaign-flow-data.mjs b/scripts/verify-campaign-flow-data.mjs index f41b706..369d833 100644 --- a/scripts/verify-campaign-flow-data.mjs +++ b/scripts/verify-campaign-flow-data.mjs @@ -41,6 +41,22 @@ for (const [flowKey, nextBattleId] of sortieFlowNextBattleIds.entries()) { assert(battleIds.has(nextBattleId), `Sortie flow ${flowKey} references unknown next battle id: ${nextBattleId}`); } +for (const flowKey of sortieFlowKeys) { + const nextBattleId = sortieFlowNextBattleIds.get(flowKey); + const campaignStep = sortieFlowCampaignSteps.get(flowKey); + if (!nextBattleId) { + continue; + } + + assert(campaignStep, `Sortie flow ${flowKey} has next battle ${nextBattleId} but no campaign step`); + if (campaignStep) { + assert( + routedBattleSteps.get(campaignStep) === nextBattleId, + `Sortie flow ${flowKey} marks campaign step ${campaignStep} but routes to ${routedBattleSteps.get(campaignStep) ?? 'no battle'} instead of ${nextBattleId}` + ); + } +} + for (const [battleId, unlockBattleId] of campaignRewardUnlockBattleIds.entries()) { const nextBattleId = sortieFlowNextBattleIds.get(battleId); assert(battleIds.has(unlockBattleId), `Battle ${battleId} campaign reward unlocks unknown battle id: ${unlockBattleId}`);