impact
What a hit does: one place where cover, marks, surface rules and pigment properties meet.
impact
What a hit does: one place where cover, marks, surface rules and pigment properties meet.
Given a projectile that ended on something (modules/ballistics) or a cone pulse (modules/arms), it adds cover
to the thing or leaves a mark on the surface, starts the timed effects the surface rule and the pigment ask
for, bursts a splash over what stands near, and reports everything it did, including the offences the config
attaches to those moments, so the game can tell whoever tracks crimes. It owns no state of its own: it writes
to the stores it is given.
local Impact = require("~.modules.impact")
local impact = Impact.new(cfg, { cover = cover, splats = splats, field = field, query = query })
-- cover: modules/cover; splats: modules/splats; field: Surfaces.field(); query: as modules/ballistics
-- (query is only needed for splash)
local report = impact:land(event.shot, event.hit) -- after Ballistics:step returned an "impact"
local reports = impact:pulse(cone) -- a cone arm's pulse (needs query.overlap)
-- report = {
-- target, kind, part, what was hit (target nil for the static world)
-- pigment, arm, owner,
-- splat = id | nil, the mark it left
-- cover = { event, ... }, modules/cover's events for this hit (cover, effect, out)
-- effects = { { effect, id, seconds, radius, factor, x, z } }, timed effects started on the field
-- offences = { name, ... }, offences the config names for what happened, in order, no repeats
-- splashed = { report, ... } } the same for each thing the splash reached
Rules, all data: a hit on a thing whose `kind` is a cover kind adds `shot.cover` x the pigment's cover factor
(x the splash share); a "blind" effect lasts its seconds x the pigment's blind factor; a hit on anything else is
looked up in cfg.surfaces[kind] by the arm's name ("mark" leaves a splat, anything else starts an area effect
of rule.radius round the point and still leaves the mark); a pigment's own effects for that kind are added.
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/v2paintKit.modules.impact — what a hit does: one place where cover, marks, surface rules and pigment properties meet. Given a projectile that ended on something (modules/ballistics) or a cone pulse (modules/arms), it adds cover to the thing or leaves a mark on the surface, starts the timed effects the surface rule and the pigment ask for, bursts a splash over what stands near, and reports everything it did, including the offences the config attaches to those moments, so the game can tell whoever tracks crimes. It owns no state of its own: it writes to the stores it is given. local Impact = require("~.modules.impact") local impact = Impact.new(cfg, { cover = cover, splats = splats, field = field, query = query }) -- cover: modules/cover; splats: modules/splats; field: Surfaces.field(); query: as modules/ballistics -- (query is only needed for splash) local report = impact:land(event.shot, event.hit) -- after Ballistics:step returned an "impact" local reports = impact:pulse(cone) -- a cone arm's pulse (needs query.overlap) -- report = { -- target, kind, part, what was hit (target nil for the static world) -- pigment, arm, owner, -- splat = id | nil, the mark it left -- cover = { event, ... }, modules/cover's events for this hit (cover, effect, out) -- effects = { { effect, id, seconds, radius, factor, x, z } }, timed effects started on the field -- offences = { name, ... }, offences the config names for what happened, in order, no repeats -- splashed = { report, ... } } the same for each thing the splash reached Rules, all data: a hit on a thing whose `kind` is a cover kind adds `shot.cover` x the pigment's cover factor (x the splash share); a "blind" effect lasts its seconds x the pigment's blind factor; a hit on anything else is looked up in cfg.surfaces[kind] by the arm's name ("mark" leaves a splat, anything else starts an area effect of rule.radius round the point and still leaves the mark); a pigment's own effects for that kind are added.
new(cfg: any, stores: any) → any
| arg | type | description |
|---|---|---|
| cfg | any | |
| stores | any |
note(list: { string }, offence: string?) → void
| arg | type | description |
|---|---|---|
| list | { string } | |
| offence | string? |
start(self: any, report: any, e: any, id: string?, x: number, z: number) → void
| arg | type | description |
|---|---|---|
| self | any | |
| report | any | |
| e | any | |
| id | string? | |
| x | number | |
| z | number |
land(self: any, shot: any, hit: any, share: number, splash: boolean) → any
| arg | type | description |
|---|---|---|
| self | any | |
| shot | any | |
| hit | any | |
| share | number | |
| splash | boolean |
land(shot: any, hit: any) → any
A projectile ended on something. See the header for the report.
| arg | type | description |
|---|---|---|
| shot | any | |
| hit | any |
pulse(cone: any) → void
A cone arm's pulse: everything it reaches takes the pulse's cover. Returns one report per thing, nearest first.
| arg | type | description |
|---|---|---|
| cone | any |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.