From 760c957818ecc3f06a9304b23abd5f161a53843d Mon Sep 17 00:00:00 2001 From: Pauljd Date: Sun, 8 Nov 2026 20:31:40 +0000 Subject: [PATCH] Orbi-Raiders: power-ups as on the Stage B sheet Paul decided the approved power-up sheet wins over the brief: Turbo Tuner lasts 10 s, Double Broadcast 12 s, and the Guide Bomb clears one row (the lowest occupied row of the grid, divers included, a Corrupt Pixel doesn't split; the Dead Channel and its sprites are immune). Tests and the prototype doc updated (43 Raiders tests pass). Co-Authored-By: Claude Opus 5.5 --- .../classic/arcade/raiders/RaidersSim.kt | 24 ++++++++++------ .../classic/arcade/raiders/RaidersSimTest.kt | 28 +++++++++++++++---- docs/VERIFICATION-orbi-raiders.md | 2 +- docs/orbi-raiders-prototype.md | 11 ++++---- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/java/tv/orbit/classic/arcade/raiders/RaidersSim.kt b/android/app/src/main/java/tv/orbit/classic/arcade/raiders/RaidersSim.kt index 7db49414..94fe8213 100644 --- a/android/app/src/main/java/tv/orbit/classic/arcade/raiders/RaidersSim.kt +++ b/android/app/src/main/java/tv/orbit/classic/arcade/raiders/RaidersSim.kt @@ -108,13 +108,13 @@ internal class Spark { var colour = 0 } -/** The six power-ups (Stage B power-up sheet, timings from the approved proposal). Four are timed and only one of those is ever on. */ +/** The six power-ups, as on the approved Stage B power-up sheet (Paul, 8 Nov 2026: the sheet wins over the brief). Four are timed and only one of those is ever on. */ internal enum class Power(val title: String, val line: String, val seconds: Float, val weight: Int) { SignalShield("Signal Shield", "Soaks up one hit", 8f, 22), - TurboTuner("Turbo Tuner", "Faster ship", 8f, 18), + TurboTuner("Turbo Tuner", "Faster ship", 10f, 18), RewindBurst("Rewind Burst", "Pushes the wave back up", 3f, 14), - DoubleBroadcast("Double Broadcast", "Two shots", 10f, 22), - GuideBomb("Guide Bomb", "Clears the weak invaders", 0f, 12), + DoubleBroadcast("Double Broadcast", "Two shots", 12f, 22), + GuideBomb("Guide Bomb", "Clears the lowest row", 0f, 12), OrbitOverdrive("Orbit Overdrive", "Fills Overdrive", 0f, 12); val timed get() = seconds > 0f @@ -675,7 +675,7 @@ internal class RaidersSim(var pilot: Pilot = Pilot.Ollie, difficulty: Difficulty kill(e) } - private fun kill(e: Enemy) { + private fun kill(e: Enemy, split: Boolean = true) { e.active = false streak++ score += Kind.points[e.kind] * multiplier @@ -686,7 +686,7 @@ internal class RaidersSim(var pilot: Pilot = Pilot.Ollie, difficulty: Difficulty // Its place in the pool is free now and may be reused by the first half, so read it all first. val kind = e.kind; val x = e.x; val y = e.y; val slotX = e.slotX; val slotY = e.slotY val mode = if (e.mode == M_FORM) M_FORM else M_RETURN - if (kind == Kind.PIXEL) { + if (split && kind == Kind.PIXEL) { spawn(Kind.PIXEL_SMALL, slotX - 8f, slotY, mode)?.let { it.x = x - 8f; it.y = y } spawn(Kind.PIXEL_SMALL, slotX + 8f, slotY, mode)?.let { it.x = x + 8f; it.y = y } } @@ -737,9 +737,15 @@ internal class RaidersSim(var pilot: Pilot = Pilot.Ollie, difficulty: Difficulty fun collect(p: Power) { events = events or Events.POWER when (p) { - Power.GuideBomb -> for (i in enemies.indices) { - val e = enemies[i] - if (e.active && (e.kind == Kind.STATIC || e.kind == Kind.PIXEL_SMALL || e.kind == Kind.GREMLIN || e.kind == Kind.MINION)) { damage += e.hp; kill(e) } + Power.GuideBomb -> { + // Clears one row of the grid: the lowest occupied formation row (its divers too), whatever the invaders in + // it are. A Corrupt Pixel caught by it doesn't split. The Dead Channel and its free-flying sprites aren't + // in a row, so they're immune. + var row = -1f + for (e in enemies) if (e.active && e.kind != Kind.MINION && e.slotY > row) row = e.slotY + if (row >= 0f) for (e in enemies) { + if (e.active && e.kind != Kind.MINION && abs(e.slotY - row) < .5f) { damage += e.hp; kill(e, split = false) } + } } Power.OrbitOverdrive -> meter = 1f else -> { power = p; powerLeft = p.seconds } diff --git a/android/app/src/test/java/tv/orbit/classic/arcade/raiders/RaidersSimTest.kt b/android/app/src/test/java/tv/orbit/classic/arcade/raiders/RaidersSimTest.kt index cd4c14e6..79a5312e 100644 --- a/android/app/src/test/java/tv/orbit/classic/arcade/raiders/RaidersSimTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/arcade/raiders/RaidersSimTest.kt @@ -205,7 +205,7 @@ class RaidersSimTest { assertEquals(Power.SignalShield, s.power) s.collect(Power.DoubleBroadcast) assertEquals(Power.DoubleBroadcast, s.power) - assertEquals(10f, s.powerLeft, .001f) + assertEquals(12f, s.powerLeft, .001f) // Instant ones don't touch the timed one. s.collect(Power.OrbitOverdrive) assertEquals(Power.DoubleBroadcast, s.power) @@ -223,7 +223,7 @@ class RaidersSimTest { s.run(4) assertNull("$p gone after ${p.seconds} s", s.power) } - assertEquals(listOf(8f, 8f, 3f, 10f), listOf(Power.SignalShield, Power.TurboTuner, Power.RewindBurst, Power.DoubleBroadcast).map { it.seconds }) + assertEquals(listOf(8f, 10f, 3f, 12f), listOf(Power.SignalShield, Power.TurboTuner, Power.RewindBurst, Power.DoubleBroadcast).map { it.seconds }) } @Test fun signalShieldSoaksUpOneHit() { @@ -235,12 +235,28 @@ class RaidersSimTest { assertEquals(2, s.bars) } - @Test fun guideBombClearsTheWeakInvadersOnly() { + @Test fun guideBombClearsTheLowestOccupiedRowOnly() { val s = sim() - s.place(Kind.STATIC, 50f, 50f); s.place(Kind.GREMLIN, 90f, 50f); s.place(Kind.PIXEL_SMALL, 130f, 50f) - val sat = s.place(Kind.SATELLITE, 170f, 50f); val void = s.place(Kind.VOID, 210f, 50f) + // Row at y 50 (higher on screen) and the lowest row at y 90, with every kind in it, a Corrupt Pixel included. + val top = listOf(s.place(Kind.STATIC, 50f, 50f), s.place(Kind.SATELLITE, 90f, 50f)) + s.place(Kind.STATIC, 50f, 90f); s.place(Kind.SATELLITE, 90f, 90f); s.place(Kind.VOID, 130f, 90f); s.place(Kind.PIXEL, 170f, 90f) s.collect(Power.GuideBomb) - assertEquals(listOf(sat, void), s.enemies.filter { it.active }) + // The whole lowest row goes, tough ones too, and the Pixel doesn't split; the row above is untouched. + assertEquals(top, s.enemies.filter { it.active }) + // A second bomb takes the next row. + s.collect(Power.GuideBomb) + assertTrue(s.enemies.none { it.active }) + } + + @Test fun guideBombLeavesTheBossAndItsSpritesAlone() { + val s = sim() + val minion = s.place(Kind.MINION, 60f, 120f) + val inRow = s.place(Kind.GREMLIN, 100f, 60f) + s.collect(Power.GuideBomb) + // The minion is lower on screen but isn't in a row, so the bomb takes the grid row and leaves the minion. + assertTrue(minion.active); assertTrue(!inRow.active) + s.collect(Power.GuideBomb) + assertTrue(minion.active) } @Test fun doubleBroadcastFiresTwoAndRewindPushesTheWaveUp() { diff --git a/docs/VERIFICATION-orbi-raiders.md b/docs/VERIFICATION-orbi-raiders.md index 15bd5386..b37a78b0 100644 --- a/docs/VERIFICATION-orbi-raiders.md +++ b/docs/VERIFICATION-orbi-raiders.md @@ -32,7 +32,7 @@ They now use Channel Chaos, which still is, and the Kids-suitable count went fro arrive in turn (Gentle a row fewer); the Dead Channel on wave 5, its attacks warned, beaten into the result card and on to wave 6; Restart Level back to the wave's start; **combo** ×2/×3/×4 thresholds, nine kills at ×1 then ×2, reset on a hit; wave-clear bonus; **power-ups: only one timed at a time, a new one replaces it**, instant ones leave it alone; each timed - one lasts its seconds; Signal Shield soaks one hit; Guide Bomb clears only the weak; Double Broadcast fires two; Rewind + one lasts its seconds; Signal Shield soaks one hit; Guide Bomb clears the lowest occupied row (bosses immune; changed 8 Nov to the power-up sheet, with Turbo Tuner 10 s and Double Broadcast 12 s); Double Broadcast fires two; Rewind pushes the wave up; Overdrive needs a full meter, each pilot's own (Luna slows time, Blaze can't be hit); Luna's shield regrows; **pause freezes the simulation** (ten seconds paused: no ticks and no time saved up); a long frame is at most 5 ticks; holding fire shoots at the fixed rate (5 shots a second for Ollie); the ship speeds up while held, Blaze faster. diff --git a/docs/orbi-raiders-prototype.md b/docs/orbi-raiders-prototype.md index 7980f4f8..92199657 100644 --- a/docs/orbi-raiders-prototype.md +++ b/docs/orbi-raiders-prototype.md @@ -67,15 +67,14 @@ timed power-up is on at a time; a new one replaces it.** The HUD shows its badge | Power-up | Kind | What it does | Chance weight | |---|---|---|---| | Signal Shield | timed, 8 s | Soaks up one hit, then goes | 22 | -| Turbo Tuner | timed, 8 s | Ship 45% faster | 18 | +| Turbo Tuner | timed, 10 s | Ship 45% faster | 18 | | Rewind Burst | timed, 3 s | Pushes the wave back up (up to 40 units) and the invaders fire at 35% | 14 | -| Double Broadcast | timed, 10 s | Two shots side by side | 22 | -| Guide Bomb | instant | Clears every weak invader on screen (Static Sprites, Gremlins, Pixel bits, the boss's sprites) | 12 | +| Double Broadcast | timed, 12 s | Two shots side by side | 22 | +| Guide Bomb | instant | Clears one row: the lowest occupied row of the grid, every invader in it (divers from that row too; a Corrupt Pixel doesn't split). The Dead Channel and its free-flying sprites are immune | 12 | | Orbit Overdrive | instant | Fills the Overdrive meter | 12 | -The timings follow the approved proposal (and Paul's brief). **The Stage B power-up sheet says Turbo Tuner 10 s, Double -Broadcast 12 s and Guide Bomb "clears a row of the grid"**; the prototype uses 8 s, 10 s and "weak invaders". One of the two -needs updating once Paul has played it. +The timings and the Guide Bomb follow the approved **Stage B power-up sheet**: Paul decided on 8 November 2026 that the +sheet wins over the brief (which had Turbo Tuner 8 s, Double Broadcast 10 s and a bomb that cleared the weak invaders). ### Score