diff --git a/scripts/qa-representative-battles.mjs b/scripts/qa-representative-battles.mjs index 8a09783..f266c38 100644 --- a/scripts/qa-representative-battles.mjs +++ b/scripts/qa-representative-battles.mjs @@ -1833,7 +1833,7 @@ async function playBattleWithoutDebugVictory(page, battle) { return; } - if ((no === 51 || no === 52) && round >= 10) { + if ((no === 51 && round >= 10) || no === 52) { const objectives = state().objectives ?? []; const targetRoutes = no === 51 @@ -2075,6 +2075,11 @@ async function playBattleWithoutDebugVictory(page, battle) { }; function canTakeAttack(unit, attack, threat = protectedIds.has(unit.id) ? incomingThreat(unit, unit) : 0) { + const isTarget = targetIds.has(attack.target.id); + const isLeaderTarget = attack.target.id.includes('leader'); + if (no >= 47 && no <= 52 && (isLeaderTarget || isTarget) && !secureObjectivesSatisfied()) { + return false; + } if (!protectedIds.has(unit.id)) { const kill = attack.preview.damage >= attack.target.hp; const hpRate = unit.hp / Math.max(1, unit.maxHp); @@ -2090,8 +2095,6 @@ async function playBattleWithoutDebugVictory(page, battle) { return true; } const pressProtected = shouldPressProtected(unit); - const isTarget = targetIds.has(attack.target.id); - const isLeaderTarget = attack.target.id.includes('leader'); const kill = attack.preview.damage >= attack.target.hp; if (isLastProtectedFighter(unit)) { const hpRate = unit.hp / Math.max(1, unit.maxHp);