limb
Vars | |
bodypart_disabled | If disabled, limb is as good as missing. |
---|---|
can_be_disabled | Controls whether bodypart_disabled makes sense or not for this limb. |
current_gauze | If we have a gauze wrapping currently applied (not including splints) |
disable_threshold | Multiplied by max_damage it returns the threshold which defines a limb being disabled or not. From 0 to 1. 0 means no disable thru damage |
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. |
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/grasp_self) |
last_maxed | So we know if we need to scream if this limb hits max damage |
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 |
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 | |
apply_gauze | apply_gauze() is used to- well, apply gauze to a bodypart |
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 |
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. |
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_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_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 |
seep_gauze | seep_gauze() is for when a gauze wrapping absorbs blood or pus from wounds, lowering its absorption capacity. |
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. |
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
bodypart_disabled
If disabled, limb is as good as missing.
can_be_disabled
Controls whether bodypart_disabled makes sense or not for this limb.
current_gauze
If we have a gauze wrapping currently applied (not including splints)
disable_threshold
Multiplied by max_damage it returns the threshold which defines a limb being disabled or not. From 0 to 1. 0 means no disable thru damage
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.
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/grasp_self)
last_maxed
So we know if we need to scream if this limb hits max damage
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
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
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
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_wounding_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]
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.
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_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_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
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 fall 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?)
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.
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