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

cover

How painted a thing is, and the moment it is painted out.

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

cover

How painted a thing is, and the moment it is painted out.

Cover is the health of everything paint can stop: a guard's visor and body, a windscreen, a lens, a relay.
Nothing dies. A thing has parts (cfg.cover.kinds[kind].parts); each hit adds cover to one part; a part fires
its effects as its cover rises through their thresholds (a visor at 0.3 blinds for four seconds); when the
kind's `out` rule is met the thing is PAINTED OUT: it stops doing what it does for `out.seconds`, or until it
is repaired when the rule gives no seconds. Parts that are left alone wipe themselves clean again.

  local Cover = require("~.modules.cover")
  local cover = Cover.new(cfg.cover)
  cover:add("w3", "guard")                       -- register a thing of a kind (false for an unknown kind)
  local events = cover:hit("w3", "visor", 0.34)  -- cover added to a part (nil part: the kind's defaultPart)
  -- { type = "cover", id, kind, part, value, delta }
  -- { type = "effect", id, kind, part, effect, seconds, offence }    a threshold crossed
  -- { type = "out", id, kind, effect, seconds, offence }             painted out
  local later = cover:tick(dt)                   -- { type = "back", id, kind } when it returns; wiping happens here
  cover:isOut("w3")   cover:outLeft("w3")        -- seconds left (math.huge when it waits for repair, 0 when in)
  cover:value("w3", "visor")   cover:total("w3") -- 0..1 of a part, and the mean over its parts
  cover:repair("w3")                             -- cleaned by hand: back at once, every part empty
  cover:remove("w3")
  cover:view("w3")     -- { id, kind, out, outLeft, total, parts = { { part, value } } } for a meter over a target
  cover:serialise()    Cover.restore(cfg.cover, rows)     -- only kinds marked persist = true

A thing that is out takes no more cover until it is back.

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

paintKit.modules.cover — how painted a thing is, and the moment it is painted out. Cover is the health of everything paint can stop: a guard's visor and body, a windscreen, a lens, a relay. Nothing dies. A thing has parts (cfg.cover.kinds[kind].parts); each hit adds cover to one part; a part fires its effects as its cover rises through their thresholds (a visor at 0.3 blinds for four seconds); when the kind's `out` rule is met the thing is PAINTED OUT: it stops doing what it does for `out.seconds`, or until it is repaired when the rule gives no seconds. Parts that are left alone wipe themselves clean again. local Cover = require("~.modules.cover") local cover = Cover.new(cfg.cover) cover:add("w3", "guard") -- register a thing of a kind (false for an unknown kind) local events = cover:hit("w3", "visor", 0.34) -- cover added to a part (nil part: the kind's defaultPart) -- { type = "cover", id, kind, part, value, delta } -- { type = "effect", id, kind, part, effect, seconds, offence } a threshold crossed -- { type = "out", id, kind, effect, seconds, offence } painted out local later = cover:tick(dt) -- { type = "back", id, kind } when it returns; wiping happens here cover:isOut("w3") cover:outLeft("w3") -- seconds left (math.huge when it waits for repair, 0 when in) cover:value("w3", "visor") cover:total("w3") -- 0..1 of a part, and the mean over its parts cover:repair("w3") -- cleaned by hand: back at once, every part empty cover:remove("w3") cover:view("w3") -- { id, kind, out, outLeft, total, parts = { { part, value } } } for a meter over a target cover:serialise() Cover.restore(cfg.cover, rows) -- only kinds marked persist = true A thing that is out takes no more cover until it is back.

new(cfg: any) → any

argtypedescription
cfgany

add(id: string, kind: string) → boolean

Register a thing. Returns false when the config has no such kind. Registering again keeps its cover.

argtypedescription
idstring
kindstring

has(id: string) → boolean

argtypedescription
idstring

kind(id: string) → string

argtypedescription
idstring

remove(id: string) → void

argtypedescription
idstring

value(id: string, part: string) → number

argtypedescription
idstring
partstring

total(id: string) → number

The mean cover over a thing's parts.

argtypedescription
idstring

isOut(id: string) → boolean

argtypedescription
idstring

outLeft(id: string) → number

argtypedescription
idstring

hit(id: string, part: string?, amount: number) → void

Add cover to a part of a thing. Returns the events it caused (see the header), empty for an unknown thing.

argtypedescription
idstring
partstring?
amountnumber

clean(t: any) → void

argtypedescription
tany

repair(id: string) → boolean

Clean a thing by hand. Returns true if it was out or had any cover.

argtypedescription
idstring

tick(dt: number) → void

Count down the painted-out, and let untouched parts wipe clean. Returns { type = "back", id, kind } events in id order.

argtypedescription
dtnumber

view(id: string) → any

One thing for a meter: parts in name order.

argtypedescription
idstring

serialise( ) → void

The persistent things (kinds with persist = true) that are not clean, as plain rows in id order.

restore(cfg: any, rows: { any }) → any

A tracker holding the saved things. Things registered later with the same id keep their saved cover.

argtypedescription
cfgany
rows{ any }

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.