Add campaign ending epilogue
This commit is contained in:
@@ -9430,22 +9430,64 @@ try {
|
||||
postSixtyFifthProgressState.campaignProgress?.totalKnown !== 65 ||
|
||||
postSixtyFifthProgressState.campaignProgress?.activeChapter?.id !== 'northern-campaign' ||
|
||||
postSixtyFifthProgressState.campaignProgress?.latestBattleTitle !== '위수 북안 압박전' ||
|
||||
postSixtyFifthProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
|
||||
postSixtyFifthProgressState.campaignProgress?.nextBattleTitle !== '북벌의 끝과 남은 뜻'
|
||||
) {
|
||||
throw new Error(`Expected post-sixty-fifth progress tab to complete Weishui north bank pressure and leave the next northern step pending: ${JSON.stringify(postSixtyFifthProgressState?.campaignProgress)}`);
|
||||
throw new Error(`Expected post-sixty-fifth progress tab to complete Weishui north bank pressure and expose the final epilogue: ${JSON.stringify(postSixtyFifthProgressState?.campaignProgress)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-post-sixty-fifth-progress.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(1160, 38);
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
return activeScenes.includes('StoryScene');
|
||||
});
|
||||
await page.waitForFunction(() => {
|
||||
const story = window.__HEROS_DEBUG__?.scene('StoryScene')?.getDebugState?.();
|
||||
return story?.currentPageId === 'sixty-fifth-victory-delay-line-pressed' && story?.backgroundReady === true;
|
||||
});
|
||||
await page.screenshot({ path: 'dist/verification-ending-epilogue-story.png', fullPage: true });
|
||||
await page.evaluate(async () => {
|
||||
const delay = (ms) => new Promise((resolve) => window.setTimeout(resolve, ms));
|
||||
for (let i = 0; i < 16; i += 1) {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
if (activeScenes.includes('EndingScene')) {
|
||||
break;
|
||||
}
|
||||
window.__HEROS_DEBUG__?.scene('StoryScene')?.advance?.();
|
||||
await delay(520);
|
||||
}
|
||||
});
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
const ending = window.__HEROS_DEBUG__?.scene('EndingScene')?.getDebugState?.();
|
||||
return activeScenes.includes('EndingScene') && ending?.ready === true && ending?.campaignStep === 'ending-complete';
|
||||
});
|
||||
const endingState = await page.evaluate(() => ({
|
||||
activeScenes: window.__HEROS_DEBUG__?.activeScenes() ?? [],
|
||||
ending: window.__HEROS_DEBUG__?.scene('EndingScene')?.getDebugState?.() ?? null
|
||||
}));
|
||||
if (
|
||||
!endingState.activeScenes.includes('EndingScene') ||
|
||||
endingState.ending?.campaignStep !== 'ending-complete' ||
|
||||
endingState.ending?.latestBattleId !== 'sixty-fifth-battle-weishui-northbank' ||
|
||||
endingState.ending?.completedBattles !== 65 ||
|
||||
endingState.ending?.endingTitle !== '북벌의 끝과 남은 뜻'
|
||||
) {
|
||||
throw new Error(`Expected final epilogue to mark ending-complete and show EndingScene: ${JSON.stringify(endingState)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-ending-screen.png', fullPage: true });
|
||||
|
||||
await page.evaluate(() => {
|
||||
const game = window.__HEROS_GAME__;
|
||||
game?.scene.stop('CampScene');
|
||||
game?.scene.stop('BattleScene');
|
||||
game?.scene.stop('StoryScene');
|
||||
game?.scene.stop('EndingScene');
|
||||
game?.scene.start('TitleScene');
|
||||
});
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
return activeScenes.includes('TitleScene') && !activeScenes.includes('CampScene');
|
||||
return activeScenes.includes('TitleScene') && !activeScenes.includes('CampScene') && !activeScenes.includes('EndingScene');
|
||||
});
|
||||
await page.waitForTimeout(800);
|
||||
for (const [x, y] of [
|
||||
@@ -9455,21 +9497,21 @@ try {
|
||||
]) {
|
||||
await page.mouse.click(x, y);
|
||||
await page.waitForTimeout(300);
|
||||
const continuedToCamp = await page.evaluate(() => {
|
||||
const continuedToEnding = await page.evaluate(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
return activeScenes.includes('CampScene');
|
||||
return activeScenes.includes('EndingScene');
|
||||
});
|
||||
if (continuedToCamp) {
|
||||
if (continuedToEnding) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let attempt = 0; attempt < 24; attempt += 1) {
|
||||
const continuedToNorthbankCamp = await page.evaluate(() => {
|
||||
const continuedToEnding = await page.evaluate(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
const camp = window.__HEROS_DEBUG__?.camp?.() ?? null;
|
||||
return activeScenes.includes('CampScene') && camp?.campaign?.step === 'sixty-fifth-camp';
|
||||
const ending = window.__HEROS_DEBUG__?.scene('EndingScene')?.getDebugState?.();
|
||||
return activeScenes.includes('EndingScene') && ending?.campaignStep === 'ending-complete';
|
||||
});
|
||||
if (continuedToNorthbankCamp) {
|
||||
if (continuedToEnding) {
|
||||
break;
|
||||
}
|
||||
await page.keyboard.press('Space');
|
||||
@@ -9477,18 +9519,18 @@ try {
|
||||
}
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
const camp = window.__HEROS_DEBUG__?.camp?.() ?? null;
|
||||
return activeScenes.includes('CampScene') && camp?.campaign?.step === 'sixty-fifth-camp';
|
||||
const ending = window.__HEROS_DEBUG__?.scene('EndingScene')?.getDebugState?.();
|
||||
return activeScenes.includes('EndingScene') && ending?.campaignStep === 'ending-complete';
|
||||
});
|
||||
const titleContinueState = await page.evaluate(() => ({
|
||||
activeScenes: window.__HEROS_DEBUG__?.activeScenes() ?? [],
|
||||
camp: window.__HEROS_DEBUG__?.camp?.() ?? null
|
||||
ending: window.__HEROS_DEBUG__?.scene('EndingScene')?.getDebugState?.() ?? null
|
||||
}));
|
||||
if (!titleContinueState.activeScenes.includes('CampScene') || titleContinueState.camp?.campaign?.step !== 'sixty-fifth-camp') {
|
||||
throw new Error(`Expected title continue to reopen the Weishui north bank aftermath camp: ${JSON.stringify(titleContinueState)}`);
|
||||
if (!titleContinueState.activeScenes.includes('EndingScene') || titleContinueState.ending?.campaignStep !== 'ending-complete') {
|
||||
throw new Error(`Expected title continue to reopen the ending screen: ${JSON.stringify(titleContinueState)}`);
|
||||
}
|
||||
|
||||
console.log(`Verified title-to-Weishui-northbank flow, recruited officer sortie selection, Ma Liang, Yi Ji, Gong Zhi, Huang Zhong, Wei Yan, Pang Tong, Fa Zheng, Wu Yi, Yan Yan, Li Yan, Huang Quan, Ma Chao, Ma Dai, Wang Ping joins, Luofeng, Luo main gate, Mianzhu, Chengdu surrender, Jiameng, Yangping, Dingjun, Hanzhong decisive battle, King of Hanzhong council, Shu-Han foundation state, Jing Province defense vanguard, Fan Castle vanguard, Han River flood, Fan siege, Jing rear crisis, Gongan collapse, Maicheng isolation, Yiling vanguard, Yiling fire attack, Baidi entrustment, Nanzhong stabilization, Meng Huo pacification, second capture, third capture, fourth capture, fifth capture, sixth capture, final capture, northern campaign preparation, Qishan road first northern expedition, Tianshui advance, Jieting crisis, Jiang Wei joining, Qishan retreat, Chencang siege, Wudu/Yinping commanderies, Hanzhong rainy-pass defense, Qishan renewed offensive, Lucheng pursuit, Weishui camps, Weishui north bank pressure, and pending next northern step state at ${targetUrl}`);
|
||||
console.log(`Verified title-to-ending flow, recruited officer sortie selection, Ma Liang, Yi Ji, Gong Zhi, Huang Zhong, Wei Yan, Pang Tong, Fa Zheng, Wu Yi, Yan Yan, Li Yan, Huang Quan, Ma Chao, Ma Dai, Wang Ping joins, Luofeng, Luo main gate, Mianzhu, Chengdu surrender, Jiameng, Yangping, Dingjun, Hanzhong decisive battle, King of Hanzhong council, Shu-Han foundation state, Jing Province defense vanguard, Fan Castle vanguard, Han River flood, Fan siege, Jing rear crisis, Gongan collapse, Maicheng isolation, Yiling vanguard, Yiling fire attack, Baidi entrustment, Nanzhong stabilization, Meng Huo pacification, second capture, third capture, fourth capture, fifth capture, sixth capture, final capture, northern campaign preparation, Qishan road first northern expedition, Tianshui advance, Jieting crisis, Jiang Wei joining, Qishan retreat, Chencang siege, Wudu/Yinping commanderies, Hanzhong rainy-pass defense, Qishan renewed offensive, Lucheng pursuit, Weishui camps, Weishui north bank pressure, final epilogue, ending-complete save state, and title continue to ending screen at ${targetUrl}`);
|
||||
} finally {
|
||||
await browser?.close();
|
||||
if (serverProcess && !serverProcess.killed) {
|
||||
|
||||
Reference in New Issue
Block a user