Improve final unit move turn prompt

This commit is contained in:
2026-06-24 16:58:39 +09:00
parent 9fae89a55f
commit 3eda3e8d14
2 changed files with 88 additions and 17 deletions

View File

@@ -237,7 +237,7 @@ try {
throw new Error(`Expected positional bond bonuses and reduced counter damage: ${JSON.stringify(combatMechanicsProbe)}`);
}
const moveWaitTurnPromptState = await page.evaluate(() => {
const moveWaitTurnPromptStates = await page.evaluate(() => {
const scene = window.__HEROS_GAME__?.scene.getScene('BattleScene');
const state = window.__HEROS_DEBUG__?.battle();
const lastAlly = state?.units?.find((unit) => unit.id === 'zhang-fei');
@@ -261,11 +261,26 @@ try {
scene.selectUnit(liveLastAlly);
scene.moveSelectedUnit(liveLastAlly.x, liveLastAlly.y);
const postMoveState = window.__HEROS_DEBUG__?.battle();
scene.completeUnitAction(liveLastAlly, 'wait');
return window.__HEROS_DEBUG__?.battle();
const postWaitState = window.__HEROS_DEBUG__?.battle();
return { postMoveState, postWaitState };
});
if (!moveWaitTurnPromptState?.turnPromptVisible || moveWaitTurnPromptState.phase !== 'idle') {
throw new Error(`Expected move-wait completion to show turn-end prompt: ${JSON.stringify(moveWaitTurnPromptState)}`);
if (
!moveWaitTurnPromptStates?.postMoveState?.turnPromptVisible ||
moveWaitTurnPromptStates.postMoveState.turnPromptMode !== 'post-move' ||
moveWaitTurnPromptStates.postMoveState.phase !== 'command' ||
moveWaitTurnPromptStates.postMoveState.pendingMove?.unitId !== 'zhang-fei' ||
moveWaitTurnPromptStates.postMoveState.actedUnitIds?.includes('zhang-fei')
) {
throw new Error(`Expected final ally move to show post-move turn prompt: ${JSON.stringify(moveWaitTurnPromptStates)}`);
}
if (
!moveWaitTurnPromptStates.postWaitState?.turnPromptVisible ||
moveWaitTurnPromptStates.postWaitState.turnPromptMode !== 'turn-end' ||
moveWaitTurnPromptStates.postWaitState.phase !== 'idle'
) {
throw new Error(`Expected move-wait completion to show turn-end prompt: ${JSON.stringify(moveWaitTurnPromptStates)}`);
}
await page.evaluate(() => {