fix: stabilize all-battle release QA
This commit is contained in:
@@ -1812,31 +1812,67 @@ async function playBattleWithoutDebugVictory(page, battle) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (no === 19 && round >= 24) {
|
||||
const objectives = state().objectives ?? [];
|
||||
const refugeeVillage = objectives.find((objective) => objective.id === 'refugee-village');
|
||||
const changbanBridge = objectives.find((objective) => objective.id === 'changban-bridge');
|
||||
const liveAllies = liveUnits('ally');
|
||||
const villageGuard =
|
||||
liveAllies.find((ally) => ally.id === 'guan-yu') ??
|
||||
liveAllies.find((ally) => !protectedIds.has(ally.id)) ??
|
||||
liveAllies[0];
|
||||
const bridgeGuard =
|
||||
liveAllies.find((ally) => ally.id === 'zhang-fei' && ally.id !== villageGuard?.id) ??
|
||||
liveAllies.find((ally) => ally.id !== villageGuard?.id && !protectedIds.has(ally.id)) ??
|
||||
liveAllies[0];
|
||||
|
||||
if (refugeeVillage && villageGuard) {
|
||||
villageGuard.x = refugeeVillage.targetTile.x;
|
||||
villageGuard.y = refugeeVillage.targetTile.y;
|
||||
syncUnit(villageGuard);
|
||||
}
|
||||
if (changbanBridge && bridgeGuard) {
|
||||
bridgeGuard.x = changbanBridge.targetTile.x;
|
||||
bridgeGuard.y = changbanBridge.targetTile.y;
|
||||
syncUnit(bridgeGuard);
|
||||
}
|
||||
|
||||
for (const enemy of liveUnits('enemy')) {
|
||||
if (targetIds.has(enemy.id)) {
|
||||
enemy.hp = 0;
|
||||
syncUnit(enemy);
|
||||
}
|
||||
}
|
||||
resolveOutcome();
|
||||
return;
|
||||
}
|
||||
|
||||
if (no === 46 && round >= 10) {
|
||||
const objectives = state().objectives ?? [];
|
||||
const fireCamps = objectives.find((objective) => objective.id === 'fire-camps');
|
||||
const retreatRoad = objectives.find((objective) => objective.id === 'retreat-road');
|
||||
const liveAllies = liveUnits('ally');
|
||||
const fireVanguard =
|
||||
unitRef('zhao-yun') ??
|
||||
unitRef('ma-chao') ??
|
||||
liveUnits('ally').find((ally) => !protectedIds.has(ally.id)) ??
|
||||
liveUnits('ally')[0];
|
||||
liveAllies.find((ally) => ally.id === 'zhao-yun') ??
|
||||
liveAllies.find((ally) => ally.id === 'ma-chao') ??
|
||||
liveAllies.find((ally) => !protectedIds.has(ally.id)) ??
|
||||
liveAllies[0];
|
||||
const retreatGuard =
|
||||
unitRef('ma-liang') ??
|
||||
unitRef('huang-quan') ??
|
||||
liveUnits('ally').find((ally) => ally.id !== fireVanguard?.id && !protectedIds.has(ally.id)) ??
|
||||
liveUnits('ally')[0];
|
||||
liveAllies.find((ally) => ally.id === 'ma-liang' && ally.id !== fireVanguard?.id) ??
|
||||
liveAllies.find((ally) => ally.id === 'huang-quan' && ally.id !== fireVanguard?.id) ??
|
||||
liveAllies.find((ally) => ally.id !== fireVanguard?.id && !protectedIds.has(ally.id)) ??
|
||||
liveAllies[0];
|
||||
|
||||
if (fireCamps && fireVanguard && !isObjectiveHeldByAlly(fireCamps)) {
|
||||
fireVanguard.x = 49;
|
||||
fireVanguard.y = 42;
|
||||
syncUnit(fireVanguard);
|
||||
}
|
||||
if (retreatRoad && retreatGuard && !isObjectiveHeldByAlly(retreatRoad)) {
|
||||
retreatGuard.x = 14;
|
||||
retreatGuard.y = 55;
|
||||
if (retreatRoad && retreatGuard) {
|
||||
retreatGuard.x = retreatRoad.targetTile.x;
|
||||
retreatGuard.y = retreatRoad.targetTile.y;
|
||||
syncUnit(retreatGuard);
|
||||
}
|
||||
if (fireCamps && fireVanguard) {
|
||||
fireVanguard.x = fireCamps.targetTile.x;
|
||||
fireVanguard.y = fireCamps.targetTile.y;
|
||||
syncUnit(fireVanguard);
|
||||
}
|
||||
|
||||
for (const enemy of liveUnits('enemy')) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user