Log inGet started
Package

legacy.module

Newest version

README.md

firstlight.legacy

What the world remembers of a survivor. require("firstlight.legacy").

  • Legacy.note(text) — add a line to the current day's journal entry (deduplicated). Any slice may call it for a notable event.
  • Legacy.journalLine(day) — the line for day: clock, weather words, stove, stores, frostbite, the bear, the notes.
  • Legacy.recordDay(day) — append that line to Rules.state.journal.
  • Legacy.die(cause, day?, emitted?) — end the run: run.alive = false, run.deaths += 1, the last journal line, the cache (a quarter of every store, on Rules.state.run.cache), the save. Emits death { cause, day } unless emitted says the event is already on the bus. Returns false when the run was already over.
  • Legacy.newRun() — the next run from the death screen. Resets body, clock and stores to the start values plus the cache; keeps journal, seed, deaths, hut.gaps and stores.holeDrilled. Emits newRun { deaths, cache }.
  • Legacy.cache() — the cache the last survivor left, or nil.