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_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]. |
| offset_location | Determines body area of the overlay for height offsets |
Procs | |
| 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. |
| 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 |
| 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 |
| 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 |
| 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. |
| 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 |
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.
- bodypart_owner: the bodypart we're trying to draw on, will never be null.
- owner: the mob we're trying to draw on. Likely bodypart_owner.owner, can be null.
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.
- image: the image generated by get_image() that we want to color
- limb: the limb we're drawing onto, can be null if we're just drawing a general overlay for the mob and not a specific limb.
- layer_index: the index of the layer we're drawing on, used for generating the image.
get_all_overlays
Returns a list of overlays that this overlay datum draws
- limb: the limb we're drawing onto
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
- limb: the limb we're drawing onto, can be null if we're just drawing a general overlay for the mob and not a specific limb
- layer_index: the index of the layer we're drawing on. Typically some postfix for an icon state ie. "front" or "behind" (Used like "overlay_front" or "overlay_behind"
- layer_real: the actual layer we're drawing on, used for generating the image. Some (negative) number like -10 to -30. (Used like layer = layer_real, you shouldn't need to mess with it.)
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
- limb: the limb we're drawing onto, can be null if we're just drawing a general overlay for the mob and not a specific limb
- layer_index: the index of the layer we're drawing on, used for generating the image
- layer_real: the actual layer we're drawing on, used for generating the image
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.
- limb: the limb we're drawing onto, can be null if we're just drawing a general overlay for the mob and not a specific limb.
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