mutant
Variant of bodypart_overlay meant to work synchronously with external organs. Gets imprinted upon Insert in on_species_gain
Vars | |
alpha | Alpha value associated to the overlay, to be inherited from the parent limb. |
---|---|
cache_key_extra_information | Additional information we might want to add to the cache_key, stored into a list. Should only ever contain strings. |
color_source | Where does this organ inherit its color from? |
draw_color | The color this organ draws with. Updated by bodypart/inherit_color() |
emissive_eligibility_by_color_index | An associative list of color indexes (i.e. "1") to boolean that says whether or not that color should get an emissive overlay. Can be null. |
feature_key | Defines what kind of 'organ' we're looking at. Sprites have names like 'm_mothwings_firemoth_ADJ'. 'mothwings' would then be feature_key |
imprint_on_next_insertion | Take on the dna/preference from whoever we're gonna be inserted in |
last_built_icon_states | A simple cache of what the last icon_states built were. It's really only there to help with debugging what's happening. |
modsuit_affected | Whether or not this overlay can be affected by MODsuit-related procs. |
overlay_indexes_to_color | A simple list of indexes to color (as we don't want to color emissives, MOD overlays or inner ears) |
sprite_datum | Sprite datum we use to draw on the bodypart |
Procs | |
add_emissives | Helper proc to add the appropriate emissives to the overlays, based on the preferences. |
build_emissive_eligibility | Builds emissive_eligibility_by_layer from the input list of three booleans.
Will not do anything if the given argument is null . |
build_icon_state | Helper to generate the icon_state for the bodypart_overlay we're trying to draw. |
color_images | Colors the given overlays list. Limb can be null. This is different from the base procs as it allows for multiple overlays to be colored at once. Useful for matrixed color mutant bodyparts. |
fetch_sprite_datum | Sprite accessories are singletons, stored list("Big Snout" = instance of /datum/sprite_accessory/snout/big), so here we get that singleton |
fetch_sprite_datum_from_name | Get the singleton from the sprite name |
generate_icon_cache | Generate a unique key based on our sprites. So that if we've aleady drawn these sprites, they can be found in the cache and wont have to be drawn again (blessing and curse, but mostly curse) |
get_base_icon_state | Return the BASE icon state of the sprite datum (so not the gender, layer, feature_key) |
get_color_layer_names | Returns the color_layer_names of the sprite_datum associated with our datum. Mainly here so that it can be overriden elsewhere to have other effects. |
get_feature_key_for_overlay | Helper to fetch the feature_key of the bodypart_overlay, so that it can be
overriden in the cases where feature_key is not what we want to use here. |
get_global_feature_list | Return a dumb glob list for this specific feature (called from parse_sprite) |
get_image | Get the image we need to draw on the person. Called from get_overlay() which is called from _bodyparts.dm. Limb can be null |
get_images | Get the images we need to draw on the person. Called from get_overlay() which is called from _bodyparts.dm.
limb can be null.
This is different from the base procs as it allows for multiple overlays to
be generated for one bodypart_overlay. Useful for matrixed color mutant bodyparts. |
get_random_appearance | Grab a random appearance datum (thats not locked) |
get_singular_image | Helper to generate one individual image for a multi-image overlay. Very similar to get_image(), just a little simplified. |
inherit_color | Give the organ its color. Force will override the existing one. |
randomize_appearance | Completely random image and color generation (obeys what a player can choose from) |
randomize_sprite | Grab a random sprite |
set_appearance | Change our accessory sprite, using the accesssory type. If you need to change the sprite for something, use simple_change_sprite() |
set_appearance_from_dna | Allows us to set the appearance from data that's located within the provided DNA, for a little more control over what exactly is displayed. |
set_appearance_from_name | In a lot of cases, appearances are stored in DNA as the Name, instead of the path. Use set_appearance instead of possible |
set_modsuit_status | Helper to set the MOD-related info on the overlay, useful for MODsuit overlays. |
Var Details
alpha
Alpha value associated to the overlay, to be inherited from the parent limb.
cache_key_extra_information
Additional information we might want to add to the cache_key, stored into a list. Should only ever contain strings.
color_source
Where does this organ inherit its color from?
draw_color
The color this organ draws with. Updated by bodypart/inherit_color()
emissive_eligibility_by_color_index
An associative list of color indexes (i.e. "1") to boolean that says whether or not that color should get an emissive overlay. Can be null.
feature_key
Defines what kind of 'organ' we're looking at. Sprites have names like 'm_mothwings_firemoth_ADJ'. 'mothwings' would then be feature_key
imprint_on_next_insertion
Take on the dna/preference from whoever we're gonna be inserted in
last_built_icon_states
A simple cache of what the last icon_states built were. It's really only there to help with debugging what's happening.
modsuit_affected
Whether or not this overlay can be affected by MODsuit-related procs.
overlay_indexes_to_color
A simple list of indexes to color (as we don't want to color emissives, MOD overlays or inner ears)
sprite_datum
Sprite datum we use to draw on the bodypart
Proc Details
add_emissives
Helper proc to add the appropriate emissives to the overlays, based on the preferences.
Arguments:
- overlays - The list of mutable appearances previously generated and colored.
- limb - The limb containing this bodypart_overlay. Cannot be null, otherwise there's going to be issues with how the emissives are generated, so it won't add them if the limb is missing, somehow.
build_emissive_eligibility
Builds emissive_eligibility_by_layer
from the input list of three booleans.
Will not do anything if the given argument is null
.
build_icon_state
Helper to generate the icon_state for the bodypart_overlay we're trying to draw.
Arguments:
- gender - The gender of the limb. Can be "f" or "m".
- image_layer - The layer on which the icon will be drawn.
- color_layer - The color_layer of this icon_state, if any. Should be either "primary", "secondary", "tertiary" or
null
. Defaults tonull
. - feature_key_suffix - A string that will be directly appended to the result
of
get_feature_key_for_overlay()
. Defaults tonull
.
color_images
Colors the given overlays list. Limb can be null. This is different from the base procs as it allows for multiple overlays to be colored at once. Useful for matrixed color mutant bodyparts.
fetch_sprite_datum
Sprite accessories are singletons, stored list("Big Snout" = instance of /datum/sprite_accessory/snout/big), so here we get that singleton
fetch_sprite_datum_from_name
Get the singleton from the sprite name
generate_icon_cache
Generate a unique key based on our sprites. So that if we've aleady drawn these sprites, they can be found in the cache and wont have to be drawn again (blessing and curse, but mostly curse)
get_base_icon_state
Return the BASE icon state of the sprite datum (so not the gender, layer, feature_key)
get_color_layer_names
Returns the color_layer_names of the sprite_datum associated with our datum. Mainly here so that it can be overriden elsewhere to have other effects.
get_feature_key_for_overlay
Helper to fetch the feature_key
of the bodypart_overlay, so that it can be
overriden in the cases where feature_key
is not what we want to use here.
get_global_feature_list
Return a dumb glob list for this specific feature (called from parse_sprite)
get_image
Get the image we need to draw on the person. Called from get_overlay() which is called from _bodyparts.dm. Limb can be null
get_images
Get the images we need to draw on the person. Called from get_overlay() which is called from _bodyparts.dm.
limb
can be null.
This is different from the base procs as it allows for multiple overlays to
be generated for one bodypart_overlay. Useful for matrixed color mutant bodyparts.
get_random_appearance
Grab a random appearance datum (thats not locked)
get_singular_image
Helper to generate one individual image for a multi-image overlay. Very similar to get_image(), just a little simplified.
Arguments:
- image_icon_state - The icon_state of the mutable_appearance we want to get.
- image_layer - The layer of the mutable_appearance we want to get.
- owner - The owner of the limb this is drawn on. Can be null.
- icon_override - The icon to use for the mutable_appearance, rather than
sprite_datum.icon
. Default isnull
, and its value will be used if it's anything else.
inherit_color
Give the organ its color. Force will override the existing one.
randomize_appearance
Completely random image and color generation (obeys what a player can choose from)
randomize_sprite
Grab a random sprite
set_appearance
Change our accessory sprite, using the accesssory type. If you need to change the sprite for something, use simple_change_sprite()
set_appearance_from_dna
Allows us to set the appearance from data that's located within the provided DNA, for a little more control over what exactly is displayed.
Arguments:
- dna - The
/datum/dna
datum from which we're going to be extracting the data to set the - accessory_name - instead of using the name from mutant_bodyparts[feature_key][MUTANT_INDEX_NAME] you can optionally pass one explicitly
- feature_key - same as with accessory_key, you can optionally pass a feature_key explicitly appearance.
set_appearance_from_name
In a lot of cases, appearances are stored in DNA as the Name, instead of the path. Use set_appearance instead of possible
set_modsuit_status
Helper to set the MOD-related info on the overlay, useful for MODsuit overlays.
Arguments:
- status - boolean of whether or not this overlay should currently be under the effect of MODsuit overlays.