/
pipes.dm
97 lines (76 loc) · 2.48 KB
/
pipes.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/obj/machinery/atmospherics/pipe
damage_deflection = 12
var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke
var/volume = 0
use_power = NO_POWER_USE
can_unwrench = 1
var/datum/pipeline/parent = null
//Buckling
can_buckle = 1
buckle_requires_restraints = 1
buckle_lying = -1
/obj/machinery/atmospherics/pipe/New()
add_atom_colour(pipe_color, FIXED_COLOUR_PRIORITY)
volume = 35 * device_type
..()
///I have no idea why there's a new and at this point I'm too afraid to ask
/obj/machinery/atmospherics/pipe/Initialize(mapload)
. = ..()
if(hide)
AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) //if changing this, change the subtypes RemoveElements too, because thats how bespoke works
/obj/machinery/atmospherics/pipe/nullifyNode(i)
var/obj/machinery/atmospherics/oldN = nodes[i]
..()
if(oldN)
SSair.add_to_rebuild_queue(oldN)
/obj/machinery/atmospherics/pipe/destroy_network()
QDEL_NULL(parent)
/obj/machinery/atmospherics/pipe/build_network()
if(QDELETED(parent))
parent = new
parent.build_pipeline(src)
/obj/machinery/atmospherics/pipe/proc/releaseAirToTurf()
if(air_temporary)
var/turf/T = loc
T.assume_air(air_temporary)
air_update_turf()
/obj/machinery/atmospherics/pipe/return_air()
return parent.air
/obj/machinery/atmospherics/pipe/return_analyzable_air()
return parent.air
/obj/machinery/atmospherics/pipe/remove_air(amount)
return parent.air.remove(amount)
/obj/machinery/atmospherics/pipe/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pipe_meter))
var/obj/item/pipe_meter/meter = W
user.dropItemToGround(meter)
meter.setAttachLayer(piping_layer)
else
return ..()
/obj/machinery/atmospherics/pipe/returnPipenet()
return parent
/obj/machinery/atmospherics/pipe/setPipenet(datum/pipeline/P)
parent = P
/obj/machinery/atmospherics/pipe/Destroy()
QDEL_NULL(parent)
releaseAirToTurf()
QDEL_NULL(air_temporary)
var/turf/T = loc
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
var/obj/item/pipe_meter/PM = new (T)
meter.transfer_fingerprints_to(PM)
qdel(meter)
. = ..()
/obj/machinery/atmospherics/pipe/proc/update_node_icon()
for(var/i in 1 to device_type)
if(nodes[i])
var/obj/machinery/atmospherics/N = nodes[i]
N.update_icon()
/obj/machinery/atmospherics/pipe/returnPipenets()
. = list(parent)
/obj/machinery/atmospherics/pipe/proc/paint(paint_color)
add_atom_colour(paint_color, FIXED_COLOUR_PRIORITY)
pipe_color = paint_color
update_node_icon()
return TRUE