Add Maicheng isolation chapter
This commit is contained in:
@@ -1739,7 +1739,7 @@ try {
|
||||
if (
|
||||
progressTabState?.activeTab !== 'progress' ||
|
||||
progressTabState.campaignProgress?.completedKnown !== 17 ||
|
||||
progressTabState.campaignProgress?.totalKnown !== 43 ||
|
||||
progressTabState.campaignProgress?.totalKnown !== 44 ||
|
||||
progressTabState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
|
||||
progressTabState.campaignProgress?.latestBattleTitle !== '융중 방문로' ||
|
||||
progressTabState.campaignProgress?.nextBattleTitle !== '박망파 매복전'
|
||||
@@ -1891,7 +1891,7 @@ try {
|
||||
if (
|
||||
postBowangProgressState?.activeTab !== 'progress' ||
|
||||
postBowangProgressState.campaignProgress?.completedKnown !== 18 ||
|
||||
postBowangProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postBowangProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postBowangProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
|
||||
postBowangProgressState.campaignProgress?.latestBattleTitle !== '박망파 매복전' ||
|
||||
postBowangProgressState.campaignProgress?.nextBattleTitle !== '장판파 피난로'
|
||||
@@ -2029,7 +2029,7 @@ try {
|
||||
if (
|
||||
postChangbanProgressState?.activeTab !== 'progress' ||
|
||||
postChangbanProgressState.campaignProgress?.completedKnown !== 19 ||
|
||||
postChangbanProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postChangbanProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postChangbanProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
|
||||
postChangbanProgressState.campaignProgress?.latestBattleTitle !== '장판파 피난로' ||
|
||||
postChangbanProgressState.campaignProgress?.nextBattleTitle !== '강동 사절로'
|
||||
@@ -2167,7 +2167,7 @@ try {
|
||||
if (
|
||||
postJiangdongProgressState?.activeTab !== 'progress' ||
|
||||
postJiangdongProgressState.campaignProgress?.completedKnown !== 20 ||
|
||||
postJiangdongProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postJiangdongProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postJiangdongProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
|
||||
postJiangdongProgressState.campaignProgress?.latestBattleTitle !== '강동 사절로' ||
|
||||
postJiangdongProgressState.campaignProgress?.nextBattleTitle !== '적벽 전초전'
|
||||
@@ -2307,7 +2307,7 @@ try {
|
||||
if (
|
||||
postRedCliffsProgressState?.activeTab !== 'progress' ||
|
||||
postRedCliffsProgressState.campaignProgress?.completedKnown !== 21 ||
|
||||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postRedCliffsProgressState.campaignProgress?.activeChapter?.title !== '적벽대전' ||
|
||||
postRedCliffsProgressState.campaignProgress?.latestBattleTitle !== '적벽 전초전' ||
|
||||
postRedCliffsProgressState.campaignProgress?.nextBattleTitle !== '적벽 화공전'
|
||||
@@ -2447,7 +2447,7 @@ try {
|
||||
if (
|
||||
postFireAttackProgressState?.activeTab !== 'progress' ||
|
||||
postFireAttackProgressState.campaignProgress?.completedKnown !== 22 ||
|
||||
postFireAttackProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postFireAttackProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postFireAttackProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postFireAttackProgressState.campaignProgress?.latestBattleTitle !== '적벽 화공전' ||
|
||||
postFireAttackProgressState.campaignProgress?.nextBattleTitle !== '형주 남부 진입전'
|
||||
@@ -2590,7 +2590,7 @@ try {
|
||||
if (
|
||||
postJingzhouProgressState?.activeTab !== 'progress' ||
|
||||
postJingzhouProgressState.campaignProgress?.completedKnown !== 23 ||
|
||||
postJingzhouProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postJingzhouProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postJingzhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postJingzhouProgressState.campaignProgress?.latestBattleTitle !== '형주 남부 진입전' ||
|
||||
postJingzhouProgressState.campaignProgress?.nextBattleTitle !== '계양 설득전'
|
||||
@@ -2732,7 +2732,7 @@ try {
|
||||
if (
|
||||
postGuiyangProgressState?.activeTab !== 'progress' ||
|
||||
postGuiyangProgressState.campaignProgress?.completedKnown !== 24 ||
|
||||
postGuiyangProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postGuiyangProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postGuiyangProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postGuiyangProgressState.campaignProgress?.latestBattleTitle !== '계양 설득전' ||
|
||||
postGuiyangProgressState.campaignProgress?.nextBattleTitle !== '무릉 산길 확보전'
|
||||
@@ -2875,7 +2875,7 @@ try {
|
||||
if (
|
||||
postWulingProgressState?.activeTab !== 'progress' ||
|
||||
postWulingProgressState.campaignProgress?.completedKnown !== 25 ||
|
||||
postWulingProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postWulingProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postWulingProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postWulingProgressState.campaignProgress?.latestBattleTitle !== '무릉 산길 확보전' ||
|
||||
postWulingProgressState.campaignProgress?.nextBattleTitle !== '장사 노장 대면전'
|
||||
@@ -3024,7 +3024,7 @@ try {
|
||||
if (
|
||||
postChangshaProgressState?.activeTab !== 'progress' ||
|
||||
postChangshaProgressState.campaignProgress?.completedKnown !== 26 ||
|
||||
postChangshaProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postChangshaProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postChangshaProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postChangshaProgressState.campaignProgress?.latestBattleTitle !== '장사 노장 대면전' ||
|
||||
postChangshaProgressState.campaignProgress?.nextBattleTitle !== '익주 원군로'
|
||||
@@ -3169,7 +3169,7 @@ try {
|
||||
if (
|
||||
postYizhouProgressState?.activeTab !== 'progress' ||
|
||||
postYizhouProgressState.campaignProgress?.completedKnown !== 27 ||
|
||||
postYizhouProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postYizhouProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postYizhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postYizhouProgressState.campaignProgress?.latestBattleTitle !== '익주 원군로' ||
|
||||
postYizhouProgressState.campaignProgress?.nextBattleTitle !== '부수관 진입전'
|
||||
@@ -3316,7 +3316,7 @@ try {
|
||||
if (
|
||||
postFuPassProgressState?.activeTab !== 'progress' ||
|
||||
postFuPassProgressState.campaignProgress?.completedKnown !== 28 ||
|
||||
postFuPassProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postFuPassProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postFuPassProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postFuPassProgressState.campaignProgress?.latestBattleTitle !== '부수관 진입전' ||
|
||||
postFuPassProgressState.campaignProgress?.nextBattleTitle !== '낙성 외곽전'
|
||||
@@ -3465,7 +3465,7 @@ try {
|
||||
if (
|
||||
postLuoProgressState?.activeTab !== 'progress' ||
|
||||
postLuoProgressState.campaignProgress?.completedKnown !== 29 ||
|
||||
postLuoProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postLuoProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postLuoProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postLuoProgressState.campaignProgress?.latestBattleTitle !== '낙성 외곽전' ||
|
||||
postLuoProgressState.campaignProgress?.nextBattleTitle !== '낙봉파 매복전'
|
||||
@@ -3611,7 +3611,7 @@ try {
|
||||
if (
|
||||
postLuofengProgressState?.activeTab !== 'progress' ||
|
||||
postLuofengProgressState.campaignProgress?.completedKnown !== 30 ||
|
||||
postLuofengProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postLuofengProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postLuofengProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postLuofengProgressState.campaignProgress?.latestBattleTitle !== '낙봉파 매복전' ||
|
||||
postLuofengProgressState.campaignProgress?.nextBattleTitle !== '낙성 본성 공략'
|
||||
@@ -3763,7 +3763,7 @@ try {
|
||||
if (
|
||||
postLuoMainProgressState?.activeTab !== 'progress' ||
|
||||
postLuoMainProgressState.campaignProgress?.completedKnown !== 31 ||
|
||||
postLuoMainProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postLuoMainProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postLuoMainProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postLuoMainProgressState.campaignProgress?.latestBattleTitle !== '낙성 본성 공략' ||
|
||||
postLuoMainProgressState.campaignProgress?.nextBattleTitle !== '면죽관 압박전'
|
||||
@@ -3916,7 +3916,7 @@ try {
|
||||
if (
|
||||
postMianzhuProgressState?.activeTab !== 'progress' ||
|
||||
postMianzhuProgressState.campaignProgress?.completedKnown !== 32 ||
|
||||
postMianzhuProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postMianzhuProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postMianzhuProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postMianzhuProgressState.campaignProgress?.latestBattleTitle !== '면죽관 압박전' ||
|
||||
postMianzhuProgressState.campaignProgress?.nextBattleTitle !== '성도 항복 권고전'
|
||||
@@ -4070,7 +4070,7 @@ try {
|
||||
if (
|
||||
postChengduProgressState?.activeTab !== 'progress' ||
|
||||
postChengduProgressState.campaignProgress?.completedKnown !== 33 ||
|
||||
postChengduProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postChengduProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postChengduProgressState.campaignProgress?.activeChapter?.title !== '촉한 건국' ||
|
||||
postChengduProgressState.campaignProgress?.latestBattleTitle !== '성도 항복 권고전' ||
|
||||
postChengduProgressState.campaignProgress?.nextBattleTitle !== '가맹관 마초 대면전'
|
||||
@@ -4225,7 +4225,7 @@ try {
|
||||
if (
|
||||
postJiamengProgressState?.activeTab !== 'progress' ||
|
||||
postJiamengProgressState.campaignProgress?.completedKnown !== 34 ||
|
||||
postJiamengProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postJiamengProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postJiamengProgressState.campaignProgress?.activeChapter?.title !== '촉한 건국' ||
|
||||
postJiamengProgressState.campaignProgress?.latestBattleTitle !== '가맹관 마초 대면전' ||
|
||||
postJiamengProgressState.campaignProgress?.nextBattleTitle !== '양평관 정찰전'
|
||||
@@ -4381,7 +4381,7 @@ try {
|
||||
if (
|
||||
postYangpingProgressState?.activeTab !== 'progress' ||
|
||||
postYangpingProgressState.campaignProgress?.completedKnown !== 35 ||
|
||||
postYangpingProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postYangpingProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postYangpingProgressState.campaignProgress?.activeChapter?.title !== '촉한 건국' ||
|
||||
postYangpingProgressState.campaignProgress?.latestBattleTitle !== '양평관 정찰전' ||
|
||||
postYangpingProgressState.campaignProgress?.nextBattleTitle !== '정군산 전초전'
|
||||
@@ -4538,7 +4538,7 @@ try {
|
||||
if (
|
||||
postDingjunProgressState?.activeTab !== 'progress' ||
|
||||
postDingjunProgressState.campaignProgress?.completedKnown !== 36 ||
|
||||
postDingjunProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postDingjunProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postDingjunProgressState.campaignProgress?.activeChapter?.title !== '촉한 건국' ||
|
||||
postDingjunProgressState.campaignProgress?.latestBattleTitle !== '정군산 전초전' ||
|
||||
postDingjunProgressState.campaignProgress?.nextBattleTitle !== '한중 결전'
|
||||
@@ -4691,7 +4691,7 @@ try {
|
||||
if (
|
||||
postHanzhongProgressState?.activeTab !== 'progress' ||
|
||||
postHanzhongProgressState.campaignProgress?.completedKnown !== 37 ||
|
||||
postHanzhongProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postHanzhongProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postHanzhongProgressState.campaignProgress?.activeChapter?.title !== '촉한 건국' ||
|
||||
postHanzhongProgressState.campaignProgress?.latestBattleTitle !== '한중 결전' ||
|
||||
postHanzhongProgressState.campaignProgress?.nextBattleTitle !== '한중왕 즉위 준비'
|
||||
@@ -4752,7 +4752,7 @@ try {
|
||||
if (
|
||||
postKingCouncilProgressState?.activeTab !== 'progress' ||
|
||||
postKingCouncilProgressState.campaignProgress?.completedKnown !== 37 ||
|
||||
postKingCouncilProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postKingCouncilProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postKingCouncilProgressState.campaignProgress?.latestBattleTitle !== '한중 결전' ||
|
||||
postKingCouncilProgressState.campaignProgress?.nextBattleTitle !== '촉한 건국 선포'
|
||||
) {
|
||||
@@ -4812,7 +4812,7 @@ try {
|
||||
if (
|
||||
postFoundationProgressState?.activeTab !== 'progress' ||
|
||||
postFoundationProgressState.campaignProgress?.completedKnown !== 37 ||
|
||||
postFoundationProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postFoundationProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postFoundationProgressState.campaignProgress?.latestBattleTitle !== '한중 결전' ||
|
||||
postFoundationProgressState.campaignProgress?.nextBattleTitle !== '형주 방위 전초전'
|
||||
) {
|
||||
@@ -4963,7 +4963,7 @@ try {
|
||||
if (
|
||||
postJingDefenseProgressState?.activeTab !== 'progress' ||
|
||||
postJingDefenseProgressState.campaignProgress?.completedKnown !== 38 ||
|
||||
postJingDefenseProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postJingDefenseProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postJingDefenseProgressState.campaignProgress?.latestBattleTitle !== '형주 방위 전초전' ||
|
||||
postJingDefenseProgressState.campaignProgress?.nextBattleTitle !== '번성 외곽 압박전'
|
||||
) {
|
||||
@@ -5116,7 +5116,7 @@ try {
|
||||
if (
|
||||
postFanCastleProgressState?.activeTab !== 'progress' ||
|
||||
postFanCastleProgressState.campaignProgress?.completedKnown !== 39 ||
|
||||
postFanCastleProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postFanCastleProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postFanCastleProgressState.campaignProgress?.latestBattleTitle !== '번성 외곽 압박전' ||
|
||||
postFanCastleProgressState.campaignProgress?.nextBattleTitle !== '한수 수공'
|
||||
) {
|
||||
@@ -5270,7 +5270,7 @@ try {
|
||||
if (
|
||||
postHanRiverProgressState?.activeTab !== 'progress' ||
|
||||
postHanRiverProgressState.campaignProgress?.completedKnown !== 40 ||
|
||||
postHanRiverProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postHanRiverProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postHanRiverProgressState.campaignProgress?.latestBattleTitle !== '한수 수공' ||
|
||||
postHanRiverProgressState.campaignProgress?.nextBattleTitle !== '번성 공성전'
|
||||
) {
|
||||
@@ -5424,7 +5424,7 @@ try {
|
||||
if (
|
||||
postFanSiegeProgressState?.activeTab !== 'progress' ||
|
||||
postFanSiegeProgressState.campaignProgress?.completedKnown !== 41 ||
|
||||
postFanSiegeProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postFanSiegeProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postFanSiegeProgressState.campaignProgress?.latestBattleTitle !== '번성 공성전' ||
|
||||
postFanSiegeProgressState.campaignProgress?.nextBattleTitle !== '강릉 나루 경계전'
|
||||
) {
|
||||
@@ -5586,7 +5586,7 @@ try {
|
||||
if (
|
||||
postJingRearProgressState?.activeTab !== 'progress' ||
|
||||
postJingRearProgressState.campaignProgress?.completedKnown !== 42 ||
|
||||
postJingRearProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postJingRearProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postJingRearProgressState.campaignProgress?.latestBattleTitle !== '강릉 나루 경계전' ||
|
||||
postJingRearProgressState.campaignProgress?.nextBattleTitle !== '공안 성문 변고'
|
||||
) {
|
||||
@@ -5741,14 +5741,172 @@ try {
|
||||
if (
|
||||
postGonganProgressState?.activeTab !== 'progress' ||
|
||||
postGonganProgressState.campaignProgress?.completedKnown !== 43 ||
|
||||
postGonganProgressState.campaignProgress?.totalKnown !== 43 ||
|
||||
postGonganProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postGonganProgressState.campaignProgress?.latestBattleTitle !== '공안 성문 변고' ||
|
||||
postGonganProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
|
||||
postGonganProgressState.campaignProgress?.nextBattleTitle !== '맥성 고립전'
|
||||
) {
|
||||
throw new Error(`Expected post-Gongan progress tab to complete the forty-third battle and leave Maicheng isolation as the next prepared slice: ${JSON.stringify(postGonganProgressState?.campaignProgress)}`);
|
||||
throw new Error(`Expected post-Gongan progress tab to complete the forty-third battle and point to Maicheng isolation: ${JSON.stringify(postGonganProgressState?.campaignProgress)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-post-gongan-progress.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(1120, 38);
|
||||
await page.waitForTimeout(180);
|
||||
const maichengSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
!maichengSortieState?.sortieVisible ||
|
||||
maichengSortieState.campaign?.step !== 'forty-third-camp' ||
|
||||
maichengSortieState.sortiePlan?.objectiveLine !== '맥성 고립전 · 맥성 포위망 돌파' ||
|
||||
maichengSortieState.sortiePlan?.maxCount !== 7 ||
|
||||
maichengSortieState.sortiePlan?.recommendedTotal !== 7 ||
|
||||
!maichengSortieState.sortieRoster?.some((unit) => unit.id === 'guan-yu' && unit.selected && unit.required) ||
|
||||
!maichengSortieState.sortieRoster?.some((unit) => unit.id === 'wang-ping' && unit.recommended) ||
|
||||
!maichengSortieState.sortieRoster?.some((unit) => unit.id === 'ma-dai' && unit.recommended)
|
||||
) {
|
||||
throw new Error(`Expected Maicheng isolation sortie prep to lock Guan Yu and expose a seven-officer breakout choice: ${JSON.stringify(maichengSortieState)}`);
|
||||
}
|
||||
assertSortieTacticalRoster(maichengSortieState, [
|
||||
'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',
|
||||
'fa-zheng',
|
||||
'wu-yi',
|
||||
'yan-yan',
|
||||
'li-yan',
|
||||
'huang-quan',
|
||||
'ma-chao',
|
||||
'ma-dai',
|
||||
'wang-ping'
|
||||
]);
|
||||
|
||||
const maichengPriorityUnits = ['wang-ping', 'zhao-yun', 'huang-zhong', 'ma-dai', 'ma-liang'];
|
||||
for (const unitId of maichengPriorityUnits) {
|
||||
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.required && !maichengPriorityUnits.includes(unit.id)
|
||||
);
|
||||
if (removable) {
|
||||
await clickSortieRosterUnit(page, removable.id);
|
||||
}
|
||||
await clickSortieRosterUnit(page, unitId);
|
||||
}
|
||||
}
|
||||
|
||||
const maichengSortieReadyState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
!maichengPriorityUnits.every((unitId) =>
|
||||
maichengSortieReadyState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)
|
||||
) ||
|
||||
!maichengSortieReadyState.sortieRoster?.some((unit) => unit.id === 'liu-bei' && unit.selected && unit.required) ||
|
||||
!maichengSortieReadyState.sortieRoster?.some((unit) => unit.id === 'guan-yu' && unit.selected && unit.required) ||
|
||||
maichengSortieReadyState.sortiePlan?.selectedCount !== 7 ||
|
||||
maichengSortieReadyState.sortiePlan?.recommendedSelectedCount < 7
|
||||
) {
|
||||
throw new Error(`Expected Maicheng isolation sortie to deploy Liu Bei, Guan Yu, Wang Ping, Zhao Yun, Huang Zhong, Ma Dai, and Ma Liang: ${JSON.stringify(maichengSortieReadyState)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-maicheng-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-maicheng-story.png', fullPage: true });
|
||||
|
||||
for (let i = 0; i < 55; i += 1) {
|
||||
const enteredFortyFourthBattle = await page.evaluate(() => {
|
||||
const state = window.__HEROS_DEBUG__?.battle();
|
||||
return state?.scene === 'BattleScene' && state?.battleId === 'forty-fourth-battle-maicheng-isolation';
|
||||
});
|
||||
if (enteredFortyFourthBattle) {
|
||||
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 === 'forty-fourth-battle-maicheng-isolation' && state?.battleOutcome === null && state?.phase === 'idle';
|
||||
});
|
||||
await page.screenshot({ path: 'dist/verification-forty-fourth-battle.png', fullPage: true });
|
||||
|
||||
const fortyFourthBattleState = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
|
||||
const fortyFourthEnemies = fortyFourthBattleState.units.filter((unit) => unit.faction === 'enemy');
|
||||
const fortyFourthAllies = fortyFourthBattleState.units.filter((unit) => unit.faction === 'ally');
|
||||
const fortyFourthEnemyBehaviors = new Set(fortyFourthEnemies.map((unit) => unit.ai));
|
||||
if (
|
||||
fortyFourthBattleState.camera?.mapWidth !== 88 ||
|
||||
fortyFourthBattleState.camera?.mapHeight !== 70 ||
|
||||
fortyFourthBattleState.victoryConditionLabel !== '맥성 포위망 돌파' ||
|
||||
fortyFourthEnemies.length < 45 ||
|
||||
!fortyFourthEnemyBehaviors.has('aggressive') ||
|
||||
!fortyFourthEnemyBehaviors.has('guard') ||
|
||||
!fortyFourthEnemyBehaviors.has('hold') ||
|
||||
!fortyFourthEnemies.some((unit) => unit.id === 'maicheng-leader-lu-meng') ||
|
||||
!fortyFourthEnemies.some((unit) => unit.id === 'maicheng-officer-lu-xun') ||
|
||||
!fortyFourthEnemies.some((unit) => unit.id === 'maicheng-officer-pan-zhang') ||
|
||||
!fortyFourthEnemies.some((unit) => unit.id === 'maicheng-officer-ma-zhong') ||
|
||||
!fortyFourthEnemies.some((unit) => unit.id === 'maicheng-officer-xu-huang') ||
|
||||
!fortyFourthAllies.some((unit) => unit.id === 'guan-yu') ||
|
||||
!fortyFourthAllies.some((unit) => unit.id === 'wang-ping') ||
|
||||
!fortyFourthAllies.some((unit) => unit.id === 'zhao-yun') ||
|
||||
!fortyFourthAllies.some((unit) => unit.id === 'huang-zhong') ||
|
||||
!fortyFourthAllies.some((unit) => unit.id === 'ma-dai')
|
||||
) {
|
||||
throw new Error(`Expected forty-fourth battle to use Maicheng isolation map, breakout objective, selected support officers, and mixed Wu/Wei AI: ${JSON.stringify(fortyFourthBattleState)}`);
|
||||
}
|
||||
|
||||
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 fortyFourthCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
fortyFourthCampState?.campBattleId !== 'forty-fourth-battle-maicheng-isolation' ||
|
||||
fortyFourthCampState.campTitle !== '맥성 고립전 후 군영' ||
|
||||
fortyFourthCampState.availableDialogueIds?.length !== 3 ||
|
||||
!fortyFourthCampState.availableDialogueIds.every((id) => id.includes('maicheng')) ||
|
||||
fortyFourthCampState.availableVisitIds?.length !== 2 ||
|
||||
!fortyFourthCampState.availableVisitIds.every((id) => id.includes('maicheng')) ||
|
||||
fortyFourthCampState.rosterCollection?.total < 22
|
||||
) {
|
||||
throw new Error(`Expected forty-fourth camp to expose Maicheng dialogue/visit sets and preserve the full officer roster: ${JSON.stringify(fortyFourthCampState)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-maicheng-camp.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(966, 38);
|
||||
await page.waitForTimeout(180);
|
||||
const postMaichengProgressState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
postMaichengProgressState?.activeTab !== 'progress' ||
|
||||
postMaichengProgressState.campaignProgress?.completedKnown !== 44 ||
|
||||
postMaichengProgressState.campaignProgress?.totalKnown !== 44 ||
|
||||
postMaichengProgressState.campaignProgress?.latestBattleTitle !== '맥성 고립전' ||
|
||||
postMaichengProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
|
||||
) {
|
||||
throw new Error(`Expected post-Maicheng progress tab to complete the forty-fourth battle and pause before the next prepared slice: ${JSON.stringify(postMaichengProgressState?.campaignProgress)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-post-maicheng-progress.png', fullPage: true });
|
||||
|
||||
await page.evaluate(() => {
|
||||
const game = window.__HEROS_GAME__;
|
||||
game?.scene.stop('CampScene');
|
||||
@@ -5781,10 +5939,10 @@ try {
|
||||
camp: window.__HEROS_DEBUG__?.camp?.() ?? null
|
||||
}));
|
||||
if (!titleContinueState.activeScenes.includes('CampScene')) {
|
||||
throw new Error(`Expected title continue to reopen the latest camp after Gongan collapse: ${JSON.stringify(titleContinueState)}`);
|
||||
throw new Error(`Expected title continue to reopen the latest camp after Maicheng isolation: ${JSON.stringify(titleContinueState)}`);
|
||||
}
|
||||
|
||||
console.log(`Verified title-to-forty-third-battle 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 Castle siege, Jing rear crisis, and Gongan collapse state at ${targetUrl}`);
|
||||
console.log(`Verified title-to-forty-fourth-battle 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 Castle siege, Jing rear crisis, Gongan collapse, and Maicheng isolation state at ${targetUrl}`);
|
||||
} finally {
|
||||
await browser?.close();
|
||||
if (serverProcess && !serverProcess.killed) {
|
||||
|
||||
Reference in New Issue
Block a user