Files
2025-02-05 06:19:18 +00:00

3 lines
14 KiB
HTML
Raw Permalink 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/plumbing - /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="datum/component/plumbing.html#var">Var Details</a> - <a href="datum/component/plumbing.html#proc">Proc Details</a></header><main><h1>plumbing <aside>/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/plumbing.html">plumbing</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L1"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 1"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/component/plumbing.html#var/active">active</a></th><td>FALSE to pretty much just not exist in the plumbing world so we can be moved, TRUE to go plumbo mode</td></tr><tr><th><a href="datum/component/plumbing.html#var/demand_connects">demand_connects</a></th><td>direction in wich we act as a demander</td></tr><tr><th><a href="datum/component/plumbing.html#var/ducterlays">ducterlays</a></th><td>We can't just cut all of the parents' overlays, so we'll track them here</td></tr><tr><th><a href="datum/component/plumbing.html#var/ducts">ducts</a></th><td>Index with &quot;1&quot; = /datum/ductnet/theductpointingnorth etc. &quot;1&quot; being the num2text from NORTH define</td></tr><tr><th><a href="datum/component/plumbing.html#var/reagents">reagents</a></th><td>shortcut to our parents' reagent holder</td></tr><tr><th><a href="datum/component/plumbing.html#var/supply_connects">supply_connects</a></th><td>directions in wich we act as a supplier</td></tr><tr><th><a href="datum/component/plumbing.html#var/turn_connects">turn_connects</a></th><td>if TRUE connects will spin with the parent object visually and codually, so you can have it work in any direction. FALSE if you want it to be static</td></tr><tr><th><a href="datum/component/plumbing.html#var/use_overlays">use_overlays</a></th><td>TRUE if we wanna add proper pipe outless under our parent object. this is pretty good if i may so so myself</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/component/plumbing.html#proc/can_add">can_add</a></th><td>Can we be added to the ductnet?</td></tr><tr><th><a href="datum/component/plumbing.html#proc/can_give">can_give</a></th><td>returns TRUE when they can give the specified amount and reagent. called by process request</td></tr><tr><th><a href="datum/component/plumbing.html#proc/create_overlays">create_overlays</a></th><td>We create our luxurious piping overlays/underlays, to indicate where we do what. only called once if use_overlays = TRUE in Initialize()</td></tr><tr><th><a href="datum/component/plumbing.html#proc/disable">disable</a></th><td>we stop acting like a plumbing thing and disconnect if we are, so we can safely be moved and stuff</td></tr><tr><th><a href="datum/component/plumbing.html#proc/enable">enable</a></th><td>settle wherever we are, and start behaving like a piece of plumbing</td></tr><tr><th><a href="datum/component/plumbing.html#proc/get_original_direction">get_original_direction</a></th><td>Give the direction of a pipe, and it'll return wich direction it originally was when it's object pointed SOUTH</td></tr><tr><th><a href="datum/component/plumbing.html#proc/process_request">process_request</a></th><td>check who can give us what we want, and how many each of them will give us</td></tr><tr><th><a href="datum/component/plumbing.html#proc/send_request">send_request</a></th><td>called from in process(). only calls process_request(), but can be overwritten for children with special behaviour</td></tr><tr><th><a href="datum/component/plumbing.html#proc/toggle_active">toggle_active</a></th><td>Toggle our machinery on or off. This is called by a hook from default_unfasten_wrench with anchored as only param, so we dont have to copypaste this on every object that can move</td></tr><tr><th><a href="datum/component/plumbing.html#proc/transfer_to">transfer_to</a></th><td>this is where the reagent is actually transferred and is thus the finish point of our process()</td></tr><tr><th><a href="datum/component/plumbing.html#proc/update_dir">update_dir</a></th><td>We update our connects only when we settle down by taking our current and original direction to find our new connects
If someone wants it to fucking spin while connected to something go actually knock yourself out</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/active"><aside class="declaration">var </aside>active <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L15"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 15"></a></h3><p>FALSE to pretty much just not exist in the plumbing world so we can be moved, TRUE to go plumbo mode</p><h3 id="var/demand_connects"><aside class="declaration">var </aside>demand_connects <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L13"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 13"></a></h3><p>direction in wich we act as a demander</p><h3 id="var/ducterlays"><aside class="declaration">var </aside>ducterlays <aside> /list/image</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L9"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 9"></a></h3><p>We can't just cut all of the parents' overlays, so we'll track them here</p><h3 id="var/ducts"><aside class="declaration">var </aside>ducts <aside> /list/datum/ductnet</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L3"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 3"></a></h3><p>Index with &quot;1&quot; = /datum/ductnet/theductpointingnorth etc. &quot;1&quot; being the num2text from NORTH define</p><h3 id="var/reagents"><aside class="declaration">var </aside>reagents <aside> /<a href="datum.html">datum</a>/<a href="datum/reagents.html">reagents</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L5"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 5"></a></h3><p>shortcut to our parents' reagent holder</p><h3 id="var/supply_connects"><aside class="declaration">var </aside>supply_connects <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L11"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 11"></a></h3><p>directions in wich we act as a supplier</p><h3 id="var/turn_connects"><aside class="declaration">var </aside>turn_connects <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L17"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 17"></a></h3><p>if TRUE connects will spin with the parent object visually and codually, so you can have it work in any direction. FALSE if you want it to be static</p><h3 id="var/use_overlays"><aside class="declaration">var </aside>use_overlays <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L7"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 7"></a></h3><p>TRUE if we wanna add proper pipe outless under our parent object. this is pretty good if i may so so myself</p><h2 id="proc">Proc Details</h2><h3 id="proc/can_add"><aside class="declaration">proc </aside>can_add<aside>(/<a href="datum.html">datum</a>/<a href="datum/ductnet.html">ductnet</a>/D, dir) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L46"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 46"></a></aside></h3><p>Can we be added to the ductnet?</p><h3 id="proc/can_give"><aside class="declaration">proc </aside>can_give<aside>(amount, reagent, /<a href="datum.html">datum</a>/<a href="datum/ductnet.html">ductnet</a>/net) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L73"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 73"></a></aside></h3><p>returns TRUE when they can give the specified amount and reagent. called by process request</p><h3 id="proc/create_overlays"><aside class="declaration">proc </aside>create_overlays<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L93"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 93"></a></aside></h3><p>We create our luxurious piping overlays/underlays, to indicate where we do what. only called once if use_overlays = TRUE in Initialize()</p><h3 id="proc/disable"><aside class="declaration">proc </aside>disable<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L126"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 126"></a></aside></h3><p>we stop acting like a plumbing thing and disconnect if we are, so we can safely be moved and stuff</p><h3 id="proc/enable"><aside class="declaration">proc </aside>enable<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L140"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 140"></a></aside></h3><p>settle wherever we are, and start behaving like a piece of plumbing</p><h3 id="proc/get_original_direction"><aside class="declaration">proc </aside>get_original_direction<aside>(dir) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L193"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 193"></a></aside></h3><p>Give the direction of a pipe, and it'll return wich direction it originally was when it's object pointed SOUTH</p><h3 id="proc/process_request"><aside class="declaration">proc </aside>process_request<aside>(amount, reagent, dir) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L59"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 59"></a></aside></h3><p>check who can give us what we want, and how many each of them will give us</p><h3 id="proc/send_request"><aside class="declaration">proc </aside>send_request<aside>(dir) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L56"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 56"></a></aside></h3><p>called from in process(). only calls process_request(), but can be overwritten for children with special behaviour</p><h3 id="proc/toggle_active"><aside class="declaration">proc </aside>toggle_active<aside>(/<a href="obj.html">obj</a>/O, new_state) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L165"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 165"></a></aside></h3><p>Toggle our machinery on or off. This is called by a hook from default_unfasten_wrench with anchored as only param, so we dont have to copypaste this on every object that can move</p><h3 id="proc/transfer_to"><aside class="declaration">proc </aside>transfer_to<aside>(/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/plumbing.html">plumbing</a>/target, amount, reagent, /<a href="datum.html">datum</a>/<a href="datum/ductnet.html">ductnet</a>/net) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L85"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 85"></a></aside></h3><p>this is where the reagent is actually transferred and is thus the finish point of our process()</p><h3 id="proc/update_dir"><aside class="declaration">proc </aside>update_dir<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/components/plumbing/_plumbing.dm#L173"><img src="git.png" width="16" height="16" title="code/datums/components/plumbing/_plumbing.dm 173"></a></aside></h3><p>We update our connects only when we settle down by taking our current and original direction to find our new connects
If someone wants it to fucking spin while connected to something go actually knock yourself out</p></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>