Log inGet started
World

Painted Metropolis

Branchmain
Commit1e1d3a3d4d

README.md

roster

Pursuers as named people: who walks which beat on which day, who can be bought or

leaned on, who knows the suspect's face, and what happens when an arrangement is found out.

A roster is a list of people the game supplies as data ({ id, post, beat, days = { 1..7 }, from, to,
bribe = price?, leverage = "file id"? }). The suspect can ARRANGE with one of them (pay a bribe, or use
leverage the game says it holds) that a beat goes unwatched on one weekday. Every time an arrangement is used
there is a chance it is found out (cfg.roster.foundOut, rolled on the host's generator): then the arrangement
ends, that person is replaced for `penaltyDays` by double cover on the beat, and they will never deal again.
People who have seen the suspect up close remember the face for `faceDays`.

  local Roster = require("~.modules.roster")
  local roster = Roster.new(cfg.roster, people, rng)
  roster:onDuty("lowmarket", 3, 14.5)        -- people of a post on duty on weekday 3 at 14:30: { person, ... }
  roster:cover("arcade", 3, 14.5)            -- how many watch a beat then: 0 (arranged away), 1, or 2 (doubled)
  local ok, why = roster:arrange("w_brandt", { how = "bribe", weekday = 3, wallet = 400, holds = {} })
  -- ok, nil, cost  |  false, "unknown" | "burnt" | "no price" | "no leverage" | "sous" | "has one"
  local used = roster:use("arcade", 3, day)  -- the suspect relied on it today: nil when there is none, else
  -- { person, foundOut = bool }  (found out: the arrangement is gone and the beat is doubled from tomorrow)
  roster:sawFace("w_brandt", day)   roster:knowsFace("w_brandt", day)
  roster:dayPassed(day)                      -- expires penalties and forgotten faces
  roster:view(day)                           -- { { id, post, beat, days, from, to, bribe, leverage, arranged = weekday | nil,
                                             --     burnt, knowsFace, doubledUntil } } id order (for a screen)
  roster:serialise()   roster:restore(data)

Config (cfg.roster): foundOut = { base, perUse }  chance per use = base + perUse x earlier uses (capped at 1);
penaltyDays; faceDays.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.