Add Fu Pass entry chapter

This commit is contained in:
2026-06-23 09:14:41 +09:00
parent 17cbaab55d
commit 8349d1044f
11 changed files with 1260 additions and 34 deletions

View File

@@ -1736,7 +1736,7 @@ try {
if (
progressTabState?.activeTab !== 'progress' ||
progressTabState.campaignProgress?.completedKnown !== 17 ||
progressTabState.campaignProgress?.totalKnown !== 27 ||
progressTabState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postBowangProgressState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postChangbanProgressState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postJiangdongProgressState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postFireAttackProgressState.campaignProgress?.totalKnown !== 28 ||
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 !== 27 ||
postJingzhouProgressState.campaignProgress?.totalKnown !== 28 ||
postJingzhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postJingzhouProgressState.campaignProgress?.latestBattleTitle !== '형주 남부 진입전' ||
postJingzhouProgressState.campaignProgress?.nextBattleTitle !== '계양 설득전'
@@ -2729,7 +2729,7 @@ try {
if (
postGuiyangProgressState?.activeTab !== 'progress' ||
postGuiyangProgressState.campaignProgress?.completedKnown !== 24 ||
postGuiyangProgressState.campaignProgress?.totalKnown !== 27 ||
postGuiyangProgressState.campaignProgress?.totalKnown !== 28 ||
postGuiyangProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postGuiyangProgressState.campaignProgress?.latestBattleTitle !== '계양 설득전' ||
postGuiyangProgressState.campaignProgress?.nextBattleTitle !== '무릉 산길 확보전'
@@ -2872,7 +2872,7 @@ try {
if (
postWulingProgressState?.activeTab !== 'progress' ||
postWulingProgressState.campaignProgress?.completedKnown !== 25 ||
postWulingProgressState.campaignProgress?.totalKnown !== 27 ||
postWulingProgressState.campaignProgress?.totalKnown !== 28 ||
postWulingProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postWulingProgressState.campaignProgress?.latestBattleTitle !== '무릉 산길 확보전' ||
postWulingProgressState.campaignProgress?.nextBattleTitle !== '장사 노장 대면전'
@@ -3021,7 +3021,7 @@ try {
if (
postChangshaProgressState?.activeTab !== 'progress' ||
postChangshaProgressState.campaignProgress?.completedKnown !== 26 ||
postChangshaProgressState.campaignProgress?.totalKnown !== 27 ||
postChangshaProgressState.campaignProgress?.totalKnown !== 28 ||
postChangshaProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postChangshaProgressState.campaignProgress?.latestBattleTitle !== '장사 노장 대면전' ||
postChangshaProgressState.campaignProgress?.nextBattleTitle !== '익주 원군로'
@@ -3166,15 +3166,162 @@ try {
if (
postYizhouProgressState?.activeTab !== 'progress' ||
postYizhouProgressState.campaignProgress?.completedKnown !== 27 ||
postYizhouProgressState.campaignProgress?.totalKnown !== 27 ||
postYizhouProgressState.campaignProgress?.totalKnown !== 28 ||
postYizhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postYizhouProgressState.campaignProgress?.latestBattleTitle !== '익주 원군로' ||
postYizhouProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
postYizhouProgressState.campaignProgress?.nextBattleTitle !== '부수관 진입전'
) {
throw new Error(`Expected post-Yi Province progress tab to complete the relief-road battle and pause on Fu Pass preparation: ${JSON.stringify(postYizhouProgressState?.campaignProgress)}`);
throw new Error(`Expected post-Yi Province progress tab to complete the relief-road battle and open Fu Pass entry: ${JSON.stringify(postYizhouProgressState?.campaignProgress)}`);
}
await page.screenshot({ path: 'dist/verification-post-yizhou-progress.png', fullPage: true });
await page.mouse.click(1120, 38);
await page.waitForTimeout(180);
const fuPassSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
!fuPassSortieState?.sortieVisible ||
!fuPassSortieState.sortiePlan?.objectiveLine?.includes('부수관 진입전') ||
!fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'pang-tong' && unit.recruited && unit.recommended) ||
!fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'zhuge-liang' && unit.recruited && unit.recommended) ||
!fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'huang-zhong' && unit.recruited && unit.recommended) ||
!fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'wei-yan' && unit.recruited && unit.recommended) ||
!fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'zhao-yun' && unit.recruited && unit.recommended) ||
fuPassSortieState.sortieRoster?.some((unit) => unit.id === 'fa-zheng') ||
fuPassSortieState.sortieRoster?.length < 14 ||
fuPassSortieState.sortiePlan?.maxCount !== 6
) {
throw new Error(`Expected twenty-seventh camp sortie prep to target Fu Pass with Pang Tong selectable and Fa Zheng absent before victory: ${JSON.stringify(fuPassSortieState)}`);
}
assertSortieTacticalRoster(fuPassSortieState, [
'liu-bei',
'guan-yu',
'zhang-fei',
'jian-yong',
'mi-zhu',
'sun-qian',
'zhao-yun',
'zhuge-liang',
'ma-liang',
'yi-ji',
'gong-zhi',
'huang-zhong',
'wei-yan',
'pang-tong'
]);
const fuPassPriorityUnits = ['pang-tong', 'zhuge-liang', 'wei-yan', 'huang-zhong', 'zhao-yun'];
for (const unitId of fuPassPriorityUnits) {
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' && !fuPassPriorityUnits.includes(unit.id)
);
if (removable) {
await clickSortieRosterUnit(page, removable.id);
}
await clickSortieRosterUnit(page, unitId);
}
}
const fuPassSortieReadyState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
!fuPassPriorityUnits.every((unitId) =>
fuPassSortieReadyState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)
) ||
fuPassSortieReadyState.sortiePlan?.selectedCount !== 6 ||
fuPassSortieReadyState.sortiePlan?.recommendedSelectedCount < 6
) {
throw new Error(`Expected Fu Pass sortie to deploy Pang Tong, Zhuge Liang, Wei Yan, Huang Zhong, and Zhao Yun while preserving six-officer pressure: ${JSON.stringify(fuPassSortieReadyState)}`);
}
await page.screenshot({ path: 'dist/verification-fupass-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-fupass-story.png', fullPage: true });
for (let i = 0; i < 50; i += 1) {
const enteredTwentyEighthBattle = await page.evaluate(() => {
const state = window.__HEROS_DEBUG__?.battle();
return state?.scene === 'BattleScene' && state?.battleId === 'twenty-eighth-battle-fu-pass-entry';
});
if (enteredTwentyEighthBattle) {
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-eighth-battle-fu-pass-entry' && state?.battleOutcome === null && state?.phase === 'idle';
});
await page.screenshot({ path: 'dist/verification-twenty-eighth-battle.png', fullPage: true });
const twentyEighthBattleState = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
const twentyEighthEnemies = twentyEighthBattleState.units.filter((unit) => unit.faction === 'enemy');
const twentyEighthAllies = twentyEighthBattleState.units.filter((unit) => unit.faction === 'ally');
const twentyEighthEnemyBehaviors = new Set(twentyEighthEnemies.map((unit) => unit.ai));
if (
twentyEighthBattleState.camera?.mapWidth !== 56 ||
twentyEighthBattleState.camera?.mapHeight !== 38 ||
twentyEighthBattleState.victoryConditionLabel !== '고패 퇴각' ||
twentyEighthEnemies.length < 20 ||
!twentyEighthEnemyBehaviors.has('aggressive') ||
!twentyEighthEnemyBehaviors.has('guard') ||
!twentyEighthEnemyBehaviors.has('hold') ||
!twentyEighthEnemies.some((unit) => unit.id === 'fupass-leader-gao-pei') ||
!twentyEighthAllies.some((unit) => unit.id === 'pang-tong') ||
!twentyEighthAllies.some((unit) => unit.id === 'huang-zhong') ||
!twentyEighthAllies.some((unit) => unit.id === 'wei-yan') ||
twentyEighthAllies.some((unit) => unit.id === 'fa-zheng')
) {
throw new Error(`Expected twenty-eighth battle to use Fu Pass map, Gao Pei objective, Pang Tong as selectable ally, mixed AI, and no Fa Zheng before victory: ${JSON.stringify(twentyEighthBattleState)}`);
}
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 twentyEighthCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
twentyEighthCampState?.campBattleId !== 'twenty-eighth-battle-fu-pass-entry' ||
twentyEighthCampState.campTitle !== '부수관 진입 후 군영' ||
twentyEighthCampState.availableDialogueIds?.length !== 3 ||
!twentyEighthCampState.availableDialogueIds.every((id) => id.endsWith('fupass')) ||
twentyEighthCampState.availableVisitIds?.length !== 2 ||
!twentyEighthCampState.campaign?.roster?.some((unit) => unit.id === 'fa-zheng') ||
!twentyEighthCampState.sortieRoster?.some((unit) => unit.id === 'fa-zheng' && unit.recruited) ||
twentyEighthCampState.rosterCollection?.total < 15
) {
throw new Error(`Expected twenty-eighth camp to recruit Fa Zheng and expose Fu Pass dialogue/visit sets: ${JSON.stringify(twentyEighthCampState)}`);
}
await page.screenshot({ path: 'dist/verification-fupass-camp.png', fullPage: true });
await page.mouse.click(966, 38);
await page.waitForTimeout(180);
const postFuPassProgressState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (
postFuPassProgressState?.activeTab !== 'progress' ||
postFuPassProgressState.campaignProgress?.completedKnown !== 28 ||
postFuPassProgressState.campaignProgress?.totalKnown !== 28 ||
postFuPassProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
postFuPassProgressState.campaignProgress?.latestBattleTitle !== '부수관 진입전' ||
postFuPassProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
) {
throw new Error(`Expected post-Fu Pass progress tab to complete the pass-entry battle and pause on Luo Castle preparation: ${JSON.stringify(postFuPassProgressState?.campaignProgress)}`);
}
await page.screenshot({ path: 'dist/verification-post-fupass-progress.png', fullPage: true });
await page.evaluate(() => window.__HEROS_GAME__?.scene.start('TitleScene'));
await page.waitForFunction(() => {
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
@@ -3186,7 +3333,7 @@ try {
return activeScenes.includes('CampScene');
});
console.log(`Verified title-to-twenty-seventh-battle flow, recruited officer sortie selection, Ma Liang, Yi Ji, Gong Zhi, Huang Zhong, Wei Yan, and Pang Tong joins, result states, and debug API at ${targetUrl}`);
console.log(`Verified title-to-twenty-eighth-battle flow, recruited officer sortie selection, Ma Liang, Yi Ji, Gong Zhi, Huang Zhong, Wei Yan, Pang Tong, and Fa Zheng joins, result states, and debug API at ${targetUrl}`);
} finally {
await browser?.close();
if (serverProcess && !serverProcess.killed) {