-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
unary_devices.dm
51 lines (44 loc) · 1.42 KB
/
unary_devices.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/obj/machinery/atmospherics/components/unary
icon = 'icons/obj/atmospherics/components/unary_devices.dmi'
dir = SOUTH
initialize_directions = SOUTH
device_type = UNARY
pipe_flags = PIPING_ONE_PER_TURF
construction_type = /obj/item/pipe/directional
///Unique id of the device
var/uid
///Increases to prevent duplicated Ids
var/static/gl_uid = 1
FASTDMM_PROP(\
pipe_type = PIPE_TYPE_NODE,\
pipe_interference_group = "atmos-[piping_layer]"\
)
/obj/machinery/atmospherics/components/unary/set_init_directions()
initialize_directions = dir
/obj/machinery/atmospherics/components/unary/on_construction()
..()
update_appearance()
/obj/machinery/atmospherics/components/unary/proc/assign_uid_vents()
uid = num2text(gl_uid++)
return uid
/obj/machinery/atmospherics/components/unary/proc/change_pipe_connection(disconnect)
if(disconnect)
disconnect_pipes()
return
connect_pipes()
/obj/machinery/atmospherics/components/unary/proc/connect_pipes()
var/obj/machinery/atmospherics/node1 = nodes[1]
atmos_init()
node1 = nodes[1]
if(node1)
node1.atmos_init()
node1.add_member(src)
SSair.add_to_rebuild_queue(src)
/obj/machinery/atmospherics/components/unary/proc/disconnect_pipes()
var/obj/machinery/atmospherics/node1 = nodes[1]
if(node1)
if(src in node1.nodes) //Only if it's actually connected. On-pipe version would is one-sided.
node1.disconnect(src)
nodes[1] = null
if(parents[1])
nullify_pipenet(parents[1])