Skip to content

Commit

Permalink
[MIRROR] More Plumbing Fixes & Pill Press UI Changes [MDB IGNORE] (#179)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Giz <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent a75d80d commit e499d02
Show file tree
Hide file tree
Showing 57 changed files with 331 additions and 296 deletions.
18 changes: 0 additions & 18 deletions code/__DEFINES/plumbing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,5 @@

#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
#define DUCT_COLOR_OMNI "omni"
40 changes: 7 additions & 33 deletions code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,45 +45,18 @@
#define SYNTHFLESH_UNHUSK_AMOUNT 100

//used by chem masters and pill presses
#define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die
#define RANDOM_PILL_STYLE 22 //Dont change this one though

//used by chem masters and pill presses
//update this if you add more patch icons
#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
// The categories of reagent packaging
#define CAT_CONDIMENTS "condiments"
#define CAT_TUBES "tubes"
#define CAT_PILLS "pills"
#define CAT_PATCHES "patches"
#define DEFAULT_PATCH_STYLE "bandaid_blank"

//used by chem master
#define CONDIMASTER_STYLE_AUTO "auto"
#define CONDIMASTER_STYLE_FALLBACK "_"

#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
///the minimum volume of reagents than can be operated on.
#define CHEMICAL_QUANTISATION_LEVEL 0.0001
Expand All @@ -97,9 +70,10 @@
#define BUFFER_IONIZING_STRENGTH 30
///The maximum temperature a reagent holder can attain
#define CHEMICAL_MAXIMUM_TEMPERATURE 99999

///The default purity of all non reacted reagents
#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
///allows on_mob_dead() if present in a dead body
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/~skyrat_defines/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@

///Amount of synthflesh required to unhusk someone
#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"
17 changes: 17 additions & 0 deletions code/_globalvars/lists/plumbing.dm
Original file line number Diff line number Diff line change
@@ -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",
))
48 changes: 48 additions & 0 deletions code/_globalvars/lists/reagents.dm
Original file line number Diff line number Diff line change
@@ -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
GLOBAL_LIST(chemical_reactions_list)
/// list of all /datum/chemical_reaction datums. Used during chemical reactions. Indexed by REACTANT types
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/plumbing/_plumbing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
if(!demand_connects || !reagents)
return PROCESS_KILL

if(reagents.total_volume < reagents.maximum_volume)
if(!reagents.holder_full())
for(var/D in GLOB.cardinals)
if(D & demand_connects)
send_request(D)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/asset_cache/assets/chemmaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

/datum/asset/spritesheet/chemmaster/create_spritesheets()
var/list/ids = list()
for(var/category in GLOB.chem_master_containers)
for(var/obj/item/reagent_containers/container as anything in GLOB.chem_master_containers[category])
for(var/category in GLOB.reagent_containers)
for(var/obj/item/reagent_containers/container as anything in GLOB.reagent_containers[category])
var/icon_file = initial(container.icon)
var/icon_state = initial(container.icon_state)
var/id = sanitize_css_class_name("[container]")
Expand Down
25 changes: 0 additions & 25 deletions code/modules/asset_cache/assets/patches.dm

This file was deleted.

26 changes: 0 additions & 26 deletions code/modules/asset_cache/assets/pills.dm

This file was deleted.

29 changes: 15 additions & 14 deletions code/modules/plumbing/plumbers/bottler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,24 @@
///changes the tile array
/obj/machinery/plumbing/bottler/setDir(newdir)
. = ..()
var/turf/target_turf = get_turf(src)
switch(dir)
if(NORTH)
goodspot = get_step(get_turf(src), NORTH)
inputspot = get_step(get_turf(src), SOUTH)
badspot = get_step(get_turf(src), EAST)
goodspot = get_step(target_turf, NORTH)
inputspot = get_step(target_turf, SOUTH)
badspot = get_step(target_turf, EAST)
if(SOUTH)
goodspot = get_step(get_turf(src), SOUTH)
inputspot = get_step(get_turf(src), NORTH)
badspot = get_step(get_turf(src), WEST)
goodspot = get_step(target_turf, SOUTH)
inputspot = get_step(target_turf, NORTH)
badspot = get_step(target_turf, WEST)
if(WEST)
goodspot = get_step(get_turf(src), WEST)
inputspot = get_step(get_turf(src), EAST)
badspot = get_step(get_turf(src), NORTH)
goodspot = get_step(target_turf, WEST)
inputspot = get_step(target_turf, EAST)
badspot = get_step(target_turf, NORTH)
if(EAST)
goodspot = get_step(get_turf(src), EAST)
inputspot = get_step(get_turf(src), WEST)
badspot = get_step(get_turf(src), SOUTH)
goodspot = get_step(target_turf, EAST)
inputspot = get_step(target_turf, WEST)
badspot = get_step(target_turf, SOUTH)

//If by some miracle
if( ( !valid_output_configuration ) && ( goodspot != null && inputspot != null && badspot != null ) )
Expand All @@ -63,7 +64,7 @@
if(!valid_output_configuration)
to_chat(user, span_warning("A flashing notification on the screen reads: \"Output location error!\""))
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))
return .
wanted_amount = new_amount
Expand All @@ -78,7 +79,7 @@
return PROCESS_KILL

///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)
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))
Expand Down
Loading

0 comments on commit e499d02

Please sign in to comment.