Add Guiyang persuasion chapter
This commit is contained in:
@@ -1736,7 +1736,7 @@ try {
|
||||
if (
|
||||
progressTabState?.activeTab !== 'progress' ||
|
||||
progressTabState.campaignProgress?.completedKnown !== 17 ||
|
||||
progressTabState.campaignProgress?.totalKnown !== 23 ||
|
||||
progressTabState.campaignProgress?.totalKnown !== 24 ||
|
||||
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 !== 23 ||
|
||||
postBowangProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
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 !== 23 ||
|
||||
postChangbanProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
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 !== 23 ||
|
||||
postJiangdongProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
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 !== 23 ||
|
||||
postRedCliffsProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
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 !== 23 ||
|
||||
postFireAttackProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
postFireAttackProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postFireAttackProgressState.campaignProgress?.latestBattleTitle !== '적벽 화공전' ||
|
||||
postFireAttackProgressState.campaignProgress?.nextBattleTitle !== '형주 남부 진입전'
|
||||
@@ -2587,15 +2587,157 @@ try {
|
||||
if (
|
||||
postJingzhouProgressState?.activeTab !== 'progress' ||
|
||||
postJingzhouProgressState.campaignProgress?.completedKnown !== 23 ||
|
||||
postJingzhouProgressState.campaignProgress?.totalKnown !== 23 ||
|
||||
postJingzhouProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
postJingzhouProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postJingzhouProgressState.campaignProgress?.latestBattleTitle !== '형주 남부 진입전' ||
|
||||
postJingzhouProgressState.campaignProgress?.nextBattleTitle !== '준비 중'
|
||||
postJingzhouProgressState.campaignProgress?.nextBattleTitle !== '계양 설득전'
|
||||
) {
|
||||
throw new Error(`Expected post-Jing Province progress tab to complete the new chapter opening and pause on next commandery preparation: ${JSON.stringify(postJingzhouProgressState?.campaignProgress)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-post-jingzhou-progress.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(1120, 38);
|
||||
await page.waitForTimeout(180);
|
||||
const guiyangSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
!guiyangSortieState?.sortieVisible ||
|
||||
!guiyangSortieState.sortiePlan?.objectiveLine?.includes('계양 설득전') ||
|
||||
!guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'ma-liang' && unit.recruited && unit.recommended) ||
|
||||
!guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'zhuge-liang' && unit.recruited && unit.recommended) ||
|
||||
!guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'zhao-yun' && unit.recruited && unit.recommended) ||
|
||||
!guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'guan-yu' && unit.recommended) ||
|
||||
!guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'sun-qian' && unit.recruited && unit.recommended) ||
|
||||
guiyangSortieState.sortieRoster?.some((unit) => unit.id === 'yi-ji') ||
|
||||
guiyangSortieState.sortieRoster?.length < 9 ||
|
||||
guiyangSortieState.sortiePlan?.maxCount !== 6
|
||||
) {
|
||||
throw new Error(`Expected twenty-third camp sortie prep to target Guiyang with Ma Liang recommended and Yi Ji absent before victory: ${JSON.stringify(guiyangSortieState)}`);
|
||||
}
|
||||
assertSortieTacticalRoster(guiyangSortieState, [
|
||||
'liu-bei',
|
||||
'guan-yu',
|
||||
'zhang-fei',
|
||||
'jian-yong',
|
||||
'mi-zhu',
|
||||
'sun-qian',
|
||||
'zhao-yun',
|
||||
'zhuge-liang',
|
||||
'ma-liang'
|
||||
]);
|
||||
|
||||
const guiyangPriorityUnits = ['ma-liang', 'zhuge-liang', 'zhao-yun', 'guan-yu', 'sun-qian'];
|
||||
for (const unitId of guiyangPriorityUnits) {
|
||||
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' && !guiyangPriorityUnits.includes(unit.id)
|
||||
);
|
||||
if (removable) {
|
||||
await clickSortieRosterUnit(page, removable.id);
|
||||
}
|
||||
await clickSortieRosterUnit(page, unitId);
|
||||
}
|
||||
}
|
||||
|
||||
const guiyangSortieReadyState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
!guiyangPriorityUnits.every((unitId) =>
|
||||
guiyangSortieReadyState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)
|
||||
) ||
|
||||
guiyangSortieReadyState.sortiePlan?.selectedCount !== 6 ||
|
||||
guiyangSortieReadyState.sortiePlan?.recommendedSelectedCount < 6
|
||||
) {
|
||||
throw new Error(`Expected Guiyang sortie to deploy Ma Liang and other recommended officers while preserving six-officer pressure: ${JSON.stringify(guiyangSortieReadyState)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-guiyang-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-guiyang-story.png', fullPage: true });
|
||||
|
||||
for (let i = 0; i < 50; i += 1) {
|
||||
const enteredTwentyFourthBattle = await page.evaluate(() => {
|
||||
const state = window.__HEROS_DEBUG__?.battle();
|
||||
return state?.scene === 'BattleScene' && state?.battleId === 'twenty-fourth-battle-guiyang-persuasion';
|
||||
});
|
||||
if (enteredTwentyFourthBattle) {
|
||||
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-fourth-battle-guiyang-persuasion' && state?.battleOutcome === null && state?.phase === 'idle';
|
||||
});
|
||||
await page.screenshot({ path: 'dist/verification-twenty-fourth-battle.png', fullPage: true });
|
||||
|
||||
const twentyFourthBattleState = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
|
||||
const twentyFourthEnemies = twentyFourthBattleState.units.filter((unit) => unit.faction === 'enemy');
|
||||
const twentyFourthAllies = twentyFourthBattleState.units.filter((unit) => unit.faction === 'ally');
|
||||
const twentyFourthEnemyBehaviors = new Set(twentyFourthEnemies.map((unit) => unit.ai));
|
||||
if (
|
||||
twentyFourthBattleState.camera?.mapWidth !== 48 ||
|
||||
twentyFourthBattleState.camera?.mapHeight !== 32 ||
|
||||
twentyFourthBattleState.victoryConditionLabel !== '조범 항복' ||
|
||||
twentyFourthEnemies.length < 17 ||
|
||||
!twentyFourthEnemyBehaviors.has('aggressive') ||
|
||||
!twentyFourthEnemyBehaviors.has('guard') ||
|
||||
!twentyFourthEnemyBehaviors.has('hold') ||
|
||||
!twentyFourthEnemies.some((unit) => unit.id === 'guiyang-leader-zhao-fan') ||
|
||||
!twentyFourthAllies.some((unit) => unit.id === 'ma-liang') ||
|
||||
!twentyFourthAllies.some((unit) => unit.id === 'zhuge-liang') ||
|
||||
!twentyFourthAllies.some((unit) => unit.id === 'sun-qian') ||
|
||||
twentyFourthAllies.some((unit) => unit.id === 'yi-ji')
|
||||
) {
|
||||
throw new Error(`Expected twenty-fourth battle to use Guiyang map, Zhao Fan objective, mixed AI, selected allied officers, and no Yi Ji before victory: ${JSON.stringify(twentyFourthBattleState)}`);
|
||||
}
|
||||
|
||||
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 twentyFourthCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
twentyFourthCampState?.campBattleId !== 'twenty-fourth-battle-guiyang-persuasion' ||
|
||||
twentyFourthCampState.campTitle !== '계양 설득전 후 군영' ||
|
||||
twentyFourthCampState.availableDialogueIds?.length !== 3 ||
|
||||
!twentyFourthCampState.availableDialogueIds.every((id) => id.endsWith('guiyang')) ||
|
||||
twentyFourthCampState.availableVisitIds?.length !== 2 ||
|
||||
!twentyFourthCampState.campaign?.roster?.some((unit) => unit.id === 'yi-ji') ||
|
||||
!twentyFourthCampState.sortieRoster?.some((unit) => unit.id === 'yi-ji' && unit.recruited) ||
|
||||
twentyFourthCampState.rosterCollection?.total < 10
|
||||
) {
|
||||
throw new Error(`Expected twenty-fourth camp to recruit Yi Ji and expose Guiyang dialogue/visit sets: ${JSON.stringify(twentyFourthCampState)}`);
|
||||
}
|
||||
await page.screenshot({ path: 'dist/verification-guiyang-camp.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(966, 38);
|
||||
await page.waitForTimeout(180);
|
||||
const postGuiyangProgressState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (
|
||||
postGuiyangProgressState?.activeTab !== 'progress' ||
|
||||
postGuiyangProgressState.campaignProgress?.completedKnown !== 24 ||
|
||||
postGuiyangProgressState.campaignProgress?.totalKnown !== 24 ||
|
||||
postGuiyangProgressState.campaignProgress?.activeChapter?.title !== '형주·익주 확보' ||
|
||||
postGuiyangProgressState.campaignProgress?.latestBattleTitle !== '계양 설득전' ||
|
||||
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.evaluate(() => window.__HEROS_GAME__?.scene.start('TitleScene'));
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
@@ -2607,7 +2749,7 @@ try {
|
||||
return activeScenes.includes('CampScene');
|
||||
});
|
||||
|
||||
console.log(`Verified title-to-twenty-third-battle flow, recruited officer sortie selection, Ma Liang join, result states, and debug API at ${targetUrl}`);
|
||||
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}`);
|
||||
} finally {
|
||||
await browser?.close();
|
||||
if (serverProcess && !serverProcess.killed) {
|
||||
|
||||
Reference in New Issue
Block a user