Add Wuling mountain road chapter

This commit is contained in:
2026-06-23 08:16:37 +09:00
parent f8cc2f329c
commit 98876673a8
11 changed files with 1183 additions and 30 deletions

View File

@@ -1736,7 +1736,7 @@ try {
if (
progressTabState?.activeTab !== 'progress' ||
progressTabState.campaignProgress?.completedKnown !== 17 ||
progressTabState.campaignProgress?.totalKnown !== 24 ||
progressTabState.campaignProgress?.totalKnown !== 25 ||
progressTabState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
progressTabState.campaignProgress?.latestBattleTitle !== '융중 방문로' ||
progressTabState.campaignProgress?.nextBattleTitle !== '박망파 매복전'
@@ -1888,7 +1888,7 @@ try {
if (
postBowangProgressState?.activeTab !== 'progress' ||
postBowangProgressState.campaignProgress?.completedKnown !== 18 ||
postBowangProgressState.campaignProgress?.totalKnown !== 24 ||
postBowangProgressState.campaignProgress?.totalKnown !== 25 ||
postBowangProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
postBowangProgressState.campaignProgress?.latestBattleTitle !== '박망파 매복전' ||
postBowangProgressState.campaignProgress?.nextBattleTitle !== '장판파 피난로'
@@ -2026,7 +2026,7 @@ try {
if (
postChangbanProgressState?.activeTab !== 'progress' ||
postChangbanProgressState.campaignProgress?.completedKnown !== 19 ||
postChangbanProgressState.campaignProgress?.totalKnown !== 24 ||
postChangbanProgressState.campaignProgress?.totalKnown !== 25 ||
postChangbanProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
postChangbanProgressState.campaignProgress?.latestBattleTitle !== '장판파 피난로' ||
postChangbanProgressState.campaignProgress?.nextBattleTitle !== '강동 사절로'
@@ -2164,7 +2164,7 @@ try {
if (
postJiangdongProgressState?.activeTab !== 'progress' ||
postJiangdongProgressState.campaignProgress?.completedKnown !== 20 ||
postJiangdongProgressState.campaignProgress?.totalKnown !== 24 ||
postJiangdongProgressState.campaignProgress?.totalKnown !== 25 ||
postJiangdongProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
postJiangdongProgressState.campaignProgress?.latestBattleTitle !== '강동 사절로' ||
postJiangdongProgressState.campaignProgress?.nextBattleTitle !== '적벽 전초전'
@@ -2304,7 +2304,7 @@ try {
if (
postRedCliffsProgressState?.activeTab !== 'progress' ||
postRedCliffsProgressState.campaignProgress?.completedKnown !== 21 ||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 24 ||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 25 ||
postRedCliffsProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
postRedCliffsProgressState.campaignProgress?.latestBattleTitle !== '적벽 전초전' ||
postRedCliffsProgressState.campaignProgress?.nextBattleTitle !== '적벽 화공전'
@@ -2444,7 +2444,7 @@ try {
if (
postFireAttackProgressState?.activeTab !== 'progress' ||
postFireAttackProgressState.campaignProgress?.completedKnown !== 22 ||
postFireAttackProgressState.campaignProgress?.totalKnown !== 24 ||
postFireAttackProgressState.campaignProgress?.totalKnown !== 25 ||
postFireAttackProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postFireAttackProgressState.campaignProgress?.latestBattleTitle !== '적벽 화공전' ||
postFireAttackProgressState.campaignProgress?.nextBattleTitle !== '형주 남부 진입전'
@@ -2587,7 +2587,7 @@ try {
if (
postJingzhouProgressState?.activeTab !== 'progress' ||
postJingzhouProgressState.campaignProgress?.completedKnown !== 23 ||
postJingzhouProgressState.campaignProgress?.totalKnown !== 24 ||
postJingzhouProgressState.campaignProgress?.totalKnown !== 25 ||
postJingzhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postJingzhouProgressState.campaignProgress?.latestBattleTitle !== '형주 남부 진입전' ||
postJingzhouProgressState.campaignProgress?.nextBattleTitle !== '계양 설득전'
@@ -2729,15 +2729,158 @@ try {
if (
postGuiyangProgressState?.activeTab !== 'progress' ||
postGuiyangProgressState.campaignProgress?.completedKnown !== 24 ||
postGuiyangProgressState.campaignProgress?.totalKnown !== 24 ||
postGuiyangProgressState.campaignProgress?.totalKnown !== 25 ||
postGuiyangProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postGuiyangProgressState.campaignProgress?.latestBattleTitle !== '계양 설득전' ||
postGuiyangProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
postGuiyangProgressState.campaignProgress?.nextBattleTitle !== '무릉 산길 확보전'
) {
throw new Error(`Expected post-Guiyang progress tab to complete the new commandery battle and pause on Wuling preparation: ${JSON.stringify(postGuiyangProgressState?.campaignProgress)}`);
}
await page.screenshot({ path: 'dist/verification-post-guiyang-progress.png', fullPage: true });
await page.mouse.click(1120, 38);
await page.waitForTimeout(180);
const wulingSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
!wulingSortieState?.sortieVisible ||
!wulingSortieState.sortiePlan?.objectiveLine?.includes('무릉 산길 확보전') ||
!wulingSortieState.sortieRoster?.some((unit) => unit.id === 'ma-liang' && unit.recruited && unit.recommended) ||
!wulingSortieState.sortieRoster?.some((unit) => unit.id === 'yi-ji' && unit.recruited && unit.recommended) ||
!wulingSortieState.sortieRoster?.some((unit) => unit.id === 'zhuge-liang' && unit.recruited && unit.recommended) ||
!wulingSortieState.sortieRoster?.some((unit) => unit.id === 'zhao-yun' && unit.recruited && unit.recommended) ||
!wulingSortieState.sortieRoster?.some((unit) => unit.id === 'zhang-fei' && unit.recommended) ||
wulingSortieState.sortieRoster?.some((unit) => unit.id === 'gong-zhi') ||
wulingSortieState.sortieRoster?.length < 10 ||
wulingSortieState.sortiePlan?.maxCount !== 6
) {
throw new Error(`Expected twenty-fourth camp sortie prep to target Wuling with Yi Ji recommended and Gong Zhi absent before victory: ${JSON.stringify(wulingSortieState)}`);
}
assertSortieTacticalRoster(wulingSortieState, [
'liu-bei',
'guan-yu',
'zhang-fei',
'jian-yong',
'mi-zhu',
'sun-qian',
'zhao-yun',
'zhuge-liang',
'ma-liang',
'yi-ji'
]);
const wulingPriorityUnits = ['ma-liang', 'yi-ji', 'zhuge-liang', 'zhao-yun', 'zhang-fei'];
for (const unitId of wulingPriorityUnits) {
const currentSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (!currentSortieState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)) {
const removable = currentSortieState.sortieRoster?.find(
(unit) => unit.selected && unit.id !== 'liu-bei' && !wulingPriorityUnits.includes(unit.id)
);
if (removable) {
await clickSortieRosterUnit(page, removable.id);
}
await clickSortieRosterUnit(page, unitId);
}
}
const wulingSortieReadyState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
!wulingPriorityUnits.every((unitId) =>
wulingSortieReadyState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)
) ||
wulingSortieReadyState.sortiePlan?.selectedCount !== 6 ||
wulingSortieReadyState.sortiePlan?.recommendedSelectedCount < 6
) {
throw new Error(`Expected Wuling sortie to deploy Ma Liang, Yi Ji, and the mountain-road priority officers while preserving six-officer pressure: ${JSON.stringify(wulingSortieReadyState)}`);
}
await page.screenshot({ path: 'dist/verification-wuling-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-wuling-story.png', fullPage: true });
for (let i = 0; i < 50; i += 1) {
const enteredTwentyFifthBattle = await page.evaluate(() => {
const state = window.__HEROS_DEBUG__?.battle();
return state?.scene === 'BattleScene' && state?.battleId === 'twenty-fifth-battle-wuling-mountain-road';
});
if (enteredTwentyFifthBattle) {
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 === 'twenty-fifth-battle-wuling-mountain-road' && state?.battleOutcome === null && state?.phase === 'idle';
});
await page.screenshot({ path: 'dist/verification-twenty-fifth-battle.png', fullPage: true });
const twentyFifthBattleState = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
const twentyFifthEnemies = twentyFifthBattleState.units.filter((unit) => unit.faction === 'enemy');
const twentyFifthAllies = twentyFifthBattleState.units.filter((unit) => unit.faction === 'ally');
const twentyFifthEnemyBehaviors = new Set(twentyFifthEnemies.map((unit) => unit.ai));
if (
twentyFifthBattleState.camera?.mapWidth !== 50 ||
twentyFifthBattleState.camera?.mapHeight !== 34 ||
twentyFifthBattleState.victoryConditionLabel !== '김선 퇴각' ||
twentyFifthEnemies.length < 19 ||
!twentyFifthEnemyBehaviors.has('aggressive') ||
!twentyFifthEnemyBehaviors.has('guard') ||
!twentyFifthEnemyBehaviors.has('hold') ||
!twentyFifthEnemies.some((unit) => unit.id === 'wuling-leader-jin-xuan') ||
!twentyFifthAllies.some((unit) => unit.id === 'ma-liang') ||
!twentyFifthAllies.some((unit) => unit.id === 'yi-ji') ||
!twentyFifthAllies.some((unit) => unit.id === 'zhao-yun') ||
twentyFifthAllies.some((unit) => unit.id === 'gong-zhi')
) {
throw new Error(`Expected twenty-fifth battle to use Wuling map, Jin Xuan objective, mixed AI, selected allied officers, and no Gong Zhi before victory: ${JSON.stringify(twentyFifthBattleState)}`);
}
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 twentyFifthCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
twentyFifthCampState?.campBattleId !== 'twenty-fifth-battle-wuling-mountain-road' ||
twentyFifthCampState.campTitle !== '무릉 산길 확보 후 군영' ||
twentyFifthCampState.availableDialogueIds?.length !== 3 ||
!twentyFifthCampState.availableDialogueIds.every((id) => id.endsWith('wuling')) ||
twentyFifthCampState.availableVisitIds?.length !== 2 ||
!twentyFifthCampState.campaign?.roster?.some((unit) => unit.id === 'gong-zhi') ||
!twentyFifthCampState.sortieRoster?.some((unit) => unit.id === 'gong-zhi' && unit.recruited) ||
twentyFifthCampState.rosterCollection?.total < 11
) {
throw new Error(`Expected twenty-fifth camp to recruit Gong Zhi and expose Wuling dialogue/visit sets: ${JSON.stringify(twentyFifthCampState)}`);
}
await page.screenshot({ path: 'dist/verification-wuling-camp.png', fullPage: true });
await page.mouse.click(966, 38);
await page.waitForTimeout(180);
const postWulingProgressState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
postWulingProgressState?.activeTab !== 'progress' ||
postWulingProgressState.campaignProgress?.completedKnown !== 25 ||
postWulingProgressState.campaignProgress?.totalKnown !== 25 ||
postWulingProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postWulingProgressState.campaignProgress?.latestBattleTitle !== '무릉 산길 확보전' ||
postWulingProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
) {
throw new Error(`Expected post-Wuling progress tab to complete the mountain-road battle and pause on Changsha preparation: ${JSON.stringify(postWulingProgressState?.campaignProgress)}`);
}
await page.screenshot({ path: 'dist/verification-post-wuling-progress.png', fullPage: true });
await page.evaluate(() => window.__HEROS_GAME__?.scene.start('TitleScene'));
await page.waitForFunction(() => {
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
@@ -2749,7 +2892,7 @@ try {
return activeScenes.includes('CampScene');
});
console.log(`Verified title-to-twenty-fourth-battle flow, recruited officer sortie selection, Ma Liang and Yi Ji joins, result states, and debug API at ${targetUrl}`);
console.log(`Verified title-to-twenty-fifth-battle flow, recruited officer sortie selection, Ma Liang, Yi Ji, and Gong Zhi joins, result states, and debug API at ${targetUrl}`);
} finally {
await browser?.close();
if (serverProcess && !serverProcess.killed) {