Log inGet started
World

Hullbreaker

Branchmain
Branchesmain
Commitcdbe4bf730

README.md

game.reset

Puts the Kestrel Wake — and the scrapper flying around inside her — back the way a run finds them.

shell clears the run's numbers when a player asks for another go: air back to full, tonnage back to zero, instability back to zero, and phase("briefing") on the bus. This module is the other half of that restart. It clears the world:

  • the suit stands down — nothing on the clamp, no velocity, back at the skiff
  • every plate on the manifest is bolted back on, welds whole, out of the shaft
  • the hazard rig is rebuilt, so members that let go are holding again
  • the skiff's cargo maw is restored if something took it

It also owns pointer lock, because that single piece of state decides whether the mouse aims the helmet or moves a cursor, and the game needs both:

phasepointerwhy
runningcapturedthe mouse is the helmet
briefing / won / lostfreea card is up and its button has to be clickable

Using it

local Reset = require("game.reset")

Reset.install()        -- subscribe to `phase`, once per game.rules load
Reset.restore()        -- put the world back right now
Reset.ensureDock()     -- restore the cargo maw if the skiff lost it

install() is idempotent and guards on the rules module rather than on this chunk, so a hot reload does not stack a second handler.