Add Wolong recruitment chapter

This commit is contained in:
2026-06-23 05:09:14 +09:00
parent c209107b43
commit 64af9c1f68
12 changed files with 1033 additions and 22 deletions

View File

@@ -1636,6 +1636,100 @@ try {
}
await page.screenshot({ path: 'dist/verification-liu-biao-visits.png', fullPage: true });
await page.mouse.click(1120, 38);
await page.waitForTimeout(160);
const sixteenthCampWolongSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
!sixteenthCampWolongSortieState?.sortieVisible ||
!sixteenthCampWolongSortieState.sortiePlan?.objectiveLine?.includes('융중 방문로') ||
!sixteenthCampWolongSortieState.sortieRoster?.some((unit) => unit.id === 'zhao-yun' && unit.recruited && unit.recommended) ||
!sixteenthCampWolongSortieState.sortieRoster?.some((unit) => unit.id === 'sun-qian' && unit.recruited && unit.recommended) ||
sixteenthCampWolongSortieState.sortieRoster?.length < 7 ||
sixteenthCampWolongSortieState.sortiePlan?.maxCount !== 6
) {
throw new Error(`Expected sixteenth camp sortie prep to target Wolong visit road with expanded selectable roster: ${JSON.stringify(sixteenthCampWolongSortieState)}`);
}
assertSortieTacticalRoster(sixteenthCampWolongSortieState, [
'liu-bei',
'guan-yu',
'zhang-fei',
'jian-yong',
'mi-zhu',
'sun-qian',
'zhao-yun'
]);
await page.screenshot({ path: 'dist/verification-wolong-sortie.png', fullPage: true });
await page.mouse.click(1068, 646);
await page.waitForFunction(() => {
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
return activeScenes.includes('StoryScene');
});
await page.screenshot({ path: 'dist/verification-wolong-story.png', fullPage: true });
for (let i = 0; i < 24; i += 1) {
const enteredSeventeenthBattle = await page.evaluate(() => {
const state = window.__HEROS_DEBUG__?.battle();
return state?.scene === 'BattleScene' && state?.battleId === 'seventeenth-battle-wolong-visit-road';
});
if (enteredSeventeenthBattle) {
break;
}
await page.keyboard.press('Space');
await page.waitForTimeout(320);
}
await page.waitForFunction(() => {
const state = window.__HEROS_DEBUG__?.battle();
return state?.scene === 'BattleScene' && state?.battleId === 'seventeenth-battle-wolong-visit-road' && state?.battleOutcome === null && state?.phase === 'idle';
});
await page.screenshot({ path: 'dist/verification-seventeenth-battle.png', fullPage: true });
const seventeenthBattleState = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
const seventeenthEnemies = seventeenthBattleState.units.filter((unit) => unit.faction === 'enemy');
const seventeenthAllies = seventeenthBattleState.units.filter((unit) => unit.faction === 'ally');
const seventeenthEnemyBehaviors = new Set(seventeenthEnemies.map((unit) => unit.ai));
if (
seventeenthBattleState.camera?.mapWidth !== 34 ||
seventeenthBattleState.camera?.mapHeight !== 26 ||
seventeenthBattleState.victoryConditionLabel !== '채순 격파' ||
seventeenthEnemies.length < 15 ||
!seventeenthEnemyBehaviors.has('aggressive') ||
!seventeenthEnemyBehaviors.has('guard') ||
!seventeenthEnemyBehaviors.has('hold') ||
!seventeenthEnemies.some((unit) => unit.id === 'wolong-road-leader-cai-xun') ||
!seventeenthAllies.some((unit) => unit.id === 'zhao-yun') ||
seventeenthAllies.some((unit) => unit.id === 'zhuge-liang')
) {
throw new Error(`Expected seventeenth battle to use Wolong visit map, Cai Xun objective, mixed AI, and pre-Zhuge sortie: ${JSON.stringify(seventeenthBattleState)}`);
}
await page.evaluate(() => window.__HEROS_DEBUG__?.forceBattleOutcome('victory'));
await page.waitForFunction(() => {
const state = window.__HEROS_DEBUG__?.battle();
return state?.battleOutcome === 'victory' && state?.phase === 'resolved' && state?.resultVisible === true;
});
await page.mouse.click(738, 642);
await page.waitForFunction(() => {
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
return activeScenes.includes('CampScene');
});
const seventeenthCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
seventeenthCampState?.campBattleId !== 'seventeenth-battle-wolong-visit-road' ||
seventeenthCampState.campTitle !== '와룡 출려 후 군영' ||
seventeenthCampState.availableDialogueIds?.length !== 3 ||
!seventeenthCampState.availableDialogueIds.every((id) => id.endsWith('wolong-visit')) ||
seventeenthCampState.availableVisitIds?.length !== 2 ||
!seventeenthCampState.campaign?.roster?.some((unit) => unit.id === 'zhuge-liang') ||
!seventeenthCampState.report?.bonds?.some((bond) => bond.id === 'liu-bei__zhuge-liang') ||
!seventeenthCampState.report?.bonds?.some((bond) => bond.id === 'guan-yu__zhuge-liang')
) {
throw new Error(`Expected seventeenth camp to recruit Zhuge Liang and expose Wolong dialogue/visit sets: ${JSON.stringify(seventeenthCampState)}`);
}
await page.screenshot({ path: 'dist/verification-zhuge-recruit-camp.png', fullPage: true });
await page.evaluate(() => window.__HEROS_GAME__?.scene.start('TitleScene'));
await page.waitForFunction(() => {
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
@@ -1647,7 +1741,7 @@ try {
return activeScenes.includes('CampScene');
});
console.log(`Verified title-to-sixteenth-battle flow, recruit sortie selection, result states, and debug API at ${targetUrl}`);
console.log(`Verified title-to-seventeenth-battle flow, recruit sortie selection, result states, and debug API at ${targetUrl}`);
} finally {
await browser?.close();
if (serverProcess && !serverProcess.killed) {