[MIRROR] More Plumbing Fixes & Pill Press UI Changes [MDB IGNORE] (#24458)

* More Plumbing Fixes & Pill Press UI Changes

* Fixing diffs/ modular stuff

* Modular

* Update reagents.dm

* Update pill_press.dm

* Update pill_press.dm

* Update pill_press.dm

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-20 10:15:08 +02:00
committed by GitHub
parent 7e10731217
commit b5f3de6ebd
57 changed files with 332 additions and 297 deletions

View File

@@ -8,23 +8,5 @@
#define MACHINE_REAGENT_TRANSFER 10 //the default max plumbing machinery transfers #define MACHINE_REAGENT_TRANSFER 10 //the default max plumbing machinery transfers
/// List of plumbing layers as name => bitflag
GLOBAL_LIST_INIT(plumbing_layers, list(
"First Layer" = FIRST_DUCT_LAYER,
"Second Layer" = SECOND_DUCT_LAYER,
"Default Layer" = THIRD_DUCT_LAYER,
"Fourth Layer" = FOURTH_DUCT_LAYER,
"Fifth Layer" = FIFTH_DUCT_LAYER,
))
/// Reverse of plumbing_layers, as "[bitflag]" => name
GLOBAL_LIST_INIT(plumbing_layer_names, list(
"[FIRST_DUCT_LAYER]" = "First Layer",
"[SECOND_DUCT_LAYER]" = "Second Layer",
"[THIRD_DUCT_LAYER]" = "Default Layer",
"[FOURTH_DUCT_LAYER]" = "Fourth Layer",
"[FIFTH_DUCT_LAYER]" = "Fifth Layer",
))
/// Name of omni color /// Name of omni color
#define DUCT_COLOR_OMNI "omni" #define DUCT_COLOR_OMNI "omni"

View File

@@ -45,45 +45,18 @@
#define SYNTHFLESH_UNHUSK_AMOUNT 100 #define SYNTHFLESH_UNHUSK_AMOUNT 100
//used by chem masters and pill presses //used by chem masters and pill presses
#define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die // The categories of reagent packaging
#define RANDOM_PILL_STYLE 22 //Dont change this one though #define CAT_CONDIMENTS "condiments"
#define CAT_TUBES "tubes"
//used by chem masters and pill presses #define CAT_PILLS "pills"
//update this if you add more patch icons #define CAT_PATCHES "patches"
#define PATCH_STYLE_LIST list(\
"bandaid_1", \
"bandaid_2", \
"bandaid_3", \
"bandaid_4", \
"bandaid_blank", \
"bandaid_both", \
"bandaid_brute", \
"bandaid_brute_2", \
"bandaid_burn", \
"bandaid_burn_2", \
"bandaid_clown", \
"bandaid_colonthree", \
"bandaid_exclaimationpoint", \
"bandaid_mix", \
"bandaid_monke", \
"bandaid_msic", \
"bandaid_questionmark", \
"bandaid_suffocation", \
"bandaid_suffocation_2", \
"bandaid_toxin", \
"bandaid_toxin_2", \
) //icon_state list
#define DEFAULT_PATCH_STYLE "bandaid_blank" #define DEFAULT_PATCH_STYLE "bandaid_blank"
//used by chem master //used by chem master
#define CONDIMASTER_STYLE_AUTO "auto" #define CONDIMASTER_STYLE_AUTO "auto"
#define CONDIMASTER_STYLE_FALLBACK "_" #define CONDIMASTER_STYLE_FALLBACK "_"
#define ALLERGIC_REMOVAL_SKIP "Allergy" #define ALLERGIC_REMOVAL_SKIP "Allergy"
/// the default temperature at which chemicals are added to reagent holders at
#define DEFAULT_REAGENT_TEMPERATURE 300
//Used in holder.dm/equlibrium.dm to set values and volume limits //Used in holder.dm/equlibrium.dm to set values and volume limits
///the minimum volume of reagents than can be operated on. ///the minimum volume of reagents than can be operated on.
#define CHEMICAL_QUANTISATION_LEVEL 0.0001 #define CHEMICAL_QUANTISATION_LEVEL 0.0001
@@ -97,9 +70,10 @@
#define BUFFER_IONIZING_STRENGTH 30 #define BUFFER_IONIZING_STRENGTH 30
///The maximum temperature a reagent holder can attain ///The maximum temperature a reagent holder can attain
#define CHEMICAL_MAXIMUM_TEMPERATURE 99999 #define CHEMICAL_MAXIMUM_TEMPERATURE 99999
///The default purity of all non reacted reagents ///The default purity of all non reacted reagents
#define REAGENT_STANDARD_PURITY 0.75 #define REAGENT_STANDARD_PURITY 0.75
/// the default temperature at which chemicals are added to reagent holders at
#define DEFAULT_REAGENT_TEMPERATURE 300
//reagent bitflags, used for altering how they works //reagent bitflags, used for altering how they works
///allows on_mob_dead() if present in a dead body ///allows on_mob_dead() if present in a dead body

View File

@@ -3,3 +3,8 @@
///Amount of synthflesh required to unhusk someone ///Amount of synthflesh required to unhusk someone
#define SYNTHFLESH_LING_UNHUSK_AMOUNT 200 #define SYNTHFLESH_LING_UNHUSK_AMOUNT 200
//used by chem masters and pill presses
// The categories of reagent packaging
#define CAT_HYPOS "hypos"
#define CAT_DARTS "darts"

View File

@@ -0,0 +1,17 @@
/// List of plumbing layers as name => bitflag
GLOBAL_LIST_INIT(plumbing_layers, list(
"First Layer" = FIRST_DUCT_LAYER,
"Second Layer" = SECOND_DUCT_LAYER,
"Default Layer" = THIRD_DUCT_LAYER,
"Fourth Layer" = FOURTH_DUCT_LAYER,
"Fifth Layer" = FIFTH_DUCT_LAYER,
))
/// Reverse of plumbing_layers, as "[bitflag]" => name
GLOBAL_LIST_INIT(plumbing_layer_names, list(
"[FIRST_DUCT_LAYER]" = "First Layer",
"[SECOND_DUCT_LAYER]" = "Second Layer",
"[THIRD_DUCT_LAYER]" = "Default Layer",
"[FOURTH_DUCT_LAYER]" = "Fourth Layer",
"[FIFTH_DUCT_LAYER]" = "Fifth Layer",
))

View File

@@ -1,3 +1,51 @@
//Pills & Patches
/// List of containers the Chem Master machine can print
GLOBAL_LIST_INIT(reagent_containers, list(
CAT_CONDIMENTS = list(
/obj/item/reagent_containers/cup/bottle,
/obj/item/reagent_containers/condiment/flour,
/obj/item/reagent_containers/condiment/sugar,
/obj/item/reagent_containers/condiment/rice,
/obj/item/reagent_containers/condiment/cornmeal,
/obj/item/reagent_containers/condiment/milk,
/obj/item/reagent_containers/condiment/soymilk,
/obj/item/reagent_containers/condiment/yoghurt,
/obj/item/reagent_containers/condiment/saltshaker,
/obj/item/reagent_containers/condiment/peppermill,
/obj/item/reagent_containers/condiment/soysauce,
/obj/item/reagent_containers/condiment/bbqsauce,
/obj/item/reagent_containers/condiment/enzyme,
/obj/item/reagent_containers/condiment/hotsauce,
/obj/item/reagent_containers/condiment/coldsauce,
/obj/item/reagent_containers/condiment/mayonnaise,
/obj/item/reagent_containers/condiment/ketchup,
/obj/item/reagent_containers/condiment/olive_oil,
/obj/item/reagent_containers/condiment/vegetable_oil,
/obj/item/reagent_containers/condiment/peanut_butter,
/obj/item/reagent_containers/condiment/cherryjelly,
/obj/item/reagent_containers/condiment/honey,
/obj/item/reagent_containers/condiment/pack,
),
CAT_TUBES = list(
/obj/item/reagent_containers/cup/tube
),
CAT_PILLS = typecacheof(list(
/obj/item/reagent_containers/pill/style
)),
CAT_PATCHES = typecacheof(list(
/obj/item/reagent_containers/pill/patch/style
)),
// SKYRAT EDIT ADDITION START
CAT_HYPOS = list(
/obj/item/reagent_containers/cup/vial/small,
/obj/item/reagent_containers/cup/vial/large,
),
CAT_DARTS = typecacheof(list(
/obj/item/reagent_containers/syringe/smartdart
)),
// SKYRAT EDIT ADDITION END
))
/// list of all /datum/chemical_reaction datums indexed by their typepath. Use this for general lookup stuff /// list of all /datum/chemical_reaction datums indexed by their typepath. Use this for general lookup stuff
GLOBAL_LIST(chemical_reactions_list) GLOBAL_LIST(chemical_reactions_list)
/// list of all /datum/chemical_reaction datums. Used during chemical reactions. Indexed by REACTANT types /// list of all /datum/chemical_reaction datums. Used during chemical reactions. Indexed by REACTANT types

View File

@@ -75,7 +75,7 @@
if(!demand_connects || !reagents) if(!demand_connects || !reagents)
return PROCESS_KILL return PROCESS_KILL
if(reagents.total_volume < reagents.maximum_volume) if(!reagents.holder_full())
for(var/D in GLOB.cardinals) for(var/D in GLOB.cardinals)
if(D & demand_connects) if(D & demand_connects)
send_request(D) send_request(D)

View File

@@ -4,8 +4,8 @@
/datum/asset/spritesheet/chemmaster/create_spritesheets() /datum/asset/spritesheet/chemmaster/create_spritesheets()
var/list/ids = list() var/list/ids = list()
for(var/category in GLOB.chem_master_containers) for(var/category in GLOB.reagent_containers)
for(var/obj/item/reagent_containers/container as anything in GLOB.chem_master_containers[category]) for(var/obj/item/reagent_containers/container as anything in GLOB.reagent_containers[category])
var/icon_file = initial(container.icon) var/icon_file = initial(container.icon)
var/icon_state = initial(container.icon_state) var/icon_state = initial(container.icon_state)
var/id = sanitize_css_class_name("[container]") var/id = sanitize_css_class_name("[container]")

View File

@@ -1,25 +0,0 @@
/datum/asset/spritesheet/simple/patches
name = "patches"
assets = list(
"bandaid_1" = 'icons/ui_icons/patches/bandaid_1.png',
"bandaid_2" = 'icons/ui_icons/patches/bandaid_2.png',
"bandaid_3" = 'icons/ui_icons/patches/bandaid_3.png',
"bandaid_4" = 'icons/ui_icons/patches/bandaid_4.png',
"bandaid_blank" = 'icons/ui_icons/patches/bandaid_blank.png',
"bandaid_both" = 'icons/ui_icons/patches/bandaid_both.png',
"bandaid_brute" = 'icons/ui_icons/patches/bandaid_brute.png',
"bandaid_brute_2" = 'icons/ui_icons/patches/bandaid_brute_2.png',
"bandaid_burn" = 'icons/ui_icons/patches/bandaid_burn.png',
"bandaid_burn_2" = 'icons/ui_icons/patches/bandaid_burn_2.png',
"bandaid_clown" = 'icons/ui_icons/patches/bandaid_clown.png',
"bandaid_colonthree" = 'icons/ui_icons/patches/bandaid_colonthree.png',
"bandaid_exclaimationpoint" = 'icons/ui_icons/patches/bandaid_exclaimationpoint.png',
"bandaid_mix" = 'icons/ui_icons/patches/bandaid_mix.png',
"bandaid_monke" = 'icons/ui_icons/patches/bandaid_monke.png',
"bandaid_msic" = 'icons/ui_icons/patches/bandaid_msic.png',
"bandaid_questionmark" = 'icons/ui_icons/patches/bandaid_questionmark.png',
"bandaid_suffocation" = 'icons/ui_icons/patches/bandaid_suffocation.png',
"bandaid_suffocation_2" = 'icons/ui_icons/patches/bandaid_suffocation_2.png',
"bandaid_toxin" = 'icons/ui_icons/patches/bandaid_toxin.png',
"bandaid_toxin_2" = 'icons/ui_icons/patches/bandaid_toxin_2.png',
)

View File

@@ -1,26 +0,0 @@
/datum/asset/spritesheet/simple/pills
name = "pills"
assets = list(
"pill1" = 'icons/ui_icons/pills/pill1.png',
"pill2" = 'icons/ui_icons/pills/pill2.png',
"pill3" = 'icons/ui_icons/pills/pill3.png',
"pill4" = 'icons/ui_icons/pills/pill4.png',
"pill5" = 'icons/ui_icons/pills/pill5.png',
"pill6" = 'icons/ui_icons/pills/pill6.png',
"pill7" = 'icons/ui_icons/pills/pill7.png',
"pill8" = 'icons/ui_icons/pills/pill8.png',
"pill9" = 'icons/ui_icons/pills/pill9.png',
"pill10" = 'icons/ui_icons/pills/pill10.png',
"pill11" = 'icons/ui_icons/pills/pill11.png',
"pill12" = 'icons/ui_icons/pills/pill12.png',
"pill13" = 'icons/ui_icons/pills/pill13.png',
"pill14" = 'icons/ui_icons/pills/pill14.png',
"pill15" = 'icons/ui_icons/pills/pill15.png',
"pill16" = 'icons/ui_icons/pills/pill16.png',
"pill17" = 'icons/ui_icons/pills/pill17.png',
"pill18" = 'icons/ui_icons/pills/pill18.png',
"pill19" = 'icons/ui_icons/pills/pill19.png',
"pill20" = 'icons/ui_icons/pills/pill20.png',
"pill21" = 'icons/ui_icons/pills/pill21.png',
"pill22" = 'icons/ui_icons/pills/pill22.png',
)

View File

@@ -34,23 +34,24 @@
///changes the tile array ///changes the tile array
/obj/machinery/plumbing/bottler/setDir(newdir) /obj/machinery/plumbing/bottler/setDir(newdir)
. = ..() . = ..()
var/turf/target_turf = get_turf(src)
switch(dir) switch(dir)
if(NORTH) if(NORTH)
goodspot = get_step(get_turf(src), NORTH) goodspot = get_step(target_turf, NORTH)
inputspot = get_step(get_turf(src), SOUTH) inputspot = get_step(target_turf, SOUTH)
badspot = get_step(get_turf(src), EAST) badspot = get_step(target_turf, EAST)
if(SOUTH) if(SOUTH)
goodspot = get_step(get_turf(src), SOUTH) goodspot = get_step(target_turf, SOUTH)
inputspot = get_step(get_turf(src), NORTH) inputspot = get_step(target_turf, NORTH)
badspot = get_step(get_turf(src), WEST) badspot = get_step(target_turf, WEST)
if(WEST) if(WEST)
goodspot = get_step(get_turf(src), WEST) goodspot = get_step(target_turf, WEST)
inputspot = get_step(get_turf(src), EAST) inputspot = get_step(target_turf, EAST)
badspot = get_step(get_turf(src), NORTH) badspot = get_step(target_turf, NORTH)
if(EAST) if(EAST)
goodspot = get_step(get_turf(src), EAST) goodspot = get_step(target_turf, EAST)
inputspot = get_step(get_turf(src), WEST) inputspot = get_step(target_turf, WEST)
badspot = get_step(get_turf(src), SOUTH) badspot = get_step(target_turf, SOUTH)
//If by some miracle //If by some miracle
if( ( !valid_output_configuration ) && ( goodspot != null && inputspot != null && badspot != null ) ) if( ( !valid_output_configuration ) && ( goodspot != null && inputspot != null && badspot != null ) )
@@ -63,7 +64,7 @@
if(!valid_output_configuration) if(!valid_output_configuration)
to_chat(user, span_warning("A flashing notification on the screen reads: \"Output location error!\"")) to_chat(user, span_warning("A flashing notification on the screen reads: \"Output location error!\""))
return . return .
var/new_amount = tgui_input_number(user, "Set Amount to Fill", "Desired Amount", max_value = 100) var/new_amount = tgui_input_number(user, "Set Amount to Fill", "Desired Amount", max_value = reagents.maximum_volume, round_value = TRUE)
if(!new_amount || QDELETED(user) || QDELETED(src) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH)) if(!new_amount || QDELETED(user) || QDELETED(src) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
return . return .
wanted_amount = new_amount wanted_amount = new_amount
@@ -78,7 +79,7 @@
return PROCESS_KILL return PROCESS_KILL
///see if machine has enough to fill, is anchored down and has any inputspot objects to pick from ///see if machine has enough to fill, is anchored down and has any inputspot objects to pick from
if(reagents.total_volume >= wanted_amount && anchored && length(inputspot.contents)) if(reagents.total_volume + (CHEMICAL_QUANTISATION_LEVEL * 10) >= wanted_amount && anchored && length(inputspot.contents))
use_power(active_power_usage * seconds_per_tick) use_power(active_power_usage * seconds_per_tick)
var/obj/AM = pick(inputspot.contents)///pick a reagent_container that could be used var/obj/AM = pick(inputspot.contents)///pick a reagent_container that could be used
if((is_reagent_container(AM) && !istype(AM, /obj/item/reagent_containers/hypospray/medipen)) || istype(AM, /obj/item/ammo_casing/shotgun/dart)) if((is_reagent_container(AM) && !istype(AM, /obj/item/reagent_containers/hypospray/medipen)) || istype(AM, /obj/item/ammo_casing/shotgun/dart))

View File

@@ -1,3 +1,10 @@
///the minimum size of a pill or patch
#define MIN_VOLUME 5
///the maximum size a pill or patch can be
#define MAX_VOLUME 50
///max amount of pills allowed on our tile before we start storing them instead
#define MAX_FLOOR_PRODUCTS 10
///We take a constant input of reagents, and produce a pill once a set volume is reached ///We take a constant input of reagents, and produce a pill once a set volume is reached
/obj/machinery/plumbing/pill_press /obj/machinery/plumbing/pill_press
name = "chemical press" name = "chemical press"
@@ -5,114 +12,114 @@
icon_state = "pill_press" icon_state = "pill_press"
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2 active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2
///maximum size of a pill /// current operating product (pills or patches)
var/max_pill_volume = 50
///maximum size of a patch
var/max_patch_volume = 40
///maximum size of a bottle
var/max_bottle_volume = 50
///current operating product (pills or patches)
var/product = "pill" var/product = "pill"
///the minimum size a pill or patch can be /// selected size of the product
var/min_volume = 5
///the maximum size a pill or patch can be
var/max_volume = 50
///selected size of the product
var/current_volume = 10 var/current_volume = 10
///prefix for the product name /// prefix for the product name
var/product_name = "factory" var/product_name = "factory"
///the icon_state number for the pill. /// All packaging types wrapped up in 1 big list
var/pill_number = RANDOM_PILL_STYLE var/static/list/packaging_types = null
///list of id's and icons for the pill selection of the ui ///The type of packaging to use
var/list/pill_styles var/packaging_type
/// Currently selected patch style ///Category of packaging
var/patch_style = DEFAULT_PATCH_STYLE var/packaging_category
/// List of available patch styles for UI /// list of products stored in the machine, so we dont have 610 pills on one tile
var/list/patch_styles
///list of products stored in the machine, so we dont have 610 pills on one tile
var/list/stored_products = list() var/list/stored_products = list()
///max amount of pills allowed on our tile before we start storing them instead
var/max_floor_products = 10
/obj/machinery/plumbing/pill_press/examine(mob/user)
. = ..()
. += span_notice("The [name] currently has [stored_products.len] stored. There needs to be less than [max_floor_products] on the floor to continue dispensing.")
/obj/machinery/plumbing/pill_press/Initialize(mapload, bolt, layer) /obj/machinery/plumbing/pill_press/Initialize(mapload, bolt, layer)
. = ..() . = ..()
if(!packaging_types)
var/datum/asset/spritesheet/simple/assets = get_asset_datum(/datum/asset/spritesheet/chemmaster)
var/list/types = list(
CAT_PILLS = GLOB.reagent_containers[CAT_PILLS],
CAT_PATCHES = GLOB.reagent_containers[CAT_PATCHES],
"Bottles" = list(/obj/item/reagent_containers/cup/bottle),
CAT_HYPOS = GLOB.reagent_containers[CAT_HYPOS], // SKYRAT EDIT ADDITION - Hypovials
)
packaging_types = list()
for(var/category in types)
var/list/packages = types[category]
var/list/category_item = list("cat_name" = category)
for(var/obj/item/reagent_containers/container as anything in packages)
var/list/package_item = list(
"class_name" = assets.icon_class_name(sanitize_css_class_name("[container]")),
"ref" = REF(container)
)
category_item["products"] += list(package_item)
packaging_types += list(category_item)
packaging_type = REF(GLOB.reagent_containers[CAT_PILLS][1])
decode_category()
AddComponent(/datum/component/plumbing/simple_demand, bolt, layer) AddComponent(/datum/component/plumbing/simple_demand, bolt, layer)
/obj/machinery/plumbing/pill_press/examine(mob/user)
. = ..()
. += span_notice("The [name] currently has [stored_products.len] stored. There needs to be less than [MAX_FLOOR_PRODUCTS] on the floor to continue dispensing.")
/// decode product category from it's type path and returns the decoded typepath
/obj/machinery/plumbing/pill_press/proc/decode_category()
var/obj/item/reagent_containers/container = locate(packaging_type)
if(ispath(container, /obj/item/reagent_containers/pill/patch))
packaging_category = CAT_PATCHES
else if(ispath(container, /obj/item/reagent_containers/pill))
packaging_category = CAT_PILLS
// SKYRAT EDIT ADDITION START - HYPOVIALS
else if(ispath(container, /obj/item/reagent_containers/cup/vial))
packaging_category = CAT_HYPOS
// SKYRAT EDIT ADDITION END
else
packaging_category = "Bottles"
return container
/obj/machinery/plumbing/pill_press/process(seconds_per_tick) /obj/machinery/plumbing/pill_press/process(seconds_per_tick)
if(machine_stat & NOPOWER) if(machine_stat & NOPOWER)
return return
if(reagents.total_volume >= current_volume)
if (product == "pill") //shift & check to account for floating point inaccuracies
var/obj/item/reagent_containers/pill/P = new(src) if(reagents.total_volume + (CHEMICAL_QUANTISATION_LEVEL * 10) >= current_volume)
reagents.trans_to(P, current_volume) var/obj/item/reagent_containers/container = locate(packaging_type)
P.name = trim("[product_name] pill") container = new container(src)
stored_products += P var/suffix
if(pill_number == RANDOM_PILL_STYLE) switch(packaging_category)
P.icon_state = "pill[rand(1,21)]" if(CAT_PILLS)
suffix = "Pill"
if(CAT_PATCHES)
suffix = "Patch"
//SKYRAT EDIT ADDITION BEGIN - HYPOVIALS
if (CAT_HYPOS)
suffix = "Vial"
//SKYRAT EDIT ADDITION END - HYPOVIALS
else else
P.icon_state = "pill[pill_number]" suffix = "Bottle"
if(P.icon_state == "pill4") //mirrored from chem masters container.name = "[product_name] [suffix]"
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality." reagents.trans_to(container, current_volume)
else if (product == "patch") stored_products += container
var/obj/item/reagent_containers/pill/patch/P = new(src)
reagents.trans_to(P, current_volume) //dispense stored products on the floor
P.name = trim("[product_name] patch")
P.icon_state = patch_style
stored_products += P
else if (product == "bottle")
var/obj/item/reagent_containers/cup/bottle/P = new(src)
reagents.trans_to(P, current_volume)
P.name = trim("[product_name] bottle")
stored_products += P
//SKYRAT EDIT ADDITION BEGIN - HYPOVIALS
else if (product == "vial")
var/obj/item/reagent_containers/cup/vial/small/P = new(src)
reagents.trans_to(P, current_volume)
P.name = trim("[product_name] vial")
stored_products += P
//SKYRAT EDIT ADDITION END - HYPOVIALS
if(stored_products.len) if(stored_products.len)
var/pill_amount = 0 var/pill_amount = 0
for(var/thing in loc) for(var/obj/item/reagent_containers/thing in loc)
if(!istype(thing, /obj/item/reagent_containers/cup/bottle) && !istype(thing, /obj/item/reagent_containers/pill) && !istype(thing, /obj/item/reagent_containers/cup/vial/small)) //SKYRAT EDIT - Hypovials from chem presses
continue
pill_amount++ pill_amount++
if(pill_amount >= max_floor_products) //too much so just stop if(pill_amount >= MAX_FLOOR_PRODUCTS) //too much so just stop
break break
if(pill_amount < max_floor_products && anchored) if(pill_amount < MAX_FLOOR_PRODUCTS && anchored)
var/atom/movable/AM = stored_products[1] //AM because forceMove is all we need var/atom/movable/AM = stored_products[1] //AM because forceMove is all we need
stored_products -= AM stored_products -= AM
AM.forceMove(drop_location()) AM.forceMove(drop_location())
use_power(active_power_usage * seconds_per_tick) use_power(active_power_usage * seconds_per_tick)
/obj/machinery/plumbing/pill_press/proc/load_styles()
//expertly copypasted from chemmasters
var/datum/asset/spritesheet/simple/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
pill_styles = list()
for (var/x in 1 to PILL_STYLE_COUNT)
var/list/SL = list()
SL["id"] = x
SL["class_name"] = assets.icon_class_name("pill[x]")
pill_styles += list(SL)
var/datum/asset/spritesheet/simple/patches_assets = get_asset_datum(/datum/asset/spritesheet/simple/patches)
patch_styles = list()
for (var/raw_patch_style in PATCH_STYLE_LIST)
//adding class_name for use in UI
var/list/patch_style = list()
patch_style["style"] = raw_patch_style
patch_style["class_name"] = patches_assets.icon_class_name(raw_patch_style)
patch_styles += list(patch_style)
/obj/machinery/plumbing/pill_press/ui_assets(mob/user) /obj/machinery/plumbing/pill_press/ui_assets(mob/user)
return list( return list(
get_asset_datum(/datum/asset/spritesheet/simple/pills), get_asset_datum(/datum/asset/spritesheet/chemmaster)
get_asset_datum(/datum/asset/spritesheet/simple/patches),
) )
/obj/machinery/plumbing/pill_press/ui_interact(mob/user, datum/tgui/ui) /obj/machinery/plumbing/pill_press/ui_interact(mob/user, datum/tgui/ui)
@@ -121,45 +128,45 @@
ui = new(user, src, "ChemPress", name) ui = new(user, src, "ChemPress", name)
ui.open() ui.open()
/obj/machinery/plumbing/pill_press/ui_data(mob/user) /obj/machinery/plumbing/pill_press/ui_static_data(mob/user)
if(!pill_styles || !patch_styles)
load_styles()
var/list/data = list() var/list/data = list()
data["pill_style"] = pill_number
data["min_volume"] = MIN_VOLUME
data["max_volume"] = MAX_VOLUME
data["packaging_types"] = packaging_types
return data
/obj/machinery/plumbing/pill_press/ui_data(mob/user)
var/list/data = list()
data["current_volume"] = current_volume data["current_volume"] = current_volume
data["product_name"] = product_name data["product_name"] = product_name
data["pill_styles"] = pill_styles data["packaging_type"] = packaging_type
data["product"] = product data["packaging_category"] = packaging_category
data["min_volume"] = min_volume
data["max_volume"] = max_volume
data["patch_style"] = patch_style
data["patch_styles"] = patch_styles
return data return data
/obj/machinery/plumbing/pill_press/ui_act(action, params) /obj/machinery/plumbing/pill_press/ui_act(action, params)
. = ..() . = ..()
if(.) if(.)
return return
. = TRUE . = TRUE
switch(action) switch(action)
if("change_pill_style")
pill_number = clamp(text2num(params["id"]), 1 , PILL_STYLE_COUNT)
if("change_current_volume") if("change_current_volume")
current_volume = clamp(text2num(params["volume"]), min_volume, max_volume) current_volume = round(clamp(text2num(params["volume"]), MIN_VOLUME, MAX_VOLUME))
if("change_product_name") if("change_product_name")
product_name = html_encode(params["name"]) var/formatted_name = html_encode(params["name"])
if (length(formatted_name) > MAX_NAME_LEN)
product_name = copytext(formatted_name, 1, MAX_NAME_LEN + 1)
else
product_name = formatted_name
if("change_product") if("change_product")
product = params["product"] packaging_type = params["ref"]
if (product == "pill") var/obj/item/reagent_containers/container = decode_category()
max_volume = max_pill_volume current_volume = clamp(current_volume, MIN_VOLUME, initial(container.volume))
else if (product == "patch")
max_volume = max_patch_volume #undef MIN_VOLUME
else if (product == "bottle") #undef MAX_VOLUME
max_volume = max_bottle_volume #undef MAX_FLOOR_PRODUCTS
//SKYRAT EDIT ADDITION BEGIN - HYPOVIALS
else if (product == "vial")
max_volume = max_bottle_volume
//SKYRAT EDIT ADDITION END - HYPOVIALS
current_volume = clamp(current_volume, min_volume, max_volume)
if("change_patch_style")
patch_style = params["patch_style"]

View File

@@ -2,59 +2,6 @@
#define TRANSFER_MODE_MOVE 1 #define TRANSFER_MODE_MOVE 1
#define TARGET_BEAKER "beaker" #define TARGET_BEAKER "beaker"
#define TARGET_BUFFER "buffer" #define TARGET_BUFFER "buffer"
#define CAT_CONDIMENTS "condiments"
#define CAT_TUBES "tubes"
#define CAT_PILLS "pills"
#define CAT_PATCHES "patches"
#define CAT_HYPOS "hypos" // SKYRAT EDIT ADDITION
#define CAT_DARTS "darts" // SKYRAT EDIT ADDITION
/// List of containers the Chem Master machine can print
GLOBAL_LIST_INIT(chem_master_containers, list(
CAT_CONDIMENTS = list(
/obj/item/reagent_containers/cup/bottle,
/obj/item/reagent_containers/condiment/flour,
/obj/item/reagent_containers/condiment/sugar,
/obj/item/reagent_containers/condiment/rice,
/obj/item/reagent_containers/condiment/cornmeal,
/obj/item/reagent_containers/condiment/milk,
/obj/item/reagent_containers/condiment/soymilk,
/obj/item/reagent_containers/condiment/yoghurt,
/obj/item/reagent_containers/condiment/saltshaker,
/obj/item/reagent_containers/condiment/peppermill,
/obj/item/reagent_containers/condiment/soysauce,
/obj/item/reagent_containers/condiment/bbqsauce,
/obj/item/reagent_containers/condiment/enzyme,
/obj/item/reagent_containers/condiment/hotsauce,
/obj/item/reagent_containers/condiment/coldsauce,
/obj/item/reagent_containers/condiment/mayonnaise,
/obj/item/reagent_containers/condiment/ketchup,
/obj/item/reagent_containers/condiment/olive_oil,
/obj/item/reagent_containers/condiment/vegetable_oil,
/obj/item/reagent_containers/condiment/peanut_butter,
/obj/item/reagent_containers/condiment/cherryjelly,
/obj/item/reagent_containers/condiment/honey,
/obj/item/reagent_containers/condiment/pack,
),
CAT_TUBES = list(
/obj/item/reagent_containers/cup/tube
),
CAT_PILLS = typecacheof(list(
/obj/item/reagent_containers/pill/style
)),
CAT_PATCHES = typecacheof(list(
/obj/item/reagent_containers/pill/patch/style
)),
// SKYRAT EDIT ADDITION START
CAT_HYPOS = list(
/obj/item/reagent_containers/cup/vial/small,
/obj/item/reagent_containers/cup/vial/large,
),
CAT_DARTS = typecacheof(list(
/obj/item/reagent_containers/syringe/smartdart
))
// SKYRAT EDIT ADDITION END
))
/obj/machinery/chem_master /obj/machinery/chem_master
name = "ChemMaster 3000" name = "ChemMaster 3000"
@@ -70,7 +17,7 @@ GLOBAL_LIST_INIT(chem_master_containers, list(
/// Icons for different percentages of buffer reagents /// Icons for different percentages of buffer reagents
var/fill_icon = 'icons/obj/medical/reagent_fillings.dmi' var/fill_icon = 'icons/obj/medical/reagent_fillings.dmi'
var/fill_icon_state = "chemmaster" var/fill_icon_state = "chemmaster"
var/list/fill_icon_thresholds = list(10,20,30,40,50,60,70,80,90,100) var/static/list/fill_icon_thresholds = list(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
/// Inserted reagent container /// Inserted reagent container
var/obj/item/reagent_containers/beaker var/obj/item/reagent_containers/beaker
/// Whether separated reagents should be moved back to container or destroyed. /// Whether separated reagents should be moved back to container or destroyed.
@@ -225,11 +172,11 @@ GLOBAL_LIST_INIT(chem_master_containers, list(
/obj/machinery/chem_master/proc/load_printable_containers() /obj/machinery/chem_master/proc/load_printable_containers()
printable_containers = list( printable_containers = list(
CAT_TUBES = GLOB.chem_master_containers[CAT_TUBES], CAT_TUBES = GLOB.reagent_containers[CAT_TUBES],
CAT_PILLS = GLOB.chem_master_containers[CAT_PILLS], CAT_PILLS = GLOB.reagent_containers[CAT_PILLS],
CAT_PATCHES = GLOB.chem_master_containers[CAT_PATCHES], CAT_PATCHES = GLOB.reagent_containers[CAT_PATCHES],
CAT_HYPOS = GLOB.chem_master_containers[CAT_HYPOS], // SKYRAT EDIT ADDITION CAT_HYPOS = GLOB.reagent_containers[CAT_HYPOS], // SKYRAT EDIT ADDITION
CAT_DARTS = GLOB.chem_master_containers[CAT_DARTS], // SKYRAT EDIT ADDITION CAT_DARTS = GLOB.reagent_containers[CAT_DARTS], // SKYRAT EDIT ADDITION
) )
/obj/machinery/chem_master/ui_assets(mob/user) /obj/machinery/chem_master/ui_assets(mob/user)
@@ -503,16 +450,10 @@ GLOBAL_LIST_INIT(chem_master_containers, list(
/obj/machinery/chem_master/condimaster/load_printable_containers() /obj/machinery/chem_master/condimaster/load_printable_containers()
printable_containers = list( printable_containers = list(
CAT_CONDIMENTS = GLOB.chem_master_containers[CAT_CONDIMENTS], CAT_CONDIMENTS = GLOB.reagent_containers[CAT_CONDIMENTS],
) )
#undef TRANSFER_MODE_DESTROY #undef TRANSFER_MODE_DESTROY
#undef TRANSFER_MODE_MOVE #undef TRANSFER_MODE_MOVE
#undef TARGET_BEAKER #undef TARGET_BEAKER
#undef TARGET_BUFFER #undef TARGET_BUFFER
#undef CAT_CONDIMENTS
#undef CAT_TUBES
#undef CAT_PILLS
#undef CAT_PATCHES
#undef CAT_HYPOS // SKYRAT EDIT ADDITION
#undef CAT_DARTS // SKYRAT EDIT ADDITION

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

View File

@@ -599,6 +599,7 @@
#include "code\_globalvars\lists\mobs.dm" #include "code\_globalvars\lists\mobs.dm"
#include "code\_globalvars\lists\names.dm" #include "code\_globalvars\lists\names.dm"
#include "code\_globalvars\lists\objects.dm" #include "code\_globalvars\lists\objects.dm"
#include "code\_globalvars\lists\plumbing.dm"
#include "code\_globalvars\lists\poll_ignore.dm" #include "code\_globalvars\lists\poll_ignore.dm"
#include "code\_globalvars\lists\quirks.dm" #include "code\_globalvars\lists\quirks.dm"
#include "code\_globalvars\lists\rcd.dm" #include "code\_globalvars\lists\rcd.dm"
@@ -3231,10 +3232,8 @@
#include "code\modules\asset_cache\assets\orbit.dm" #include "code\modules\asset_cache\assets\orbit.dm"
#include "code\modules\asset_cache\assets\paper.dm" #include "code\modules\asset_cache\assets\paper.dm"
#include "code\modules\asset_cache\assets\particle_editor.dm" #include "code\modules\asset_cache\assets\particle_editor.dm"
#include "code\modules\asset_cache\assets\patches.dm"
#include "code\modules\asset_cache\assets\pda.dm" #include "code\modules\asset_cache\assets\pda.dm"
#include "code\modules\asset_cache\assets\permissions.dm" #include "code\modules\asset_cache\assets\permissions.dm"
#include "code\modules\asset_cache\assets\pills.dm"
#include "code\modules\asset_cache\assets\pipes.dm" #include "code\modules\asset_cache\assets\pipes.dm"
#include "code\modules\asset_cache\assets\plane_debug.dm" #include "code\modules\asset_cache\assets\plane_debug.dm"
#include "code\modules\asset_cache\assets\plumbing.dm" #include "code\modules\asset_cache\assets\plumbing.dm"

View File

@@ -0,0 +1,112 @@
import { useBackend, useLocalState } from '../backend';
import { Box, Button, Input, LabeledList, NumberInput, Section } from '../components';
import { capitalizeAll } from 'common/string';
import { Window } from '../layouts';
type Product = {
ref: string;
class_name: string;
};
type Category = {
cat_name: string;
products: Product[];
};
type Data = {
current_volume: Number;
product_name: string;
min_volume: Number;
max_volume: Number;
packaging_category: string;
packaging_types: Category[];
packaging_type: string;
};
export const ChemPress = (props, context) => {
const { act, data } = useBackend<Data>(context);
const {
current_volume,
product_name,
min_volume,
max_volume,
packaging_category,
packaging_types,
packaging_type,
} = data;
const [categoryName, setCategoryName] = useLocalState(
context,
'categoryName',
packaging_category
);
const shownCategory =
packaging_types.find((category) => category.cat_name === categoryName) ||
packaging_types[0];
return (
<Window width={300} height={330}>
<Window.Content>
<Section>
<LabeledList>
<LabeledList.Item label="Product">
{packaging_types.map((category, i) => (
<Button.Checkbox
key={category.cat_name}
content={capitalizeAll(category.cat_name)}
checked={category.cat_name === shownCategory.cat_name}
onClick={() => setCategoryName(category.cat_name)}
/>
))}
</LabeledList.Item>
<LabeledList.Item label="Volume">
<NumberInput
value={current_volume}
unit="u"
width="43px"
minValue={min_volume}
maxValue={max_volume}
step={1}
stepPixelSize={2}
onChange={(e, value) =>
act('change_current_volume', {
volume: value,
})
}
/>
</LabeledList.Item>
<LabeledList.Item label="Name">
<Input
value={product_name}
placeholder={product_name}
onChange={(e, value) =>
act('change_product_name', {
name: value,
})
}
/>
</LabeledList.Item>
<LabeledList.Item label="Styles">
{shownCategory.products.map((design, j) => (
<Button
key={j}
selected={design.ref === packaging_type}
color="transparent"
onClick={() =>
act('change_product', {
ref: design.ref,
})
}>
<Box
className={design.class_name}
style={{
transform: 'scale(1.5)',
}}
/>
</Button>
))}
</LabeledList.Item>
</LabeledList>
</Section>
</Window.Content>
</Window>
);
};