Orbi-Fax: secret page 1000, open only after Orbi-Raiders Story mode
Page 1000 shows Paul's exact text: "CONGRATULATIONS, YOUNG TRAVELLER. / YOU HAVE REACHED THE END OF TELETEXT. / THERE IS NOTHING HERE. / PLEASE GO OUTSIDE." It types out as 999 does (all at once with Reduce motion), and Back returns to the page before. - It opens only for a profile whose own Arcade save says Story mode is complete, read through StoryProgress -> ArcadeProgress.isStoryComplete. - ArcadeProgress is a stub returning false until the Arcade's own lands. - Orbi-Fax never writes Arcade data. No profile, a Kids profile without the Arcade, or any failure reading the save means locked. - Locked, there's no trace: three-digit picker and keys, no index entry, 999 unchanged. - Unlocked, the picker gains a fourth digit and the keys can reach 1000. - Adds 8 tests, the P1000 concept preview, and the generator writing four-digit page numbers in the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -232,4 +232,88 @@ class OrbiFaxTest {
|
||||
val page = built(OrbiFaxPages(data().copy(records = records)), ORBI_FAX_ARCADE)
|
||||
assertTrue(page.rowText(5).startsWith(" STAR CHASE")); assertTrue(page.rowText(5).trimEnd().endsWith("12,480"))
|
||||
}
|
||||
|
||||
// ---- page 1000, the secret past the wizard ----
|
||||
|
||||
private val adultA = Profile("a", "Paul", "ollie", ProfileKind.Grown)
|
||||
private val adultB = Profile("b", "Guest", "zip", ProfileKind.Grown)
|
||||
|
||||
@Test fun lockedThereIsNoWayToPage1000AndNoHint() {
|
||||
val book = OrbiFaxPages(data())
|
||||
val keyed = OrbiFaxNav().digit(1).digit(0).digit(0).digit(0)
|
||||
assertEquals(100, keyed.page); assertEquals("0", keyed.typed) // three digits, as ever
|
||||
assertEquals(3, OrbiFaxNav().press(OrbiFaxKey.Cyan, book)!!.picker!!.digits.size)
|
||||
assertEquals(ORBI_FAX_INDEX, OrbiFaxNav().go(ORBI_FAX_SECRET_PAGE).page)
|
||||
assertFalse(ORBI_FAX_SECRET_PAGE in book.pages); assertFalse(ORBI_FAX_SECRET_PAGE in book.choices(100))
|
||||
assertFalse((0 until 25).any { built(book, 100).rowText(it).contains("1000") })
|
||||
assertFalse((0 until 25).any { built(book, 999).rowText(it).contains("1000") })
|
||||
}
|
||||
|
||||
@Test fun unlockedTheNumberKeysAndAFourDigitPickerReachIt() {
|
||||
val book = OrbiFaxPages(data().copy(secret = true))
|
||||
val waiting = OrbiFaxNav(secret = true).digit(1).digit(0).digit(0)
|
||||
assertEquals("100", waiting.typed) // waits a moment for a fourth digit
|
||||
assertEquals(ORBI_FAX_SECRET_PAGE, waiting.digit(0).page)
|
||||
assertEquals(100, waiting.settle().page) // none came: page 100
|
||||
assertEquals(510, OrbiFaxNav(secret = true).digit(5).digit(1).digit(0).page)
|
||||
var nav = OrbiFaxNav(secret = true).press(OrbiFaxKey.Cyan, book)!!
|
||||
assertEquals(listOf(0, 1, 0, 0), nav.picker!!.digits)
|
||||
nav = nav.press(OrbiFaxKey.Up, book)!!.press(OrbiFaxKey.Right, book)!!.press(OrbiFaxKey.Down, book)!!
|
||||
assertEquals(listOf(1, 0, 0, 0), nav.picker!!.digits)
|
||||
assertEquals(ORBI_FAX_SECRET_PAGE, nav.press(OrbiFaxKey.Ok, book)!!.page)
|
||||
assertFalse(ORBI_FAX_SECRET_PAGE in book.pages); assertFalse(ORBI_FAX_SECRET_PAGE in book.choices(100)) // still no index entry
|
||||
}
|
||||
|
||||
@Test fun backFromPage1000ReturnsToThePageBefore() {
|
||||
val book = OrbiFaxPages(data().copy(secret = true))
|
||||
val there = OrbiFaxNav(page = 700, secret = true).go(ORBI_FAX_SECRET_PAGE)
|
||||
assertEquals(700, there.back)
|
||||
val back = there.press(OrbiFaxKey.Back, book)!!
|
||||
assertEquals(700, back.page); assertTrue(back.secret)
|
||||
assertNull(back.press(OrbiFaxKey.Back, book)) // and from there, back to the TV
|
||||
}
|
||||
|
||||
@Test fun page1000SaysExactlyWhatPaulWroteAndTypesItOut() {
|
||||
val book = OrbiFaxPages(data().copy(secret = true))
|
||||
val nav = OrbiFaxNav(secret = true).go(ORBI_FAX_SECRET_PAGE)
|
||||
val page = built(book, ORBI_FAX_SECRET_PAGE, nav = nav)
|
||||
assertTrue(page.rowText(0).startsWith("P1000 ORBI-FAX 1000"))
|
||||
assertEquals(listOf("CONGRATULATIONS, YOUNG TRAVELLER.", "YOU HAVE REACHED THE END OF TELETEXT.", "THERE IS NOTHING HERE.", "PLEASE GO OUTSIDE."),
|
||||
listOf(5, 9, 13, 17).map { page.rowText(it).trim() })
|
||||
val typing = TeletextPage().also { book.build(it, ORBI_FAX_SECRET_PAGE, 0, now, zone, reveal = 41) }
|
||||
assertEquals("CONGRATULATIONS, YOUNG TRAVELLER.", typing.rowText(5).trim())
|
||||
assertEquals("YOU HAVE", typing.rowText(9).trim())
|
||||
assertEquals("", typing.rowText(13).trim())
|
||||
// Locked, the same number is just a page that isn't there.
|
||||
assertTrue(built(OrbiFaxPages(data()), ORBI_FAX_SECRET_PAGE).rowText(6).contains("no page 1000"))
|
||||
}
|
||||
|
||||
@Test fun theUnlockIsEachProfilesOwn() {
|
||||
val done = StoryProgress { it == "a" }
|
||||
assertTrue(orbiFaxSecret(adultA, done)); assertFalse(orbiFaxSecret(adultB, done))
|
||||
val d = orbiFaxData(emptyList(), emptyMap(), null, { emptyList() }, OrbiFaxPages.records(0, 0, 0, 0, 0, 0, 0, 0), adultA, now, zone, progress = done)
|
||||
assertTrue(d.secret)
|
||||
assertFalse(orbiFaxData(emptyList(), emptyMap(), null, { emptyList() }, OrbiFaxPages.records(0, 0, 0, 0, 0, 0, 0, 0), adultB, now, zone, progress = done).secret)
|
||||
}
|
||||
|
||||
@Test fun kidsUnlockItOnlyWithTheArcadeAllowed() {
|
||||
val all = StoryProgress { true }
|
||||
assertTrue(orbiFaxSecret(Profile("k", "Kids", "ollie", ProfileKind.Kids, arcade = true), all))
|
||||
assertFalse(orbiFaxSecret(Profile("k", "Kids", "ollie", ProfileKind.Kids, arcade = false), all))
|
||||
}
|
||||
|
||||
@Test fun aMissingOrUnreadableSaveMeansLocked() {
|
||||
assertFalse(orbiFaxSecret(adultA, StoryProgress { false })) // no file, or no flag
|
||||
assertFalse(orbiFaxSecret(adultA, StoryProgress { throw org.json.JSONException("bad") })) // a file that won't parse
|
||||
assertFalse(orbiFaxSecret(adultA, StoryProgress { throw java.io.IOException("gone") }))
|
||||
assertFalse(orbiFaxSecret(null, StoryProgress { true })) // no profile at all
|
||||
assertFalse(ArcadeProgress.isStoryComplete("a")) // the stub, until the Arcade's lands
|
||||
}
|
||||
|
||||
@Test fun page999IsTheSameForEveryoneLockedOrNot() {
|
||||
val locked = built(OrbiFaxPages(data()), 999)
|
||||
val unlocked = built(OrbiFaxPages(data().copy(secret = true)), 999, nav = OrbiFaxNav(page = 999, secret = true))
|
||||
for (r in 1 until 24) assertEquals("row $r", locked.rowText(r), unlocked.rowText(r))
|
||||
assertEquals(ORBI_FAX_WARNING, listOf(3, 5, 7, 9).joinToString(" ") { unlocked.rowText(it).substring(21).trim() })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user