- Clear all three standard locations to unlock custom minefields. + Clear the Training Pad and FOB Perimeter to unlock custom minefields.
) : null} diff --git a/src/lib/minigames/custom/eod.ts b/src/lib/minigames/custom/eod.ts index 7e515c9..659770a 100644 --- a/src/lib/minigames/custom/eod.ts +++ b/src/lib/minigames/custom/eod.ts @@ -23,13 +23,9 @@ export interface EodUnlockStats { bestSupplyRoadTime: number; } -/** A player unlocks the custom minefield editor once they cleared all three standard difficulties. */ +/** A player unlocks the custom minefield editor once they cleared Training Pad and FOB Perimeter. */ export function isEodUnlocked(stats: EodUnlockStats): boolean { - return ( - stats.bestTrainingTime > 0 && - stats.bestPerimeterTime > 0 && - stats.bestSupplyRoadTime > 0 - ); + return stats.bestTrainingTime > 0 && stats.bestPerimeterTime > 0; } export function validateMinefieldName(name: unknown): { error?: string; name: string } { diff --git a/tests/int/custom-minefields.int.spec.ts b/tests/int/custom-minefields.int.spec.ts index 2dfec59..d1b903f 100644 --- a/tests/int/custom-minefields.int.spec.ts +++ b/tests/int/custom-minefields.int.spec.ts @@ -465,7 +465,7 @@ describe("Custom minefields", () => { // --------------------------------------------------------------------------- describe("Unlock gating", () => { - it("locks custom minefields until a win is recorded on all three difficulties", () => { + it("locks custom minefields until Training Pad and FOB Perimeter are cleared", () => { expect( isEodUnlocked({ bestTrainingTime: 0, bestPerimeterTime: 0, bestSupplyRoadTime: 0 }), ).toBe(false); @@ -473,18 +473,24 @@ describe("Custom minefields", () => { isEodUnlocked({ bestTrainingTime: 45, bestPerimeterTime: 0, bestSupplyRoadTime: 0 }), ).toBe(false); expect( - isEodUnlocked({ bestTrainingTime: 45, bestPerimeterTime: 60, bestSupplyRoadTime: 0 }), + isEodUnlocked({ bestTrainingTime: 0, bestPerimeterTime: 60, bestSupplyRoadTime: 0 }), ).toBe(false); }); - it("unlocks once every difficulty has a best time above zero", () => { + it("unlocks once Training Pad and FOB Perimeter have best times above zero", () => { expect( - isEodUnlocked({ bestTrainingTime: 1, bestPerimeterTime: 1, bestSupplyRoadTime: 1 }), + isEodUnlocked({ bestTrainingTime: 1, bestPerimeterTime: 1, bestSupplyRoadTime: 0 }), ).toBe(true); expect( - isEodUnlocked({ bestTrainingTime: 45, bestPerimeterTime: 60, bestSupplyRoadTime: 120 }), + isEodUnlocked({ bestTrainingTime: 45, bestPerimeterTime: 60, bestSupplyRoadTime: 0 }), ).toBe(true); }); + + it("does not let a Main Supply Road win substitute for the required sectors", () => { + expect( + isEodUnlocked({ bestTrainingTime: 0, bestPerimeterTime: 0, bestSupplyRoadTime: 120 }), + ).toBe(false); + }); }); // ---------------------------------------------------------------------------