mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +01:00
15 lines
12 KiB
HTML
15 lines
12 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/obj/machinery - 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="obj/machinery.html#var">Var Details</a> - <a href="obj/machinery.html#proc">Proc Details</a></header><main><h1>machinery <aside>/<a href="obj.html">obj</a>/<a href="obj/machinery.html">machinery</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L2"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 2"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/machinery.html#var/active_power_consumption">active_power_consumption</a></th><td>How much power does this machine consume when it is in use. This should not be set manually, use the helper procs!</td></tr><tr><th><a href="obj/machinery.html#var/being_repaired">being_repaired</a></th><td>This is if the machinery is being repaired</td></tr><tr><th><a href="obj/machinery.html#var/idle_power_consumption">idle_power_consumption</a></th><td>How much power does this machine consume when it is idling. This should not be set manually, use the helper procs!</td></tr><tr><th><a href="obj/machinery.html#var/machine_powernet">machine_powernet</a></th><td>The powernet this machine is connected to</td></tr><tr><th><a href="obj/machinery.html#var/power_channel">power_channel</a></th><td>The power channel this machine uses, idle/passive power consumption will pull from this channel and machine won't work if power channel has no power</td></tr><tr><th><a href="obj/machinery.html#var/power_initialized">power_initialized</a></th><td>Has power been initialized on this machine? Set in Initialize(), prevents all power updates to the local powernet until this is TRUE to avoid weird numbers.</td></tr><tr><th><a href="obj/machinery.html#var/power_state">power_state</a></th><td>How is this machine currently passively consuming power?</td></tr><tr><th><a href="obj/machinery.html#var/siemens_strength">siemens_strength</a></th><td>how badly will it shock you?</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/machinery.html#proc/_add_static_power">_add_static_power</a></th><td>Helper proc to positively adjust static power tracking on the machine's powernet, not meant for general use!</td></tr><tr><th><a href="obj/machinery.html#proc/_remove_static_power">_remove_static_power</a></th><td>Helper proc to negatively adjust static power tracking on the machine's powernet, not meant for general use!</td></tr><tr><th><a href="obj/machinery.html#proc/can_use_shortcut">can_use_shortcut</a></th><td>Makes sure the user is allowed to interact with the machine when they use a shortcut, like Control or Alt-clicking.</td></tr><tr><th><a href="obj/machinery.html#proc/change_power_mode">change_power_mode</a></th><td>Helper proc to change the machines power usage mode, automatically adjusts static power usage to maintain perfect parity</td></tr><tr><th><a href="obj/machinery.html#proc/get_internal_wires">get_internal_wires</a></th><td>Returns the wires of the machine, or null if not declared.</td></tr><tr><th><a href="obj/machinery.html#proc/has_power">has_power</a></th><td>POWER RELATED PROCS</td></tr><tr><th><a href="obj/machinery.html#proc/try_attack_hand">try_attack_hand</a></th><td>Preprocess machinery interaction.</td></tr><tr><th><a href="obj/machinery.html#proc/update_active_power_consumption">update_active_power_consumption</a></th><td>Safely changes the static power on the local powernet based on an adjustment in active power</td></tr><tr><th><a href="obj/machinery.html#proc/update_idle_power_consumption">update_idle_power_consumption</a></th><td>Safely changes the static power on the local powernet based on an adjustment in idle power</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/active_power_consumption"><aside class="declaration">var </aside>active_power_consumption <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L20"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 20"></a></h3><p>How much power does this machine consume when it is in use. This should not be set manually, use the helper procs!</p><h3 id="var/being_repaired"><aside class="declaration">var </aside>being_repaired <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L35"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 35"></a></h3><p>This is if the machinery is being repaired</p><h3 id="var/idle_power_consumption"><aside class="declaration">var </aside>idle_power_consumption <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L18"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 18"></a></h3><p>How much power does this machine consume when it is idling. This should not be set manually, use the helper procs!</p><h3 id="var/machine_powernet"><aside class="declaration">var </aside>machine_powernet <aside>– /<a href="datum.html">datum</a>/<a href="datum/local_powernet.html">local_powernet</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L24"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 24"></a></h3><p>The powernet this machine is connected to</p><h3 id="var/power_channel"><aside class="declaration">var </aside>power_channel <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L22"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 22"></a></h3><p>The power channel this machine uses, idle/passive power consumption will pull from this channel and machine won't work if power channel has no power</p><h3 id="var/power_initialized"><aside class="declaration">var </aside>power_initialized <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L26"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 26"></a></h3><p>Has power been initialized on this machine? Set in Initialize(), prevents all power updates to the local powernet until this is TRUE to avoid weird numbers.</p><h3 id="var/power_state"><aside class="declaration">var </aside>power_state <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L16"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 16"></a></h3><p>How is this machine currently passively consuming power?</p><h3 id="var/siemens_strength"><aside class="declaration">var </aside>siemens_strength <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L29"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 29"></a></h3><p>how badly will it shock you?</p><h2 id="proc">Proc Details</h2><h3 id="proc/_add_static_power"><aside class="declaration">proc </aside>_add_static_power<aside>(channel, amount) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L119"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 119"></a></aside></h3><p>Helper proc to positively adjust static power tracking on the machine's powernet, not meant for general use!</p><h3 id="proc/_remove_static_power"><aside class="declaration">proc </aside>_remove_static_power<aside>(channel, amount) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L124"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 124"></a></aside></h3><p>Helper proc to negatively adjust static power tracking on the machine's powernet, not meant for general use!</p><h3 id="proc/can_use_shortcut"><aside class="declaration">proc </aside>can_use_shortcut<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L592"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 592"></a></aside></h3><p>Makes sure the user is allowed to interact with the machine when they use a shortcut, like Control or Alt-clicking.</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>user - the mob who is trying to interact with the machine.</li>
|
||
</ul><h3 id="proc/change_power_mode"><aside class="declaration">proc </aside>change_power_mode<aside>(use_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L157"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 157"></a></aside></h3><p>Helper proc to change the machines power usage mode, automatically adjusts static power usage to maintain perfect parity</p><h3 id="proc/get_internal_wires"><aside class="declaration">proc </aside>get_internal_wires<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L559"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 559"></a></aside></h3><p>Returns the wires of the machine, or null if not declared.</p>
|
||
<p>Note: <code>/obj/machinery/</code> does not contain a <code>/datum/wires/</code> variable,
|
||
and needs to be implemented on any child object with this function overwritten.</p><h3 id="proc/has_power"><aside class="declaration">proc </aside>has_power<aside>(channel) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L103"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 103"></a></aside></h3><p>POWER RELATED PROCS</p><h3 id="proc/try_attack_hand"><aside class="declaration">proc </aside>try_attack_hand<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L252"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 252"></a></aside></h3><p>Preprocess machinery interaction.</p>
|
||
<p>If overriding and extending interaction limitations, better call this with ..()
|
||
unless you really know what you are doing.</p>
|
||
<p>Returns TRUE when interaction is done due to different limitations and nothing should be done next.
|
||
Returns FALSE when interaction can be continued.
|
||
Arguments:</p>
|
||
<ul>
|
||
<li>user - the mob interacting with this machinery</li>
|
||
</ul><h3 id="proc/update_active_power_consumption"><aside class="declaration">proc </aside>update_active_power_consumption<aside>(channel, amount) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L185"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 185"></a></aside></h3><p>Safely changes the static power on the local powernet based on an adjustment in active power</p><h3 id="proc/update_idle_power_consumption"><aside class="declaration">proc </aside>update_idle_power_consumption<aside>(channel, amount) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/game/machinery/machinery.dm#L177"><img src="git.png" width="16" height="16" title="code/game/machinery/machinery.dm 177"></a></aside></h3><p>Safely changes the static power on the local powernet based on an adjustment in idle power</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/edee60476d21ee840643bd1abe7f6003a8c65773">edee604</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |