bodypart

Vars | |
animal_origin | If it's a nonhuman bodypart (e.g. monkey) |
---|---|
body_damage_coeff | Multiplier of the limb's damage that gets applied to the mob |
body_part | bitflag used to check which clothes cover this bodypart |
bodypart_disabled | If disabled, limb is as good as missing. |
bodytype | List of bodytypes flags, important for fitting clothing. If you'd like to know if a bodypart is organic, please use is_organic_limb() |
bone_status | Is it fine, broken, splinted, or just straight up fucking gone |
brute_reduction | Subtracted from brute damage taken |
burn_reduction | Subtracted from burn damage taken |
can_be_disabled | Controls whether bodypart_disabled makes sense or not for this limb. |
cremation_progress | Gradually increases while burning when at full damage, destroys the limb when at 100 |
damage_color | The colour of damage done to this bodypart |
disable_threshold | Multiplied by max_damage it returns the threshold which defines a limb being disabled or not. From 0 to 1. |
dismemberable | Whether it can be dismembered with a weapon |
dmg_overlay_type | the type of damage overlay (if any) to use when this bodypart is bruised/burned. |
draw_color | Greyscale draw color |
held_index | Are we a hand? if so, which one! |
is_dimorphic | Is there a sprite difference between male and female? |
is_husked | Whether the limb is husked |
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_gender | Defines what sprite the limb should use if it is also sexually dimorphic. |
limb_id | This is effectively the icon_state prefix for limbs. |
overlay_icon_state | The icon state of the limb's overlay, colored with a different color |
plaintext_zone | The body zone of this part in english ("chest", "left arm", etc) without the species attached to it |
plantigrade_forced | Whether the clothing being worn forces the limb into being "squished" to plantigrade/standard humanoid compliance |
should_draw_greyscale | Limbs need this information as a back-up incase they are generated outside of a carbon (limbgrower) |
species_secondary_color | The color of the limb's overlay |
use_damage_color | Should we even use a color? |
uses_mutcolor | Does this limb have a greyscale version? |
Procs | |
deconstruct | This is the MEAT of limb icon code |
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: |
on_owner_easylimbwound_trait_gain | Called when TRAIT_EASYLIMBDISABLE is added to the owner. |
on_owner_easylimbwound_trait_loss | Called when TRAIT_EASYLIMBDISABLE is removed from the 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. |
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. |
set_stamina_dam | Proc to hook behavior associated to the change of the stamina_dam variable's value. |
Var Details
animal_origin

If it's a nonhuman bodypart (e.g. monkey)
body_damage_coeff

Multiplier of the limb's damage that gets applied to the mob
body_part

bitflag used to check which clothes cover this bodypart
bodypart_disabled

If disabled, limb is as good as missing.
bodytype

List of bodytypes flags, important for fitting clothing. If you'd like to know if a bodypart is organic, please use is_organic_limb()
bone_status

Is it fine, broken, splinted, or just straight up fucking gone
brute_reduction

Subtracted from brute damage taken
burn_reduction

Subtracted from burn damage taken
can_be_disabled

Controls whether bodypart_disabled makes sense or not for this limb.
cremation_progress

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

The colour of damage done to this bodypart
disable_threshold

Multiplied by max_damage it returns the threshold which defines a limb being disabled or not. From 0 to 1.
dismemberable

Whether it can be dismembered with a weapon
dmg_overlay_type

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

Greyscale draw color
held_index

Are we a hand? if so, which one!
is_dimorphic

Is there a sprite difference between male and female?
is_husked

Whether the limb is husked
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_gender

Defines what sprite the limb should use if it is also sexually dimorphic.
limb_id

This is effectively the icon_state prefix for limbs.
overlay_icon_state

The icon state of the limb's overlay, colored with a different color
plaintext_zone

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

Whether the clothing being worn forces the limb into being "squished" to plantigrade/standard humanoid compliance
should_draw_greyscale

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

The color of the limb's overlay
use_damage_color

Should we even use a color?
uses_mutcolor

Does this limb have a greyscale version?
Proc Details
deconstruct
This is the MEAT of limb icon code
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
- Whether or not it's digitigrade
- 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:)
on_owner_easylimbwound_trait_gain
Called when TRAIT_EASYLIMBDISABLE is added to the owner.
on_owner_easylimbwound_trait_loss
Called when TRAIT_EASYLIMBDISABLE is removed from the 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.
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.
set_stamina_dam
Proc to hook behavior associated to the change of the stamina_dam variable's value.