/tg/ Station 13 - Modules - Types — Var Details - Proc Details

graffiti_paint_job

A spray can painting a saved piece onto a wall, a floor or a full-tile window over time: a do_after while each layer appears in turn from the bottom, left to right in strips, the surface recomposited at each step. The can is charged once, as the piece's paint first shows. Stopping leaves the paint revealed so far, and puts the piece in the painter's Unfinished slot, ready to resume on that surface, unless a pane loosened under it, which drops the piece's paint whole.

The steps are costly work that SScustom_sprite_work runs within its overrun budget, as it runs the editors' composites, so under load they come late rather than at their time; the finish shows the whole piece when the do_after ends.

Make one, then start() it. A player runs one at a time, kept in SSgraffiti.paint_jobs while it runs.

Vars

canThe spray can painting.
layer_recordsEach layer of the piece decoded by graffiti_layer_records(), once, so that the steps only merge them.
paidWhether the can has paid for the piece: once its paint has shown, this job's or the stopped job's it resumes.
pieceThe canonical piece painted, the job's own copy.
piece_idThe library piece painted, or "unfinished" for the Unfinished slot's piece.
placementThe piece's placement on the surface, packed as SSgraffiti keeps it, or null until its art has paint. The left half of a two-tile piece.
placement2The right half's placement of a two-tile piece, packed, or null.
reveallist("progress" = strips revealed, "due" = strips the step timer has reached, which the next step reveals, "total" = strips in the piece, "per_step" = strips each tick of the step timer adds, "delay" = time between the ticks, "duration" = the do_after's time from where the job starts, before do_after applies the painter's action speed).
spray_cooldownWhen the last spray sound ends.
step_timerThe timer whose ticks make the next strips due.
surfaceThe wall, floor or window tile painted: the left tile of a two-tile piece.
userThe painter.

Procs

NewSets a job up, continuing a stopped one where resume is for this surface and the paint it left is still there, which paid for the piece.
advanceThe step timer's tick: the next strips are due, and the job asks SScustom_sprite_work to reveal them as costly work. Ticks that come while a step waits for the subsystem's overrun budget add their strips to it. The last strip waits for finish(), so a job stopped early never shows the whole piece; the tick that reaches it stops the timer.
awaitWaits out the job in a do_after on the surface, then finishes it, or stops it when the painter couldn't keep at it.
chargeCharges the can for the piece once, never refused, as its paint first shows, so a job stopped short of its last strip pays too.
costly_work_dueA step that is due merges the revealed layers and recomposites the surface: costly work, which waits for its turn among every painter's composites (SSgraffiti's composite_turn()).
credit_surfaceMarks each tile the finished piece is on as the painter's work (graffiti_credit_painter()).
finishCompletes the job: the whole piece on the surface, the can charged unless it has paid (charge()), each tile's graffiti counted as the painter's art and the painter given the graffiti achievement. A piece painted from the Unfinished slot leaves it.
interruptStops the job, leaving the paint revealed so far. The piece goes in the painter's Unfinished slot, with where to resume it while that paint is still on the surface. A pane loosened under the piece drops all of the paint revealed, both halves of a two-tile piece, and the piece goes in the slot with nowhere to resume.
owner_ckeyReturns the account the job paints for, which keeps its placements and its Unfinished piece even when the painter's body loses its player.
paintShows the piece on its tiles as far as progress reveals it: new art for each tile's placement, or, once a tile's art has paint, a new placement on top of its stack. Its time counts against every painter's composites (SSgraffiti's spend_composite()). The halves of a two-tile piece share one placement id. The first step whose paint shows charges the can (charge()). A step whose paint took the painter's own oldest pieces past their caps says so once, even one that stops the job.
piece_recordsReturns the piece's layers decoded, once, for the steps to merge.
release_surfaceLets go of the surface as the job ends: its tiles' decals let go of their merges.
run_deferred_workReveals the strips that are due on the surface, with the spray sound. A step that has to wait for the overrun budget waits in SScustom_sprite_work's queue before this runs. Each step counts as one of the painter's composites for the round, as a freehand session's do.
startStarts painting: the can shakes, the strips start appearing and the do_after runs. Nothing is placed before a strip with paint shows, and a resumed job goes on with the placements it left.
still_validWhether the painter can keep painting: holding the uncapped can and able to use it, with the surface, both tiles of a two-tile piece and of one kind, still taking graffiti and the paint revealed so far still on it.
stopped_resumeReturns where a stopped piece resumes: on its tiles while the paint revealed so far is still there. A pane loosened under the piece drops all of that paint, both halves of a two-tile piece, and it resumes nowhere.
surface_validWhether the surface still takes the job's paint: both tiles of a two-tile piece and of one kind, still taking graffiti, with the paint revealed so far still on them.
tile_artsReturns the art of each of the piece's tiles as far as progress reveals it.

Var Details

can

The spray can painting.

layer_records

Each layer of the piece decoded by graffiti_layer_records(), once, so that the steps only merge them.

paid

Whether the can has paid for the piece: once its paint has shown, this job's or the stopped job's it resumes.

piece

The canonical piece painted, the job's own copy.

piece_id

The library piece painted, or "unfinished" for the Unfinished slot's piece.

placement

The piece's placement on the surface, packed as SSgraffiti keeps it, or null until its art has paint. The left half of a two-tile piece.

placement2

The right half's placement of a two-tile piece, packed, or null.

reveal

list("progress" = strips revealed, "due" = strips the step timer has reached, which the next step reveals, "total" = strips in the piece, "per_step" = strips each tick of the step timer adds, "delay" = time between the ticks, "duration" = the do_after's time from where the job starts, before do_after applies the painter's action speed).

spray_cooldown

When the last spray sound ends.

step_timer

The timer whose ticks make the next strips due.

surface

The wall, floor or window tile painted: the left tile of a two-tile piece.

user

The painter.

Proc Details

New

Sets a job up, continuing a stopped one where resume is for this surface and the paint it left is still there, which paid for the piece.

The job takes GRAFFITI_REVEAL_BASE plus GRAFFITI_REVEAL_PER_PIXEL for each painted pixel, half that for taggers, at the painter's action speed as its do_after does. Its steps come about every GRAFFITI_REVEAL_MIN_STEP at most, a quick piece revealing several strips a step, and spread over the whole job. A resumed job takes what is left of that.

Arguments:

advance

The step timer's tick: the next strips are due, and the job asks SScustom_sprite_work to reveal them as costly work. Ticks that come while a step waits for the subsystem's overrun budget add their strips to it. The last strip waits for finish(), so a job stopped early never shows the whole piece; the tick that reaches it stops the timer.

await

Waits out the job in a do_after on the surface, then finishes it, or stops it when the painter couldn't keep at it.

charge

Charges the can for the piece once, never refused, as its paint first shows, so a job stopped short of its last strip pays too.

costly_work_due

A step that is due merges the revealed layers and recomposites the surface: costly work, which waits for its turn among every painter's composites (SSgraffiti's composite_turn()).

credit_surface

Marks each tile the finished piece is on as the painter's work (graffiti_credit_painter()).

finish

Completes the job: the whole piece on the surface, the can charged unless it has paid (charge()), each tile's graffiti counted as the painter's art and the painter given the graffiti achievement. A piece painted from the Unfinished slot leaves it.

interrupt

Stops the job, leaving the paint revealed so far. The piece goes in the painter's Unfinished slot, with where to resume it while that paint is still on the surface. A pane loosened under the piece drops all of the paint revealed, both halves of a two-tile piece, and the piece goes in the slot with nowhere to resume.

Arguments:

owner_ckey

Returns the account the job paints for, which keeps its placements and its Unfinished piece even when the painter's body loses its player.

Returns:

paint

Shows the piece on its tiles as far as progress reveals it: new art for each tile's placement, or, once a tile's art has paint, a new placement on top of its stack. Its time counts against every painter's composites (SSgraffiti's spend_composite()). The halves of a two-tile piece share one placement id. The first step whose paint shows charges the can (charge()). A step whose paint took the painter's own oldest pieces past their caps says so once, even one that stops the job.

Arguments:

Returns:

piece_records

Returns the piece's layers decoded, once, for the steps to merge.

Arguments:

Returns:

release_surface

Lets go of the surface as the job ends: its tiles' decals let go of their merges.

run_deferred_work

Reveals the strips that are due on the surface, with the spray sound. A step that has to wait for the overrun budget waits in SScustom_sprite_work's queue before this runs. Each step counts as one of the painter's composites for the round, as a freehand session's do.

Returns:

start

Starts painting: the can shakes, the strips start appearing and the do_after runs. Nothing is placed before a strip with paint shows, and a resumed job goes on with the placements it left.

Returns:

still_valid

Whether the painter can keep painting: holding the uncapped can and able to use it, with the surface, both tiles of a two-tile piece and of one kind, still taking graffiti and the paint revealed so far still on it.

Returns:

stopped_resume

Returns where a stopped piece resumes: on its tiles while the paint revealed so far is still there. A pane loosened under the piece drops all of that paint, both halves of a two-tile piece, and it resumes nowhere.

Returns:

surface_valid

Whether the surface still takes the job's paint: both tiles of a two-tile piece and of one kind, still taking graffiti, with the paint revealed so far still on them.

Returns:

tile_arts

Returns the art of each of the piece's tiles as far as progress reveals it.

Arguments:

Returns: