Files
Bubberstation/code/datums/components/plumbing/splitter.dm
SkyratBot 483b829c2d [MIRROR] Adds a plumbing layer manifold (#4367)
* Adds a plumbing layer manifold (#57494)

Adds a multilayer plumbing manifold, I also murdered the multilayer duct

You can now alt-click the plumbing RCD to change the layer it prints. I made a whole thing where right clicking changed the settings and you could use that to change machinery aswell. I even did that with the plunger, it was absolutely beautiful. Anyway that drained the life out of me because apparently there's no attack_obj_secondary and afterattack_secondary ALSO called attack_obj (left click). I just hate whoever made it with intensity

Plumbing now uses three layers. They should be easier to navigate. I tried to make layer connecting the same as cross-color connecting, but that would take more of my soul then there is to take

* Adds a plumbing layer manifold

Co-authored-by: Time-Green <timkoster1@hotmail.com>
2021-03-24 19:30:36 +00:00

48 lines
1.3 KiB
Plaintext

/datum/component/plumbing/splitter
demand_connects = NORTH
supply_connects = SOUTH | EAST
/datum/component/plumbing/splitter/Initialize(start=TRUE, _ducting_layer, _turn_connects=TRUE, datum/reagents/custom_receiver)
. = ..()
if(. && !istype(parent, /obj/machinery/plumbing/splitter))
return FALSE
/datum/component/plumbing/splitter/can_give(amount, reagent, datum/ductnet/net)
. = ..()
if(!.)
return
var/direction
for(var/A in ducts)
if(ducts[A] == net)
direction = get_original_direction(text2num(A))
break
var/obj/machinery/plumbing/splitter/S = parent
switch(direction)
if(SOUTH)
if(S.turn_straight && S.transfer_straight <= amount)
S.turn_straight = FALSE
return TRUE
if(EAST)
if(!S.turn_straight && S.transfer_side <= amount)
S.turn_straight = TRUE
return TRUE
return FALSE
/datum/component/plumbing/splitter/transfer_to(datum/component/plumbing/target, amount, reagent, datum/ductnet/net)
var/direction
for(var/A in ducts)
if(ducts[A] == net)
direction = get_original_direction(text2num(A))
break
var/obj/machinery/plumbing/splitter/S = parent
switch(direction)
if(SOUTH)
if(amount >= S.transfer_straight)
amount = S.transfer_straight
if(EAST)
if(amount >= S.transfer_side)
amount = S.transfer_side
return ..()