/tg/ Station 13 - Modules - TypesVar Details - Proc Details

bodypart_overlay

Bodypart ovarlay datum. These can be added to any limb to give them a proper overlay, that'll even stay if the limb gets removed This is the abstract parent, don't use it!!

Vars

blocks_emissiveWhether the overlay blocks emissive light
draw_on_husksCan this overlay be drawn on husked mobs?
layersAssoc list [icon state postfix] to [layer of overlay].
offset_locationDetermines body area of the overlay for height offsets

Procs

added_to_limbCalled on being added to a limb.
can_draw_on_bodypartChecks whether the bodypart overlay can be drawn on the mob/bodypart. Used so snouts are hidden by masks and whatnot.
clear_layerUsed for removing layers at runtime
color_imageUsed to color the image, if necessary. By default it does nothing.
get_all_overlaysReturns a list of overlays that this overlay datum draws
get_emissive_overlayReturns the emissive appearance copy of the base_overlay, if it's meant to have one. Assumes that you ran through needs_emissive_at_layer() beforehand. Mainly intended for /datum/bodypart_overlay/mutant and its subtypes.
get_imageThe actual proc where images / mutable appearances are generated for get_overlay Must be implemented by subtypes, at its simplest it should just return an image
get_layer_postfixesGets all the layer postfixes for this bodypart overlay
get_overlayHandles generating an individual overlay or an overlay + an emissive blocker
huskify_imageHelper to make an image look like a husk. Returns the husk-ified image, doesn't modify the original image.
icon_render_keyUsed in human rendering to cache generated bodyparts. Anything your bodypart overlay can change - such as color, icon state, etc - should be included in this, otherwise you'll end up with caching issues where different looking overlays will share the same cache and thus look the same.
needs_emissive_at_layerWhether or not this bodypart_overlay should have an emissive at that layer. Intended to be used by /datum/bodypart_overlay/mutant and its subtypes. If you use this, completely override it, don't call parent.
removed_from_limbCalled on being removed from a limb.
set_appearanceUsed by subtypes to change the appearance of the overlay. Typically implemented in tandem with a sprite accessory.
set_layerUsed for adding a layer at runtime
set_layersUsed for adding layers at runtime

Var Details

blocks_emissive

Whether the overlay blocks emissive light

draw_on_husks

Can this overlay be drawn on husked mobs?

layers

Assoc list [icon state postfix] to [layer of overlay].

For simple overlays this will be a list of one element, but for more complicated overlays, this can be any number of component layers.

Example: layers = list("front" = BODY_LAYER_FRONT) // - one layer, with icon state "[iconstate]_front" layers = list("adjacent" = BODY_LAYER_ADJACENT, "behind" = BODY_LAYER_BEHIND) // - two layers, one is "[iconstate]_adjacent", the other is "[iconstate]_behind" layers = list("layer1" = BODY_LAYER_ADJACENT, "layer2" = BODY_LAYER_BEHIND) // - two layers, with icon states "[iconstate]_layer1" and "[iconstate]_layer2" layers = list("" = BODY_LAYER_FRONT) // - one layer, with icon state "[iconstate]"

This is cached, so be careful editing it at runtime (use the helpers!)

offset_location

Determines body area of the overlay for height offsets

Proc Details

added_to_limb

Called on being added to a limb.

can_draw_on_bodypart

Checks whether the bodypart overlay can be drawn on the mob/bodypart. Used so snouts are hidden by masks and whatnot.

Returns TRUE if we can draw Returns FALSE if we can't draw

clear_layer

Used for removing layers at runtime

color_image

Used to color the image, if necessary. By default it does nothing.

get_all_overlays

Returns a list of overlays that this overlay datum draws

Returns a list of images/mutable appearances

get_emissive_overlay

Returns the emissive appearance copy of the base_overlay, if it's meant to have one. Assumes that you ran through needs_emissive_at_layer() beforehand. Mainly intended for /datum/bodypart_overlay/mutant and its subtypes.

get_image

The actual proc where images / mutable appearances are generated for get_overlay Must be implemented by subtypes, at its simplest it should just return an image

Returns an image/mutable appearance to draw on the mob.

get_layer_postfixes

Gets all the layer postfixes for this bodypart overlay

get_overlay

Handles generating an individual overlay or an overlay + an emissive blocker

Returns a list of images/mutable appearances, usually just one, but can be two if we need an emissive blocker

huskify_image

Helper to make an image look like a husk. Returns the husk-ified image, doesn't modify the original image.

icon_render_key

Used in human rendering to cache generated bodyparts. Anything your bodypart overlay can change - such as color, icon state, etc - should be included in this, otherwise you'll end up with caching issues where different looking overlays will share the same cache and thus look the same.

Returns a list of strings/numbers/whatever that represents the unique appearance of the overlay.

needs_emissive_at_layer

Whether or not this bodypart_overlay should have an emissive at that layer. Intended to be used by /datum/bodypart_overlay/mutant and its subtypes. If you use this, completely override it, don't call parent.

removed_from_limb

Called on being removed from a limb.

set_appearance

Used by subtypes to change the appearance of the overlay. Typically implemented in tandem with a sprite accessory.

set_layer

Used for adding a layer at runtime

set_layers

Used for adding layers at runtime