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

bodypart

Vars

any_existing_wound_can_mangle_our_exteriorIf false, no wound that can be applied to us can mangle our exterior. Used for determining if we should use [hp_percent_to_dismemberable] instead of normal dismemberment.
any_existing_wound_can_mangle_our_interiorIf false, no wound that can be applied to us can mangle our interior. Used for determining if we should use [hp_percent_to_dismemberable] instead of normal dismemberment.
applied_itemsLazylist of category to item applied to this limb
attack_typeType of an attack from this limb does. Arms will do punches, Legs for kicks, and head for bites. (TO ADD: tactical chestbumps)
augment_colorsA recolourable finish's colours, "#rrggbb" four times: paint, accent, frame, lights. Null on every other limb. A limb with them carries /datum/element/augment_paint, which draws its paint and glow and keys its icons by them.
aux_zone_markingsThe same for its aux zone (hands).
base_meat_amountHow much meat do we add to butcher_drops when automatically generating them from our species datum?
bio_statusDoes this part have an internal or external anatomy biostate? Assigned on init based on biological_state
biological_stateA bitfield of biological states, exclusively used to determine which wounds this limb will get, as well as how easily it will happen. Set to BIO_STANDARD_UNJOINTED because most species have both flesh bone and blood in their limbs.
bleed_overlay_iconIf we're bleeding, which icon are we displaying on this part
blood_dna_infoThe cached info about the blood this organ belongs to, set during on_removal()
body_damage_coeffA mutiplication of the burn and brute damage that the limb's stored damage contributes to its attached mob's overall wellbeing.
body_partbitflag used to check which clothes cover this bodypart
body_zoneBODY_ZONE_CHEST, BODY_ZONE_L_ARM, etc , used for def_zone
bodypart_disabledControls if the limb is disabled. TRUE means it is disabled (similar to being removed, but still present for the sake of targeted interactions).
bodypart_effectsLazylist of /datum/status_effect/grouped/bodypart_effect types. Instances of this are applied to the carbon when added the limb is attached, and merged with similair limbs
bodypart_flagsRandom flags that describe this bodypart
bodypart_overlaysA list of all bodypart overlays to draw
bodypart_texturesA list of all bodypart textures to apply
bodypart_trait_sourceThe name of the trait source that the organ gives. Should not be altered during the events of gameplay, and will cause problems if it is.
bodypart_traitsTraits that are given to the holder of the part. This does not update automatically on life(), only when the organs are initially generated or inserted!
bodyshapeA bitfield of bodyshapes for clothing and other sprite information
bodytypeA bitfield of bodytypes for surgery, and misc information
brute_damThe current amount of brute damage the limb has
brute_modifierBrute damage gets multiplied by this on receive_damage()
burn_damThe current amount of burn damage the limb has
burn_modifierBurn damage gets multiplied by this on receive_damage()
butcher_drop_cacheInit cache for our butcher drops for sanic speed
butcher_drops_overrideLazy assoc list of [item type] = [amount] that we drop when butchered. Overrides whatever we would drop normally based on our species datum.
butcher_replacementWhat skeleton limb, if any, we replace ourselves with when butchered?
cached_bleed_rateOur current bleed rate. Cached, update with refresh_bleed_rate()
can_be_disabledWhether it is possible for the limb to be disabled whatsoever. TRUE means that it is possible.
change_exempt_flagsDefines when a bodypart should not be changed. Example: BP_BLOCK_CHANGE_SPECIES prevents the limb from being overwritten on species gain
color_overridesAn assoc list of priority (as a string because byond) -> color, used to override draw_color.
current_styleThe bodypart's currently applied style's name. Only necessary for bodyparts that come in multiple variants, like prosthetics and cyborg bodyparts.
disabled_wound_penaltyWhen this bodypart hits max damage, this number is added to all wound rolls. Obviously only relevant for bodyparts that have damage caps.
dmg_overlay_typethe type of damage overlay (if any) to use when this bodypart is bruised/burned.
draw_colorThe actual color a limb is drawn as, set by /proc/update_limb()
embedded_objectsList of obj/item's embedded inside us. Managed by embedded components, do not modify directly
feature_offsetsList of the above datums which have actually been instantiated, managed automatically
generic_bleedstacksHow much generic bleedstacks we have on this bodypart
grappled_attack_verbif we have a special attack verb for hitting someone who is grappled by us, it goes here.
grappled_attack_verb_continuousContinuous tense grapple verb for successful attacks
grasped_byIf something is currently grasping this bodypart and trying to staunch bleeding (see /obj/item/hand_item/self_grasp)
held_indexare we a hand? if so, which one!
hp_percent_to_dismemberableIn the case we dont have dismemberable features, or literally cant get wounds, we will use this percent to determine when we can be dismembered. Compared to our ABSOLUTE maximum. Stored in decimal; 0.8 = 80%.
husk_colorThe color to multiply the greyscaled husk sprites by. Can be null. Old husk sprite chest color is #A6A6A6
husk_typeThe type of husk for building an iconstate
icon_greyscaleThe icon for Organic limbs using greyscale
icon_huskThe icon for husked limbs
icon_invisibleThe icon for invisible limbs
icon_staticThe icon for non-greyscale limbs
is_actually_just_invisibleUsed for taur limbs that do not get rendered at all
is_dimorphicIs there a sprite difference between male and female?
is_emissiveIf this limb should have emissive overlays
is_huskedWhether the bodypart (and the owner) is husked.
is_invisibleWhether the bodypart (and the owner) is invisible through invisibleman trait.
keeps_type_nameSet on our limbs whose types name them, which keep that name - tg names every other limb for its limb_id and zone, as "robotic left arm"
last_maxedSo we know if we need to scream if this limb hits max damage
limb_idThe ID of a species used to generate the icon. Needs to match the icon_state portion in the limbs file!
mangled_stateMangling state (interior, exterior) of the bodypart
marking_keyThe part of this limb's icon cache keys standing for the markings it draws, or null for none. See LIMB_MARKING_ICON_KEY.
marking_key_alphaThe markings_alpha marking_key was built with.
marking_key_aux_markingsThe aux_zone_markings list marking_key was built from.
marking_key_digitigradeWhether marking_key was built for a digitigrade limb.
marking_key_markingsThe markings list marking_key was built from.
marking_key_revisionGLOB.body_marking_entry_revision when marking_key was built, -1 until it first is.
markingsThe /datum/body_marking_entry list this limb draws on its body zone, or null for none. Normally the owner DNA collection's own list for that zone, shared with it and read-only: replace it by assigning another list, never edit it. A detached limb goes on drawing the list it last got.
markings_alphaThe alpha our markings are drawn at. A creating update_limb() sets it from the owner's species.
max_damageThe maximum brute OR burn damage a bodypart can take. Once we hit this cap, no more damage of either type!
muscle_definitionHow defined a fitness limb's muscles are drawn, from 0, none, to MUSCLE_DEFINITION_MAX: an overlay on the limb, under its markings. Null until the limb is first set up for an owner (update_limb()'s is_creating), when it takes the definition in the owner's DNA, then kept wherever the limb goes. Only fitness limbs read it.
muscle_sizeHow big this limb's muscles are drawn, a MUSCLE_SIZE_* define: MUSCLE_SIZE_NORMAL is today's sprites. Fixed by its type: each size of a limb is its own subtype, below. Clothing and underwear fitting read it per limb, so each arm and leg can differ.
ownerThe mob that "owns" this limb DO NOT MODIFY DIRECTLY. Use update_owner()
plaintext_zoneThe body zone of this part in english ("chest", "left arm", etc) without the species attached to it
prefixSet on our limbs whose limb_id does not read as words - tg's name starts with this instead, as "vox primalis left arm" for vox_primalis
robotic_emp_paralyze_damage_percent_thresholdget_damage() / total_damage must surpass this to allow our limb to be disabled, even temporarily, by an EMP.
scarrableIf this limb can be scarred.
scarsThe scars currently afflicting this body part
scars_covered_by_clothesA hat won't cover your face, but a shirt covering your chest will cover your... you know, chest
should_draw_greyscaleLimbs need this information as a back-up incase they are generated outside of a carbon (limbgrower)
species_idID of a species to use as an override for species-based biological logic, such as what species to pull the meat from, if our limb_id doesn't match
stump_typepathTypepath of this limb as a stump
surgery_stateWhat state is the bodypart in for determining surgery availability
texture_bodypart_overlayA potential texturing overlay to put on the limb
unarmed_attack_effectwhat visual effect is used when this limb is used to strike someone.
unarmed_attack_soundSounds when this bodypart is used in an umarmed attack
unarmed_attack_verbsthe verbs used for an unarmed attack when using this limb, such as arm.unarmed_attack_verbs = list("punch")
unarmed_attack_verbs_continuousContinuous tense attack verbs for successful attacks
unarmed_damage_highHighest possible punch damage this bodypart can ive.
unarmed_damage_lowLowest possible punch damage this bodypart can give. If this is set to 0, unarmed attacks will always miss.
unarmed_effectivenessDetermines the accuracy bonus, armor penetration and knockdown probability.
unarmed_grab_damage_bonusIf this limb is used to grab (which is only arms right now), how much additional damage does it deal to the grabbed individual when they fail to escape the grab?
unarmed_grab_escape_chance_bonusIf this limb is used to grab (which is only arms right now), how much more difficult is it to escape the grab, before accounting for grab state? Values above 0 is a malus, values below 0 is a bonus. This is less powerful than adjusting grab state. If the arm has both an increased grab level and a chance reduction, it is very hard to escape a grab.
unarmed_grab_state_bonusIf this limb is used to grab (which is only arms right now), how much more effective is the limb? Every integer above or below 0 is one effective grab level. Higher is a bonus, lower is a malus. This is more powerful than adjusting grab escape chance. If the arm has both an increased grab level and a chance reduction, it is very hard to escape a grab.
unarmed_pummeling_bonusMultiplier applied to effectiveness and damage when attacking a grabbed target.
unarmed_sharpnessThe 'sharpness' of the limb. Could indicate claws, teeth or spines. Should default to NONE, or blunt.
use_alternate_dismemberment_calc_even_if_mangleableIf true, we will use [hp_percent_to_dismemberable] even if we are dismemberable via wounds. Useful for things with extreme wound resistance.
worn_offsets_speciesThe species whose worn offsets this limb carries, for a limb drawn in that species' shape whoever made it - see /datum/species/proc/add_worn_offsets
wound_damage_multiplierOur current stored wound damage multiplier
wound_resistanceThis number is added to the effective wound armor on this body part (as long as it isn't managled externally or internally), higher numbers mean more defense, negative means easier to wound
woundsThe wounds currently afflicting this body part
zombie_colorThe color to multiply the zombie husk sprites by.

Procs

_embed_objectINTERNAL PROC, DO NOT USE Properly sets us up to manage an inserted embeded object
_unembed_objectINTERNAL PROC, DO NOT USE Cleans up any attachment we have to the embedded object, removes it from our list
add_biostateAdds biostate to the limb and ensures surgical states are updated accordingly
add_bodypart_overlayAdds a bodypart overlay to the limb
add_bodypart_textureAdds a bodypart texture to the limb
add_bodypart_traitAdd a trait to the bodypart traits list, then applies the trait if necessary
add_bodyshapeAdd a bodyshape to the bodypart, then synchronize with the owner if necessary
add_surgical_stateAdd one or multiple surgical states to the bodypart
adjustBleedStacksModifies our generic bleedstacks. You must use this to change the variable Takes the amount to adjust by, and the lowest amount we're allowed to have post adjust
append_base_marking_overlaysAppends this limb's native base markings before height and body textures are applied.
apply_custom_markingPuts a zone drawing on this limb as an overlay of overlay_type, replacing, updating or removing the one it has.
apply_itemInserts an item into the applied items list for this bodypart
apply_ownershipApply ownership of a limb to someone, giving the appropriate traits, updates and signals
attempt_feature_restyleAsks the external organs inside the limb if they can restyle
can_attach_limbChecks if you can attach a limb, returns TRUE if you can.
can_be_graspedIf TRUE, the owner of this bodypart can try grabbing it to slow bleeding, as well as various other effects.
change_appearanceA multi-purpose setter for all things immediately important to the icon and iconstate of the limb.
check_for_frankensteinChecks if a limb qualifies as a BODYPART_IMPLANTED
check_for_injuriesCalled when a bodypart is checked for injuries.
check_series_wounding_modsShould return an assoc list of (wound_series -> penalty). Will be used in determining series-specific penalties for wounding.
check_woundingcheck_wounding() is where we handle rolling for, selecting, and applying a wound if we meet the criteria
check_woundings_modscheck_wounding_mods() is where we handle the various modifiers of a wound roll
clear_augment_finishTakes a recolourable finish off a limb, if it had one, with its element: its colours go, and its glow and its fit go back to its type's own.
clear_ownershipRun all necessary procs to remove a limbs ownership and remove the appropriate signals and traits
custom_sprite_icon_fileThe icon file this limb draws from: its greyscale sheet when it should draw greyscale, else its static one.
dirt_sprite_readsReturns what this limb's sprites are drawn from as mess reads them (drawn_sheet(), custom_sprite_limb_state()): the limb, then every var those read. A limb that still reads the same (dirt_sprite_unchanged()) draws the same sprites.
dirt_sprite_unchangedReturns whether this limb's sprites are drawn from what they were when dirt_sprite_reads() read it.
dismemberRemove target limb from its owner, with side effects.
dismemberable_by_total_damageReturns TRUE if our total percent damage is more or equal to our dismemberable percentage, but FALSE if a wound can cause us to be dismembered.
dismemberable_by_woundReturns if our current mangling status allows us to be dismembered. Requires both no exterior/mangled exterior and no interior/mangled interior.
draw_augment_paintDraws a recolourable finish's paint and glow into the images get_limb_icon() made: for the limb's own image and its hand's, copies drawing the finish's _paint and _glow states through their colour matrices, added above everything the limb drew (its markings too, which the plates cover where they cover skin). Copies of the limb's images, they keep its layer, height, texture and facing; a leg's are split into the leg's two halves through the masked leg cache (handle_masking()), as draw_muscle_definition() splits definition.
draw_muscle_definitionDraws this limb's muscle definition into the images get_limb_icon() made: the definition overlay for the state the limb draws, its size and its step, right above the limb's own image, both halves of a leg's, and so under its markings and everything else on it. It's a copy of the limb's image drawing the overlay, so it's coloured, offset for height and textured as the limb is, and a husk's is toned as the limb is.
drawn_sheetReturns the sheet this limb's own sprite is drawn from, as get_limb_icon() draws it, or null when it draws none of its own: a stump, an invisible limb, or a taur's legs, which its taur body stands in for.
drop_limbRefits the worn clothing of a body a fitness arm, leg or chest above the Normal size comes off, whether lost or swapped for another limb.
emp_effectThe actual effect of EMPs on the limb. Allows children to override it however they want
fitness_sheetReturns the sheet this limb draws in place of sheet: its muscle size's sheet when sheet has size sheets and that one holds the state the limb draws, else sheet itself. Only asked for a limb above the Normal size.
forced_removalIn-case someone, somehow only teleports someones limb
generate_husk_keyKeys a husked limb by the markings it still draws: grey, but at their own alpha and with their own glow.
get_bodypart_damage_stateGets overlays to apply to the mob when damaged.
get_butcher_dropsReturns a lazy assoc list of items dropped when the limb is butchered
get_cache_keyReturns a string representing the bodyparts icon cache key
get_custom_markingThis limb's custom marking overlay of exactly this type. Hand paint is a subtype of zone paint on the same arm.
get_external_descriptionReturns the generic description of our BIO_EXTERNAL feature(s), prioritizing certain ones over others. Returns error on failure.
get_internal_descriptionReturns the generic description of our BIO_INTERNAL feature(s), prioritizing certain ones over others. Returns error on failure.
get_limb_iconGenerates an /image for the limb to be used as an overlay
get_reported_surgery_stateReturns all surgical states, filtering out stuff which should not be reported
get_splint_factorGet how splinted this bodypart is based on applied items
get_surgery_examineReturns surgery examine information for this bodypart
get_surgery_self_checkReturns surgery self-check information for this bodypart
get_wound_threshold_of_wound_typeA simple proc that gets the best wound to fit the criteria laid out, then returns its wound threshold.
get_wound_typeGet whatever wound of the given type is currently attached to this limb, if any
handle_maskingThis proc serves as a way to ensure that legs layer properly on a mob. To do this, two separate images are created - A low layer one, and a normal layer one. Each of the image will appropriately crop out dirs that are not used on that given layer.
help_remove_gauzeHelper for someone helping to remove our gauze
huskify_imageTakes in an image and greyscales it to later be recolored to look like a husk
is_splintedReturns TRUE if the limb is splinted with gauze or tape with an effective splint factor
is_woundableCheck if a bodypart can be wounded
marking_zone_keyReturns the string standing for the markings this limb draws on one zone, in order, with their colours and glow.
on_addingCalled on addition of a bodypart
on_attempt_feature_restyleInvoke async so we don't break signals
on_attempt_feature_restyle_mobSomeone used a restyling thingymajigga on our limb owner
on_owner_cleanCalled when limb's current owner gets washed
on_owner_nolimbdisable_trait_gainCalled when TRAIT_NOLIMBDISABLE is added to the owner.
on_owner_nolimbdisable_trait_lossCalled when TRAIT_NOLIMBDISABLE is removed from the owner.
on_paralysis_trait_gainCalled when TRAIT_PARALYSIS is added to the limb.
on_paralysis_trait_lossCalled when TRAIT_PARALYSIS is removed from the limb.
on_removalA limb leaving its body takes its private images with it, so a limb put in its place, even one drawn under the same key before the body is drawn again (a species change swaps them so), is drawn from its own sprites.
painless_wound_rollAllows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds
paint_copyReturns a copy of base, one of a limb's own images, drawing state from sheet in matrix, and with block_templates, an emissive blocker for it: a copy of the limb's own blocker for base, so it sits on the emissive plane as that does.
rebuild_marking_icon_keyBuilds the part of this limb's icon cache keys standing for the markings it draws, and stamps what it was built from.
receive_damage#receive_damage
refresh_bleed_rateRefresh the cache of our rate of bleeding sans any modifiers ANYTHING ADDED TO THIS PROC NEEDS TO CALL IT WHEN ITS EFFECT CHANGES
remove_biostateRemoves biostate from the limb and ensures surgical states are updated accordingly
remove_bodypart_overlayRemoves a bodypart overlay from the limb
remove_bodypart_textureRemoves a bodypart texture from the limb
remove_bodypart_traitRemove a trait from the bodypart traits list, then removes the trait if necessary
remove_bodyshapeRemove a bodyshape from the bodypart, then synchronize with the owner if necessary
remove_surgical_stateRemove one or multiple surgical states from the bodypart
replace_limbTry to attach this bodypart to a mob, while replacing one if it exists, does nothing if it fails. Returns TRUE on success, FALSE on failure.
reset_appearanceResets the base appearance of a limb to it's default values.
seep_gauzeseep_gauze() is for when a gauze wrapping absorbs blood or pus from wounds, lowering its absorption capacity.
setBleedStacksSets our generic bleedstacks
set_bio_state_statusAssigns our bio_status to ANATOMY_EXTERIOR or/and ANATOMY_INTERIOR. Used to determine if we as a whole have a interior or exterior biostate, or both.
set_brute_damProc to hook behavior associated to the change of the brute_dam variable's value.
set_burn_damProc to hook behavior associated to the change of the burn_dam variable's value.
set_can_be_disabledProc to change the value of the can_be_disabled variable and react to the event of its change.
set_disabledProc to change the value of the disabled variable and react to the event of its change.
set_icon_greyscale
set_icon_static
set_initial_damageSets the damage of a bodypart when it is created.
sync_custom_zone_markingsApplies this limb's zone drawing and, for arms, its hand drawing.
try_attach_limbRefits the worn clothing of a body a fitness arm, leg or chest above the Normal size is attached to: attaching a leg redraws only the uniform and suit, an arm only the gloves, and a chest none of them.
try_dismembertry_dismember() is used, once we've confirmed that a flesh and bone bodypart has both the skin and bone mangled, to actually roll for it
update_augment_skin_sheetPoints a recolourable finish's limb at the skin sheet in its owner's skin ramp: the humanoid one under a mutant colour.
update_bodypart_damage_stateUpdates an organ's brute/burn states for use by update_damage_overlays(). Returns TRUE if state changed (IE, an update is needed)
update_icon_droppedTo update the bodypart's icon when not attached to a mob
update_ownerProc to change the value of the owner variable and react to the event of its change.
update_surgical_stateCalled when surgical state changes so we can react to it
update_wound_theoryUpdates our "can be theoretically dismembered by wounds" variables by iterating through all wound static data.
update_woundsupdate_wounds() is called whenever a wound is gained or lost on this bodypart, as well as if there's a change of some kind on a bone wound possibly changing disabled status

Var Details

any_existing_wound_can_mangle_our_exterior

If false, no wound that can be applied to us can mangle our exterior. Used for determining if we should use [hp_percent_to_dismemberable] instead of normal dismemberment.

any_existing_wound_can_mangle_our_interior

If false, no wound that can be applied to us can mangle our interior. Used for determining if we should use [hp_percent_to_dismemberable] instead of normal dismemberment.

applied_items

Lazylist of category to item applied to this limb

attack_type

Type of an attack from this limb does. Arms will do punches, Legs for kicks, and head for bites. (TO ADD: tactical chestbumps)

augment_colors

A recolourable finish's colours, "#rrggbb" four times: paint, accent, frame, lights. Null on every other limb. A limb with them carries /datum/element/augment_paint, which draws its paint and glow and keys its icons by them.

aux_zone_markings

The same for its aux zone (hands).

base_meat_amount

How much meat do we add to butcher_drops when automatically generating them from our species datum?

bio_status

Does this part have an internal or external anatomy biostate? Assigned on init based on biological_state

biological_state

A bitfield of biological states, exclusively used to determine which wounds this limb will get, as well as how easily it will happen. Set to BIO_STANDARD_UNJOINTED because most species have both flesh bone and blood in their limbs.

bleed_overlay_icon

If we're bleeding, which icon are we displaying on this part

blood_dna_info

The cached info about the blood this organ belongs to, set during on_removal()

body_damage_coeff

A mutiplication of the burn and brute damage that the limb's stored damage contributes to its attached mob's overall wellbeing.

body_part

bitflag used to check which clothes cover this bodypart

body_zone

BODY_ZONE_CHEST, BODY_ZONE_L_ARM, etc , used for def_zone

bodypart_disabled

Controls if the limb is disabled. TRUE means it is disabled (similar to being removed, but still present for the sake of targeted interactions).

bodypart_effects

Lazylist of /datum/status_effect/grouped/bodypart_effect types. Instances of this are applied to the carbon when added the limb is attached, and merged with similair limbs

bodypart_flags

Random flags that describe this bodypart

bodypart_overlays

A list of all bodypart overlays to draw

bodypart_textures

A list of all bodypart textures to apply

bodypart_trait_source

The name of the trait source that the organ gives. Should not be altered during the events of gameplay, and will cause problems if it is.

bodypart_traits

Traits that are given to the holder of the part. This does not update automatically on life(), only when the organs are initially generated or inserted!

bodyshape

A bitfield of bodyshapes for clothing and other sprite information

bodytype

A bitfield of bodytypes for surgery, and misc information

brute_dam

The current amount of brute damage the limb has

brute_modifier

Brute damage gets multiplied by this on receive_damage()

burn_dam

The current amount of burn damage the limb has

burn_modifier

Burn damage gets multiplied by this on receive_damage()

butcher_drop_cache

Init cache for our butcher drops for sanic speed

butcher_drops_override

Lazy assoc list of [item type] = [amount] that we drop when butchered. Overrides whatever we would drop normally based on our species datum.

butcher_replacement

What skeleton limb, if any, we replace ourselves with when butchered?

cached_bleed_rate

Our current bleed rate. Cached, update with refresh_bleed_rate()

can_be_disabled

Whether it is possible for the limb to be disabled whatsoever. TRUE means that it is possible.

change_exempt_flags

Defines when a bodypart should not be changed. Example: BP_BLOCK_CHANGE_SPECIES prevents the limb from being overwritten on species gain

color_overrides

An assoc list of priority (as a string because byond) -> color, used to override draw_color.

current_style

The bodypart's currently applied style's name. Only necessary for bodyparts that come in multiple variants, like prosthetics and cyborg bodyparts.

disabled_wound_penalty

When this bodypart hits max damage, this number is added to all wound rolls. Obviously only relevant for bodyparts that have damage caps.

dmg_overlay_type

the type of damage overlay (if any) to use when this bodypart is bruised/burned.

draw_color

The actual color a limb is drawn as, set by /proc/update_limb()

embedded_objects

List of obj/item's embedded inside us. Managed by embedded components, do not modify directly

feature_offsets

List of the above datums which have actually been instantiated, managed automatically

generic_bleedstacks

How much generic bleedstacks we have on this bodypart

grappled_attack_verb

if we have a special attack verb for hitting someone who is grappled by us, it goes here.

grappled_attack_verb_continuous

Continuous tense grapple verb for successful attacks

grasped_by

If something is currently grasping this bodypart and trying to staunch bleeding (see /obj/item/hand_item/self_grasp)

held_index

are we a hand? if so, which one!

hp_percent_to_dismemberable

In the case we dont have dismemberable features, or literally cant get wounds, we will use this percent to determine when we can be dismembered. Compared to our ABSOLUTE maximum. Stored in decimal; 0.8 = 80%.

husk_color

The color to multiply the greyscaled husk sprites by. Can be null. Old husk sprite chest color is #A6A6A6

husk_type

The type of husk for building an iconstate

icon_greyscale

The icon for Organic limbs using greyscale

icon_husk

The icon for husked limbs

icon_invisible

The icon for invisible limbs

icon_static

The icon for non-greyscale limbs

is_actually_just_invisible

Used for taur limbs that do not get rendered at all

is_dimorphic

Is there a sprite difference between male and female?

is_emissive

If this limb should have emissive overlays

is_husked

Whether the bodypart (and the owner) is husked.

is_invisible

Whether the bodypart (and the owner) is invisible through invisibleman trait.

keeps_type_name

Set on our limbs whose types name them, which keep that name - tg names every other limb for its limb_id and zone, as "robotic left arm"

last_maxed

So we know if we need to scream if this limb hits max damage

limb_id

The ID of a species used to generate the icon. Needs to match the icon_state portion in the limbs file!

mangled_state

Mangling state (interior, exterior) of the bodypart

marking_key

The part of this limb's icon cache keys standing for the markings it draws, or null for none. See LIMB_MARKING_ICON_KEY.

marking_key_alpha

The markings_alpha marking_key was built with.

marking_key_aux_markings

The aux_zone_markings list marking_key was built from.

marking_key_digitigrade

Whether marking_key was built for a digitigrade limb.

marking_key_markings

The markings list marking_key was built from.

marking_key_revision

GLOB.body_marking_entry_revision when marking_key was built, -1 until it first is.

markings

The /datum/body_marking_entry list this limb draws on its body zone, or null for none. Normally the owner DNA collection's own list for that zone, shared with it and read-only: replace it by assigning another list, never edit it. A detached limb goes on drawing the list it last got.

markings_alpha

The alpha our markings are drawn at. A creating update_limb() sets it from the owner's species.

max_damage

The maximum brute OR burn damage a bodypart can take. Once we hit this cap, no more damage of either type!

muscle_definition

How defined a fitness limb's muscles are drawn, from 0, none, to MUSCLE_DEFINITION_MAX: an overlay on the limb, under its markings. Null until the limb is first set up for an owner (update_limb()'s is_creating), when it takes the definition in the owner's DNA, then kept wherever the limb goes. Only fitness limbs read it.

muscle_size

How big this limb's muscles are drawn, a MUSCLE_SIZE_* define: MUSCLE_SIZE_NORMAL is today's sprites. Fixed by its type: each size of a limb is its own subtype, below. Clothing and underwear fitting read it per limb, so each arm and leg can differ.

owner

The mob that "owns" this limb DO NOT MODIFY DIRECTLY. Use update_owner()

plaintext_zone

The body zone of this part in english ("chest", "left arm", etc) without the species attached to it

prefix

Set on our limbs whose limb_id does not read as words - tg's name starts with this instead, as "vox primalis left arm" for vox_primalis

robotic_emp_paralyze_damage_percent_threshold

get_damage() / total_damage must surpass this to allow our limb to be disabled, even temporarily, by an EMP.

scarrable

If this limb can be scarred.

scars

The scars currently afflicting this body part

scars_covered_by_clothes

A hat won't cover your face, but a shirt covering your chest will cover your... you know, chest

should_draw_greyscale

Limbs need this information as a back-up incase they are generated outside of a carbon (limbgrower)

species_id

ID of a species to use as an override for species-based biological logic, such as what species to pull the meat from, if our limb_id doesn't match

stump_typepath

Typepath of this limb as a stump

surgery_state

What state is the bodypart in for determining surgery availability

texture_bodypart_overlay

A potential texturing overlay to put on the limb

unarmed_attack_effect

what visual effect is used when this limb is used to strike someone.

unarmed_attack_sound

Sounds when this bodypart is used in an umarmed attack

unarmed_attack_verbs

the verbs used for an unarmed attack when using this limb, such as arm.unarmed_attack_verbs = list("punch")

unarmed_attack_verbs_continuous

Continuous tense attack verbs for successful attacks

unarmed_damage_high

Highest possible punch damage this bodypart can ive.

unarmed_damage_low

Lowest possible punch damage this bodypart can give. If this is set to 0, unarmed attacks will always miss.

unarmed_effectiveness

Determines the accuracy bonus, armor penetration and knockdown probability.

unarmed_grab_damage_bonus

If this limb is used to grab (which is only arms right now), how much additional damage does it deal to the grabbed individual when they fail to escape the grab?

unarmed_grab_escape_chance_bonus

If this limb is used to grab (which is only arms right now), how much more difficult is it to escape the grab, before accounting for grab state? Values above 0 is a malus, values below 0 is a bonus. This is less powerful than adjusting grab state. If the arm has both an increased grab level and a chance reduction, it is very hard to escape a grab.

unarmed_grab_state_bonus

If this limb is used to grab (which is only arms right now), how much more effective is the limb? Every integer above or below 0 is one effective grab level. Higher is a bonus, lower is a malus. This is more powerful than adjusting grab escape chance. If the arm has both an increased grab level and a chance reduction, it is very hard to escape a grab.

unarmed_pummeling_bonus

Multiplier applied to effectiveness and damage when attacking a grabbed target.

unarmed_sharpness

The 'sharpness' of the limb. Could indicate claws, teeth or spines. Should default to NONE, or blunt.

use_alternate_dismemberment_calc_even_if_mangleable

If true, we will use [hp_percent_to_dismemberable] even if we are dismemberable via wounds. Useful for things with extreme wound resistance.

worn_offsets_species

The species whose worn offsets this limb carries, for a limb drawn in that species' shape whoever made it - see /datum/species/proc/add_worn_offsets

wound_damage_multiplier

Our current stored wound damage multiplier

wound_resistance

This number is added to the effective wound armor on this body part (as long as it isn't managled externally or internally), higher numbers mean more defense, negative means easier to wound

wounds

The wounds currently afflicting this body part

zombie_color

The color to multiply the zombie husk sprites by.

Proc Details

_embed_object

INTERNAL PROC, DO NOT USE Properly sets us up to manage an inserted embeded object

_unembed_object

INTERNAL PROC, DO NOT USE Cleans up any attachment we have to the embedded object, removes it from our list

add_biostate

Adds biostate to the limb and ensures surgical states are updated accordingly

add_bodypart_overlay

Adds a bodypart overlay to the limb

Returns the overlay that was added, or null if it was not added.

add_bodypart_texture

Adds a bodypart texture to the limb

add_bodypart_trait

Add a trait to the bodypart traits list, then applies the trait if necessary

add_bodyshape

Add a bodyshape to the bodypart, then synchronize with the owner if necessary

add_surgical_state

Add one or multiple surgical states to the bodypart

adjustBleedStacks

Modifies our generic bleedstacks. You must use this to change the variable Takes the amount to adjust by, and the lowest amount we're allowed to have post adjust

append_base_marking_overlays

Appends this limb's native base markings before height and body textures are applied.

The ordinary limb renderer passes its existing overlay list, preserving native layer order without allocating another list. An editor may request one body or auxiliary zone, omit the separate emissive appearances and replace the live marking opacity while sampling its pixels. No body, custom paint or external-organ overlays are included. A marking draws only the state its drawn_state() answers, and nothing where it has no art: see zone_icon_state().

Consecutive markings of one colour on sheets of one size draw as one appearance, and a zone's glows on one sheet size as one glow, each where its first marking was: see merge_body_marking_run(). Only at full opacity: translucent markings, and the glows fading with them, darken where they overlap, which one blended layer cannot repeat (markings_copy.dm notes the same), so a reduced markings_alpha draws them one by one. So does an editor's single-zone request, which samples them.

Arguments:

Returns the same output list.

apply_custom_marking

Puts a zone drawing on this limb as an overlay of overlay_type, replacing, updating or removing the one it has.

apply_item

Inserts an item into the applied items list for this bodypart

Note: Forcemoves the item to the bodypart's contents when called!

Arguments:

Returns TRUE if the item was successfully applied Returns FALSE if the item was not applied (e.g. an item of the same category is already applied and override is FALSE)

apply_ownership

Apply ownership of a limb to someone, giving the appropriate traits, updates and signals

attempt_feature_restyle

Asks the external organs inside the limb if they can restyle

can_attach_limb

Checks if you can attach a limb, returns TRUE if you can.

can_be_grasped

If TRUE, the owner of this bodypart can try grabbing it to slow bleeding, as well as various other effects.

change_appearance

A multi-purpose setter for all things immediately important to the icon and iconstate of the limb.

check_for_frankenstein

Checks if a limb qualifies as a BODYPART_IMPLANTED

check_for_injuries

Called when a bodypart is checked for injuries.

check_series_wounding_mods

Should return an assoc list of (wound_series -> penalty). Will be used in determining series-specific penalties for wounding.

check_wounding

check_wounding() is where we handle rolling for, selecting, and applying a wound if we meet the criteria

We generate a "score" for how woundable the attack was based on the damage and other factors discussed in /obj/item/bodypart/proc/check_woundings_mods, then go down the list from most severe to least severe wounds in that category. We can promote a wound from a lesser to a higher severity this way, but we give up if we have a wound of the given type and fail to roll a higher severity, so no sidegrades/downgrades

Arguments:

check_woundings_mods

check_wounding_mods() is where we handle the various modifiers of a wound roll

A short list of things we consider: any armor a human target may be wearing, and if they have no wound armor on the limb, and add the plain wound_bonus if there is any value to add We also flick through all of the wounds we currently have on this limb and add their threshold penalties, so that having lots of bad wounds makes you more liable to get hurt worse We add the inherent wound_resistance variable the bodypart has (heads and chests are slightly harder to wound) as an armor bonus unless the limb is mangled, and a small wound bonus if the limb is already disabled Once we have everything, we then check if we have acquired any armor. If so, reduce our value by the percentage value of that armour. If not, we add our exposed_wound_bonus as a final bonus to our roll.

Arguments:

clear_augment_finish

Takes a recolourable finish off a limb, if it had one, with its element: its colours go, and its glow and its fit go back to its type's own.

clear_ownership

Run all necessary procs to remove a limbs ownership and remove the appropriate signals and traits

custom_sprite_icon_file

The icon file this limb draws from: its greyscale sheet when it should draw greyscale, else its static one.

dirt_sprite_reads

Returns what this limb's sprites are drawn from as mess reads them (drawn_sheet(), custom_sprite_limb_state()): the limb, then every var those read. A limb that still reads the same (dirt_sprite_unchanged()) draws the same sprites.

dirt_sprite_unchanged

Returns whether this limb's sprites are drawn from what they were when dirt_sprite_reads() read it.

Arguments:

dismember

Remove target limb from its owner, with side effects.

dismemberable_by_total_damage

Returns TRUE if our total percent damage is more or equal to our dismemberable percentage, but FALSE if a wound can cause us to be dismembered.

dismemberable_by_wound

Returns if our current mangling status allows us to be dismembered. Requires both no exterior/mangled exterior and no interior/mangled interior.

draw_augment_paint

Draws a recolourable finish's paint and glow into the images get_limb_icon() made: for the limb's own image and its hand's, copies drawing the finish's _paint and _glow states through their colour matrices, added above everything the limb drew (its markings too, which the plates cover where they cover skin). Copies of the limb's images, they keep its layer, height, texture and facing; a leg's are split into the leg's two halves through the masked leg cache (handle_masking()), as draw_muscle_definition() splits definition.

Anything else the limb lights, like a glowing marking, would light the plates over it in the dark, so then each _paint copy also gets an emissive blocker, a copy of the limb's own. A limb with nothing else lit gets none: only an emissive counts, told by its colour matrix, never the emissive blockers its overlays bring along. The finish's own lights masks, the limb's and its hand's, are never under a _paint pixel, so they stay lit.

Nothing is drawn for a limb get_limb_icon() drew none of its own image for: a stump, an invisible limb, a taur's legs. Nor for a zone whose packed state the sheet doesn't hold: a finish with no lights on a hand has no _glow there.

Arguments:

draw_muscle_definition

Draws this limb's muscle definition into the images get_limb_icon() made: the definition overlay for the state the limb draws, its size and its step, right above the limb's own image, both halves of a leg's, and so under its markings and everything else on it. It's a copy of the limb's image drawing the overlay, so it's coloured, offset for height and textured as the limb is, and a husk's is toned as the limb is.

No icon is made for it: the overlay is its sheet's own state, the leg halves come from the masked leg cache (handle_masking()) and a husk's tone from husk_toned_sheet().

Nothing is drawn where the definition sheet has no state for what the limb draws: hands, digitigrade legs, and a limb drawn from another sheet, like another species' look. Nor is anything drawn for a limb get_limb_icon() draws none of, like a taur's hidden legs, nor an invisible one.

Arguments:

drawn_sheet

Returns the sheet this limb's own sprite is drawn from, as get_limb_icon() draws it, or null when it draws none of its own: a stump, an invisible limb, or a taur's legs, which its taur body stands in for.

drop_limb

Refits the worn clothing of a body a fitness arm, leg or chest above the Normal size comes off, whether lost or swapped for another limb.

emp_effect

The actual effect of EMPs on the limb. Allows children to override it however they want

fitness_sheet

Returns the sheet this limb draws in place of sheet: its muscle size's sheet when sheet has size sheets and that one holds the state the limb draws, else sheet itself. Only asked for a limb above the Normal size.

The size sheets hold every plain limb's states and the digitigrade legs'. A state a size's sheet lacks keeps the limb drawing today's sprite from its own sheet, never a missing state.

Arguments:

forced_removal

In-case someone, somehow only teleports someones limb

generate_husk_key

Keys a husked limb by the markings it still draws: grey, but at their own alpha and with their own glow.

get_bodypart_damage_state

Gets overlays to apply to the mob when damaged.

get_butcher_drops

Returns a lazy assoc list of items dropped when the limb is butchered

get_cache_key

Returns a string representing the bodyparts icon cache key

get_custom_marking

This limb's custom marking overlay of exactly this type. Hand paint is a subtype of zone paint on the same arm.

get_external_description

Returns the generic description of our BIO_EXTERNAL feature(s), prioritizing certain ones over others. Returns error on failure.

get_internal_description

Returns the generic description of our BIO_INTERNAL feature(s), prioritizing certain ones over others. Returns error on failure.

get_limb_icon

Generates an /image for the limb to be used as an overlay

get_reported_surgery_state

Returns all surgical states, filtering out stuff which should not be reported

get_splint_factor

Get how splinted this bodypart is based on applied items

Multiplier applied to maluses, so lower = better

get_surgery_examine

Returns surgery examine information for this bodypart

get_surgery_self_check

Returns surgery self-check information for this bodypart

get_wound_threshold_of_wound_type

A simple proc that gets the best wound to fit the criteria laid out, then returns its wound threshold.

Args:

Returns: return_value_if_no_wound if no wound is found - if one IS found, the wound threshold for that wound.

get_wound_type

Get whatever wound of the given type is currently attached to this limb, if any

handle_masking

This proc serves as a way to ensure that legs layer properly on a mob. To do this, two separate images are created - A low layer one, and a normal layer one. Each of the image will appropriately crop out dirs that are not used on that given layer.

Arguments:

help_remove_gauze

Helper for someone helping to remove our gauze

huskify_image

Takes in an image and greyscales it to later be recolored to look like a husk

Then returns a separate image/MA that is the blood overlay for the husk May return multiple if the blood overlay has an emissive associated

is_splinted

Returns TRUE if the limb is splinted with gauze or tape with an effective splint factor

is_woundable

Check if a bodypart can be wounded

marking_zone_key

Returns the string standing for the markings this limb draws on one zone, in order, with their colours and glow.

Arguments:

Returns:

on_adding

Called on addition of a bodypart

on_attempt_feature_restyle

Invoke async so we don't break signals

on_attempt_feature_restyle_mob

Someone used a restyling thingymajigga on our limb owner

on_owner_clean

Called when limb's current owner gets washed

on_owner_nolimbdisable_trait_gain

Called when TRAIT_NOLIMBDISABLE is added to the owner.

on_owner_nolimbdisable_trait_loss

Called when TRAIT_NOLIMBDISABLE is removed from the owner.

on_paralysis_trait_gain

Called when TRAIT_PARALYSIS is added to the limb.

on_paralysis_trait_loss

Called when TRAIT_PARALYSIS is removed from the limb.

on_removal

A limb leaving its body takes its private images with it, so a limb put in its place, even one drawn under the same key before the body is drawn again (a species change swaps them so), is drawn from its own sprites.

painless_wound_roll

Allows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds

paint_copy

Returns a copy of base, one of a limb's own images, drawing state from sheet in matrix, and with block_templates, an emissive blocker for it: a copy of the limb's own blocker for base, so it sits on the emissive plane as that does.

Arguments:

Returns:

rebuild_marking_icon_key

Builds the part of this limb's icon cache keys standing for the markings it draws, and stamps what it was built from.

LIMB_MARKING_ICON_KEY reuses the result until something it describes changes: the marking lists are swapped for others, an entry anywhere is recoloured or its glow toggled (GLOB.body_marking_entry_revision), markings_alpha changes, or the limb turns digitigrade or back. Marking lists are never edited in place, so the same list still holds the same entries in the same order.

Returns:

receive_damage

#receive_damage

called when a bodypart is taking damage Damage will not exceed max_damage using this proc, and negative damage cannot be used to heal Returns TRUE if damage icon states changes Args: brute - The amount of brute damage dealt. burn - The amount of burn damage dealt. blocked - The amount of damage blocked by armor. update_health - Whether to update the owner's health from receiving the hit. required_bodytype - A bodytype flag requirement to get this damage (ex: BODYTYPE_ORGANIC) wound_bonus - Additional bonus chance to get a wound. exposed_wound_bonus - Additional bonus chance to get a wound if the bodypart is naked. wound_clothing - If this should damage clothing. sharpness - Flag on whether the attack is edged or pointy attack_direction - The direction the bodypart is attacked from, used to send blood flying in the opposite direction. damage_source - The source of damage, typically a weapon.

refresh_bleed_rate

Refresh the cache of our rate of bleeding sans any modifiers ANYTHING ADDED TO THIS PROC NEEDS TO CALL IT WHEN ITS EFFECT CHANGES

remove_biostate

Removes biostate from the limb and ensures surgical states are updated accordingly

remove_bodypart_overlay

Removes a bodypart overlay from the limb

remove_bodypart_texture

Removes a bodypart texture from the limb

remove_bodypart_trait

Remove a trait from the bodypart traits list, then removes the trait if necessary

remove_bodyshape

Remove a bodyshape from the bodypart, then synchronize with the owner if necessary

remove_surgical_state

Remove one or multiple surgical states from the bodypart

replace_limb

Try to attach this bodypart to a mob, while replacing one if it exists, does nothing if it fails. Returns TRUE on success, FALSE on failure.

reset_appearance

Resets the base appearance of a limb to it's default values.

seep_gauze

seep_gauze() is for when a gauze wrapping absorbs blood or pus from wounds, lowering its absorption capacity.

The passed amount of seepage is deducted from the bandage's absorption capacity, and if we reach a negative absorption capacity, the bandages falls off and we're left with nothing.

Arguments:

setBleedStacks

Sets our generic bleedstacks

set_bio_state_status

Assigns our bio_status to ANATOMY_EXTERIOR or/and ANATOMY_INTERIOR. Used to determine if we as a whole have a interior or exterior biostate, or both.

set_brute_dam

Proc to hook behavior associated to the change of the brute_dam variable's value.

set_burn_dam

Proc to hook behavior associated to the change of the burn_dam variable's value.

set_can_be_disabled

Proc to change the value of the can_be_disabled variable and react to the event of its change.

set_disabled

Proc to change the value of the disabled variable and react to the event of its change.

set_icon_greyscale

This should only be ran by augments, if you don't know what you're doing, you shouldn't be touching this.

A setter for the icon_greyscale variable of the bodypart. Runs through icon_exists() for sanity, and it won't change anything in the event that the check fails.

Arguments:

set_icon_static

This should only be ran by augments, if you don't know what you're doing, you shouldn't be touching this.

A setter for the icon_static variable of the bodypart. Runs through icon_exists() for sanity, and it won't change anything in the event that the check fails.

Arguments:

set_initial_damage

Sets the damage of a bodypart when it is created.

sync_custom_zone_markings

Applies this limb's zone drawing and, for arms, its hand drawing.

try_attach_limb

Refits the worn clothing of a body a fitness arm, leg or chest above the Normal size is attached to: attaching a leg redraws only the uniform and suit, an arm only the gloves, and a chest none of them.

try_dismember

try_dismember() is used, once we've confirmed that a flesh and bone bodypart has both the skin and bone mangled, to actually roll for it

Mangling is calculated in update_wounds(), this simply makes the roll for whether we actually dismember or not using how damaged the limb already is, and how much damage this blow was for. If we have a critical bone wound instead of just a severe, we add +10% to the roll. Lastly, we choose which kind of dismember we want based on the wounding type we hit with. Note we don't care about all the normal mods or armor for this

Arguments:

update_augment_skin_sheet

Points a recolourable finish's limb at the skin sheet in its owner's skin ramp: the humanoid one under a mutant colour.

update_bodypart_damage_state

Updates an organ's brute/burn states for use by update_damage_overlays(). Returns TRUE if state changed (IE, an update is needed)

update_icon_dropped

To update the bodypart's icon when not attached to a mob

update_owner

Proc to change the value of the owner variable and react to the event of its change.

update_surgical_state

Called when surgical state changes so we can react to it

update_wound_theory

Updates our "can be theoretically dismembered by wounds" variables by iterating through all wound static data.

update_wounds

update_wounds() is called whenever a wound is gained or lost on this bodypart, as well as if there's a change of some kind on a bone wound possibly changing disabled status

Covers tabulating the damage multipliers we have from wounds (burn specifically), as well as deleting our gauze wrapping if we don't have any wounds that can use bandaging Dismemberment for flesh and bone requires the victim to have the skin on their bodypart destroyed (either a critical cut or piercing wound), and at least a hairline fracture (severe bone), at which point we can start rolling for dismembering. The attack must also deal at least 10 damage, and must be a brute attack of some kind (sorry for now, cakehat, maybe later)

Arguments: