From 528dddb1c97e6f74bb5e861cd39d5aa67fff463d Mon Sep 17 00:00:00 2001 From: Pinta <68373373+softcerv@users.noreply.github.com> Date: Sat, 21 Aug 2021 17:30:13 -0400 Subject: [PATCH] [MOSTLY NON-MODULAR] Hypovials can be printed from ChemMasters and pill presses. (#7601) * Hypovials are printable via the chem-master * Hypovials can now be made from factories * There really isn't a reason for this to be in the autolathe any more. * linters fuck --- code/modules/plumbing/plumbers/pill_press.dm | 14 ++++++++++++++ .../chemistry/machinery/chem_master.dm | 13 +++++++++++++ .../hyposprays/code/game/autolathe_designs.dm | 9 --------- tgui/packages/tgui/interfaces/ChemMaster.js | 19 +++++++++++++++++++ tgui/packages/tgui/interfaces/ChemPress.js | 7 +++++++ 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/code/modules/plumbing/plumbers/pill_press.dm b/code/modules/plumbing/plumbers/pill_press.dm index 6f27d61e0c6..175b7a96a3a 100644 --- a/code/modules/plumbing/plumbers/pill_press.dm +++ b/code/modules/plumbing/plumbers/pill_press.dm @@ -3,6 +3,7 @@ name = "chemical press" desc = "A press that makes pills, patches and bottles." icon_state = "pill_press" + buffer = 60 //SKYRAT EDIT HYPOVIALS. This is needed so it can completely fill the vials up. ///maximum size of a pill var/max_pill_volume = 50 @@ -10,6 +11,8 @@ var/max_patch_volume = 40 ///maximum size of a bottle var/max_bottle_volume = 30 + //SKYRAT EDIT HYPOVIALS maximum size of a vial + var/max_vial_volume = 60 ///current operating product (pills or patches) var/product = "pill" ///the minimum size a pill or patch can be @@ -72,6 +75,13 @@ reagents.trans_to(P, current_volume) P.name = trim("[product_name] bottle") stored_products += P + //SKYRAT EDIT HYPOVIALS + else if (product == "vial") + var/obj/item/reagent_containers/glass/bottle/vial/small/P = new(src) + reagents.trans_to(P, current_volume) + P.name = trim("[product_name] vial") + stored_products += P + //SKYRAT EDIT HYPOVIALS END if(stored_products.len) var/pill_amount = 0 for(var/thing in loc) @@ -128,4 +138,8 @@ max_volume = max_patch_volume else if (product == "bottle") max_volume = max_bottle_volume + //SKYRAT EDIT HYPOVIALS + else if (product == "vial") + max_volume = max_vial_volume + //SKYRAT EDIT HPYOVIALS END current_volume = clamp(current_volume, min_volume, max_volume) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 8ca5e1a0b1c..07b3115c729 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -312,6 +312,10 @@ vol_each_max = min(40, vol_each_max) else if (item_type == "bottle") vol_each_max = min(30, vol_each_max) + //SKYRAT EDIT ADDITION START - HYPOVIALS + else if (item_type == "vial") + vol_each_max = min(60, vol_each_max) + //SKYRAT EDIT ADDITION END - HYPOVIALS else if (item_type == "condimentPack") vol_each_max = min(10, vol_each_max) else if (item_type == "condimentBottle") @@ -392,6 +396,15 @@ P.name = trim("[name] bottle") adjust_item_drop_location(P) reagents.trans_to(P, vol_each, transfered_by = usr) + //SKYRAT EDIT ADDTION HYPOVIALS START + if(item_type == "vial") + var/obj/item/reagent_containers/glass/bottle/vial/small/P + for(var/i = 0; i < amount; i++) + P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location()) + P.name = trim("[name] vial") + adjust_item_drop_location(P) + reagents.trans_to(P, vol_each, transfered_by = usr) + //SKYRAT EDIT ADDTION HYPOVIALS END return TRUE if(item_type == "condimentPack") var/obj/item/reagent_containers/food/condiment/pack/P diff --git a/modular_skyrat/modules/hyposprays/code/game/autolathe_designs.dm b/modular_skyrat/modules/hyposprays/code/game/autolathe_designs.dm index 2197d74f43a..956a3496444 100644 --- a/modular_skyrat/modules/hyposprays/code/game/autolathe_designs.dm +++ b/modular_skyrat/modules/hyposprays/code/game/autolathe_designs.dm @@ -1,12 +1,3 @@ -/datum/design/hypovialsmall - name = "Hypovial" - id = "hypovial" - build_type = AUTOLATHE | PROTOLATHE - materials = list(/datum/material/iron = 500) - build_path = /obj/item/reagent_containers/glass/bottle/vial/small - category = list("initial","Medical","Medical Designs") - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - /datum/design/hypoviallarge name = "Large Hypovial" id = "large_hypovial" diff --git a/tgui/packages/tgui/interfaces/ChemMaster.js b/tgui/packages/tgui/interfaces/ChemMaster.js index db1652020cc..5f8ef027c5e 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster.js +++ b/tgui/packages/tgui/interfaces/ChemMaster.js @@ -230,6 +230,12 @@ const PackagingControls = (props, context) => { bottleAmount, setBottleAmount, ] = useSharedState(context, 'bottleAmount', 1); + // SKYRAT EDIT HYPOVIALS + const [ + vialAmount, + setVialAmount, + ] = useSharedState(context, 'vialAmount', 1); + // SKYRAT EDIT END const [ packAmount, setPackAmount, @@ -299,6 +305,19 @@ const PackagingControls = (props, context) => { volume: 'auto', })} /> )} + {!condi && ( // SKYRAT EDIT HYPOVIALS + setVialAmount(value)} + onCreate={() => act('create', { + type: 'vial', + amount: vialAmount, + volume: 'auto', + })} /> // SKYRAT EDIT HYPOVIALS END + )} {!!condi && ( { product: "bottle", })} /> + act('change_product', { + product: "vial", + })} + />