48 lines
20 KiB
HTML
48 lines
20 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>/obj/item/bodypart - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="obj/item/bodypart.html#var">Var Details</a> - <a href="obj/item/bodypart.html#proc">Proc Details</a></header><main><h1>bodypart <aside>/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/bodypart.html">bodypart</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L2"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 2"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/item/bodypart.html#var/current_gauze">current_gauze</a></th><td>If we have a gauze wrapping currently applied (not including splints)</td></tr><tr><th><a href="obj/item/bodypart.html#var/disable_threshold">disable_threshold</a></th><td>Threshold at which we are disabled. Defaults to max_damage if unset.</td></tr><tr><th><a href="obj/item/bodypart.html#var/disabled_wound_penalty">disabled_wound_penalty</a></th><td>When this bodypart hits max damage, this number is added to all wound rolls. Obviously only relevant for bodyparts that have damage caps.</td></tr><tr><th><a href="obj/item/bodypart.html#var/forcereplace">forcereplace</a></th><td>does this limb have replacement capability, despite probably not being robotic?</td></tr><tr><th><a href="obj/item/bodypart.html#var/generic_bleedstacks">generic_bleedstacks</a></th><td>How much generic bleedstacks we have on this bodypart</td></tr><tr><th><a href="obj/item/bodypart.html#var/last_maxed">last_maxed</a></th><td>So we know if we need to scream if this limb hits max damage</td></tr><tr><th><a href="obj/item/bodypart.html#var/scars">scars</a></th><td>The scars currently afflicting this body part</td></tr><tr><th><a href="obj/item/bodypart.html#var/scars_covered_by_clothes">scars_covered_by_clothes</a></th><td>A hat won't cover your face, but a shirt covering your chest will cover your... you know, chest</td></tr><tr><th><a href="obj/item/bodypart.html#var/wound_damage_multiplier">wound_damage_multiplier</a></th><td>Our current stored wound damage multiplier</td></tr><tr><th><a href="obj/item/bodypart.html#var/wound_resistance">wound_resistance</a></th><td>This number is subtracted from all wound rolls on this bodypart, higher numbers mean more defense, negative means easier to wound</td></tr><tr><th><a href="obj/item/bodypart.html#var/wounds">wounds</a></th><td>The wounds currently afflicting this body part</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/item/bodypart.html#proc/apply_gauze">apply_gauze</a></th><td>apply_gauze() is used to- well, apply gauze to a bodypart</td></tr><tr><th><a href="obj/item/bodypart.html#proc/check_wounding">check_wounding</a></th><td>check_wounding() is where we handle rolling for, selecting, and applying a wound if we meet the criteria</td></tr><tr><th><a href="obj/item/bodypart.html#proc/check_woundings_mods">check_woundings_mods</a></th><td>check_wounding_mods() is where we handle the various modifiers of a wound roll</td></tr><tr><th><a href="obj/item/bodypart.html#proc/get_disable_threshold">get_disable_threshold</a></th><td>Gets the damage at which point we're disabled.</td></tr><tr><th><a href="obj/item/bodypart.html#proc/get_mangled_state">get_mangled_state</a></th><td>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)</td></tr><tr><th><a href="obj/item/bodypart.html#proc/get_organs">get_organs</a></th><td>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</td></tr><tr><th><a href="obj/item/bodypart.html#proc/get_wound_type">get_wound_type</a></th><td>Get whatever wound of the given type is currently attached to this limb, if any</td></tr><tr><th><a href="obj/item/bodypart.html#proc/painless_wound_roll">painless_wound_roll</a></th><td>Allows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds</td></tr><tr><th><a href="obj/item/bodypart.html#proc/seep_gauze">seep_gauze</a></th><td>seep_gauze() is for when a gauze wrapping absorbs blood or pus from wounds, lowering its absorption capacity.</td></tr><tr><th><a href="obj/item/bodypart.html#proc/try_dismember">try_dismember</a></th><td>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</td></tr><tr><th><a href="obj/item/bodypart.html#proc/update_wounds">update_wounds</a></th><td>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</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/current_gauze"><aside class="declaration">var </aside>current_gauze <aside>– /<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/stack.html">stack</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L104"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 104"></a></h3><p>If we have a gauze wrapping currently applied (not including splints)</p><h3 id="var/disable_threshold"><aside class="declaration">var </aside>disable_threshold <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L36"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 36"></a></h3><p>Threshold at which we are disabled. Defaults to max_damage if unset.</p><h3 id="var/disabled_wound_penalty"><aside class="declaration">var </aside>disabled_wound_penalty <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L95"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 95"></a></h3><p>When this bodypart hits max damage, this number is added to all wound rolls. Obviously only relevant for bodyparts that have damage caps.</p><h3 id="var/forcereplace"><aside class="declaration">var </aside>forcereplace <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L107"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 107"></a></h3><p>does this limb have replacement capability, despite probably not being robotic?</p><h3 id="var/generic_bleedstacks"><aside class="declaration">var </aside>generic_bleedstacks <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L102"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 102"></a></h3><p>How much generic bleedstacks we have on this bodypart</p><h3 id="var/last_maxed"><aside class="declaration">var </aside>last_maxed <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L100"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 100"></a></h3><p>So we know if we need to scream if this limb hits max damage</p><h3 id="var/scars"><aside class="declaration">var </aside>scars <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L88"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 88"></a></h3><p>The scars currently afflicting this body part</p><h3 id="var/scars_covered_by_clothes"><aside class="declaration">var </aside>scars_covered_by_clothes <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L98"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 98"></a></h3><p>A hat won't cover your face, but a shirt covering your chest will cover your... you know, chest</p><h3 id="var/wound_damage_multiplier"><aside class="declaration">var </aside>wound_damage_multiplier <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L90"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 90"></a></h3><p>Our current stored wound damage multiplier</p><h3 id="var/wound_resistance"><aside class="declaration">var </aside>wound_resistance <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L93"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 93"></a></h3><p>This number is subtracted from all wound rolls on this bodypart, higher numbers mean more defense, negative means easier to wound</p><h3 id="var/wounds"><aside class="declaration">var </aside>wounds <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L85"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 85"></a></h3><p>The wounds currently afflicting this body part</p><h2 id="proc">Proc Details</h2><h3 id="proc/apply_gauze"><aside class="declaration">proc </aside>apply_gauze<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/stack.html">stack</a>/gauze) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L1021"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 1021"></a></aside></h3><p>apply_gauze() is used to- well, apply gauze to a bodypart</p>
|
||
<p>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.</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>gauze- Just the gauze stack we're taking a sheet from to apply here</li>
|
||
</ul><h3 id="proc/check_wounding"><aside class="declaration">proc </aside>check_wounding<aside>(woundtype, damage, wound_bonus, bare_wound_bonus) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L381"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 381"></a></aside></h3><p>check_wounding() is where we handle rolling for, selecting, and applying a wound if we meet the criteria</p>
|
||
<p>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</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>woundtype- Either WOUND_BLUNT, WOUND_SLASH, WOUND_PIERCE, or WOUND_BURN based on the attack type.</li>
|
||
<li>damage- How much damage is tied to this attack, since wounding potential scales with damage in an attack (see: WOUND_DAMAGE_EXPONENT)</li>
|
||
<li>wound_bonus- The wound_bonus of an attack</li>
|
||
<li>bare_wound_bonus- The bare_wound_bonus of an attack</li>
|
||
</ul><h3 id="proc/check_woundings_mods"><aside class="declaration">proc </aside>check_woundings_mods<aside>(wounding_type, damage, wound_bonus, bare_wound_bonus) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L449"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 449"></a></aside></h3><p>check_wounding_mods() is where we handle the various modifiers of a wound roll</p>
|
||
<p>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</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>It's the same ones on [receive_damage]</li>
|
||
</ul><h3 id="proc/get_disable_threshold"><aside class="declaration">proc </aside>get_disable_threshold<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L522"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 522"></a></aside></h3><p>Gets the damage at which point we're disabled.</p><h3 id="proc/get_mangled_state"><aside class="declaration">proc </aside>get_mangled_state<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/dismemberment.dm#L168"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/dismemberment.dm 168"></a></aside></h3><p>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)</p>
|
||
<p>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)</p>
|
||
<p>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</p><h3 id="proc/get_organs"><aside class="declaration">proc </aside>get_organs<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L173"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 173"></a></aside></h3><p>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</p><h3 id="proc/get_wound_type"><aside class="declaration">proc </aside>get_wound_type<aside>(checking_type) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L961"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 961"></a></aside></h3><p>Get whatever wound of the given type is currently attached to this limb, if any</p><h3 id="proc/painless_wound_roll"><aside class="declaration">proc </aside>painless_wound_roll<aside>(wounding_type, phantom_wounding_dmg, wound_bonus, bare_wound_bonus, sharpness) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L326"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 326"></a></aside></h3><p>Allows us to roll for and apply a wound without actually dealing damage. Used for aggregate wounding power with pellet clouds</p><h3 id="proc/seep_gauze"><aside class="declaration">proc </aside>seep_gauze<aside>(seep_amt) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L1036"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 1036"></a></aside></h3><p>seep_gauze() is for when a gauze wrapping absorbs blood or pus from wounds, lowering its absorption capacity.</p>
|
||
<p>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.</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>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?)</li>
|
||
</ul><h3 id="proc/try_dismember"><aside class="declaration">proc </aside>try_dismember<aside>(wounding_type, wounding_dmg, wound_bonus, bare_wound_bonus) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/dismemberment.dm#L191"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/dismemberment.dm 191"></a></aside></h3><p>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</p>
|
||
<p>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</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>wounding_type: Either WOUND_BLUNT, WOUND_SLASH, or WOUND_PIERCE, basically only matters for the dismember message</li>
|
||
<li>wounding_dmg: The damage of the strike that prompted this roll, higher damage = higher chance</li>
|
||
<li>wound_bonus: Not actually used right now, but maybe someday</li>
|
||
<li>bare_wound_bonus: ditto above</li>
|
||
</ul><h3 id="proc/update_wounds"><aside class="declaration">proc </aside>update_wounds<aside>(replaced) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/surgery/bodyparts/_bodyparts.dm#L976"><img src="git.png" width="16" height="16" title="code/modules/surgery/bodyparts/_bodyparts.dm 976"></a></aside></h3><p>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</p>
|
||
<p>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</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>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</li>
|
||
</ul></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html> |