mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
<PackagingControlsItem
|
||||
label="Hypovials"
|
||||
amount={vialAmount}
|
||||
amountUnit="vials"
|
||||
sideNote="max 60u"
|
||||
onChangeAmount={(e, value) => setVialAmount(value)}
|
||||
onCreate={() => act('create', {
|
||||
type: 'vial',
|
||||
amount: vialAmount,
|
||||
volume: 'auto',
|
||||
})} /> // SKYRAT EDIT HYPOVIALS END
|
||||
)}
|
||||
{!!condi && (
|
||||
<LabeledList.Item label="Bottle type">
|
||||
<Button.Checkbox
|
||||
|
||||
@@ -42,6 +42,13 @@ export const ChemPress = (props, context) => {
|
||||
product: "bottle",
|
||||
})}
|
||||
/>
|
||||
<Button.Checkbox
|
||||
content="Vials"
|
||||
checked={product === "vial"}
|
||||
onClick={() => act('change_product', {
|
||||
product: "vial",
|
||||
})}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Volume">
|
||||
<NumberInput
|
||||
|
||||
Reference in New Issue
Block a user