From dce0d9feb61890f742e183035ef7c73d868df588 Mon Sep 17 00:00:00 2001 From: Dmitriy Resnyanskiy <62596930+L4rever@users.noreply.github.com> Date: Fri, 30 Aug 2024 21:27:46 +0500 Subject: [PATCH] Hypospray uprgrade (#13469) * Added drawing reagents from beakers/bottles to hypospray * Proximity fix --------- Co-authored-by: KIBORG04 --- .../reagents/reagent_containers/hypospray.dm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 23a05df4c643..ecb5540cb8e2 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -47,6 +47,24 @@ /obj/item/weapon/reagent_containers/hypospray/cmo list_reagents = list("tricordrazine" = 30) +/obj/item/weapon/reagent_containers/hypospray/cmo/afterattack(atom/target, mob/user, proximity, params) + if(!proximity) + return + if(istype(target, /obj/item/weapon/reagent_containers/glass)) + if(reagents.total_volume >= reagents.maximum_volume) + to_chat(user, "The hypospray is full.") + return + if(!target.reagents.total_volume) + to_chat(user, "[target] is empty.") + return + + if(!target.is_open_container()) + to_chat(user, "Container is closed.") + return + + var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) + + to_chat(user, "You fill the syringe with [trans] units of the solution.") /obj/item/weapon/reagent_containers/hypospray/autoinjector name = "inaprovaline autoinjector"