Painted Metropolis
README.md
record
The suspect's standing record: strikes that fade, and things that were taken and
sit in an impound until they are paid for, broken out, or sold.
Being caught leaves two lasting marks. STRIKES make every observer notice faster (the config's `strikes`
section reads them) and fade one at a time as days pass. CONFISCATION takes real things (a vehicle, a tool, a
stash): each becomes an item in the impound with a fee that grows by the day and a date after which it is sold.
What an item IS belongs to the game (its `data` is carried, never read); the record only holds it.
local Record = require("~.modules.record")
local record = Record.new(cfg.record)
record:strike(1, day) record.strikes
local item = record:confiscate({ id = "van", kind = "vehicle", data = anything }, day)
record:impounded(day) -- { { id, kind, fee, daysLeft, since, data } } oldest first
record:fee("van", day) -- what releasing it costs today (nil when it is not there)
local back = record:release("van", "pay" | "break", day) -- the item, out of the impound (the host charges
-- the fee for "pay"; "break" is the host's own adventure) or nil
local e = record:dayPassed(day) -- { faded = 0 | 1, sold = { item, ... } }
record:serialise() record:restore(data)
Config (cfg.record):
strikes = { max, fadeEvery } one strike fades every `fadeEvery` days without a new one
impound = { fee = { [kind] = sous, default = sous }, perDay, holdDays }
fee by kind of thing, plus perDay for every day it has stood; sold after holdDays
The interface is documented in the header of init.luau; this file repeats it for the asset browser.