-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathpipes.dm
132 lines (105 loc) · 3.45 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/obj/machinery/atmospherics/pipe
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
FASTDMM_PROP(\
set_instance_vars(\
icon_state = INSTANCE_VAR_DEFAULT\
),\
)
/obj/machinery/atmospherics/pipe/New()
add_atom_colour(pipe_color, FIXED_COLOUR_PRIORITY)
volume = 35 * device_type
return ..()
///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/nullify_node(i)
var/obj/machinery/atmospherics/old_node = nodes[i]
. = ..()
if(old_node)
SSair.add_to_rebuild_queue(old_node)
/obj/machinery/atmospherics/pipe/destroy_network()
QDEL_NULL(parent)
/obj/machinery/atmospherics/pipe/get_rebuild_targets()
if(!QDELETED(parent))
return
parent = new
return list(parent)
/obj/machinery/atmospherics/pipe/proc/releaseAirToTurf()
if(air_temporary)
var/turf/T = loc
T.assume_air(air_temporary)
/obj/machinery/atmospherics/pipe/return_air()
if(air_temporary)
return air_temporary
return parent.air
/obj/machinery/atmospherics/pipe/return_analyzable_air()
if(air_temporary)
return air_temporary
return parent.air
/obj/machinery/atmospherics/pipe/remove_air(amount)
if(air_temporary)
return air_temporary.remove(amount)
return parent.air.remove(amount)
/obj/machinery/atmospherics/pipe/remove_air_ratio(ratio)
if(air_temporary)
return air_temporary.remove_ratio(ratio)
return parent.air.remove_ratio(ratio)
/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/examine(mob/dead/observer/user)
if(istype(user))
analyzer_act(user, src)
return ..()
/obj/machinery/atmospherics/pipe/return_pipenet()
return parent
/obj/machinery/atmospherics/pipe/set_pipenet(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/update_icon(updates=ALL)
. = ..()
update_alpha()
/obj/machinery/atmospherics/pipe/proc/update_alpha()
alpha = invisibility ? 64 : 255
/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_appearance()
/obj/machinery/atmospherics/pipe/return_pipenets()
. = list(parent)
/obj/machinery/atmospherics/pipe/run_atom_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == MELEE && damage_amount < 12)
return 0
. = ..()
/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
/obj/machinery/atmospherics/pipe/update_layer()
layer = initial(layer) + (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE