From a8d72024f20a13c7edd67323d7292011901c146d Mon Sep 17 00:00:00 2001 From: "E.Gavrilov" Date: Tue, 18 Aug 2026 17:33:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=B1=D0=B8=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=20=D0=BF=D0=B8=D0=BB=D1=83=20=D1=83=D1=80=D0=BE=D0=B2=D0=BD?= =?UTF-8?q?=D1=8F=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game/LevelPlaytestBot.java | 6 ++- .../game/LevelPlaytestBotTest.java | 42 +++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/projectsacrifice/game/LevelPlaytestBot.java b/app/src/main/java/com/projectsacrifice/game/LevelPlaytestBot.java index e0c6c85..6ef240d 100644 --- a/app/src/main/java/com/projectsacrifice/game/LevelPlaytestBot.java +++ b/app/src/main/java/com/projectsacrifice/game/LevelPlaytestBot.java @@ -250,8 +250,10 @@ public final class LevelPlaytestBot { snapshot -> snapshot.playerAlive() && snapshot.playerX() < 250f) .step("Approach the saw", 4_000L, Input.right(), snapshot -> snapshot.playerAlive() && snapshot.playerX() >= 390f) - .step("Jump over the saw", 2_000L, Input.rightJump(), - snapshot -> snapshot.playerX() >= 430f) + .step("Take off before the saw", 1_000L, Input.rightJump(), + snapshot -> snapshot.playerAlive() && snapshot.playerY() <= 700f) + .step("Clear the saw", 2_000L, Input.right(), + snapshot -> snapshot.playerAlive() && snapshot.playerX() >= 680f) .step("Run to the ledge", 4_000L, Input.right(), snapshot -> snapshot.playerX() >= 750f) .step("Jump onto the ledge", 2_000L, Input.rightJump(), diff --git a/app/src/test/java/com/projectsacrifice/game/LevelPlaytestBotTest.java b/app/src/test/java/com/projectsacrifice/game/LevelPlaytestBotTest.java index 98bcc9a..53774dc 100644 --- a/app/src/test/java/com/projectsacrifice/game/LevelPlaytestBotTest.java +++ b/app/src/test/java/com/projectsacrifice/game/LevelPlaytestBotTest.java @@ -118,6 +118,17 @@ public final class LevelPlaytestBotTest { assertTrue(result.doorOpened()); } + @Test + public void levelFiveDelayedDecisionStillClearsTheSawWithOneVolunteer() { + LevelFiveDriver driver = new LevelFiveDriver(true); + + LevelPlaytestBot.Result result = new LevelPlaytestBot().proveLevelFive(driver, 25_000L); + + assertTrue(result.diagnostic(), result.completed()); + assertEquals(1, result.deaths()); + assertEquals(1, result.corpseCount()); + } + @Test public void automationSnapshotDefaultsToNoMovingPlatform() { GameView.AutomationSnapshot snapshot = new GameView.AutomationSnapshot( @@ -275,6 +286,7 @@ public final class LevelPlaytestBotTest { } private static final class LevelFiveDriver implements LevelPlaytestBot.Driver { + private final boolean overshootApproach; private int startedLevel; private long nowMillis; private boolean moveRight; @@ -285,6 +297,16 @@ public final class LevelPlaytestBotTest { private int deaths; private int corpses; private float x = 130f; + private float y = 760f; + private boolean sawTakeoffObserved; + + LevelFiveDriver() { + this(false); + } + + LevelFiveDriver(boolean overshootApproach) { + this.overshootApproach = overshootApproach; + } @Override public void startLevel(int oneBasedLevelNumber) { @@ -301,7 +323,7 @@ public final class LevelPlaytestBotTest { public GameView.AutomationSnapshot snapshot() { return new GameView.AutomationSnapshot( completed, alive, doorOpen, false, moveRight || jump, - startedLevel, nowMillis, x, 760f, deaths, corpses); + startedLevel, nowMillis, x, y, deaths, corpses); } @Override @@ -310,6 +332,7 @@ public final class LevelPlaytestBotTest { if (!alive) { alive = true; x = 130f; + y = 760f; } else if (deaths == 0 && moveRight && !jump) { deaths = 1; corpses = 1; @@ -317,11 +340,24 @@ public final class LevelPlaytestBotTest { doorOpen = true; x = 570f; } else if (moveRight && jump) { + if (x < 750f) { + sawTakeoffObserved = true; + y = 690f; + } x += 60f; } else if (moveRight && x < 390f) { - x = 400f; + x = overshootApproach ? 440f : 400f; } else if (moveRight && x < 750f) { - x = 760f; + if (overshootApproach && !sawTakeoffObserved) { + deaths++; + corpses++; + alive = false; + x = 510f; + y = 780f; + } else { + x = 760f; + y = 760f; + } } else if (moveRight && x < 1_390f) { x = 1_500f; } else if (moveRight) {