From dad1e738c7f640b50bee4c7a0ff27da74f9726c0 Mon Sep 17 00:00:00 2001
From: shellspeed1 <46614774+shellspeed1@users.noreply.github.com>
Date: Mon, 23 Sep 2019 19:30:11 -0700
Subject: [PATCH] Add files via upload
---
.../reagents/reagent_containers/chem_pack.dm | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 code/modules/reagents/reagent_containers/chem_pack.dm
diff --git a/code/modules/reagents/reagent_containers/chem_pack.dm b/code/modules/reagents/reagent_containers/chem_pack.dm
new file mode 100644
index 00000000..9a62cf47
--- /dev/null
+++ b/code/modules/reagents/reagent_containers/chem_pack.dm
@@ -0,0 +1,49 @@
+/obj/item/reagent_containers/chem_pack
+ name = "intravenous medicine bag"
+ desc = "A plastic pressure bag, or 'chem pack', for IV administration of drugs. It is fitted with a thermosealing strip."
+ icon = 'icons/obj/blood_pack.dmi'
+ icon_state = "chempack"
+ volume = 100
+ reagent_flags = OPENCONTAINER
+ spillable = TRUE
+ obj_flags = UNIQUE_RENAME
+ resistance_flags = ACID_PROOF
+ var/sealed = FALSE
+
+/obj/item/reagent_containers/chem_pack/on_reagent_change(changetype)
+ update_icon()
+
+/obj/item/reagent_containers/chem_pack/update_icon()
+ cut_overlays()
+
+ var/v = min(round(reagents.total_volume / volume * 10), 10)
+ if(v > 0)
+ var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "chempack1")
+ filling.icon_state = "chempack[v]"
+ filling.color = mix_color_from_reagents(reagents.reagent_list)
+ add_overlay(filling)
+
+/obj/item/reagent_containers/chem_pack/AltClick(mob/living/user)
+ if(user.canUseTopic(src, BE_CLOSE, NO_DEXTERY) && !sealed)
+ if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)))
+ to_chat(user, "Uh... whoops! You accidentally spill the content of the bag onto yourself.")
+ SplashReagents(user)
+ return
+
+ reagent_flags = DRAWABLE | INJECTABLE //To allow for sabotage or ghetto use.
+ spillable = FALSE
+ sealed = TRUE
+ to_chat(user, "You seal the bag.")
+
+/obj/item/reagent_containers/chem_pack/examine()
+ . = ..()
+ if(sealed)
+ . += "The bag is sealed shut."
+ else
+ . += "Alt-click to seal it."
+
+
+obj/item/reagent_containers/chem_pack/attack_self(mob/user)
+ if(sealed)
+ return
+ ..()
\ No newline at end of file