bodypart

Vars | |
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) |
---|---|
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_FLESH_BONE because most species have both flesh and bone in their limbs. |
bleed_overlay_icon | If we're bleeding, which icon are we displaying on this part |
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_overlays | A list of all bodypart overlays to draw |
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. If you want an effect that changes this, don't add directly to this. Use the add_bodypart_trait() proc |
bodytype | A bitfield of bodytypes for clothing, surgery, and misc information |
brute_dam | The current amount of brute damage the limb has |
brute_reduction | Amount subtracted from brute damage inflicted on the limb. |
brutestate | Used in determining overlays for limb damage states. As the mob receives more burn/brute damage, their limbs update to reflect. |
burn_dam | The current amount of burn damage the limb has |
burn_reduction | Amount subtracted from burn damage inflicted on the limb. |
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 |
cremation_progress | Gradually increases while burning when at full damage, destroys the limb when at 100 |
current_gauze | If we have a gauze wrapping currently applied (not including splints) |
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. |
disabling_threshold_percentage | Handles limb disabling by damage. If 0 (0%), a limb can't be disabled via damage. If 1 (100%), it is disabled at max limb damage. Anything between is the percentage of damage against maximum limb damage needed to disable the limb. |
dismemberable | whether the limb can be mutilated, including dismemberment for appendages and heads, and disembowelment for chests. TRUE means it can be subjected to these effects. |
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 |
external_organs | A list of all the external organs we've got stored to draw horns, wings and stuff with (special because we are actually in the limbs unlike normal organs :/ ) If someone ever comes around to making all organs exist in the bodyparts, you can just remove this and use a typed loop |
generic_bleedstacks | How much generic bleedstacks we have on this bodypart |
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! |
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_dimorphic | Is there a sprite difference between male and female? |
is_husked | Whether the bodypart (and the owner) is husked. |
is_invisible | Whether the bodypart (and the owner) is invisible through invisibleman trait. |
is_pseudopart | For limbs that don't really exist, eg chainsaws |
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! |
max_damage | The maximum brute OR burn damage a bodypart can take. Once we hit this cap, no more damage of either type! |
owner | The mob that "owns" this limb DO NOT MODIFY DIRECTLY. Use set_owner() |
plaintext_zone | The body zone of this part in english ("chest", "left arm", etc) without the species attached to it |
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) |
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_verb | the verb used for an unarmed attack when using this limb, such as arm.unarmed_attack_verb = punch |
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_stun_threshold | Damage at which attacks from this bodypart will stun |
variable_color | An "override" color that can be applied to ANY limb, greyscale or not. |
wound_damage_multiplier | Our current stored wound damage multiplier |
wound_resistance | This number is subtracted from all wound rolls on this bodypart, higher numbers mean more defense, negative means easier to wound |
wounds | The wounds currently afflicting this body part |
Procs | |
_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_bodypart_overlay | Add a bodypart overlay and call the appropriate update procs |
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 |
apply_gauze | apply_gauze() is used to- well, apply gauze to a bodypart |
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. |
change_appearance | A multi-purpose setter for all things immediately important to the icon and iconstate of the limb. |
check_for_injuries | Called when a bodypart is checked for injuries. |
check_wounding | check_wounding() is where we handle rolling for, selecting, and applying a wound if we meet the criteria |
check_woundings_mods | check_wounding_mods() is where we handle the various modifiers of a wound roll |
dismember | Remove target limb from it's owner, with side effects. |
drop_limb | limb removal. The "special" argument is used for swapping a limb with a new one without the effects of losing a limb kicking in. |
generate_husk_key | Generates a cache key specifically for husks |
generate_icon_key | Called from update_body_parts() these procs handle the limb icon cache. the limb icon cache adds an icon_render_key to a human mob, it represents: |
get_limb_icon | Generates an /image for the limb to be used as an overlay |
get_mangled_state | get_mangled_state() is relevant for flesh and bone bodyparts, and returns whether this bodypart has mangled skin, mangled bone, or both (or neither i guess) |
get_modified_bleed_rate | Returns our bleed rate, taking into account laying down and grabbing the limb |
get_organs | since organs aren't actually stored in the bodypart themselves while attached to a person, we have to query the owner for what we should have |
get_wound_type | Get whatever wound of the given type is currently attached to this limb, if any |
on_attempt_feature_restyle | Invoke async so we dont break signals |
on_attempt_feature_restyle_mob | Someone used a restyling thingymajigga on our limb owner |
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. |
painless_wound_roll | Allows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds |
recolor_external_organs | Loops through all of the bodypart's external organs and update's their color. |
refresh_bleed_rate | Refresh the cache of our rate of bleeding sans any modifiers ANYTHING ADDED TO THIS PROC NEEDS TO CALL IT WHEN IT'S EFFECT CHANGES |
remove_bodypart_overlay | Remove a bodypart overlay and call the appropriate update procs |
replace_limb | Try to attach this bodypart to a mob, while replacing one if it exists, does nothing if it fails. |
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. |
setBleedStacks | Embedded objects effect bleed rate, gotta refresh lads Sets our generic bleedstacks |
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_owner | Proc to change the value of the owner variable and react to the event of its change. |
synchronize_bodytypes | Transfer existing hair properties to the new human. Makes sure that the owner's bodytype flags match the flags of all of it's parts. |
try_attach_limb | Attach src to target mob if able, returns FALSE if it fails to. |
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 |
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 |
Var Details
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)
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_FLESH_BONE because most species have both flesh and bone in their limbs.
This has absolutely no meaning for robotic limbs.
bleed_overlay_icon

If we're bleeding, which icon are we displaying on this part
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_overlays

A list of all bodypart overlays to draw
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. If you want an effect that changes this, don't add directly to this. Use the add_bodypart_trait() proc
bodytype

A bitfield of bodytypes for clothing, surgery, and misc information
brute_dam

The current amount of brute damage the limb has
brute_reduction

Amount subtracted from brute damage inflicted on the limb.
brutestate

Used in determining overlays for limb damage states. As the mob receives more burn/brute damage, their limbs update to reflect.
burn_dam

The current amount of burn damage the limb has
burn_reduction

Amount subtracted from burn damage inflicted on the limb.
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
cremation_progress

Gradually increases while burning when at full damage, destroys the limb when at 100
current_gauze

If we have a gauze wrapping currently applied (not including splints)
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.
disabling_threshold_percentage

Handles limb disabling by damage. If 0 (0%), a limb can't be disabled via damage. If 1 (100%), it is disabled at max limb damage. Anything between is the percentage of damage against maximum limb damage needed to disable the limb.
dismemberable

whether the limb can be mutilated, including dismemberment for appendages and heads, and disembowelment for chests. TRUE means it can be subjected to these effects.
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
external_organs

A list of all the external organs we've got stored to draw horns, wings and stuff with (special because we are actually in the limbs unlike normal organs :/ ) If someone ever comes around to making all organs exist in the bodyparts, you can just remove this and use a typed loop
generic_bleedstacks

How much generic bleedstacks we have on this bodypart
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!
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_dimorphic

Is there a sprite difference between male and female?
is_husked

Whether the bodypart (and the owner) is husked.
is_invisible

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

For limbs that don't really exist, eg chainsaws
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!
max_damage

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

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

The body zone of this part in english ("chest", "left arm", etc) without the species attached to it
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)
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_verb

the verb used for an unarmed attack when using this limb, such as arm.unarmed_attack_verb = punch
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_stun_threshold

Damage at which attacks from this bodypart will stun
variable_color

An "override" color that can be applied to ANY limb, greyscale or not.
wound_damage_multiplier

Our current stored wound damage multiplier
wound_resistance

This number is subtracted from all wound rolls on this bodypart, higher numbers mean more defense, negative means easier to wound
wounds

The wounds currently afflicting this body part
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_bodypart_overlay
Add a bodypart overlay and call the appropriate update procs
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
apply_gauze
apply_gauze() is used to- well, apply gauze to a bodypart
As of the Wounds 2 PR, all bleeding is now bodypart based rather than the old bleedstacks system, and 90% of standard bleeding comes from flesh wounds (the exception is embedded weapons). The same way bleeding is totaled up by bodyparts, gauze now applies to all wounds on the same part. Thus, having a slash wound, a pierce wound, and a broken bone wound would have the gauze applying blood staunching to the first two wounds, while also acting as a sling for the third one. Once enough blood has been absorbed or all wounds with the ACCEPTS_GAUZE flag have been cleared, the gauze falls off.
Arguments:
- gauze- Just the gauze stack we're taking a sheet from to apply here
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.
change_appearance
A multi-purpose setter for all things immediately important to the icon and iconstate of the limb.
check_for_injuries
Called when a bodypart is checked for injuries.
Modifies the check_list list with the resulting report of the limb's status.
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:
- woundtype- Either WOUND_BLUNT, WOUND_SLASH, WOUND_PIERCE, or WOUND_BURN based on the attack type.
- damage- How much damage is tied to this attack, since wounding potential scales with damage in an attack (see: WOUND_DAMAGE_EXPONENT)
- wound_bonus- The wound_bonus of an attack
- bare_wound_bonus- The bare_wound_bonus of an attack
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, if we have a bare_wound_bonus to apply, plus the plain wound_bonus 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 Lastly, we add the inherent wound_resistance variable the bodypart has (heads and chests are slightly harder to wound), and a small bonus if the limb is already disabled
Arguments:
- It's the same ones on [/obj/item/bodypart/proc/receive_damage]
dismember
Remove target limb from it's owner, with side effects.
drop_limb
limb removal. The "special" argument is used for swapping a limb with a new one without the effects of losing a limb kicking in.
generate_husk_key
Generates a cache key specifically for husks
generate_icon_key
Called from update_body_parts() these procs handle the limb icon cache. the limb icon cache adds an icon_render_key to a human mob, it represents:
- Gender, if applicable
- The ID of the limb
- Draw color, if applicable These procs only store limbs as to increase the number of matching icon_render_keys This cache exists because drawing 6/7 icons for humans constantly is quite a waste See RemieRichards on irc.rizon.net #coderbus (RIP remie :sob:)
get_limb_icon
Generates an /image for the limb to be used as an overlay
get_mangled_state
get_mangled_state() is relevant for flesh and bone bodyparts, and returns whether this bodypart has mangled skin, mangled bone, or both (or neither i guess)
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)
Returns: BODYPART_MANGLED_NONE if we're fine, BODYPART_MANGLED_FLESH if our skin is broken, BODYPART_MANGLED_BONE if our bone is broken, or BODYPART_MANGLED_BOTH if both are broken and we're up for dismembering
get_modified_bleed_rate
Returns our bleed rate, taking into account laying down and grabbing the limb
get_organs
since organs aren't actually stored in the bodypart themselves while attached to a person, we have to query the owner for what we should have
get_wound_type
Get whatever wound of the given type is currently attached to this limb, if any
on_attempt_feature_restyle
Invoke async so we dont break signals
on_attempt_feature_restyle_mob
Someone used a restyling thingymajigga on our limb owner
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.
painless_wound_roll
Allows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds
recolor_external_organs
Loops through all of the bodypart's external organs and update's their color.
refresh_bleed_rate
Refresh the cache of our rate of bleeding sans any modifiers ANYTHING ADDED TO THIS PROC NEEDS TO CALL IT WHEN IT'S EFFECT CHANGES
remove_bodypart_overlay
Remove a bodypart overlay and call the appropriate update procs
replace_limb
Try to attach this bodypart to a mob, while replacing one if it exists, does nothing if it fails.
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:
- seep_amt - How much absorption capacity we're removing from our current bandages (think, how much blood or pus are we soaking up this tick?)
setBleedStacks
Embedded objects effect bleed rate, gotta refresh lads Sets our generic bleedstacks
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_owner
Proc to change the value of the owner
variable and react to the event of its change.
synchronize_bodytypes
Transfer existing hair properties to the new human. Makes sure that the owner's bodytype flags match the flags of all of it's parts.
try_attach_limb
Attach src to target mob if able, returns FALSE if it fails to.
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 described in the above proc, /obj/item/bodypart/proc/get_mangled_state. 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:
- wounding_type: Either WOUND_BLUNT, WOUND_SLASH, or WOUND_PIERCE, basically only matters for the dismember message
- wounding_dmg: The damage of the strike that prompted this roll, higher damage = higher chance
- wound_bonus: Not actually used right now, but maybe someday
- bare_wound_bonus: ditto above
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
Arguments:
- replaced- If true, this is being called from the remove_wound() of a wound that's being replaced, so the bandage that already existed is still relevant, but the new wound hasn't been added yet