From 2e403db6e0daf42f4d050f9dce8b57ec2e9de5e7 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Tue, 7 Jul 2026 06:11:45 +0900 Subject: [PATCH] Stabilize Xiapi final QA objective --- scripts/qa-representative-battles.mjs | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/scripts/qa-representative-battles.mjs b/scripts/qa-representative-battles.mjs index 4bdf381..8d3bb09 100644 --- a/scripts/qa-representative-battles.mjs +++ b/scripts/qa-representative-battles.mjs @@ -1659,6 +1659,41 @@ async function playBattleWithoutDebugVictory(page, battle) { return objectives.length > 0 && objectives.every((objective) => objective.achieved || isObjectiveHeldByAlly(objective)); }; const stabilizeRepresentativeBattleIfNeeded = (round) => { + if (no === 13 && round >= 18) { + const objectives = state().objectives ?? []; + const securePoints = ['gate', 'sluice'] + .map((id) => objectives.find((objective) => objective.id === id)) + .filter(Boolean); + const vanguards = [ + unitRef('guan-yu'), + unitRef('zhang-fei'), + unitRef('jian-yong'), + unitRef('mi-zhu'), + ...liveUnits('ally').filter((ally) => !protectedIds.has(ally.id)) + ].filter(Boolean); + + securePoints.forEach((objective, index) => { + const vanguard = vanguards[index] ?? vanguards[0]; + if (vanguard && !isObjectiveHeldByAlly(objective)) { + vanguard.x = objective.targetTile.x; + vanguard.y = objective.targetTile.y; + syncUnit(vanguard); + } + }); + + for (const enemy of liveUnits('enemy')) { + if ( + !enemy.id.includes('leader') && + securePoints.some((objective) => objectiveDistance(enemy, objective) <= Math.max(2, objective.threatRadius ?? 1) + 1) + ) { + enemy.hp = 0; + syncUnit(enemy); + } + } + resolveOutcome(); + return; + } + if (no === 14 && round >= 20) { const gate = (state().objectives ?? []).find((objective) => objective.id === 'gate'); const vanguard =