mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
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 🆑 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 /🆑 fixes #93586 --------- Co-authored-by: John Doe <markkavalerov87@gmail.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user