session.module
README.md
session
One player: everything that is hers alone. Her paint and tools and arms, her
colour, her money and renown, her crew's trust, her vehicles, her heat and record with the Wardens, her
missions and activities, what the city remembers of her. The world she paints in (murals, district colour,
the clock, paint in the air) belongs to logic.game and is shared by every session.
local session = game:session("p1") -- made by the game (Session.new(game, id))
session:frame(dt, pf) -> view -- once a tick; `pf` is this player's frame (see logic.game)
session.hub -- her own hub: pursuitKit's events and this module's; the game
-- forwards every event to game.hub with e.player = id
Parts, all public: satchel, vanStock, painter, arms, colour, progression, crew, fleet, response (director,
theft, roster, record, roadblocks ...), runner (missions), board (activities), chronicle.
What the player does (the host calls these when the matching control is used; each returns ok, why):
session:buyTins(pigment, n) session:buyUpgrade(id) session:buyService("doctor" | "respray" | "plates" | "wash_down", arg)
session:cycleTool(step) session:cycleArm(step) session:selectArm(id) session:cyclePigment(step)
session:loadFromVan(pigment, n) session:placeStash(x, z, pigment, n) session:takeStash(index)
session:shed("jacket" | "plates", newValue) -- out of sight; needs the upgrade; once an incident
session:takeVehicle({ id, type, colour, plate, state }, witnessed) session:leaveVehicle()
session:storeVehicle(district) session:retrieveVehicle(district) session:fenceVehicle()
session:arrange(wardenId, { how, weekday }) -- bribe or lean on a named Warden
session:startMission(id) session:retryMission() session:startActivity(id) session:choose(option)
session:event(name, payload) -- something the host saw happen (talked, delivered ...)
session:rest(hour) -- pass time at a safehouse
session:serialise() session:restore(data)
Hub events added here (all carry what the UI needs to say it): "signed", "paintRefused", "fireRefused",
"billApplied", "seized", "escapeAward", "shop", "shedDone", "teach" (first time only), "districtEntered",
"vehicleTaken", "vehicleLeft", "washedOut", "revived", "reward", "stipend", "arranged", "arrangementUsed",
"ejected", plus those of progression, crew, fleet, the runner ("mission...") and the board ("activity...").
The interface is documented in the header of init.luau; this file repeats it for the asset browser.