From 3a54507ee7324e26d3daaeb8a4a4833bfec9ad90 Mon Sep 17 00:00:00 2001 From: Alien <68290943+alien3301@users.noreply.github.com> Date: Sat, 29 Nov 2025 21:02:00 +0200 Subject: [PATCH] Gives the automated IV an output pipe and lets you rotate it (#94058) ## About The Pull Request Plumbing IV drip now has an input and an output, the input only works when it's injecting and the output only works when it's draining. You can rotate with it alt click like all other plumbing things now, IV drip hotkeys removed ## Why It's Good For The Game It's an *automated* IV drip, the whole point is you can connect it to plumbing and having half it's functionality just not work is bad. As for the rotation it's waaaaaay more useful than the IV hotkeys for plumbing. ## Changelog :cl: Cat qol: The plumbing IV drip can be rotate with alt click now add: The plumbing IV drip can now output chemicals into plumbing factories /:cl: fixes #93586 --------- Co-authored-by: John Doe Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> --- .../components/plumbing/automated_iv.dm | 36 +++++++++++++++++++ code/modules/plumbing/plumbers/iv_drip.dm | 8 ++++- tgstation.dme | 1 + 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 code/datums/components/plumbing/automated_iv.dm diff --git a/code/datums/components/plumbing/automated_iv.dm b/code/datums/components/plumbing/automated_iv.dm new file mode 100644 index 00000000000..15639d85251 --- /dev/null +++ b/code/datums/components/plumbing/automated_iv.dm @@ -0,0 +1,36 @@ +/datum/component/plumbing/automated_iv + demand_connects = SOUTH + supply_connects = NORTH + ///Temporary holder to store all the reagents from the iv drip before transferring it to the ducts + var/datum/reagents/plumbing/holder + +/datum/component/plumbing/automated_iv/Initialize(start=TRUE, _ducting_layer, _turn_connects=TRUE, datum/reagents/custom_receiver) + . = ..() + if(!istype(parent, /obj/machinery/iv_drip/plumbing)) + return COMPONENT_INCOMPATIBLE + var/obj/machinery/iv_drip/plumbing/drip = parent + holder = new(drip.reagents.maximum_volume, drip.reagents.flags) + holder.my_atom = drip + +/datum/component/plumbing/automated_iv/Destroy(force) + QDEL_NULL(holder) + return ..() + +/datum/component/plumbing/automated_iv/can_give(amount, reagent) + . = ..() + if(!.) + return + var/obj/machinery/iv_drip/plumbing/drip = parent + return drip.mode == 0 + +/datum/component/plumbing/automated_iv/send_request(dir) + var/obj/machinery/iv_drip/plumbing/drip = parent + if(drip.mode == 1) + process_request(dir = dir) + +/datum/component/plumbing/automated_iv/transfer_to(datum/component/plumbing/target, amount, reagent, datum/ductnet/net, round_robin = TRUE) + reagents.trans_to(holder, reagents.total_volume) + reagents = holder + . = ..() + var/obj/machinery/iv_drip/plumbing/drip = parent + reagents = drip.reagents diff --git a/code/modules/plumbing/plumbers/iv_drip.dm b/code/modules/plumbing/plumbers/iv_drip.dm index 88ad345ffa0..1935049fe73 100644 --- a/code/modules/plumbing/plumbers/iv_drip.dm +++ b/code/modules/plumbing/plumbers/iv_drip.dm @@ -10,9 +10,15 @@ /obj/machinery/iv_drip/plumbing/Initialize(mapload, bolt, layer) . = ..() - AddComponent(/datum/component/plumbing/simple_demand, bolt, layer) + AddComponent(/datum/component/plumbing/automated_iv, bolt, layer) AddComponent(/datum/component/simple_rotation) +/obj/machinery/iv_drip/attack_hand_secondary(mob/user, list/modifiers) + return FALSE + +/obj/machinery/iv_drip/plumbing/click_alt(mob/user) + return FALSE + /obj/machinery/iv_drip/plumbing/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) . = ..() if(isnull(held_item) || held_item.tool_behaviour != TOOL_WRENCH) diff --git a/tgstation.dme b/tgstation.dme index 9b881baed82..f4bd825d3c1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1400,6 +1400,7 @@ #include "code\datums\components\pet_commands\pet_command.dm" #include "code\datums\components\pet_commands\pet_commands_basic.dm" #include "code\datums\components\plumbing\_plumbing.dm" +#include "code\datums\components\plumbing\automated_iv.dm" #include "code\datums\components\plumbing\buffer.dm" #include "code\datums\components\plumbing\chemical_acclimator.dm" #include "code\datums\components\plumbing\filter.dm"