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

1 line
17 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>/obj/machinery/duct - /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/machinery/duct.html#var">Var Details</a> - <a href="obj/machinery/duct.html#proc">Proc Details</a></header><main><h1>duct <aside>/<a href="obj.html">obj</a>/<a href="obj/machinery.html">machinery</a>/<a href="obj/machinery/duct.html">duct</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L6"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 6"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/machinery/duct.html#var/active">active</a></th><td>wheter to even bother with plumbing code or not</td></tr><tr><th><a href="obj/machinery/duct.html#var/capacity">capacity</a></th><td>amount we can transfer per process. note that the ductnet can carry as much as the lowest capacity duct</td></tr><tr><th><a href="obj/machinery/duct.html#var/color_to_color_support">color_to_color_support</a></th><td>TRUE to let colors connect when forced with a wrench, false to just not do that at all</td></tr><tr><th><a href="obj/machinery/duct.html#var/connects">connects</a></th><td>bitfield with the directions we're connected in</td></tr><tr><th><a href="obj/machinery/duct.html#var/drop_on_wrench">drop_on_wrench</a></th><td>wheter we just unanchored or drop whatever is in the variable. either is safe</td></tr><tr><th><a href="obj/machinery/duct.html#var/duct">duct</a></th><td>our ductnet, wich tracks what we're connected to</td></tr><tr><th><a href="obj/machinery/duct.html#var/duct_color">duct_color</a></th><td>the color of our duct</td></tr><tr><th><a href="obj/machinery/duct.html#var/duct_layer">duct_layer</a></th><td>1,2,4,8,16</td></tr><tr><th><a href="obj/machinery/duct.html#var/dumb">dumb</a></th><td>set to TRUE to disable smart duct behaviour</td></tr><tr><th><a href="obj/machinery/duct.html#var/ignore_colors">ignore_colors</a></th><td>TRUE to ignore colors, so yeah we also connect with other colors without issue</td></tr><tr><th><a href="obj/machinery/duct.html#var/lock_connects">lock_connects</a></th><td>wheter we allow our connects to be changed after initialization or not</td></tr><tr><th><a href="obj/machinery/duct.html#var/lock_layers">lock_layers</a></th><td>whether we allow our layers to be altered</td></tr><tr><th><a href="obj/machinery/duct.html#var/neighbours">neighbours</a></th><td>track ducts we're connected to. Mainly for ducts we connect to that we normally wouldn't, like different layers and colors, for when we regenerate the ducts</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/machinery/duct.html#proc/add_connects">add_connects</a></th><td>add a connect direction</td></tr><tr><th><a href="obj/machinery/duct.html#proc/add_neighbour">add_neighbour</a></th><td>add a duct as neighbour. this means we're connected and will connect again if we ever regenerate</td></tr><tr><th><a href="obj/machinery/duct.html#proc/attempt_connect">attempt_connect</a></th><td>start looking around us for stuff to connect to</td></tr><tr><th><a href="obj/machinery/duct.html#proc/can_anchor">can_anchor</a></th><td>collection of all the sanity checks to prevent us from stacking ducts that shouldn't be stacked</td></tr><tr><th><a href="obj/machinery/duct.html#proc/connect_duct">connect_duct</a></th><td>connect to a duct</td></tr><tr><th><a href="obj/machinery/duct.html#proc/connect_network">connect_network</a></th><td>see if whatever we found can be connected to</td></tr><tr><th><a href="obj/machinery/duct.html#proc/connect_plumber">connect_plumber</a></th><td>connect to a plumbing object</td></tr><tr><th><a href="obj/machinery/duct.html#proc/create_duct">create_duct</a></th><td>create a new duct datum</td></tr><tr><th><a href="obj/machinery/duct.html#proc/disconnect_duct">disconnect_duct</a></th><td>we disconnect ourself from our neighbours. we also destroy our ductnet and tell our neighbours to make a new one</td></tr><tr><th><a href="obj/machinery/duct.html#proc/generate_connects">generate_connects</a></th><td>Special proc to draw a new connect frame based on neighbours. not the norm so we can support multiple duct kinds</td></tr><tr><th><a href="obj/machinery/duct.html#proc/get_adjacent_ducts">get_adjacent_ducts</a></th><td>get a list of the ducts we can connect to if we are dumb</td></tr><tr><th><a href="obj/machinery/duct.html#proc/handle_layer">handle_layer</a></th><td>update the layer we are on</td></tr><tr><th><a href="obj/machinery/duct.html#proc/lose_neighbours">lose_neighbours</a></th><td>remove all our neighbours, and remove us from our neighbours aswell</td></tr><tr><th><a href="obj/machinery/duct.html#proc/reconnect">reconnect</a></th><td>''''''''''''''''optimized''''''''''''''''' proc for quickly reconnecting after a duct net was destroyed</td></tr><tr><th><a href="obj/machinery/duct.html#proc/remove_connects">remove_connects</a></th><td>remove a connect direction</td></tr><tr><th><a href="obj/machinery/duct.html#proc/reset_connects">reset_connects</a></th><td>remove our connects</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/modules/plumbing/ducts.dm#L33"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 33"></a></h3><p>wheter to even bother with plumbing code or not</p><h3 id="var/capacity"><aside class="declaration">var </aside>capacity <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L20"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 20"></a></h3><p>amount we can transfer per process. note that the ductnet can carry as much as the lowest capacity duct</p><h3 id="var/color_to_color_support"><aside class="declaration">var </aside>color_to_color_support <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L31"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 31"></a></h3><p>TRUE to let colors connect when forced with a wrench, false to just not do that at all</p><h3 id="var/connects"><aside class="declaration">var </aside>connects <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L12"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 12"></a></h3><p>bitfield with the directions we're connected in</p><h3 id="var/drop_on_wrench"><aside class="declaration">var </aside>drop_on_wrench <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L37"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 37"></a></h3><p>wheter we just unanchored or drop whatever is in the variable. either is safe</p><h3 id="var/duct"><aside class="declaration">var </aside>duct <aside> /<a href="datum.html">datum</a>/<a href="datum/ductnet.html">ductnet</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L18"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 18"></a></h3><p>our ductnet, wich tracks what we're connected to</p><h3 id="var/duct_color"><aside class="declaration">var </aside>duct_color <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L23"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 23"></a></h3><p>the color of our duct</p><h3 id="var/duct_layer"><aside class="declaration">var </aside>duct_layer <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L27"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 27"></a></h3><p>1,2,4,8,16</p><h3 id="var/dumb"><aside class="declaration">var </aside>dumb <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L14"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 14"></a></h3><p>set to TRUE to disable smart duct behaviour</p><h3 id="var/ignore_colors"><aside class="declaration">var </aside>ignore_colors <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L25"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 25"></a></h3><p>TRUE to ignore colors, so yeah we also connect with other colors without issue</p><h3 id="var/lock_connects"><aside class="declaration">var </aside>lock_connects <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L16"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 16"></a></h3><p>wheter we allow our connects to be changed after initialization or not</p><h3 id="var/lock_layers"><aside class="declaration">var </aside>lock_layers <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L29"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 29"></a></h3><p>whether we allow our layers to be altered</p><h3 id="var/neighbours"><aside class="declaration">var </aside>neighbours <aside> /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L35"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 35"></a></h3><p>track ducts we're connected to. Mainly for ducts we connect to that we normally wouldn't, like different layers and colors, for when we regenerate the ducts</p><h2 id="proc">Proc Details</h2><h3 id="proc/add_connects"><aside class="declaration">proc </aside>add_connects<aside>(new_connects) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L219"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 219"></a></aside></h3><p>add a connect direction</p><h3 id="proc/add_neighbour"><aside class="declaration">proc </aside>add_neighbour<aside>(/<a href="obj.html">obj</a>/<a href="obj/machinery.html">machinery</a>/<a href="obj/machinery/duct.html">duct</a>/D, direction) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L206"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 206"></a></aside></h3><p>add a duct as neighbour. this means we're connected and will connect again if we ever regenerate</p><h3 id="proc/attempt_connect"><aside class="declaration">proc </aside>attempt_connect<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L71"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 71"></a></aside></h3><p>start looking around us for stuff to connect to</p><h3 id="proc/can_anchor"><aside class="declaration">proc </aside>can_anchor<aside>(/<a href="turf.html">turf</a>/T) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L297"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 297"></a></aside></h3><p>collection of all the sanity checks to prevent us from stacking ducts that shouldn't be stacked</p><h3 id="proc/connect_duct"><aside class="declaration">proc </aside>connect_duct<aside>(/<a href="obj.html">obj</a>/<a href="obj/machinery.html">machinery</a>/<a href="obj/machinery/duct.html">duct</a>/D, direction, ignore_color) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L97"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 97"></a></aside></h3><p>connect to a duct</p><h3 id="proc/connect_network"><aside class="declaration">proc </aside>connect_network<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/AM, direction, ignore_color) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L87"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 87"></a></aside></h3><p>see if whatever we found can be connected to</p><h3 id="proc/connect_plumber"><aside class="declaration">proc </aside>connect_plumber<aside>(/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/plumbing.html">plumbing</a>/P, direction) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L137"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 137"></a></aside></h3><p>connect to a plumbing object</p><h3 id="proc/create_duct"><aside class="declaration">proc </aside>create_duct<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L201"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 201"></a></aside></h3><p>create a new duct datum</p><h3 id="proc/disconnect_duct"><aside class="declaration">proc </aside>disconnect_duct<aside>(skipanchor) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L154"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 154"></a></aside></h3><p>we disconnect ourself from our neighbours. we also destroy our ductnet and tell our neighbours to make a new one</p><h3 id="proc/generate_connects"><aside class="declaration">proc </aside>generate_connects<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L192"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 192"></a></aside></h3><p>Special proc to draw a new connect frame based on neighbours. not the norm so we can support multiple duct kinds</p><h3 id="proc/get_adjacent_ducts"><aside class="declaration">proc </aside>get_adjacent_ducts<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L234"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 234"></a></aside></h3><p>get a list of the ducts we can connect to if we are dumb</p><h3 id="proc/handle_layer"><aside class="declaration">proc </aside>handle_layer<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L258"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 258"></a></aside></h3><p>update the layer we are on</p><h3 id="proc/lose_neighbours"><aside class="declaration">proc </aside>lose_neighbours<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L213"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 213"></a></aside></h3><p>remove all our neighbours, and remove us from our neighbours aswell</p><h3 id="proc/reconnect"><aside class="declaration">proc </aside>reconnect<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L168"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 168"></a></aside></h3><p>''''''''''''''''optimized''''''''''''''''' proc for quickly reconnecting after a duct net was destroyed</p><h3 id="proc/remove_connects"><aside class="declaration">proc </aside>remove_connects<aside>(dead_connects) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L224"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 224"></a></aside></h3><p>remove a connect direction</p><h3 id="proc/reset_connects"><aside class="declaration">proc </aside>reset_connects<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/plumbing/ducts.dm#L229"><img src="git.png" width="16" height="16" title="code/modules/plumbing/ducts.dm 229"></a></aside></h3><p>remove our connects</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>