▣
module · drop-in viewer
districtState
What the city remembers: each district's colour and vigilance, the
by·posted 11d ago
What it does
districtState
What the city remembers: each district's colour and vigilance, the
signed walls in it, how its people feel, and which walls the scrub crews come for.
local DistrictState = require("metropolisGame.logic.districtState")
local ds = DistrictState.new(Districts, PaintContent.sizes, Economy, hub?)
ds:signed("oldquay", "fishmarket", "piece", "clean", day) -- a wall was signed (or re-signed better)
ds:lost("oldquay", "fishmarket") -- scrubbed away
ds:colour("oldquay") -> 0..100 ds:vigilance("oldquay") -> 0..3 ds:isPainted("oldquay")
ds:incident("oldquay", peakLevel) -- an incident ended there; Wanted or worse raises vigilance
ds:paint("oldquay") -- its landmark was signed: the district is painted
ds:dayPassed(day) -> { { district, vigilance } } quiet districts cool; returns the ones that changed
ds:citizens("oldquay") -> { informer, sympathiser } shares of passers-by, turned by colour
ds:decayFactor("oldquay") -> number -- how fast heat cools there (1.5 at colour 50 and over)
ds:scrubTargets("oldquay") -> { site, ... } the walls tomorrow's crews will come for, in order
ds:paintedCount() -> number ds:walls("oldquay") -> { [site] = { size, tier, day } }
ds:view("oldquay") -> { id, colour, vigilance, painted, signed, thresholds = { tags, door, landmark } }
ds:quiet(days) -- no scrub crews anywhere for that many days (Dry Tank)
ds:serialise() ds:restore(data)
Hub events: "colour" { district, value, delta }, "threshold" { district, name }, "vigilance" { district, value,
delta }, "districtPainted" { district }.
The interface is documented in the header of init.luau; this file repeats it for the asset browser.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.