Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage pursuitKit.package·originates fromworld 0a0b119f-a…

arrest

Being caught, as a staged sequence with hooks, and its bill as an itemised list.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

arrest

Being caught, as a staged sequence with hooks, and its bill as an itemised list.

The stages are data (cfg.arrest.stages), each with a name, a duration and what the suspect may do in it:
  breakable + breakHold   the suspect can get free by holding the break input that long, if it has a charge
  skippableAfter          the stage can be ended early by the skip input after that many seconds
  control                 a name for the host's input layer ("break", "skip", "none")
The sequence moves nobody and draws nothing. It calls hooks at every boundary so animation, camera and UI stay
in step with it:

  local Arrest = require("~.modules.arrest")
  local seq = Arrest.new(cfg.arrest, {
      onStage = function(stage, ctx) end,          -- a stage begins: play the animation, cut the camera, show UI
      onStageEnd = function(stage, ctx) end,
      onBreak = function(ctx) end,                 -- the suspect got free
      onDone = function(ctx) end,                  -- the last stage ended
  })
  seq:begin({ charges = 1, by = "w3", level = 2, bill = bill })     -- ctx is passed to every hook
  local status = seq:tick(dt, { breakHeld = false, skip = false })  -- "running" | "broke" | "done" | "idle"
  seq:view()   -- { stage, index, count, time, duration, progress, breakable, breakProgress, canSkip, charges }

The bill is computed by a pure function from rules the game supplies, so the UI shows exactly what is taken:

  local bill = Arrest.bill({
      fine = { base = 40, perLevel = 35, walletShare = 0.5 },   -- min(wallet * share, base + perLevel * level)
      confiscate = { carried = true, vehicle = true, vehicleWithin = 30 },
      strikes = 1, maxStrikes = 3, hours = 2,
  }, { wallet = 180, level = 2, carried = 9, vehicleStock = 40, vehicleDistance = 12, vehicleProtected = false,
       strikes = 0, work = "fish-market wall" })
  -- { lines = { { key = "fine", amount = 90 }, { key = "carried", amount = 9 }, { key = "vehicle", amount = 40 },
  --             { key = "work", name = "fish-market wall" }, { key = "strike", amount = 1, total = 1 },
  --             { key = "hours", amount = 2 } },
  --   fine = 90, carried = 9, vehicle = 40, strikes = 1, hours = 2, work = "fish-market wall" }

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

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

pursuitKit.modules.arrest — being caught, as a staged sequence with hooks, and its bill as an itemised list. The stages are data (cfg.arrest.stages), each with a name, a duration and what the suspect may do in it: breakable + breakHold the suspect can get free by holding the break input that long, if it has a charge skippableAfter the stage can be ended early by the skip input after that many seconds control a name for the host's input layer ("break", "skip", "none") The sequence moves nobody and draws nothing. It calls hooks at every boundary so animation, camera and UI stay in step with it: local Arrest = require("~.modules.arrest") local seq = Arrest.new(cfg.arrest, { onStage = function(stage, ctx) end, -- a stage begins: play the animation, cut the camera, show UI onStageEnd = function(stage, ctx) end, onBreak = function(ctx) end, -- the suspect got free onDone = function(ctx) end, -- the last stage ended }) seq:begin({ charges = 1, by = "w3", level = 2, bill = bill }) -- ctx is passed to every hook local status = seq:tick(dt, { breakHeld = false, skip = false }) -- "running" | "broke" | "done" | "idle" seq:view() -- { stage, index, count, time, duration, progress, breakable, breakProgress, canSkip, charges } The bill is computed by a pure function from rules the game supplies, so the UI shows exactly what is taken: local bill = Arrest.bill({ fine = { base = 40, perLevel = 35, walletShare = 0.5 }, -- min(wallet * share, base + perLevel * level) confiscate = { carried = true, vehicle = true, vehicleWithin = 30 }, strikes = 1, maxStrikes = 3, hours = 2, }, { wallet = 180, level = 2, carried = 9, vehicleStock = 40, vehicleDistance = 12, vehicleProtected = false, strikes = 0, work = "fish-market wall" }) -- { lines = { { key = "fine", amount = 90 }, { key = "carried", amount = 9 }, { key = "vehicle", amount = 40 }, -- { key = "work", name = "fish-market wall" }, { key = "strike", amount = 1, total = 1 }, -- { key = "hours", amount = 2 } }, -- fine = 90, carried = 9, vehicle = 40, strikes = 1, hours = 2, work = "fish-market wall" }

new(cfg: any, hooks: any?) → any

A new sequence, idle until begin().

argtypedescription
cfgany
hooksany?

call(self: any, name: string, a: any, b: any?) → void

argtypedescription
selfany
namestring
aany
bany?

enter(self: any, index: number) → void

argtypedescription
selfany
indexnumber

begin(ctx: any?) → void

Start the sequence. `ctx.charges` is how many times the suspect may break free.

argtypedescription
ctxany?

isActive( ) → boolean

stage( ) → any

The current stage's config, or nil when idle.

tick(dt: number, input: any?) → string

Advance. `input.breakHeld`: the break input is down; `input.skip`: the skip input was pressed.

argtypedescription
dtnumber
inputany?

view( ) → any

What a UI needs to draw the sequence.

bill(rules: any, facts: any) → any

The itemised cost of an arrest. See the header for `rules` and `facts`. Nothing is applied: the host applies it.

argtypedescription
rulesany
factsany

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.