/
_plumb_machinery.dm
107 lines (90 loc) · 4.07 KB
/
_plumb_machinery.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
/**Basic plumbing object.
* It doesn't really hold anything special, YET.
* Objects that are plumbing but not a subtype are as of writing liquid pumps and the reagent_dispenser tank
* Also please note that the plumbing component is toggled on and off by the component using a signal from default_unfasten_wrench, so dont worry about it
*/
/obj/machinery/plumbing
name = "pipe thing"
icon = 'icons/obj/pipes_n_cables/hydrochem/plumbers.dmi'
icon_state = "pump"
density = TRUE
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 7.5
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
///Plumbing machinery is always gonna need reagents, so we might aswell put it here
var/buffer = 50
///Flags for reagents, like INJECTABLE, TRANSPARENT bla bla everything thats in DEFINES/reagents.dm
var/reagent_flags = TRANSPARENT
/obj/machinery/plumbing/Initialize(mapload, bolt = TRUE)
. = ..()
set_anchored(bolt)
create_reagents(buffer, reagent_flags)
AddComponent(/datum/component/simple_rotation)
interaction_flags_machine |= INTERACT_MACHINE_OFFLINE
/obj/machinery/plumbing/examine(mob/user)
. = ..()
. += span_notice("The maximum volume display reads: <b>[reagents.maximum_volume] units</b>.")
/obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/tool)
. = ..()
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced)
user.balloon_alert_to_viewers("furiously plunging...")
if(do_after(user, 3 SECONDS, target = src))
user.balloon_alert_to_viewers("finished plunging")
reagents.expose(get_turf(src), TOUCH) //splash on the floor
reagents.clear_reagents()
/obj/machinery/plumbing/welder_act(mob/living/user, obj/item/I)
. = ..()
if(anchored)
to_chat(user, span_warning("The [name] needs to be unbolted to do that!"))
if(I.tool_start_check(user, amount=1))
to_chat(user, span_notice("You start slicing the [name] apart."))
if(I.use_tool(src, user, (1.5 SECONDS), volume=50))
deconstruct(TRUE)
to_chat(user, span_notice("You slice the [name] apart."))
return TRUE
///We can empty beakers in here and everything
/obj/machinery/plumbing/input
name = "input gate"
desc = "Can be manually filled with reagents from containers."
icon_state = "pipe_input"
pass_flags_self = PASSMACHINE | LETPASSTHROW // Small
reagent_flags = TRANSPARENT | REFILLABLE
/obj/machinery/plumbing/input/Initialize(mapload, bolt, layer)
. = ..()
AddComponent(/datum/component/plumbing/simple_supply, bolt, layer)
///We can fill beakers in here and everything. we dont inheret from input because it has nothing that we need
/obj/machinery/plumbing/output
name = "output gate"
desc = "A manual output for plumbing systems, for taking reagents directly into containers."
icon_state = "pipe_output"
pass_flags_self = PASSMACHINE | LETPASSTHROW // Small
reagent_flags = TRANSPARENT | DRAINABLE
/obj/machinery/plumbing/output/Initialize(mapload, bolt, layer)
. = ..()
AddComponent(/datum/component/plumbing/simple_demand, bolt, layer)
/obj/machinery/plumbing/output/tap
name = "drinking tap"
desc = "A manual output for plumbing systems, for taking drinks directly into glasses."
icon_state = "tap_output"
/obj/machinery/plumbing/tank
name = "chemical tank"
desc = "A massive chemical holding tank."
icon_state = "tank"
buffer = 400
/obj/machinery/plumbing/tank/Initialize(mapload, bolt, layer)
. = ..()
AddComponent(/datum/component/plumbing/tank, bolt, layer)
///Layer manifold machine that connects a bunch of layers
/obj/machinery/plumbing/layer_manifold
name = "layer manifold"
desc = "A plumbing manifold for layers."
icon_state = "manifold"
density = FALSE
/obj/machinery/plumbing/layer_manifold/Initialize(mapload, bolt, layer)
. = ..()
AddComponent(/datum/component/plumbing/manifold, bolt, FIRST_DUCT_LAYER)
AddComponent(/datum/component/plumbing/manifold, bolt, SECOND_DUCT_LAYER)
AddComponent(/datum/component/plumbing/manifold, bolt, THIRD_DUCT_LAYER)
AddComponent(/datum/component/plumbing/manifold, bolt, FOURTH_DUCT_LAYER)
AddComponent(/datum/component/plumbing/manifold, bolt, FIFTH_DUCT_LAYER)