Files
Paradise/datum/component/shielded.html
T

3 lines
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/component/shielded - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/component/shielded.html#var">Var Details</a> - <a href="datum/component/shielded.html#proc">Proc Details</a></header><main><h1>shielded <aside>/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/shielded.html">shielded</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L5"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 5"></a></h1><p>The shielded component causes the parent item to nullify a certain number of attacks against the wearer, see: shielded vests.</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/component/shielded.html#var/charge_add_cd">charge_add_cd</a></th><td>The cooldown tracking when we last replenished a charge</td></tr><tr><th><a href="datum/component/shielded.html#var/charge_increment_delay">charge_increment_delay</a></th><td>Once we go unhit long enough to recharge, we replenish charges this often. The floor is effectively 1 second, AKA how often SSdcs processes</td></tr><tr><th><a href="datum/component/shielded.html#var/charge_recovery">charge_recovery</a></th><td>How many charges we recover on each charge increment</td></tr><tr><th><a href="datum/component/shielded.html#var/current_charges">current_charges</a></th><td>How many charges we currently have</td></tr><tr><th><a href="datum/component/shielded.html#var/lose_multiple_charges">lose_multiple_charges</a></th><td>Should the shield lose charges equal to the damage dealt by a hit?</td></tr><tr><th><a href="datum/component/shielded.html#var/max_charges">max_charges</a></th><td>How many charges we can have max, and how many we start with</td></tr><tr><th><a href="datum/component/shielded.html#var/on_hit_effects">on_hit_effects</a></th><td>A callback for the sparks/message that play when a charge is used, see <a href="datum/component/shielded.html#proc/default_run_hit_callback" title="/datum/component/shielded">/datum/component/shielded/proc/default_run_hit_callback</a></td></tr><tr><th><a href="datum/component/shielded.html#var/recently_hit_cd">recently_hit_cd</a></th><td>The cooldown tracking when we were last hit</td></tr><tr><th><a href="datum/component/shielded.html#var/recharge_path">recharge_path</a></th><td>The item we use for recharging</td></tr><tr><th><a href="datum/component/shielded.html#var/recharge_start_delay">recharge_start_delay</a></th><td>How long we have to avoid being hit to replenish charges. If set to 0, we never recharge lost charges</td></tr><tr><th><a href="datum/component/shielded.html#var/shield_icon">shield_icon</a></th><td>What icon is used when someone has a functional shield up</td></tr><tr><th><a href="datum/component/shielded.html#var/shield_icon_file">shield_icon_file</a></th><td>What .dmi we're pulling the shield icon from</td></tr><tr><th><a href="datum/component/shielded.html#var/shield_inhand">shield_inhand</a></th><td>Do we still shield if we're being held in-hand? If FALSE, it needs to be equipped to a slot to work</td></tr><tr><th><a href="datum/component/shielded.html#var/show_charge_as_alpha">show_charge_as_alpha</a></th><td>Should the shield's alpha change to show its remaining charge</td></tr><tr><th><a href="datum/component/shielded.html#var/wearer">wearer</a></th><td>The person currently wearing us</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/component/shielded.html#proc/actually_run_hit_callback">actually_run_hit_callback</a></th><td>The wrapper to invoke the on_hit callback, so we don't have to worry about blocking in the signal handler</td></tr><tr><th><a href="datum/component/shielded.html#proc/default_run_hit_callback">default_run_hit_callback</a></th><td>Default on_hit proc, since cult robes are stupid and have different descriptions/sparks</td></tr><tr><th><a href="datum/component/shielded.html#proc/lost_wearer">lost_wearer</a></th><td>Either we've been dropped or our wearer has been QDEL'd. Either way, they're no longer our problem</td></tr><tr><th><a href="datum/component/shielded.html#proc/on_equipped">on_equipped</a></th><td>Check if we've been equipped to a valid slot to shield</td></tr><tr><th><a href="datum/component/shielded.html#proc/on_hit_react">on_hit_react</a></th><td>This proc fires when we're hit, and is responsible for checking if we're charged, then deducting one + returning that we're blocking if so.
It then runs the callback in <a href="datum/component/shielded.html#var/on_hit_effects" title="/datum/component/shielded">/datum/component/shielded/var/on_hit_effects</a> which handles the messages/sparks (so the visuals)</td></tr><tr><th><a href="datum/component/shielded.html#proc/on_update_overlays">on_update_overlays</a></th><td>Used to draw the shield overlay on the wearer</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/charge_add_cd"><aside class="declaration">var </aside>charge_add_cd <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L33"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 33"></a></h3><p>The cooldown tracking when we last replenished a charge</p><h3 id="var/charge_increment_delay"><aside class="declaration">var </aside>charge_increment_delay <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L15"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 15"></a></h3><p>Once we go unhit long enough to recharge, we replenish charges this often. The floor is effectively 1 second, AKA how often SSdcs processes</p><h3 id="var/charge_recovery"><aside class="declaration">var </aside>charge_recovery <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L17"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 17"></a></h3><p>How many charges we recover on each charge increment</p><h3 id="var/current_charges"><aside class="declaration">var </aside>current_charges <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L11"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 11"></a></h3><p>How many charges we currently have</p><h3 id="var/lose_multiple_charges"><aside class="declaration">var </aside>lose_multiple_charges <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L25"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 25"></a></h3><p>Should the shield lose charges equal to the damage dealt by a hit?</p><h3 id="var/max_charges"><aside class="declaration">var </aside>max_charges <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L9"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 9"></a></h3><p>How many charges we can have max, and how many we start with</p><h3 id="var/on_hit_effects"><aside class="declaration">var </aside>on_hit_effects <aside> /<a href="datum.html">datum</a>/callback</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L35"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 35"></a></h3><p>A callback for the sparks/message that play when a charge is used, see <a href="datum/component/shielded.html#proc/default_run_hit_callback" title="/datum/component/shielded">/datum/component/shielded/proc/default_run_hit_callback</a></p><h3 id="var/recently_hit_cd"><aside class="declaration">var </aside>recently_hit_cd <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L31"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 31"></a></h3><p>The cooldown tracking when we were last hit</p><h3 id="var/recharge_path"><aside class="declaration">var </aside>recharge_path <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L29"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 29"></a></h3><p>The item we use for recharging</p><h3 id="var/recharge_start_delay"><aside class="declaration">var </aside>recharge_start_delay <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L13"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 13"></a></h3><p>How long we have to avoid being hit to replenish charges. If set to 0, we never recharge lost charges</p><h3 id="var/shield_icon"><aside class="declaration">var </aside>shield_icon <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L21"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 21"></a></h3><p>What icon is used when someone has a functional shield up</p><h3 id="var/shield_icon_file"><aside class="declaration">var </aside>shield_icon_file <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L19"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 19"></a></h3><p>What .dmi we're pulling the shield icon from</p><h3 id="var/shield_inhand"><aside class="declaration">var </aside>shield_inhand <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L23"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 23"></a></h3><p>Do we still shield if we're being held in-hand? If FALSE, it needs to be equipped to a slot to work</p><h3 id="var/show_charge_as_alpha"><aside class="declaration">var </aside>show_charge_as_alpha <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L27"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 27"></a></h3><p>Should the shield's alpha change to show its remaining charge</p><h3 id="var/wearer"><aside class="declaration">var </aside>wearer <aside> /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L7"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 7"></a></h3><p>The person currently wearing us</p><h2 id="proc">Proc Details</h2><h3 id="proc/actually_run_hit_callback"><aside class="declaration">proc </aside>actually_run_hit_callback<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/owner, attack_text, current_charges) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L177"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 177"></a></aside></h3><p>The wrapper to invoke the on_hit callback, so we don't have to worry about blocking in the signal handler</p><h3 id="proc/default_run_hit_callback"><aside class="declaration">proc </aside>default_run_hit_callback<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/owner, attack_text, current_charges) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L181"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 181"></a></aside></h3><p>Default on_hit proc, since cult robes are stupid and have different descriptions/sparks</p><h3 id="proc/lost_wearer"><aside class="declaration">proc </aside>lost_wearer<aside>(/<a href="datum.html">datum</a>/source, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L118"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 118"></a></aside></h3><p>Either we've been dropped or our wearer has been QDEL'd. Either way, they're no longer our problem</p><h3 id="proc/on_equipped"><aside class="declaration">proc </aside>on_equipped<aside>(/<a href="datum.html">datum</a>/source, /<a href="mob.html">mob</a>/user, slot) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L109"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 109"></a></aside></h3><p>Check if we've been equipped to a valid slot to shield</p><h3 id="proc/on_hit_react"><aside class="declaration">proc </aside>on_hit_react<aside>(/<a href="datum.html">datum</a>/source, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/<a href="mob/living/carbon/human.html">human</a>/owner, /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/hitby, damage, attack_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L145"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 145"></a></aside></h3><p>This proc fires when we're hit, and is responsible for checking if we're charged, then deducting one + returning that we're blocking if so.
It then runs the callback in <a href="datum/component/shielded.html#var/on_hit_effects" title="/datum/component/shielded">/datum/component/shielded/var/on_hit_effects</a> which handles the messages/sparks (so the visuals)</p><h3 id="proc/on_update_overlays"><aside class="declaration">proc </aside>on_update_overlays<aside>(/<a href="atom.html">atom</a>/parent_atom, /list/overlays) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/shielded.dm#L134"><img src="git.png" width="16" height="16" title="code/datums/components/shielded.dm 134"></a></aside></h3><p>Used to draw the shield overlay on the wearer</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>