diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 3e9f6346f55..e25d66686e5 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -27,8 +27,9 @@ #define DEL_REAGENT 1 // reagent deleted (fully cleared) #define ADD_REAGENT 2 // reagent added #define REM_REAGENT 3 // reagent removed (may still exist) +#define CLEAR_REAGENTS 4 // all reagents were cleared #define MIMEDRINK_SILENCE_DURATION 30 //ends up being 60 seconds given 1 tick every 2 seconds //used by chem masters and pill presses #define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die -#define RANDOM_PILL_STYLE 22 //Dont change this one though \ No newline at end of file +#define RANDOM_PILL_STYLE 22 //Dont change this one though diff --git a/code/datums/components/plumbing/_plumbing.dm b/code/datums/components/plumbing/_plumbing.dm index bd8c7fb0e41..bca558ea80e 100644 --- a/code/datums/components/plumbing/_plumbing.dm +++ b/code/datums/components/plumbing/_plumbing.dm @@ -142,15 +142,24 @@ return update_dir() active = TRUE + var/atom/movable/AM = parent + for(var/obj/machinery/duct/D in AM.loc) //Destroy any ducts under us. Ducts also self destruct if placed under a plumbing machine. machines disable when they get moved + if(D.anchored) //that should cover everything + D.disconnect_duct() if(demand_connects) START_PROCESSING(SSfluids, src) + for(var/D in GLOB.cardinals) if(D & (demand_connects | supply_connects)) - for(var/obj/machinery/duct/duct in get_step(parent, D)) - duct.attempt_connect() - - //TODO: Let plumbers directly plumb into one another without ducts if placed adjacent to each other + for(var/atom/movable/A in get_step(parent, D)) + if(istype(A, /obj/machinery/duct)) + var/obj/machinery/duct/duct = A + duct.attempt_connect() + else + var/datum/component/plumbing/P = A.GetComponent(/datum/component/plumbing) + if(P) + direct_connect(P, D) /// Toggle our machinery on or off. This is called by a hook from default_unfasten_wrench with anchored as only param, so we dont have to copypaste this on every object that can move /datum/component/plumbing/proc/toggle_active(obj/O, new_state) @@ -184,6 +193,15 @@ /datum/component/plumbing/proc/get_original_direction(dir) var/atom/movable/AM = parent return turn(dir, dir2angle(AM.dir) - 180) +//special case in-case we want to connect directly with another machine without a duct +/datum/component/plumbing/proc/direct_connect(datum/component/plumbing/P, dir) + if(!P.active) + return + var/opposite_dir = turn(dir, 180) + if(P.demand_connects & opposite_dir && supply_connects & dir || P.supply_connects & opposite_dir && demand_connects & dir) //make sure we arent connecting two supplies or demands + var/datum/ductnet/net = new() + net.add_plumber(src, dir) + net.add_plumber(P, opposite_dir) ///has one pipe input that only takes, example is manual output pipe /datum/component/plumbing/simple_demand @@ -194,4 +212,4 @@ ///input and output, like a holding tank /datum/component/plumbing/tank demand_connects = WEST - supply_connects = EAST \ No newline at end of file + supply_connects = EAST diff --git a/code/datums/components/plumbing/filter.dm b/code/datums/components/plumbing/filter.dm index 39592aac07b..76b76323c5b 100644 --- a/code/datums/components/plumbing/filter.dm +++ b/code/datums/components/plumbing/filter.dm @@ -31,7 +31,7 @@ direction = get_original_direction(text2num(A)) break if(reagent) - reagents.trans_id_to(target.reagents, reagent, amount) + reagents.trans_id_to(target.parent, reagent, amount) else for(var/A in reagents.reagent_list) var/datum/reagent/R = A @@ -56,4 +56,4 @@ return TRUE if(EAST) //left if(F.left.Find(reagent)) - return TRUE \ No newline at end of file + return TRUE diff --git a/code/datums/ductnet.dm b/code/datums/ductnet.dm index 5fc8fbe0cfa..37b07161df7 100644 --- a/code/datums/ductnet.dm +++ b/code/datums/ductnet.dm @@ -35,6 +35,8 @@ for(var/dir in P.ducts) if(P.ducts[dir] == src) P.ducts -= dir + if(!ducts.len) //there were no ducts, so it was a direct connection. we destroy ourselves since a ductnet with only one plumber and no ducts is worthless + destroy_network() ///we combine ductnets. this occurs when someone connects to seperate sets of fluid ducts /datum/ductnet/proc/assimilate(datum/ductnet/D) ducts.Add(D.ducts) @@ -49,7 +51,8 @@ for(var/A in D.ducts) var/obj/machinery/duct/M = A M.duct = src //forget your old master - qdel(D) + + destroy_network() ///destroy the network and tell all our ducts and plumbers we are gone /datum/ductnet/proc/destroy_network(delete=TRUE) for(var/A in suppliers + demanders) @@ -58,4 +61,4 @@ var/obj/machinery/duct/D = A D.duct = null if(delete) //I don't want code to run with qdeleted objects because that can never be good, so keep this in-case the ductnet has some business left to attend to before commiting suicide - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index 82798e55021..af2f81db07d 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -64,6 +64,11 @@ All the important duct code: /obj/machinery/duct/proc/attempt_connect() reset_connects() //All connects are gathered here again eitherway, we might aswell reset it so they properly update when reconnecting + for(var/atom/movable/AM in loc) + var/datum/component/plumbing/P = AM.GetComponent(/datum/component/plumbing) + if(P?.active) + disconnect_duct() //let's not built under plumbing machinery + return for(var/D in GLOB.cardinals) if(dumb && !(D & connects)) continue @@ -263,10 +268,12 @@ All the important duct code: var/direction = get_dir(src, D) if(!(direction in GLOB.cardinals)) return + if(duct_layer != D.duct_layer) + return add_connects(direction) //the connect of the other duct is handled in connect_network, but do this here for the parent duct because it's not necessary in normal cases + add_neighbour(D) connect_network(D, direction, TRUE) - add_connects(direction) update_icon() ///has a total of 5 layers and doesnt give a shit about color. its also dumb so doesnt autoconnect. /obj/machinery/duct/multilayered @@ -311,6 +318,9 @@ All the important duct code: return return ..() +/obj/machinery/duct/multilayered/handle_layer() + return + /obj/item/stack/ducts name = "stack of duct" desc = "A stack of fluid ducts." diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 5d55146ac6d..1f02f9d2a54 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -566,6 +566,8 @@ for(var/reagent in cached_reagents) var/datum/reagent/R = reagent del_reagent(R.type) + if(my_atom) + my_atom.on_reagent_change(CLEAR_REAGENTS) return 0 /datum/reagents/proc/reaction(atom/A, method = TOUCH, volume_modifier = 1, show_message = 1) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index d1e6df0de13..3f7a28d6a74 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -15,7 +15,8 @@ if(lastkey) var/mob/toucher = get_mob_by_key(lastkey) touch_msg = "[ADMIN_LOOKUPFLW(toucher)]" - message_admins("Reagent explosion reaction occurred at [ADMIN_VERBOSEJMP(T)][inside_msg]. Last Fingerprint: [touch_msg].") + if(!istype(holder.my_atom, /obj/machinery/plumbing)) //excludes standard plumbing equipment from spamming admins with this shit + message_admins("Reagent explosion reaction occurred at [ADMIN_VERBOSEJMP(T)][inside_msg]. Last Fingerprint: [touch_msg].") log_game("Reagent explosion reaction occurred at [AREACOORD(T)]. Last Fingerprint: [lastkey ? lastkey : "N/A"]." ) var/datum/effect_system/reagents_explosion/e = new() e.set_up(modifier + round(created_volume/strengthdiv, 1), T, 0, 0) diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 8b3e499f36b..34b18b1d3cb 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -700,14 +700,6 @@ build_path = /obj/item/pipe_dispenser category = list("hacked", "Construction") -/datum/design/plumbing_rcd - name = "Plumbing Constructor" - id = "plumbing_rcd" - build_type = AUTOLATHE - materials = list(/datum/material/iron = 75000, /datum/material/glass = 37500) - build_path = /obj/item/construction/plumbing - category = list("hacked", "Construction") - /datum/design/electropack name = "Electropack" id = "electropack" @@ -991,3 +983,4 @@ materials = list(/datum/material/iron = 500) build_path = /obj/item/stack/ducts category = list("initial", "Construction") + maxstack = 50 diff --git a/code/modules/research/designs/misc_designs.dm b/code/modules/research/designs/misc_designs.dm index 5c0b4b591de..6bafd985fe4 100644 --- a/code/modules/research/designs/misc_designs.dm +++ b/code/modules/research/designs/misc_designs.dm @@ -493,4 +493,11 @@ category = list("Equipment") departmental_flags = DEPARTMENTAL_FLAG_SECURITY - +/datum/design/plumbing_rcd + name = "Plumbing Constructor" + id = "plumbing_rcd" + build_type = PROTOLATHE + materials = list(/datum/material/iron = 75000, /datum/material/glass = 37500, /datum/material/plastic = 1000) + build_path = /obj/item/construction/plumbing + category = list("Equipment") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 295611e7405..0cb32e8ec45 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -11,7 +11,7 @@ design_ids = list("basic_matter_bin", "basic_cell", "basic_scanning", "basic_capacitor", "basic_micro_laser", "micro_mani", "desttagger", "handlabel", "packagewrap", "destructive_analyzer", "circuit_imprinter", "experimentor", "rdconsole", "design_disk", "tech_disk", "rdserver", "rdservercontrol", "mechfab", "paystand", "space_heater", "beaker", "large_beaker", "bucket", "xlarge_beaker", "sec_rshot", "sec_beanbag_slug", "sec_bshot", "sec_slug", "sec_Islug", "sec_dart", "sec_38", - "rglass","plasteel","plastitanium","plasmaglass","plasmareinforcedglass","titaniumglass","plastitaniumglass") + "rglass","plasteel","plastitanium","plasmaglass","plasmareinforcedglass","titaniumglass","plastitaniumglass","plumbing_rcd") /datum/techweb_node/mmi id = "mmi" diff --git a/tgui/assets/tgui.js b/tgui/assets/tgui.js index 2f667c540db..9c6e7d1df56 100644 --- a/tgui/assets/tgui.js +++ b/tgui/assets/tgui.js @@ -1 +1,22 @@ -require=function a(o,s,p){function u(e,t){if(!s[e]){if(!o[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[e]={exports:{}};o[e][0].call(i.exports,function(t){return u(o[e][1][t]||t)},i,i.exports,a,o,s,p)}return s[e].exports}for(var c="function"==typeof require&&require,t=0;t