diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 64518f73b46..1b0469b26e0 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -12,7 +12,7 @@ #define TRANSPARENT (1<<5) // Used on containers which you want to be able to see the reagents off. #define AMOUNT_VISIBLE (1<<6) // For non-transparent containers that still have the general amount of reagents in them visible. #define NO_REACT (1<<7) // Applied to a reagent holder, the contents will not react with each other. -#define REAGENT_HOLDER_INSTANT_REACT (1<<8) // Applied to a reagent holder, all of the reactions in the reagents datum will be instant. Meant to be used for things like smoke effects where reactions aren't meant to occur +#define REAGENT_HOLDER_INSTANT_REACT (1<<8) // Applied to a reagent holder, all of the reactions in the reagents datum will be instant. Meant to be used for things like smoke effects where reactions aren't meant to occur // Is an open container for all intents and purposes. #define OPENCONTAINER (REFILLABLE | DRAINABLE | TRANSPARENT) @@ -83,7 +83,9 @@ ///Used to bypass the chem_master transfer block (This is needed for competitive reactions unless you have an end state programmed). More stuff might be added later. When defining this, please add in the comments the associated reactions that it competes with #define REACTION_COMPETITIVE (1<<5) -///Used to force an equlibrium to end a reaction in reaction_step() (i.e. in a reaction_step() proc return END_REACTION to end it) +///Used for overheat_temp - This sets the overheat so high it effectively has no overheat temperature. +#define NO_OVERHEAT 99999 +////Used to force an equlibrium to end a reaction in reaction_step() (i.e. in a reaction_step() proc return END_REACTION to end it) #define END_REACTION "end_reaction" ///Minimum requirement for addiction buzz to be met @@ -96,3 +98,49 @@ #define WITHDRAWAL_STAGE2_START_CYCLE 61 #define WITHDRAWAL_STAGE2_END_CYCLE 120 #define WITHDRAWAL_STAGE3_START_CYCLE 121 + +///reagent tags - used to look up reagents for specific effects. Feel free to add to but comment it +/// This reagent does brute effects (BOTH damaging and healing) +#define REACTION_TAG_BRUTE (1<<0) +/// This reagent does burn effects (BOTH damaging and healing) +#define REACTION_TAG_BURN (1<<1) +/// This reagent does toxin effects (BOTH damaging and healing) +#define REACTION_TAG_TOXIN (1<<2) +/// This reagent does oxy effects (BOTH damaging and healing) +#define REACTION_TAG_OXY (1<<3) +/// This reagent does clone effects (BOTH damaging and healing) +#define REACTION_TAG_CLONE (1<<4) +/// This reagent primarily heals, or it's supposed to be used for healing (in the case of c2 - they are healing) +#define REACTION_TAG_HEALING (1<<5) +/// This reagent primarily damages +#define REACTION_TAG_DAMAGING (1<<6) +/// This reagent explodes as a part of it's intended effect (i.e. not overheated/impure) +#define REACTION_TAG_EXPLOSIVE (1<<7) +/// This reagent does things that are unique and special +#define REACTION_TAG_OTHER (1<<8) +/// This reagent's reaction is dangerous to create (i.e. explodes if you fail it) +#define REACTION_TAG_DANGEROUS (1<<9) +/// This reagent's reaction is easy +#define REACTION_TAG_EASY (1<<10) +/// This reagent's reaction is difficult/involved +#define REACTION_TAG_MODERATE (1<<11) +/// This reagent's reaction is hard +#define REACTION_TAG_HARD (1<<12) +/// This reagent affects organs +#define REACTION_TAG_ORGAN (1<<13) +/// This reaction creates a drink reagent +#define REACTION_TAG_DRINK (1<<14) +/// This reaction has something to do with food +#define REACTION_TAG_FOOD (1<<15) +/// This reaction is a slime reaction +#define REACTION_TAG_SLIME (1<<16) +/// This reaction is a drug reaction +#define REACTION_TAG_DRUG (1<<17) +/// This reaction is a unique reaction +#define REACTION_TAG_UNIQUE (1<<18) +/// This reaction is produces a product that affects reactions +#define REACTION_TAG_CHEMICAL (1<<19) +/// This reaction is produces a product that affects plants +#define REACTION_TAG_PLANT (1<<20) +/// This reaction is produces a product that affects plants +#define REACTION_TAG_COMPETITIVE (1<<21) diff --git a/code/__HELPERS/reagents.dm b/code/__HELPERS/reagents.dm index b8e77066e27..ac304e312aa 100644 --- a/code/__HELPERS/reagents.dm +++ b/code/__HELPERS/reagents.dm @@ -2,7 +2,7 @@ //We have to check to see if either is competitive so can ignore it (competitive reagents are supposed to conflict) if((r1.reaction_flags & REACTION_COMPETITIVE) || (r2.reaction_flags & REACTION_COMPETITIVE)) return FALSE - + //do the non-list tests first, because they are cheaper if(r1.required_container != r2.required_container) return FALSE @@ -90,6 +90,33 @@ for(var/mob/M in viewers(5, location)) to_chat(M, notification) +///Converts the pH into a tgui readable color - i.e. white and black text is readable over it. This is NOT the colourwheel for pHes however. +/proc/convert_ph_to_readable_color(pH) + switch(pH) + if(-INFINITY to 1) + return "red" + if(1 to 2) + return "orange" + if(2 to 3) + return "average" + if(3 to 4) + return "yellow" + if(4 to 5) + return "olive" + if(5 to 6) + return "good" + if(6 to 8) + return "green" + if(8 to 9.5) + return "teal" + if(9.5 to 11) + return "blue" + if(11 to 12.5) + return "violet" + if(12.5 to INFINITY) + return "purple" + +///Converts pH to universal indicator colours. This is the colorwheel for pHes #define CONVERT_PH_TO_COLOR(pH, color) \ switch(pH) {\ if(14 to INFINITY)\ @@ -123,4 +150,55 @@ if(-INFINITY to 1)\ { color = "#c6040c" }\ } - + +///Returns a list of chemical_reaction datums that have the input STRING as a product +/proc/get_reagent_type_from_product_string(string) + var/input_reagent = replacetext(lowertext(string), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name + if (isnull(input_reagent)) + return + + var/list/shortcuts = list("meth" = /datum/reagent/drug/methamphetamine) + if(shortcuts[input_reagent]) + input_reagent = shortcuts[input_reagent] + else + input_reagent = find_reagent(input_reagent) + return input_reagent + +///Returns reagent datum from typepath +/proc/find_reagent(input) + . = FALSE + if(GLOB.chemical_reagents_list[input]) //prefer IDs! + return input + else + return get_chem_id(input) + +/proc/find_reagent_object_from_type(input) + if(GLOB.chemical_reagents_list[input]) //prefer IDs! + return GLOB.chemical_reagents_list[input] + else + return null + +///Returns a random reagent object minus blacklisted reagents +/proc/get_random_reagent_id() + var/static/list/random_reagents = list() + if(!random_reagents.len) + for(var/thing in subtypesof(/datum/reagent)) + var/datum/reagent/R = thing + if(initial(R.chemical_flags) & REAGENT_CAN_BE_SYNTHESIZED) + random_reagents += R + var/picked_reagent = pick(random_reagents) + return picked_reagent + +///Returns reagent datum from reagent name string +/proc/get_chem_id(chem_name) + for(var/X in GLOB.chemical_reagents_list) + var/datum/reagent/R = GLOB.chemical_reagents_list[X] + if(ckey(chem_name) == ckey(lowertext(R.name))) + return X + +///Takes a type in and returns a list of associated recipes +/proc/get_recipe_from_reagent_product(input_type) + if(!input_type) + return + var/list/matching_reactions = GLOB.chemical_reactions_list_product_index[input_type] + return matching_reactions diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index de14dc75a84..c7551c30044 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -17,8 +17,10 @@ GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that GLOBAL_LIST_EMPTY_TYPED(singularities, /datum/component/singularity) //list of all singularities on the station GLOBAL_LIST_EMPTY(mechpad_list) //list of all /obj/machinery/mechpad -GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions +GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions. Indexed by REACTANT types +GLOBAL_LIST(chemical_reactions_list_product_index) //list of all /datum/chemical_reaction datums. Used for the reaction lookup UI. Indexed by PRODUCT type GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff +GLOBAL_LIST(chemical_reactions_results_lookup_list) //List of all reactions with their associated product and result ids. Used for reaction lookups GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id. GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path. GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes @@ -30,7 +32,7 @@ GLOBAL_LIST_EMPTY(poi_list) //list of points of interest for observe/follow GLOBAL_LIST_EMPTY(pinpointer_list) //list of all pinpointers. Used to change stuff they are pointing to all at once. GLOBAL_LIST_EMPTY(zombie_infection_list) // A list of all zombie_infection organs, for any mass "animation" GLOBAL_LIST_EMPTY(meteor_list) // List of all meteors. -GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers +GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers GLOBAL_LIST_EMPTY(ladders) GLOBAL_LIST_EMPTY(trophy_cases) ///This is a global list of all signs you can change an existing sign or new sign backing to, when using a pen on them. diff --git a/code/controllers/subsystem/processing/reagents.dm b/code/controllers/subsystem/processing/reagents.dm index 344c066adf2..1a38ae4219a 100644 --- a/code/controllers/subsystem/processing/reagents.dm +++ b/code/controllers/subsystem/processing/reagents.dm @@ -16,7 +16,7 @@ PROCESSING_SUBSYSTEM_DEF(reagents) previous_world_time = world.time //Build GLOB lists - see holder.dm build_chemical_reagent_list() - build_chemical_reactions_list() + build_chemical_reactions_lists() return /datum/controller/subsystem/processing/reagents/fire(resumed = FALSE) diff --git a/code/modules/food_and_drinks/recipes/drinks_recipes.dm b/code/modules/food_and_drinks/recipes/drinks_recipes.dm index 456fffce5c6..f336dec9b84 100644 --- a/code/modules/food_and_drinks/recipes/drinks_recipes.dm +++ b/code/modules/food_and_drinks/recipes/drinks_recipes.dm @@ -8,6 +8,8 @@ thermic_constant = 0 H_ion_release = 0 rate_up_lim = 50 + purity_min = 0 + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY ////////////////////////////////////////// COCKTAILS ////////////////////////////////////// @@ -15,6 +17,7 @@ /datum/chemical_reaction/drink/goldschlager results = list(/datum/reagent/consumable/ethanol/goldschlager = 10) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 10, /datum/reagent/gold = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY /datum/chemical_reaction/drink/patron results = list(/datum/reagent/consumable/ethanol/patron = 10) @@ -23,6 +26,7 @@ /datum/chemical_reaction/drink/bilk results = list(/datum/reagent/consumable/ethanol/bilk = 2) required_reagents = list(/datum/reagent/consumable/milk = 1, /datum/reagent/consumable/ethanol/beer = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_BRUTE /datum/chemical_reaction/drink/icetea results = list(/datum/reagent/consumable/icetea = 4) @@ -59,11 +63,13 @@ results = list(/datum/reagent/consumable/ethanol/vodka = 10) required_reagents = list(/datum/reagent/consumable/potato_juice = 10) required_catalysts = list(/datum/reagent/consumable/enzyme = 5) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/kahlua results = list(/datum/reagent/consumable/ethanol/kahlua = 5) required_reagents = list(/datum/reagent/consumable/coffee = 5, /datum/reagent/consumable/sugar = 5) required_catalysts = list(/datum/reagent/consumable/enzyme = 5) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/gin_tonic results = list(/datum/reagent/consumable/ethanol/gintonic = 3) @@ -76,6 +82,7 @@ /datum/chemical_reaction/drink/cuba_libre results = list(/datum/reagent/consumable/ethanol/cuba_libre = 4) required_reagents = list(/datum/reagent/consumable/ethanol/rum_coke = 3, /datum/reagent/consumable/limejuice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/martini results = list(/datum/reagent/consumable/ethanol/martini = 3) @@ -100,10 +107,12 @@ /datum/chemical_reaction/drink/bloody_mary results = list(/datum/reagent/consumable/ethanol/bloody_mary = 4) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/limejuice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/gargle_blaster results = list(/datum/reagent/consumable/ethanol/gargle_blaster = 5) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/ethanol/gin = 1, /datum/reagent/consumable/ethanol/whiskey = 1, /datum/reagent/consumable/ethanol/cognac = 1, /datum/reagent/consumable/limejuice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/brave_bull results = list(/datum/reagent/consumable/ethanol/brave_bull = 3) @@ -112,18 +121,22 @@ /datum/chemical_reaction/drink/tequila_sunrise results = list(/datum/reagent/consumable/ethanol/tequila_sunrise = 5) required_reagents = list(/datum/reagent/consumable/ethanol/tequila = 2, /datum/reagent/consumable/orangejuice = 2, /datum/reagent/consumable/grenadine = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/toxins_special results = list(/datum/reagent/consumable/ethanol/toxins_special = 5) required_reagents = list(/datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/ethanol/vermouth = 1, /datum/reagent/toxin/plasma = 2) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/beepsky_smash results = list(/datum/reagent/consumable/ethanol/beepsky_smash = 5) required_reagents = list(/datum/reagent/consumable/limejuice = 2, /datum/reagent/consumable/ethanol/quadruple_sec = 2, /datum/reagent/iron = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/doctor_delight results = list(/datum/reagent/consumable/doctor_delight = 5) required_reagents = list(/datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/consumable/orangejuice = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/medicine/cryoxadone = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_BRUTE | REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY /datum/chemical_reaction/drink/irish_cream results = list(/datum/reagent/consumable/ethanol/irish_cream = 3) @@ -132,10 +145,12 @@ /datum/chemical_reaction/drink/manly_dorf results = list(/datum/reagent/consumable/ethanol/manly_dorf = 3) required_reagents = list (/datum/reagent/consumable/ethanol/beer = 1, /datum/reagent/consumable/ethanol/ale = 2) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/greenbeer results = list(/datum/reagent/consumable/ethanol/beer/green = 10) required_reagents = list(/datum/reagent/colorful_reagent/powder/green = 1, /datum/reagent/consumable/ethanol/beer = 10) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/greenbeer2 //apparently there's no other way to do this results = list(/datum/reagent/consumable/ethanol/beer/green = 10) @@ -157,6 +172,7 @@ /datum/chemical_reaction/drink/atomicbomb results = list(/datum/reagent/consumable/ethanol/atomicbomb = 10) required_reagents = list(/datum/reagent/consumable/ethanol/b52 = 10, /datum/reagent/uranium = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/margarita results = list(/datum/reagent/consumable/ethanol/margarita = 4) @@ -169,6 +185,7 @@ /datum/chemical_reaction/drink/threemileisland results = list(/datum/reagent/consumable/ethanol/threemileisland = 10) required_reagents = list(/datum/reagent/consumable/ethanol/longislandicedtea = 10, /datum/reagent/uranium = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/whiskeysoda results = list(/datum/reagent/consumable/ethanol/whiskeysoda = 3) @@ -221,10 +238,12 @@ /datum/chemical_reaction/drink/antifreeze results = list(/datum/reagent/consumable/ethanol/antifreeze = 4) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 2, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/ice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/barefoot results = list(/datum/reagent/consumable/ethanol/barefoot = 3) required_reagents = list(/datum/reagent/consumable/berryjuice = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/ethanol/vermouth = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/moscow_mule results = list(/datum/reagent/consumable/ethanol/moscow_mule = 10) @@ -244,6 +263,7 @@ /datum/chemical_reaction/drink/sbiten results = list(/datum/reagent/consumable/ethanol/sbiten = 10) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 10, /datum/reagent/consumable/capsaicin = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/red_mead results = list(/datum/reagent/consumable/ethanol/red_mead = 2) @@ -257,6 +277,7 @@ /datum/chemical_reaction/drink/iced_beer results = list(/datum/reagent/consumable/ethanol/iced_beer = 6) required_reagents = list(/datum/reagent/consumable/ethanol/beer = 5, /datum/reagent/consumable/ice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/grog results = list(/datum/reagent/consumable/ethanol/grog = 2) @@ -273,7 +294,7 @@ /datum/chemical_reaction/drink/acidspit results = list(/datum/reagent/consumable/ethanol/acid_spit = 6) required_reagents = list(/datum/reagent/toxin/acid = 1, /datum/reagent/consumable/ethanol/wine = 5) - optimal_ph_min = 0 //Our reaction is very acidic, so lets shift our range + optimal_ph_min = 0 //Our reaction is very acidic, so lets shift our range /datum/chemical_reaction/drink/amasec results = list(/datum/reagent/consumable/ethanol/amasec = 10) @@ -282,6 +303,7 @@ /datum/chemical_reaction/drink/changelingsting results = list(/datum/reagent/consumable/ethanol/changelingsting = 5) required_reagents = list(/datum/reagent/consumable/ethanol/screwdrivercocktail = 1, /datum/reagent/consumable/lemon_lime = 2) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/aloe results = list(/datum/reagent/consumable/ethanol/aloe = 2) @@ -294,6 +316,7 @@ /datum/chemical_reaction/drink/neurotoxin results = list(/datum/reagent/consumable/ethanol/neurotoxin = 2) required_reagents = list(/datum/reagent/consumable/ethanol/gargle_blaster = 1, /datum/reagent/medicine/morphine = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/snowwhite results = list(/datum/reagent/consumable/ethanol/snowwhite = 2) @@ -318,14 +341,17 @@ /datum/chemical_reaction/drink/hippiesdelight results = list(/datum/reagent/consumable/ethanol/hippies_delight = 2) required_reagents = list(/datum/reagent/drug/mushroomhallucinogen = 1, /datum/reagent/consumable/ethanol/gargle_blaster = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/bananahonk results = list(/datum/reagent/consumable/ethanol/bananahonk = 2) required_reagents = list(/datum/reagent/consumable/laughter = 1, /datum/reagent/consumable/cream = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/silencer results = list(/datum/reagent/consumable/ethanol/silencer = 3) required_reagents = list(/datum/reagent/consumable/nothing = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/sugar = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/driestmartini results = list(/datum/reagent/consumable/ethanol/driestmartini = 2) @@ -334,6 +360,7 @@ /datum/chemical_reaction/drink/thirteenloko results = list(/datum/reagent/consumable/ethanol/thirteenloko = 3) required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/coffee = 1, /datum/reagent/consumable/limejuice = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/cherryshake results = list(/datum/reagent/consumable/cherryshake = 3) @@ -358,7 +385,7 @@ /datum/chemical_reaction/drink/triple_citrus results = list(/datum/reagent/consumable/triple_citrus = 5) required_reagents = list(/datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/orangejuice = 1) - optimal_ph_min = 0//Our reaction is very acidic, so lets shift our range + optimal_ph_min = 0//Our reaction is very acidic, so lets shift our range /datum/chemical_reaction/drink/grape_soda results = list(/datum/reagent/consumable/grape_soda = 2) @@ -384,6 +411,7 @@ required_reagents = list(/datum/reagent/consumable/ethanol/brave_bull = 5, /datum/reagent/consumable/ethanol/syndicatebomb = 5, /datum/reagent/consumable/ethanol/absinthe = 5) mix_message = "The mixture darkens to a healthy crimson." required_temp = 315 //Piping hot! + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_BRUTE | REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY | REACTION_TAG_CLONE /datum/chemical_reaction/drink/bacchus_blessing results = list(/datum/reagent/consumable/ethanol/bacchus_blessing = 4) @@ -419,7 +447,7 @@ results = list(/datum/reagent/consumable/hot_coco = 3) required_reagents = list(/datum/reagent/consumable/milk/chocolate_milk = 1, /datum/reagent/consumable/milk = 2) required_temp = 320 - + /datum/chemical_reaction/drink/coffee results = list(/datum/reagent/consumable/coffee = 5) required_reagents = list(/datum/reagent/toxin/coffeepowder = 1, /datum/reagent/water = 5) @@ -437,12 +465,14 @@ required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/ethanol/demonsblood = 1) mix_message = "The mixture develops a sinister glow." mix_sound = 'sound/effects/singlebeat.ogg' + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/quadruplesec results = list(/datum/reagent/consumable/ethanol/quadruple_sec = 15) required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 5, /datum/reagent/consumable/triple_citrus = 5, /datum/reagent/consumable/ethanol/creme_de_menthe = 5) mix_message = "The snap of a taser emanates clearly from the mixture as it settles." mix_sound = 'sound/weapons/taser.ogg' + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/grasshopper results = list(/datum/reagent/consumable/ethanol/grasshopper = 15) @@ -458,16 +488,19 @@ required_reagents = list(/datum/reagent/consumable/ethanol/quadruple_sec = 5, /datum/reagent/consumable/clownstears = 5, /datum/reagent/consumable/ethanol/syndicatebomb = 5) mix_message = "Judgement is upon you." mix_sound = 'sound/items/airhorn2.ogg' + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/bastion_bourbon results = list(/datum/reagent/consumable/ethanol/bastion_bourbon = 2) required_reagents = list(/datum/reagent/consumable/tea = 1, /datum/reagent/consumable/ethanol/creme_de_menthe = 1, /datum/reagent/consumable/triple_citrus = 1, /datum/reagent/consumable/berryjuice = 1) //herbal and minty, with a hint of citrus and berry mix_message = "You catch an aroma of hot tea and fruits as the mix blends into a blue-green color." + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_BRUTE | REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY /datum/chemical_reaction/drink/squirt_cider results = list(/datum/reagent/consumable/ethanol/squirt_cider = 1) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/consumable/nutriment = 1) mix_message = "The mix swirls and turns a bright red that reminds you of an apple's skin." + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/fringe_weaver results = list(/datum/reagent/consumable/ethanol/fringe_weaver = 10) @@ -478,11 +511,13 @@ results = list(/datum/reagent/consumable/ethanol/sugar_rush = 4) required_reagents = list(/datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/ethanol/wine = 1) //2 adelhyde (sweet), 1 powdered delta (sour), 1 karmotrine (alcohol) mix_message = "The mixture bubbles and brightens into a girly pink." + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/crevice_spike results = list(/datum/reagent/consumable/ethanol/crevice_spike = 6) required_reagents = list(/datum/reagent/consumable/limejuice = 2, /datum/reagent/consumable/capsaicin = 4) //2 powdered delta (sour), 4 flanergide (spicy) mix_message = "The mixture stings your eyes as it settles." + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/sake results = list(/datum/reagent/consumable/ethanol/sake = 10) @@ -494,10 +529,12 @@ results = list(/datum/reagent/consumable/ethanol/peppermint_patty = 10) required_reagents = list(/datum/reagent/consumable/hot_coco = 6, /datum/reagent/consumable/ethanol/creme_de_cacao = 1, /datum/reagent/consumable/ethanol/creme_de_menthe = 1, /datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/menthol = 1) mix_message = "The coco turns mint green just as the strong scent hits your nose." + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/alexander results = list(/datum/reagent/consumable/ethanol/alexander = 3) required_reagents = list(/datum/reagent/consumable/ethanol/cognac = 1, /datum/reagent/consumable/ethanol/creme_de_cacao = 1, /datum/reagent/consumable/cream = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/sidecar results = list(/datum/reagent/consumable/ethanol/sidecar = 4) @@ -506,6 +543,7 @@ /datum/chemical_reaction/drink/between_the_sheets results = list(/datum/reagent/consumable/ethanol/between_the_sheets = 5) required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/ethanol/sidecar = 4) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/kamikaze results = list(/datum/reagent/consumable/ethanol/kamikaze = 3) @@ -518,6 +556,7 @@ /datum/chemical_reaction/drink/fernet_cola results = list(/datum/reagent/consumable/ethanol/fernet_cola = 2) required_reagents = list(/datum/reagent/consumable/ethanol/fernet = 1, /datum/reagent/consumable/space_cola = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_TOXIN /datum/chemical_reaction/drink/fanciulli @@ -538,6 +577,7 @@ required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 1, /datum/reagent/consumable/sodawater = 1, /datum/reagent/consumable/ethanol/champagne = 1) mix_message = "The beverage starts to froth with an almost mystical zeal!" mix_sound = 'sound/effects/bubbles2.ogg' + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/bug_spray @@ -545,6 +585,7 @@ required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 2, /datum/reagent/consumable/lemon_lime = 1, /datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/ethanol/vodka = 1) mix_message = "The faint aroma of summer camping trips wafts through the air; but what's that buzzing noise?" mix_sound = 'sound/creatures/bee.ogg' + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/jack_rose results = list(/datum/reagent/consumable/ethanol/jack_rose = 4) @@ -554,14 +595,17 @@ /datum/chemical_reaction/drink/turbo results = list(/datum/reagent/consumable/ethanol/turbo = 5) required_reagents = list(/datum/reagent/consumable/ethanol/moonshine = 2, /datum/reagent/nitrous_oxide = 1, /datum/reagent/consumable/ethanol/sugar_rush = 1, /datum/reagent/consumable/pwr_game = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/old_timer results = list(/datum/reagent/consumable/ethanol/old_timer = 6) required_reagents = list(/datum/reagent/consumable/ethanol/whiskeysoda = 3, /datum/reagent/consumable/parsnipjuice = 2, /datum/reagent/consumable/ethanol/alexander = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/rubberneck results = list(/datum/reagent/consumable/ethanol/rubberneck = 10) required_reagents = list(/datum/reagent/consumable/ethanol = 4, /datum/reagent/consumable/grey_bull = 5, /datum/reagent/consumable/astrotame = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/duplex results = list(/datum/reagent/consumable/ethanol/duplex = 4) @@ -570,6 +614,7 @@ /datum/chemical_reaction/drink/trappist results = list(/datum/reagent/consumable/ethanol/trappist = 5) required_reagents = list(/datum/reagent/consumable/ethanol/ale = 2, /datum/reagent/water/holywater = 2, /datum/reagent/consumable/sugar = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/cream_soda results = list(/datum/reagent/consumable/cream_soda = 4) @@ -578,6 +623,7 @@ /datum/chemical_reaction/drink/blazaam results = list(/datum/reagent/consumable/ethanol/blazaam = 3) required_reagents = list(/datum/reagent/consumable/ethanol/gin = 2, /datum/reagent/consumable/peachjuice = 1, /datum/reagent/bluespace = 1) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/planet_cracker results = list(/datum/reagent/consumable/ethanol/planet_cracker = 4) @@ -591,6 +637,7 @@ /datum/chemical_reaction/drink/mauna_loa results = list(/datum/reagent/consumable/ethanol/mauna_loa = 5) required_reagents = list(/datum/reagent/consumable/capsaicin = 2, /datum/reagent/consumable/ethanol/kahlua = 1, /datum/reagent/consumable/ethanol/bahama_mama = 2) + reaction_tags = REACTION_TAG_DRINK | REACTION_TAG_EASY | REACTION_TAG_OTHER /datum/chemical_reaction/drink/godfather results = list(/datum/reagent/consumable/ethanol/godfather = 2) @@ -607,4 +654,4 @@ /datum/chemical_reaction/drink/ginger_amaretto results = list(/datum/reagent/consumable/ethanol/ginger_amaretto = 4) required_reagents = list(/datum/reagent/consumable/ethanol/amaretto = 1, /datum/reagent/consumable/sol_dry = 1, /datum/reagent/consumable/ice = 1, /datum/reagent/consumable/lemonjuice = 1) - + diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm index 8010b1045a5..96aadcbd5da 100644 --- a/code/modules/food_and_drinks/recipes/food_mixtures.dm +++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm @@ -16,6 +16,7 @@ optimal_ph_max = 10 thermic_constant = 0 H_ion_release = 0 + reaction_tags = REACTION_TAG_FOOD | REACTION_TAG_EASY /datum/chemical_reaction/food/tofu required_reagents = list(/datum/reagent/consumable/soymilk = 10) @@ -58,10 +59,11 @@ new /obj/item/food/chocolatebar(location) return -/datum/chemical_reaction/chocolate_bar3 +/datum/chemical_reaction/food/chocolate_bar3 required_reagents = list(/datum/reagent/consumable/milk = 2, /datum/reagent/consumable/coco = 2, /datum/reagent/consumable/sugar = 2) + reaction_flags = REACTION_INSTANT -/datum/chemical_reaction/chocolate_bar3/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) +/datum/chemical_reaction/food/chocolate_bar3/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) for(var/i = 1, i <= created_volume, i++) new /obj/item/food/chocolatebar(location) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 260baae15bf..94ca6903411 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -1,3 +1,7 @@ +#define REAGENTS_UI_MODE_LOOKUP 0 +#define REAGENTS_UI_MODE_REAGENT 1 +#define REAGENTS_UI_MODE_RECIPE 2 + /////////////These are used in the reagents subsystem init() and the reagent_id_typos.dm//////// /proc/build_chemical_reagent_list() //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id @@ -12,11 +16,16 @@ var/datum/reagent/D = new path() GLOB.chemical_reagents_list[path] = D -/proc/build_chemical_reactions_list() +/proc/build_chemical_reactions_lists() //Chemical Reactions - Initialises all /datum/chemical_reaction into a list // It is filtered into multiple lists within a list. // For example: // chemical_reaction_list[/datum/reagent/toxin/plasma] is a list of all reactions relating to plasma + //For chemical reaction list product index - indexes reactions based off the product reagent type - see get_recipe_from_reagent_product() in helpers + //For chemical reactions list lookup list - creates a bit list of info passed to the UI. This is saved to reduce lag from new windows opening, since it's a lot of data. + + //Prevent these reactions from appearing in lookup tables (UI code) + var/list/blacklist = (/datum/chemical_reaction/randomized) if(GLOB.chemical_reactions_list) return @@ -24,18 +33,50 @@ //Randomized need to go last since they need to check against conflicts with normal recipes var/paths = subtypesof(/datum/chemical_reaction) - typesof(/datum/chemical_reaction/randomized) + subtypesof(/datum/chemical_reaction/randomized) GLOB.chemical_reactions_list = list() + GLOB.chemical_reactions_results_lookup_list = list() + GLOB.chemical_reactions_list_product_index = list() for(var/path in paths) var/datum/chemical_reaction/D = new path() var/list/reaction_ids = list() + var/list/product_ids = list() + var/list/reagents = list() + var/list/product_names = list() + var/bitflags = D.reaction_tags if(!D.required_reagents || !D.required_reagents.len) //Skip impossible reactions continue for(var/reaction in D.required_reagents) reaction_ids += reaction + var/datum/reagent/reagent = find_reagent_object_from_type(reaction) + reagents += list(list("name" = reagent.name, "id" = reagent.type)) - // Create filters based on each reagent id in the required reagents list + for(var/product in D.results) + var/datum/reagent/reagent = find_reagent_object_from_type(product) + product_names += reagent.name + product_ids += product + + var/product_name + if(!length(product_names)) + var/list/names = splittext("[D.type]", "/") + product_name = names[names.len] + else + product_name = product_names[1] + + // Create filters based on each reagent id in the required reagents list - this is specifically for finding reactions from product(reagent) ids/typepaths. + for(var/id in product_ids) + if(is_type_in_list(D.type, blacklist)) + continue + if(!GLOB.chemical_reactions_list_product_index[id]) + GLOB.chemical_reactions_list_product_index[id] = list() + GLOB.chemical_reactions_list_product_index[id] += D + + //Master list of ALL reactions that is used in the UI lookup table. This is expensive to make, and we don't want to lag the server by creating it on UI request, so it's cached to send to UIs instantly. + if(!(is_type_in_list(D.type, blacklist))) + GLOB.chemical_reactions_results_lookup_list += list(list("name" = product_name, "id" = D.type, "bitflags" = bitflags, "reactants" = reagents)) + + // Create filters based on each reagent id in the required reagents list - this is used to speed up handle_reactions() for(var/id in reaction_ids) if(!GLOB.chemical_reactions_list[id]) GLOB.chemical_reactions_list[id] = list() @@ -70,6 +111,17 @@ var/list/failed_but_capable_reactions ///Hard check to see if the reagents is presently reacting var/is_reacting = FALSE + ///UI lookup stuff + ///Keeps the id of the reaction displayed in the ui + var/ui_reaction_id = null + ///Keeps the id of the reagent displayed in the ui + var/ui_reagent_id = null + ///The bitflag of the currently selected tags in the ui + var/ui_tags_selected = NONE + ///What index we're at if we have multiple reactions for a reagent product + var/ui_reaction_index = 1 + ///If we're syncing with the beaker - so return reactions that are actively happening + var/ui_beaker_sync = FALSE /datum/reagents/New(maximum=100, new_flags=0) maximum_volume = maximum @@ -1384,6 +1436,464 @@ //Using types because SOME chemicals (I'm looking at you, chlorhydrate-beer) have the same names as other chemicals. return english_list(data) + +///////////////////////////////////////////////////////////////////////////////// +///////////////////////////UI / REAGENTS LOOKUP CODE///////////////////////////// +///////////////////////////////////////////////////////////////////////////////// + + +/datum/reagents/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "Reagents", "Reaction search") + ui.status = UI_INTERACTIVE //How do I prevent a UI from autoclosing if not in LoS + ui_tags_selected = NONE //Resync with gui on open (gui expects no flags) + ui_reagent_id = null + ui_reaction_id = null + ui.open() + + +/datum/reagents/ui_status(mob/user) + return UI_INTERACTIVE //please advise + +/datum/reagents/ui_state(mob/user) + return GLOB.physical_state + +/datum/reagents/proc/generate_possible_reactions() + var/list/cached_reagents = reagent_list + if(!cached_reagents) + return null + var/list/cached_reactions = list() + var/list/possible_reactions = list() + if(!length(cached_reagents)) + return null + cached_reactions = GLOB.chemical_reactions_list + for(var/_reagent in cached_reagents) + var/datum/reagent/reagent = _reagent + for(var/_reaction in cached_reactions[reagent.type]) // Was a big list but now it should be smaller since we filtered it with our reagent id + var/datum/chemical_reaction/reaction = _reaction + if(!_reaction) + continue + if(!reaction.required_reagents)//Don't bring in empty ones + continue + var/list/cached_required_reagents = reaction.required_reagents + var/total_matching_reagents = 0 + for(var/req_reagent in cached_required_reagents) + if(!has_reagent(req_reagent, (cached_required_reagents[req_reagent]*0.01))) + continue + total_matching_reagents++ + if(total_matching_reagents >= reagent_list.len) + possible_reactions += reaction + return possible_reactions + +///Generates a (rough) rate vs temperature graph profile +/datum/reagents/proc/generate_thermodynamic_profile(datum/chemical_reaction/reaction) + var/list/coords = list() + var/x_temp + var/increment + if(reaction.is_cold_recipe) + coords += list(list(0, 0)) + coords += list(list(reaction.required_temp, 0)) + x_temp = reaction.required_temp + increment = (reaction.optimal_temp - reaction.required_temp)/10 + while(x_temp < reaction.optimal_temp) + var/y = (((x_temp - reaction.required_temp)**reaction.temp_exponent_factor)/((reaction.optimal_temp - reaction.required_temp)**reaction.temp_exponent_factor)) + coords += list(list(x_temp, y)) + x_temp += increment + else + coords += list(list(reaction.required_temp, 0)) + x_temp = reaction.required_temp + increment = (reaction.required_temp - reaction.optimal_temp)/10 + while(x_temp > reaction.optimal_temp) + var/y = (((x_temp - reaction.required_temp)**reaction.temp_exponent_factor)/((reaction.optimal_temp - reaction.required_temp)**reaction.temp_exponent_factor)) + coords += list(list(x_temp, y)) + x_temp -= increment + + coords += list(list(reaction.optimal_temp, 1)) + if(reaction.overheat_temp == NO_OVERHEAT) + if(reaction.is_cold_recipe) + coords += list(list(reaction.optimal_temp+10, 1)) + else + coords += list(list(reaction.optimal_temp-10, 1)) + return coords + coords += list(list(reaction.overheat_temp, 1)) + coords += list(list(reaction.overheat_temp, 0)) + return coords + +/datum/reagents/proc/generate_explosive_profile(datum/chemical_reaction/reaction) + if(reaction.overheat_temp == NO_OVERHEAT) + return null + var/list/coords = list() + coords += list(list(reaction.overheat_temp, 0)) + coords += list(list(reaction.overheat_temp, 1)) + if(reaction.is_cold_recipe) + coords += list(list(reaction.overheat_temp-50, 1)) + coords += list(list(reaction.overheat_temp-50, 0)) + else + coords += list(list(reaction.overheat_temp+50, 1)) + coords += list(list(reaction.overheat_temp+50, 0)) + return coords + + +///Returns a string descriptor of a reactions themic_constant +/datum/reagents/proc/determine_reaction_thermics(datum/chemical_reaction/reaction) + var/thermic = reaction.thermic_constant + if(reaction.reaction_flags & REACTION_HEAT_ARBITARY) + thermic *= 100 //Because arbitary is a lower scale + switch(thermic) + if(-INFINITY to -1500) + return "Overwhelmingly endothermic" + if(-1500 to -1000) + return "Extremely endothermic" + if(-1000 to -500) + return "Strongly endothermic" + if(-500 to -200) + return "Moderately endothermic" + if(-200 to -50) + return "Endothermic" + if(-50 to 0) + return "Weakly endothermic" + if(0) + return "" + if(0 to 50) + return "Weakly Exothermic" + if(50 to 200) + return "Exothermic" + if(200 to 500) + return "Moderately exothermic" + if(500 to 1000) + return "Strongly exothermic" + if(1000 to 1500) + return "Extremely exothermic" + if(1500 to INFINITY) + return "Overwhelmingly exothermic" + +/datum/reagents/proc/parse_addictions(datum/reagent/reagent) + var/addict_text = list() + for(var/entry in reagent.addiction_types) + var/datum/addiction/ref = SSaddiction.all_addictions[entry] + switch(reagent.addiction_types[entry]) + if(-INFINITY to 0) + continue + if(0 to 5) + addict_text += "Weak [ref.name]" + if(5 to 10) + addict_text += "[ref.name]" + if(10 to 20) + addict_text += "Strong [ref.name]" + if(20 to INFINITY) + addict_text += "Potent [ref.name]" + return addict_text + +/datum/reagents/ui_data(mob/user) + var/data = list() + data["selectedBitflags"] = ui_tags_selected + data["currentReagents"] = previous_reagent_list //This keeps the string of reagents that's updated when handle_reactions() is called + data["beakerSync"] = ui_beaker_sync + data["linkedBeaker"] = my_atom.name //To solidify the fact that the UI is linked to a beaker - not a machine. + + //First we check to see if reactions are synced with the beaker + if(ui_beaker_sync) + if(reaction_list)//But we don't want to null the previously displayed if there are none + //makes sure we're within bounds + if(ui_reaction_index > reaction_list.len) + ui_reaction_index = reaction_list.len + ui_reaction_id = reaction_list[ui_reaction_index].reaction.type + + //reagent lookup data + if(ui_reagent_id) + var/datum/reagent/reagent = find_reagent_object_from_type(ui_reagent_id) + if(!reagent) + to_chat(user, "Could not find reagent!") + ui_reagent_id = null + else + data["reagent_mode_reagent"] = list("name" = reagent.name, "id" = reagent.type, "desc" = reagent.description, "reagentCol" = reagent.color, "pH" = reagent.ph, "pHCol" = convert_ph_to_readable_color(reagent.ph), "metaRate" = (reagent.metabolization_rate/2), "OD" = reagent.overdose_threshold) + data["reagent_mode_reagent"]["addictions"] = list() + data["reagent_mode_reagent"]["addictions"] = parse_addictions(reagent) + + + var/datum/reagent/impure_reagent = GLOB.chemical_reagents_list[reagent.impure_chem] + if(impure_reagent) + data["reagent_mode_reagent"] += list("impureReagent" = impure_reagent.name, "impureId" = impure_reagent.type) + + var/datum/reagent/inverse_reagent = GLOB.chemical_reagents_list[reagent.inverse_chem] + if(inverse_reagent) + data["reagent_mode_reagent"] += list("inverseReagent" = inverse_reagent.name, "inverseId" = inverse_reagent.type) + + var/datum/reagent/failed_reagent = GLOB.chemical_reagents_list[reagent.failed_chem] + if(failed_reagent) + data["reagent_mode_reagent"] += list("failedReagent" = failed_reagent.name, "failedId" = failed_reagent.type) + + if(istype(reagent, /datum/reagent/impurity)) + data["reagent_mode_reagent"] += list("isImpure" = TRUE) + + if(reagent.chemical_flags & REAGENT_DEAD_PROCESS) + data["reagent_mode_reagent"] += list("deadProcess" = TRUE) + + //reaction lookup data + if (ui_reaction_id) + + var/datum/chemical_reaction/reaction = get_chemical_reaction(ui_reaction_id) + if(!reaction) + to_chat(user, "Could not find reaction!") + ui_reaction_id = null + return data + //Required holder + var/container_name + if(reaction.required_container) + var/list/names = splittext("[reaction.required_container]", "/") + container_name = "[names[names.len-1]] [names[names.len]]" + container_name = replacetext(container_name, "_", " ") + + //Next, find the product + var/has_product = TRUE + //If we have no product, use the typepath to create a name for it + if(!length(reaction.results)) + has_product = FALSE + var/list/names = splittext("[reaction.type]", "/") + var/product_name = names[names.len] + data["reagent_mode_recipe"] = list("name" = product_name, "id" = reaction.type, "hasProduct" = has_product, "reagentCol" = "#FFFFFF", "thermodynamics" = generate_thermodynamic_profile(reaction), "explosive" = generate_explosive_profile(reaction), "lowerpH" = reaction.optimal_ph_min, "upperpH" = reaction.optimal_ph_max, "thermics" = determine_reaction_thermics(reaction), "thermoUpper" = reaction.rate_up_lim, "minPurity" = reaction.purity_min, "inversePurity" = "N/A", "tempMin" = reaction.required_temp, "explodeTemp" = reaction.overheat_temp, "reqContainer" = container_name, "subReactLen" = 1, "subReactIndex" = 1) + + //If we do have a product then we find it + else + //Find out if we have multiple reactions for the same product + var/datum/reagent/primary_reagent = find_reagent_object_from_type(reaction.results[1])//We use the first product - though it might be worth changing this + //If we're syncing from the beaker + var/list/sub_reactions = list() + if(ui_beaker_sync && reaction_list) + for(var/_ongoing_eq in reaction_list) + var/datum/equilibrium/ongoing_eq = _ongoing_eq + var/ongoing_r = ongoing_eq.reaction + sub_reactions += ongoing_r + else + sub_reactions = get_recipe_from_reagent_product(primary_reagent.type) + var/sub_reaction_length = length(sub_reactions) + var/i = 1 + for(var/datum/chemical_reaction/sub_reaction in sub_reactions) + if(sub_reaction.type == reaction.type) + ui_reaction_index = i //update our index + break + i += 1 + data["reagent_mode_recipe"] = list("name" = primary_reagent.name, "id" = reaction.type, "hasProduct" = has_product, "reagentCol" = primary_reagent.color, "thermodynamics" = generate_thermodynamic_profile(reaction), "explosive" = generate_explosive_profile(reaction), "lowerpH" = reaction.optimal_ph_min, "upperpH" = reaction.optimal_ph_max, "thermics" = determine_reaction_thermics(reaction), "thermoUpper" = reaction.rate_up_lim, "minPurity" = reaction.purity_min, "inversePurity" = primary_reagent.inverse_chem_val, "tempMin" = reaction.required_temp, "explodeTemp" = reaction.overheat_temp, "reqContainer" = container_name, "subReactLen" = sub_reaction_length, "subReactIndex" = ui_reaction_index) + + //Results sweep + var/has_reagent = "default" + for(var/_reagent in reaction.results) + var/datum/reagent/reagent = find_reagent_object_from_type(_reagent) + if(has_reagent(_reagent)) + has_reagent = "green" + data["reagent_mode_recipe"]["products"] += list(list("name" = reagent.name, "id" = reagent.type, "ratio" = reaction.results[reagent.type], "hasReagentCol" = has_reagent)) + + //Reactant sweep + for(var/_reagent in reaction.required_reagents) + var/datum/reagent/reagent = find_reagent_object_from_type(_reagent) + var/color_r = "default" //If the holder is missing the reagent, it's displayed in orange + if(has_reagent(reagent.type)) + color_r = "green" //It's green if it's present + var/tooltip + var/tooltip_bool = FALSE + var/list/sub_reactions = get_recipe_from_reagent_product(reagent.type) + //Get sub reaction possibilities, but ignore ones that need a specific holder atom + var/sub_index = 0 + for(var/datum/chemical_reaction/sub_reaction as anything in sub_reactions) + if(sub_reaction.required_container)//So we don't have slime reactions confusing things + sub_index++ + continue + sub_index++ + break + if(sub_index) + var/datum/chemical_reaction/sub_reaction = sub_reactions[sub_index] + //Subreactions sweep (if any) + for(var/_sub_reagent in sub_reaction.required_reagents) + var/datum/reagent/sub_reagent = find_reagent_object_from_type(_sub_reagent) + tooltip += "[sub_reaction.required_reagents[_sub_reagent]]u [sub_reagent.name]\n" //I forgot the better way of doing this - fix this after this works + tooltip_bool = TRUE + data["reagent_mode_recipe"]["reactants"] += list(list("name" = reagent.name, "id" = reagent.type, "ratio" = reaction.required_reagents[reagent.type], "color" = color_r, "tooltipBool" = tooltip_bool, "tooltip" = tooltip)) + + //Catalyst sweep + for(var/_reagent in reaction.required_catalysts) + var/datum/reagent/reagent = find_reagent_object_from_type(_reagent) + var/color_r = "default" + if(has_reagent(reagent.type)) + color_r = "green" + var/tooltip + var/tooltip_bool = FALSE + var/list/sub_reactions = get_recipe_from_reagent_product(reagent.type) + if(length(sub_reactions)) + var/datum/chemical_reaction/sub_reaction = sub_reactions[1] + //Subreactions sweep (if any) + for(var/_sub_reagent in sub_reaction.required_reagents) + var/datum/reagent/sub_reagent = find_reagent_object_from_type(_sub_reagent) + tooltip += "[sub_reaction.required_reagents[_sub_reagent]]u [sub_reagent.name]\n" //I forgot the better way of doing this - fix this after this works + tooltip_bool = TRUE + data["reagent_mode_recipe"]["catalysts"] += list(list("name" = reagent.name, "id" = reagent.type, "ratio" = reaction.required_catalysts[reagent.type], "color" = color_r, "tooltipBool" = tooltip_bool, "tooltip" = tooltip)) + data["reagent_mode_recipe"]["isColdRecipe"] = reaction.is_cold_recipe + + return data + +/datum/reagents/ui_static_data(mob/user) + var/data = list() + //Use GLOB list - saves processing + data["master_reaction_list"] = GLOB.chemical_reactions_results_lookup_list + data["bitflags"] = list() + data["bitflags"]["BRUTE"] = REACTION_TAG_BRUTE + data["bitflags"]["BURN"] = REACTION_TAG_BURN + data["bitflags"]["TOXIN"] = REACTION_TAG_TOXIN + data["bitflags"]["OXY"] = REACTION_TAG_OXY + data["bitflags"]["CLONE"] = REACTION_TAG_CLONE + data["bitflags"]["HEALING"] = REACTION_TAG_HEALING + data["bitflags"]["DAMAGING"] = REACTION_TAG_DAMAGING + data["bitflags"]["EXPLOSIVE"] = REACTION_TAG_EXPLOSIVE + data["bitflags"]["OTHER"] = REACTION_TAG_OTHER + data["bitflags"]["DANGEROUS"] = REACTION_TAG_DANGEROUS + data["bitflags"]["EASY"] = REACTION_TAG_EASY + data["bitflags"]["MODERATE"] = REACTION_TAG_MODERATE + data["bitflags"]["HARD"] = REACTION_TAG_HARD + data["bitflags"]["ORGAN"] = REACTION_TAG_ORGAN + data["bitflags"]["DRINK"] = REACTION_TAG_DRINK + data["bitflags"]["FOOD"] = REACTION_TAG_FOOD + data["bitflags"]["SLIME"] = REACTION_TAG_SLIME + data["bitflags"]["DRUG"] = REACTION_TAG_DRUG + data["bitflags"]["UNIQUE"] = REACTION_TAG_UNIQUE + data["bitflags"]["CHEMICAL"] = REACTION_TAG_CHEMICAL + data["bitflags"]["PLANT"] = REACTION_TAG_PLANT + data["bitflags"]["COMPETITIVE"] = REACTION_TAG_COMPETITIVE + + return data + +/* Returns a reaction type by index from an input reagent type +* i.e. the input reagent's associated reactions are found, and the index determines which one to return +* If the index is out of range, it is set to 1 +*/ +/datum/reagents/proc/get_reaction_from_indexed_possibilities(path, index = null) + if(index) + ui_reaction_index = index + var/list/sub_reactions = get_recipe_from_reagent_product(path) + if(!length(sub_reactions)) + to_chat(usr, "There is no recipe associated with this product.") + return FALSE + if(ui_reaction_index > length(sub_reactions)) + ui_reaction_index = 1 + var/datum/chemical_reaction/reaction = sub_reactions[ui_reaction_index] + return reaction.type + +/datum/reagents/ui_act(action, params) + . = ..() + if(.) + return + switch(action) + if("find_reagent_reaction") + ui_reaction_id = get_reaction_from_indexed_possibilities(text2path(params["id"])) + return TRUE + if("reagent_click") + ui_reagent_id = text2path(params["id"]) + return TRUE + if("recipe_click") + ui_reaction_id = text2path(params["id"]) + return TRUE + if("search_reagents") + var/input_reagent = (input("Enter the name of any reagent", "Input") as text|null) + input_reagent = get_reagent_type_from_product_string(input_reagent) //from string to type + var/datum/reagent/reagent = find_reagent_object_from_type(input_reagent) + if(!reagent) + to_chat(usr, "Could not find reagent!") + return FALSE + ui_reagent_id = reagent.type + return TRUE + if("search_recipe") + var/input_reagent = (input("Enter the name of product reagent", "Input") as text|null) + input_reagent = get_reagent_type_from_product_string(input_reagent) //from string to type + var/datum/reagent/reagent = find_reagent_object_from_type(input_reagent) + if(!reagent) + to_chat(usr, "Could not find product reagent!") + return + ui_reaction_id = get_reaction_from_indexed_possibilities(reagent.type) + return TRUE + if("increment_index") + ui_reaction_index += 1 + if(!ui_beaker_sync || !reaction_list) + ui_reaction_id = get_reaction_from_indexed_possibilities(get_reagent_type_from_product_string(params["id"])) + return TRUE + if("reduce_index") + if(ui_reaction_index == 1) + return + ui_reaction_index -= 1 + if(!ui_beaker_sync || !reaction_list) + ui_reaction_id = get_reaction_from_indexed_possibilities(get_reagent_type_from_product_string(params["id"])) + return TRUE + if("beaker_sync") + ui_beaker_sync = !ui_beaker_sync + return TRUE + if("toggle_tag_brute") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_BRUTE + return TRUE + if("toggle_tag_burn") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_BURN + return TRUE + if("toggle_tag_toxin") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_TOXIN + return TRUE + if("toggle_tag_oxy") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_OXY + return TRUE + if("toggle_tag_clone") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_CLONE + return TRUE + if("toggle_tag_healing") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_HEALING + return TRUE + if("toggle_tag_damaging") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_DAMAGING + return TRUE + if("toggle_tag_explosive") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_EXPLOSIVE + return TRUE + if("toggle_tag_other") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_OTHER + return TRUE + if("toggle_tag_easy") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_EASY + return TRUE + if("toggle_tag_moderate") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_MODERATE + return TRUE + if("toggle_tag_hard") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_HARD + return TRUE + if("toggle_tag_organ") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_ORGAN + return TRUE + if("toggle_tag_drink") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_DRINK + return TRUE + if("toggle_tag_food") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_FOOD + return TRUE + if("toggle_tag_dangerous") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_DANGEROUS + return TRUE + if("toggle_tag_slime") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_SLIME + return TRUE + if("toggle_tag_drug") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_DRUG + return TRUE + if("toggle_tag_unique") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_UNIQUE + return TRUE + if("toggle_tag_chemical") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_CHEMICAL + return TRUE + if("toggle_tag_plant") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_PLANT + return TRUE + if("toggle_tag_competitive") + ui_tags_selected = ui_tags_selected ^ REACTION_TAG_COMPETITIVE + return TRUE + if("update_ui") + return TRUE + + /////////////////////////////////////////////////////////////////////////////////// @@ -1399,19 +1909,3 @@ qdel(reagents) reagents = new /datum/reagents(max_vol, flags) reagents.my_atom = src - -/proc/get_random_reagent_id() // Returns a random reagent ID minus blacklisted reagents - var/static/list/random_reagents = list() - if(!random_reagents.len) - for(var/thing in subtypesof(/datum/reagent)) - var/datum/reagent/reagent = thing - if(initial(reagent.chemical_flags) & REAGENT_CAN_BE_SYNTHESIZED) - random_reagents += reagent - var/picked_reagent = pick(random_reagents) - return picked_reagent - -/proc/get_chem_id(chem_name) - for(var/entry in GLOB.chemical_reagents_list) - var/datum/reagent/reagent = GLOB.chemical_reagents_list[entry] - if(ckey(chem_name) == ckey(lowertext(reagent.name))) - return entry diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 69274972a8b..110e98a0d2c 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -269,11 +269,17 @@ var/chemname = temp.name if(is_hallucinating && prob(5)) chemname = "[pick_list_replacements("hallucination.json", "chemicals")]" - chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name), "pH" = temp.ph, "pHCol" = ConvertpHToCol(temp.ph)))) + chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name), "pH" = temp.ph, "pHCol" = convert_ph_to_readable_color(temp.ph)))) data["chemicals"] = chemicals data["recipes"] = saved_recipes data["recordingRecipe"] = recording_recipe + data["recipeReagents"] = list() + if(beaker?.reagents.ui_reaction_id) + var/datum/chemical_reaction/reaction = get_chemical_reaction(beaker.reagents.ui_reaction_id) + for(var/_reagent in reaction.required_reagents) + var/datum/reagent/reagent = find_reagent_object_from_type(_reagent) + data["recipeReagents"] += ckey(reagent.name) return data /obj/machinery/chem_dispenser/ui_act(action, params) @@ -392,6 +398,9 @@ customTransferAmount = clamp(input(usr, "Please enter your desired transfer amount.", "Transfer amount", 0) as num|null, 0, beaker.volume) transferAmounts += customTransferAmount //SKYRAT EDIT ADDITION END + if("reaction_lookup") + if(beaker) + beaker.reagents.ui_interact(usr) /obj/machinery/chem_dispenser/attackby(obj/item/I, mob/living/user, params) if(default_unfasten_wrench(user, I)) @@ -472,32 +481,6 @@ update_appearance() return TRUE -//Converts the pH into a tgui readable color -/obj/machinery/chem_dispenser/proc/ConvertpHToCol(pH) - switch(pH) - if(-INFINITY to 1) - return "red" - if(1 to 2) - return "orange" - if(2 to 3) - return "average" - if(3 to 4) - return "yellow" - if(4 to 5) - return "olive" - if(5 to 6) - return "good" - if(6 to 8) - return "green" - if(8 to 9.5) - return "teal" - if(9.5 to 11) - return "blue" - if(11 to 12.5) - return "violet" - if(12.5 to INFINITY) - return "purple" - /obj/machinery/chem_dispenser/on_deconstruction() cell = null if(beaker) diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm index 3d0fc7caf5c..74a0e149f36 100644 --- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm +++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm @@ -29,15 +29,8 @@ beaker = null . = TRUE if("input") - var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text|null), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name - - if (isnull(input_reagent)) - return - - if(shortcuts[input_reagent]) - input_reagent = shortcuts[input_reagent] - else - input_reagent = find_reagent(input_reagent) + var/input_reagent = (input("Enter the name of any reagent", "Input") as text|null) + input_reagent = get_reagent_type_from_product_string(input_reagent) //from string to type if(!input_reagent) say("REAGENT NOT FOUND") return diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 542c8045168..e2e259432c7 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -74,7 +74,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) var/list/reagent_removal_skip_list = list() ///The set of exposure methods this penetrates skin with. var/penetrates_skin = VAPOR - /// See fermi_readme.dm REAGENT_DEAD_PROCESS, REAGENT_DONOTSPLIT, REAGENT_INVISIBLE, REAGENT_SNEAKYNAME, REAGENT_SPLITRETAINVOL, REAGENT_CANSYNTH + /// See fermi_readme.dm REAGENT_DEAD_PROCESS, REAGENT_DONOTSPLIT, REAGENT_INVISIBLE, REAGENT_SNEAKYNAME, REAGENT_SPLITRETAINVOL, REAGENT_CANSYNTH, REAGENT_IMPURE var/chemical_flags = NONE ///impure chem values (see fermi_readme.dm for more details on impure/inverse/failed mechanics): /// What chemical path is made when metabolised as a function of purity diff --git a/code/modules/reagents/chemistry/reagents/catalyst_reagents.dm b/code/modules/reagents/chemistry/reagents/catalyst_reagents.dm index 6e4e2b56c7e..e15675ef3a0 100644 --- a/code/modules/reagents/chemistry/reagents/catalyst_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/catalyst_reagents.dm @@ -42,6 +42,7 @@ ///These affect medicines /datum/reagent/catalyst_agent/speed/medicine name = "Palladium synthate catalyst" + description = "This catalyst reagent will speed up all medicine reactions that it shares a beaker with by a dramatic amount." target_reagent_type = /datum/reagent/medicine modifier = 2 ph = 2 //drift towards acidity diff --git a/code/modules/reagents/chemistry/reagents/reaction_agents_reagents.dm b/code/modules/reagents/chemistry/reagents/reaction_agents_reagents.dm index 26aa514e7ac..02269697186 100644 --- a/code/modules/reagents/chemistry/reagents/reaction_agents_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/reaction_agents_reagents.dm @@ -21,8 +21,11 @@ description = "This reagent will consume itself and move the pH of a beaker towards acidity when added to another." color = "#fbc314" ph = 0 - ///The strength of the buffer where (volume/holder.total_volume)*strength. So for 1u added to 50u the ph will decrease by 0.5 - var/strength = 30 + impure_chem = null + inverse_chem = null + failed_chem = null + ///The strength of the buffer where (volume/holder.total_volume)*strength. So for 1u added to 50u the ph will decrease by 0.4 + var/strength =30 //Consumes self on addition and shifts ph /datum/reagent/reaction_agent/acidic_buffer/intercept_reagents_transfer(datum/reagents/target, amount) @@ -39,13 +42,16 @@ target.my_atom.audible_message("The beaker fizzes as the ph changes!") playsound(target.my_atom, 'sound/chemistry/bufferadd.ogg', 50, TRUE) holder.remove_reagent(type, amount) - + /datum/reagent/reaction_agent/basic_buffer name = "Strong basic buffer" description = "This reagent will consume itself and move the pH of a beaker towards alkalinity when added to another." color = "#3853a4" ph = 14 - ///The strength of the buffer where (volume/holder.total_volume)*strength. So for 1u added to 50u the ph will increase by 0.5 + impure_chem = null + inverse_chem = null + failed_chem = null + ///The strength of the buffer where (volume/holder.total_volume)*strength. So for 1u added to 50u the ph will increase by 0.4 var/strength = 30 /datum/reagent/reaction_agent/basic_buffer/intercept_reagents_transfer(datum/reagents/target, amount) @@ -104,7 +110,7 @@ color = "#e61f82" ///How much the reaction speed is sped up by - for 5u added to 100u, an additional step of 1 will be done up to a max of 2x var/strength = 20 - + /datum/reagent/reaction_agent/speed_agent/intercept_reagents_transfer(datum/reagents/target, amount) . = ..() diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index 7cef6219221..29b9dc4dcbb 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -55,6 +55,9 @@ var/purity_min = 0.15 /// bitflags for clear conversions; REACTION_CLEAR_IMPURE, REACTION_CLEAR_INVERSE, REACTION_CLEAR_RETAIN, REACTION_INSTANT var/reaction_flags = NONE + ///Tagging vars + ///A bitflag var for tagging reagents for the reagent loopup functon + var/reaction_tags = NONE /datum/chemical_reaction/New() . = ..() diff --git a/code/modules/reagents/chemistry/recipes/cat2_medicines.dm b/code/modules/reagents/chemistry/recipes/cat2_medicines.dm index a707915787c..2072f1295ed 100644 --- a/code/modules/reagents/chemistry/recipes/cat2_medicines.dm +++ b/code/modules/reagents/chemistry/recipes/cat2_medicines.dm @@ -5,28 +5,34 @@ results = list(/datum/reagent/medicine/c2/helbital = 3) required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/fluorine = 1, /datum/reagent/carbon = 1) mix_message = "The mixture turns into a thick, yellow powder." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE /datum/chemical_reaction/medicine/libital results = list(/datum/reagent/medicine/c2/libital = 3) required_reagents = list(/datum/reagent/phenol = 1, /datum/reagent/oxygen = 1, /datum/reagent/nitrogen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE /datum/chemical_reaction/medicine/probital results = list(/datum/reagent/medicine/c2/probital = 4) required_reagents = list(/datum/reagent/copper = 1, /datum/reagent/acetone = 2, /datum/reagent/phosphorus = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE /*****BURN*****/ /datum/chemical_reaction/medicine/lenturi results = list(/datum/reagent/medicine/c2/lenturi = 5) required_reagents = list(/datum/reagent/ammonia = 1, /datum/reagent/silver = 1, /datum/reagent/sulfur = 1, /datum/reagent/oxygen = 1, /datum/reagent/chlorine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BURN /datum/chemical_reaction/medicine/aiuri results = list(/datum/reagent/medicine/c2/aiuri = 4) required_reagents = list(/datum/reagent/ammonia = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/hydrogen = 2) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BURN /datum/chemical_reaction/medicine/hercuri results = list(/datum/reagent/medicine/c2/hercuri = 5) required_reagents = list(/datum/reagent/cryostylane = 3, /datum/reagent/bromine = 1, /datum/reagent/lye = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BURN required_temp = 47 is_cold_recipe = TRUE optimal_temp = 10 @@ -40,28 +46,34 @@ required_reagents = list(/datum/reagent/hydrogen = 1, /datum/reagent/fluorine = 1, /datum/reagent/fuel/oil = 1) required_temp = 370 mix_message = "The mixture rapidly turns into a dense pink liquid." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OXY /datum/chemical_reaction/medicine/tirimol results = list(/datum/reagent/medicine/c2/tirimol = 5) required_reagents = list(/datum/reagent/nitrogen = 3, /datum/reagent/acetone = 2) required_catalysts = list(/datum/reagent/toxin/acid = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OXY /*****TOX*****/ /datum/chemical_reaction/medicine/seiver results = list(/datum/reagent/medicine/c2/seiver = 3) required_reagents = list(/datum/reagent/nitrogen = 1, /datum/reagent/potassium = 1, /datum/reagent/aluminium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_TOXIN /datum/chemical_reaction/medicine/multiver results = list(/datum/reagent/medicine/c2/multiver = 2) required_reagents = list(/datum/reagent/ash = 1, /datum/reagent/consumable/salt = 1) mix_message = "The mixture yields a fine black powder." required_temp = 380 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_PLANT | REACTION_TAG_TOXIN /datum/chemical_reaction/medicine/syriniver results = list(/datum/reagent/medicine/c2/syriniver = 5) required_reagents = list(/datum/reagent/sulfur = 1, /datum/reagent/fluorine = 1, /datum/reagent/toxin = 1, /datum/reagent/nitrous_oxide = 2) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_TOXIN /datum/chemical_reaction/medicine/penthrite results = list(/datum/reagent/medicine/c2/penthrite = 3) required_reagents = list(/datum/reagent/pentaerythritol = 1, /datum/reagent/acetone = 1, /datum/reagent/toxin/acid/nitracid = 1 , /datum/reagent/wittel = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_TOXIN diff --git a/code/modules/reagents/chemistry/recipes/catalysts.dm b/code/modules/reagents/chemistry/recipes/catalysts.dm index 7f723dfecb2..964971e66fa 100644 --- a/code/modules/reagents/chemistry/recipes/catalysts.dm +++ b/code/modules/reagents/chemistry/recipes/catalysts.dm @@ -6,6 +6,7 @@ required_reagents = list(/datum/reagent/medicine/c2/libital = 3, /datum/reagent/medicine/c2/probital = 4, /datum/reagent/toxin/plasma = 2) mix_message = "The reaction evaporates slightly as the mixture solidifies" mix_sound = 'sound/chemistry/catalyst.ogg' + reaction_tags = REACTION_TAG_MODERATE | REACTION_TAG_UNIQUE | REACTION_TAG_CHEMICAL required_temp = 320 optimal_temp = 600 overheat_temp = 800 diff --git a/code/modules/reagents/chemistry/recipes/drugs.dm b/code/modules/reagents/chemistry/recipes/drugs.dm index 2d58aed05cf..46de29b8265 100644 --- a/code/modules/reagents/chemistry/recipes/drugs.dm +++ b/code/modules/reagents/chemistry/recipes/drugs.dm @@ -1,19 +1,21 @@ /datum/chemical_reaction/space_drugs results = list(/datum/reagent/drug/space_drugs = 3) required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/lithium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG /datum/chemical_reaction/crank results = list(/datum/reagent/drug/crank = 5) required_reagents = list(/datum/reagent/medicine/diphenhydramine = 1, /datum/reagent/ammonia = 1, /datum/reagent/lithium = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/fuel = 1) mix_message = "The mixture violently reacts, leaving behind a few crystalline shards." required_temp = 390 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG /datum/chemical_reaction/krokodil results = list(/datum/reagent/drug/krokodil = 6) required_reagents = list(/datum/reagent/medicine/diphenhydramine = 1, /datum/reagent/medicine/morphine = 1, /datum/reagent/space_cleaner = 1, /datum/reagent/potassium = 1, /datum/reagent/phosphorus = 1, /datum/reagent/fuel = 1) mix_message = "The mixture dries into a pale blue powder." required_temp = 380 - + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG /datum/chemical_reaction/methamphetamine results = list(/datum/reagent/drug/methamphetamine = 4) @@ -31,6 +33,7 @@ rate_up_lim = 12.5 purity_min = 0.5 //100u will natrually just dip under this w/ no buffer reaction_flags = REACTION_HEAT_ARBITARY //Heating up is arbitary because of submechanics of this reaction. + reaction_tags = REACTION_TAG_MODERATE | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DRUG | REACTION_TAG_DANGEROUS //The less pure it is, the faster it heats up. tg please don't hate me for making your meth even more dangerous /datum/chemical_reaction/methamphetamine/reaction_step(datum/equilibrium/reaction, datum/reagents/holder, delta_t, delta_ph, step_reaction_vol) @@ -84,34 +87,42 @@ results = list(/datum/reagent/drug/bath_salts = 7) required_reagents = list(/datum/reagent/toxin/bad_food = 1, /datum/reagent/saltpetre = 1, /datum/reagent/consumable/nutriment = 1, /datum/reagent/space_cleaner = 1, /datum/reagent/consumable/enzyme = 1, /datum/reagent/consumable/tea = 1, /datum/reagent/mercury = 1) required_temp = 374 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_ORGAN | REACTION_TAG_DAMAGING /datum/chemical_reaction/aranesp results = list(/datum/reagent/drug/aranesp = 3) required_reagents = list(/datum/reagent/medicine/epinephrine = 1, /datum/reagent/medicine/atropine = 1, /datum/reagent/medicine/morphine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_TOXIN | REACTION_TAG_DAMAGING /datum/chemical_reaction/happiness results = list(/datum/reagent/drug/happiness = 4) required_reagents = list(/datum/reagent/nitrous_oxide = 2, /datum/reagent/medicine/epinephrine = 1, /datum/reagent/consumable/ethanol = 1) required_catalysts = list(/datum/reagent/toxin/plasma = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_ORGAN | REACTION_TAG_DAMAGING /datum/chemical_reaction/pumpup results = list(/datum/reagent/drug/pumpup = 5) required_reagents = list(/datum/reagent/medicine/epinephrine = 2, /datum/reagent/consumable/coffee = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_TOXIN | REACTION_TAG_DAMAGING /datum/chemical_reaction/maint_tar1 results = list(/datum/reagent/toxin/acid = 1 ,/datum/reagent/drug/maint/tar = 3) required_reagents = list(/datum/reagent/consumable/tea = 1, /datum/reagent/yuck = 1 , /datum/reagent/fuel = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_TOXIN | REACTION_TAG_DAMAGING /datum/chemical_reaction/maint_tar2 results = list(/datum/reagent/toxin/acid = 1 ,/datum/reagent/drug/maint/tar = 3) required_reagents = list(/datum/reagent/consumable/tea = 1, /datum/reagent/consumable/enzyme = 3 , /datum/reagent/fuel = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_TOXIN | REACTION_TAG_DAMAGING /datum/chemical_reaction/maint_sludge results = list(/datum/reagent/drug/maint/sludge = 1) required_reagents = list(/datum/reagent/drug/maint/tar = 3 , /datum/reagent/toxin/acid/fluacid = 1) required_catalysts = list(/datum/reagent/hydrogen_peroxide = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_TOXIN | REACTION_TAG_DAMAGING /datum/chemical_reaction/maint_powder results = list(/datum/reagent/drug/maint/powder = 1) required_reagents = list(/datum/reagent/drug/maint/sludge = 6 , /datum/reagent/toxin/acid/nitracid = 1 , /datum/reagent/consumable/enzyme = 1) required_catalysts = list(/datum/reagent/acetone_oxide = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DRUG | REACTION_TAG_ORGAN | REACTION_TAG_DAMAGING diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index b542601975f..ae55d8dca86 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -7,166 +7,204 @@ ph_exponent_factor = 0.8 purity_min = 0.1 rate_up_lim = 35 + reaction_tags = REACTION_TAG_HEALING | REACTION_TAG_EASY /datum/chemical_reaction/medicine/leporazine results = list(/datum/reagent/medicine/leporazine = 2) required_reagents = list(/datum/reagent/silicon = 1, /datum/reagent/copper = 1) required_catalysts = list(/datum/reagent/toxin/plasma = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/rezadone results = list(/datum/reagent/medicine/rezadone = 3) required_reagents = list(/datum/reagent/toxin/carpotoxin = 1, /datum/reagent/cryptobiolin = 1, /datum/reagent/copper = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_CLONE /datum/chemical_reaction/medicine/spaceacillin results = list(/datum/reagent/medicine/spaceacillin = 2) required_reagents = list(/datum/reagent/cryptobiolin = 1, /datum/reagent/medicine/epinephrine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/oculine results = list(/datum/reagent/medicine/oculine = 3) required_reagents = list(/datum/reagent/medicine/c2/multiver = 1, /datum/reagent/carbon = 1, /datum/reagent/hydrogen = 1) mix_message = "The mixture bubbles noticeably and becomes a dark grey color!" + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/inacusiate results = list(/datum/reagent/medicine/inacusiate = 2) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/carbon = 1, /datum/reagent/medicine/c2/multiver = 1) mix_message = "The mixture sputters loudly and becomes a light grey color!" + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/synaptizine results = list(/datum/reagent/medicine/synaptizine = 3) required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/lithium = 1, /datum/reagent/water = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/salglu_solution results = list(/datum/reagent/medicine/salglu_solution = 3) required_reagents = list(/datum/reagent/consumable/salt = 1, /datum/reagent/water = 1, /datum/reagent/consumable/sugar = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/mine_salve results = list(/datum/reagent/medicine/mine_salve = 3) required_reagents = list(/datum/reagent/fuel/oil = 1, /datum/reagent/water = 1, /datum/reagent/iron = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE | REACTION_TAG_BURN /datum/chemical_reaction/medicine/mine_salve2 results = list(/datum/reagent/medicine/mine_salve = 15) required_reagents = list(/datum/reagent/toxin/plasma = 5, /datum/reagent/iron = 5, /datum/reagent/consumable/sugar = 1) // A sheet of plasma, a twinkie and a sheet of metal makes four of these + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE | REACTION_TAG_BURN /datum/chemical_reaction/medicine/synthflesh results = list(/datum/reagent/medicine/c2/synthflesh = 3) required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/carbon = 1, /datum/reagent/medicine/c2/libital = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE | REACTION_TAG_BURN /datum/chemical_reaction/medicine/calomel results = list(/datum/reagent/medicine/calomel = 2) required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/chlorine = 1) required_temp = 374 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/potass_iodide results = list(/datum/reagent/medicine/potass_iodide = 2) required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/iodine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/pen_acid results = list(/datum/reagent/medicine/pen_acid = 6) required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/chlorine = 1, /datum/reagent/ammonia = 1, /datum/reagent/toxin/formaldehyde = 1, /datum/reagent/sodium = 1, /datum/reagent/toxin/cyanide = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/sal_acid results = list(/datum/reagent/medicine/sal_acid = 5) required_reagents = list(/datum/reagent/sodium = 1, /datum/reagent/phenol = 1, /datum/reagent/carbon = 1, /datum/reagent/oxygen = 1, /datum/reagent/toxin/acid = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE /datum/chemical_reaction/medicine/oxandrolone results = list(/datum/reagent/medicine/oxandrolone = 6) required_reagents = list(/datum/reagent/carbon = 3, /datum/reagent/phenol = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BURN /datum/chemical_reaction/medicine/salbutamol results = list(/datum/reagent/medicine/salbutamol = 5) required_reagents = list(/datum/reagent/medicine/sal_acid = 1, /datum/reagent/lithium = 1, /datum/reagent/aluminium = 1, /datum/reagent/bromine = 1, /datum/reagent/ammonia = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OXY /datum/chemical_reaction/medicine/ephedrine results = list(/datum/reagent/medicine/ephedrine = 4) required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/fuel/oil = 1, /datum/reagent/hydrogen = 1, /datum/reagent/diethylamine = 1) mix_message = "The solution fizzes and gives off toxic fumes." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/diphenhydramine results = list(/datum/reagent/medicine/diphenhydramine = 4) required_reagents = list(/datum/reagent/fuel/oil = 1, /datum/reagent/carbon = 1, /datum/reagent/bromine = 1, /datum/reagent/diethylamine = 1, /datum/reagent/consumable/ethanol = 1) mix_message = "The mixture dries into a pale blue powder." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/atropine results = list(/datum/reagent/medicine/atropine = 5) required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/phenol = 1, /datum/reagent/toxin/acid = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE |REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY /datum/chemical_reaction/medicine/epinephrine results = list(/datum/reagent/medicine/epinephrine = 6) required_reagents = list(/datum/reagent/phenol = 1, /datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/oxygen = 1, /datum/reagent/chlorine = 1, /datum/reagent/hydrogen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE |REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/strange_reagent results = list(/datum/reagent/medicine/strange_reagent = 3) required_reagents = list(/datum/reagent/medicine/omnizine = 1, /datum/reagent/water/holywater = 1, /datum/reagent/toxin/mutagen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/strange_reagent/alt results = list(/datum/reagent/medicine/strange_reagent = 2) required_reagents = list(/datum/reagent/medicine/omnizine/protozine = 1, /datum/reagent/water/holywater = 1, /datum/reagent/toxin/mutagen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_PLANT | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/mannitol results = list(/datum/reagent/medicine/mannitol = 3) required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/hydrogen = 1, /datum/reagent/water = 1) mix_message = "The solution slightly bubbles, becoming thicker." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/neurine results = list(/datum/reagent/medicine/neurine = 3) required_reagents = list(/datum/reagent/medicine/mannitol = 1, /datum/reagent/acetone = 1, /datum/reagent/oxygen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/mutadone results = list(/datum/reagent/medicine/mutadone = 3) required_reagents = list(/datum/reagent/toxin/mutagen = 1, /datum/reagent/acetone = 1, /datum/reagent/bromine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/antihol results = list(/datum/reagent/medicine/antihol = 3) required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/medicine/c2/multiver = 1, /datum/reagent/copper = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/cryoxadone results = list(/datum/reagent/medicine/cryoxadone = 3) required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/acetone = 1, /datum/reagent/toxin/mutagen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_PLANT | REACTION_TAG_BRUTE |REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY | REACTION_TAG_CLONE /datum/chemical_reaction/medicine/pyroxadone results = list(/datum/reagent/medicine/pyroxadone = 2) required_reagents = list(/datum/reagent/medicine/cryoxadone = 1, /datum/reagent/toxin/slimejelly = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE |REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY | REACTION_TAG_CLONE /datum/chemical_reaction/medicine/clonexadone results = list(/datum/reagent/medicine/clonexadone = 2) required_reagents = list(/datum/reagent/medicine/cryoxadone = 1, /datum/reagent/sodium = 1) required_catalysts = list(/datum/reagent/toxin/plasma = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_CLONE /datum/chemical_reaction/medicine/haloperidol results = list(/datum/reagent/medicine/haloperidol = 5) required_reagents = list(/datum/reagent/chlorine = 1, /datum/reagent/fluorine = 1, /datum/reagent/aluminium = 1, /datum/reagent/medicine/potass_iodide = 1, /datum/reagent/fuel/oil = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/regen_jelly results = list(/datum/reagent/medicine/regen_jelly = 2) required_reagents = list(/datum/reagent/medicine/omnizine = 1, /datum/reagent/toxin/slimejelly = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE |REACTION_TAG_BURN | REACTION_TAG_TOXIN | REACTION_TAG_OXY /datum/chemical_reaction/medicine/higadrite results = list(/datum/reagent/medicine/higadrite = 3) required_reagents = list(/datum/reagent/phenol = 2, /datum/reagent/lithium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_ORGAN /datum/chemical_reaction/medicine/morphine results = list(/datum/reagent/medicine/morphine = 2) required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/consumable/ethanol = 1, /datum/reagent/oxygen = 1) required_temp = 480 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER | REACTION_TAG_DRUG /datum/chemical_reaction/medicine/modafinil results = list(/datum/reagent/medicine/modafinil = 5) required_reagents = list(/datum/reagent/diethylamine = 1, /datum/reagent/ammonia = 1, /datum/reagent/phenol = 1, /datum/reagent/acetone = 1, /datum/reagent/toxin/acid = 1) required_catalysts = list(/datum/reagent/bromine = 1) // as close to the real world synthesis as possible + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/psicodine results = list(/datum/reagent/medicine/psicodine = 5) required_reagents = list( /datum/reagent/medicine/mannitol = 2, /datum/reagent/water = 2, /datum/reagent/impedrezene = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/medicine/granibitaluri results = list(/datum/reagent/medicine/granibitaluri = 3) required_reagents = list(/datum/reagent/consumable/salt = 1, /datum/reagent/carbon = 1, /datum/reagent/toxin/acid = 1) required_catalysts = list(/datum/reagent/iron = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE | REACTION_TAG_BURN ///medical stacks /datum/chemical_reaction/medicine/medsuture required_reagents = list(/datum/reagent/cellulose = 10, /datum/reagent/toxin/formaldehyde = 20, /datum/reagent/medicine/polypyr = 15) //This might be a bit much, reagent cost should be reviewed after implementation. + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE /datum/chemical_reaction/medicine/medsuture/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -175,6 +213,7 @@ /datum/chemical_reaction/medicine/medmesh required_reagents = list(/datum/reagent/cellulose = 20, /datum/reagent/consumable/aloejuice = 20, /datum/reagent/space_cleaner/sterilizine = 10) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BURN /datum/chemical_reaction/medicine/medmesh/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -183,6 +222,7 @@ /datum/chemical_reaction/medicine/poultice required_reagents = list(/datum/reagent/toxin/bungotoxin = 20, /datum/reagent/cellulose = 20, /datum/reagent/consumable/aloejuice = 20) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_HEALING | REACTION_TAG_BRUTE | REACTION_TAG_BURN /datum/chemical_reaction/medicine/poultice/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index e879e7a12a9..e2c3555aea0 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -2,44 +2,54 @@ /datum/chemical_reaction/sterilizine results = list(/datum/reagent/space_cleaner/sterilizine = 3) required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/medicine/c2/multiver = 1, /datum/reagent/chlorine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/lube results = list(/datum/reagent/lube = 4) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/silicon = 1, /datum/reagent/oxygen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/spraytan results = list(/datum/reagent/spraytan = 2) required_reagents = list(/datum/reagent/consumable/orangejuice = 1, /datum/reagent/fuel/oil = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/spraytan2 results = list(/datum/reagent/spraytan = 2) required_reagents = list(/datum/reagent/consumable/orangejuice = 1, /datum/reagent/consumable/cornoil = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/impedrezene results = list(/datum/reagent/impedrezene = 2) required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/oxygen = 1, /datum/reagent/consumable/sugar = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_ORGAN /datum/chemical_reaction/cryptobiolin results = list(/datum/reagent/cryptobiolin = 3) required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/oxygen = 1, /datum/reagent/consumable/sugar = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/glycerol results = list(/datum/reagent/glycerol = 1) required_reagents = list(/datum/reagent/consumable/cornoil = 3, /datum/reagent/toxin/acid = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_EXPLOSIVE /datum/chemical_reaction/sodiumchloride results = list(/datum/reagent/consumable/salt = 3) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/sodium = 1, /datum/reagent/chlorine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_FOOD /datum/chemical_reaction/stable_plasma results = list(/datum/reagent/stable_plasma = 1) required_reagents = list(/datum/reagent/toxin/plasma = 1) required_catalysts = list(/datum/reagent/stabilizing_agent = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/plasma_solidification required_reagents = list(/datum/reagent/iron = 5, /datum/reagent/consumable/frostoil = 5, /datum/reagent/toxin/plasma = 20) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/plasma_solidification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -50,6 +60,7 @@ required_reagents = list(/datum/reagent/consumable/frostoil = 5, /datum/reagent/gold = 20, /datum/reagent/iron = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/gold_solidification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -60,6 +71,7 @@ required_reagents = list(/datum/reagent/consumable/frostoil = 5, /datum/reagent/uranium = 20, /datum/reagent/potassium = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/uranium_solidification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -69,12 +81,14 @@ /datum/chemical_reaction/capsaicincondensation results = list(/datum/reagent/consumable/condensedcapsaicin = 5) required_reagents = list(/datum/reagent/consumable/capsaicin = 1, /datum/reagent/consumable/ethanol = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/soapification required_reagents = list(/datum/reagent/liquidgibs = 10, /datum/reagent/lye = 10) // requires two scooped gib tiles required_temp = 374 mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/soapification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -84,8 +98,11 @@ /datum/chemical_reaction/omegasoapification required_reagents = list(/datum/reagent/consumable/potato_juice = 10, /datum/reagent/consumable/ethanol/lizardwine = 10, /datum/reagent/monkey_powder = 10, /datum/reagent/drug/krokodil = 10, /datum/reagent/toxin/acid/nitracid = 10, /datum/reagent/baldium = 10, /datum/reagent/consumable/ethanol/hooch = 10, /datum/reagent/bluespace = 10, /datum/reagent/drug/pumpup = 10, /datum/reagent/consumable/space_cola = 10) required_temp = 999 + optimal_temp = 999 + overheat_temp = 1200 mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/omegasoapification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -97,6 +114,7 @@ required_temp = 374 mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/candlefication/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -107,6 +125,7 @@ required_reagents = list(/datum/reagent/liquidgibs = 10, /datum/reagent/consumable/nutriment = 10, /datum/reagent/carbon = 10) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/meatification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -118,6 +137,7 @@ results = list(/datum/reagent/carbondioxide = 3) required_reagents = list(/datum/reagent/carbon = 1, /datum/reagent/oxygen = 2) required_temp = 777 // pure carbon isn't especially reactive. + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/nitrous_oxide results = list(/datum/reagent/nitrous_oxide = 5) @@ -129,6 +149,7 @@ purity_min = 0.3 thermic_constant = 35 //gives a bonus 15C wiggle room rate_up_lim = 25 //Give a chance to pull back + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/nitrous_oxide/overly_impure(datum/reagents/holder, datum/equilibrium/equilibrium) . = ..() @@ -146,6 +167,7 @@ /datum/chemical_reaction/mulligan results = list(/datum/reagent/mulligan = 1) required_reagents = list(/datum/reagent/mutationtoxin/jelly = 1, /datum/reagent/toxin/mutagen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE ////////////////////////////////// VIROLOGY ////////////////////////////////////////// @@ -296,6 +318,7 @@ results = list(/datum/reagent/fluorosurfactant = 5) required_reagents = list(/datum/reagent/fluorine = 2, /datum/reagent/carbon = 2, /datum/reagent/toxin/acid = 1) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/foam required_reagents = list(/datum/reagent/fluorosurfactant = 1, /datum/reagent/water = 1) @@ -304,11 +327,13 @@ /datum/chemical_reaction/foam/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.create_foam(/datum/effect_system/foam_spread,2*created_volume,notification="The solution spews out foam!") + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/metalfoam required_reagents = list(/datum/reagent/aluminium = 3, /datum/reagent/foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/metalfoam/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.create_foam(/datum/effect_system/foam_spread/metal,5*created_volume,1,"The solution spews out a metallic foam!") @@ -317,6 +342,7 @@ required_reagents = list(/datum/reagent/aluminium = 3, /datum/reagent/smart_foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = TRUE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/smart_foam/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.create_foam(/datum/effect_system/foam_spread/metal/smart,5*created_volume,1,"The solution spews out metallic foam!") @@ -325,6 +351,7 @@ required_reagents = list(/datum/reagent/iron = 3, /datum/reagent/foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/ironfoam/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.create_foam(/datum/effect_system/foam_spread/metal,5*created_volume,2,"The solution spews out a metallic foam!") @@ -332,11 +359,13 @@ /datum/chemical_reaction/foaming_agent results = list(/datum/reagent/foaming_agent = 1) required_reagents = list(/datum/reagent/lithium = 1, /datum/reagent/hydrogen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/smart_foaming_agent results = list(/datum/reagent/smart_foaming_agent = 3) required_reagents = list(/datum/reagent/foaming_agent = 3, /datum/reagent/acetone = 1, /datum/reagent/iron = 1) mix_message = "The solution mixes into a frothy metal foam and conforms to the walls of its container." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /////////////////////////////// Cleaning and hydroponics ///////////////////////////////////////////////// @@ -347,42 +376,51 @@ optimal_ph_min = 1 // Lets increase our range for this basic chem optimal_ph_max = 12 H_ion_release = -0.02 //handmade is more neutral + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_PLANT /datum/chemical_reaction/diethylamine results = list(/datum/reagent/diethylamine = 2) required_reagents = list (/datum/reagent/ammonia = 1, /datum/reagent/consumable/ethanol = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_PLANT /datum/chemical_reaction/space_cleaner results = list(/datum/reagent/space_cleaner = 2) required_reagents = list(/datum/reagent/ammonia = 1, /datum/reagent/water = 1) rate_up_lim = 40 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/plantbgone results = list(/datum/reagent/toxin/plantbgone = 5) required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/water = 4) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT /datum/chemical_reaction/weedkiller results = list(/datum/reagent/toxin/plantbgone/weedkiller = 5) required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/ammonia = 4) - H_ion_release = -0.05 // Push towards acidic + H_ion_release = -0.05 // Push towards acidic + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT /datum/chemical_reaction/pestkiller results = list(/datum/reagent/toxin/pestkiller = 5) required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/consumable/ethanol = 4) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT /datum/chemical_reaction/drying_agent results = list(/datum/reagent/drying_agent = 3) required_reagents = list(/datum/reagent/stable_plasma = 2, /datum/reagent/consumable/ethanol = 1, /datum/reagent/sodium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE //////////////////////////////////// Other goon stuff /////////////////////////////////////////// /datum/chemical_reaction/acetone results = list(/datum/reagent/acetone = 3) required_reagents = list(/datum/reagent/fuel/oil = 1, /datum/reagent/fuel = 1, /datum/reagent/oxygen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/carpet results = list(/datum/reagent/carpet = 2) required_reagents = list(/datum/reagent/drug/space_drugs = 1, /datum/reagent/blood = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/carpet/black results = list(/datum/reagent/carpet/black = 2) @@ -427,15 +465,18 @@ /datum/chemical_reaction/oil results = list(/datum/reagent/fuel/oil = 3) required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/carbon = 1, /datum/reagent/hydrogen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/phenol results = list(/datum/reagent/phenol = 3) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/chlorine = 1, /datum/reagent/fuel/oil = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/ash results = list(/datum/reagent/ash = 1) required_reagents = list(/datum/reagent/fuel/oil = 1) required_temp = 480 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_PLANT /datum/chemical_reaction/colorful_reagent results = list(/datum/reagent/colorful_reagent = 5) @@ -445,6 +486,7 @@ required_reagents = list(/datum/reagent/medicine/strange_reagent = 1, /datum/reagent/medicine/c2/synthflesh = 1, /datum/reagent/blood = 1) required_temp = 374 reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/life/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) chemical_mob_spawn(holder, rand(1, round(created_volume, 1)), "Life (hostile)") //defaults to HOSTILE_SPAWN @@ -453,6 +495,7 @@ required_reagents = list(/datum/reagent/medicine/strange_reagent = 1, /datum/reagent/medicine/c2/synthflesh = 1, /datum/reagent/consumable/sugar = 1) required_temp = 374 reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/life_friendly/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) chemical_mob_spawn(holder, rand(1, round(created_volume, 1)), "Life (friendly)", FRIENDLY_SPAWN) @@ -461,6 +504,7 @@ required_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/blood = 1) required_temp = 374 reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/corgium/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -471,8 +515,9 @@ //monkey powder heehoo /datum/chemical_reaction/monkey_powder results = list(/datum/reagent/monkey_powder = 5) - required_reagents = list(/datum/reagent/consumable/banana = 1, /datum/reagent/consumable/nutriment=2,/datum/reagent/liquidgibs = 1) + required_reagents = list(/datum/reagent/consumable/banana = 1, /datum/reagent/consumable/nutriment=2, /datum/reagent/liquidgibs = 1) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/monkey required_reagents = list(/datum/reagent/monkey_powder = 50, /datum/reagent/water = 1) @@ -492,11 +537,13 @@ /datum/chemical_reaction/electrolysis results = list(/datum/reagent/oxygen = 1.5, /datum/reagent/hydrogen = 3) required_reagents = list(/datum/reagent/consumable/liquidelectricity = 1, /datum/reagent/water = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL //butterflium /datum/chemical_reaction/butterflium required_reagents = list(/datum/reagent/colorful_reagent = 1, /datum/reagent/medicine/omnizine = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/consumable/nutriment = 1) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/butterflium/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -508,6 +555,7 @@ required_reagents = list(/datum/reagent/medicine/strange_reagent = 1, /datum/reagent/consumable/cream = 5, /datum/reagent/consumable/ethanol/lizardwine = 5 ) required_temp = 374 reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/scream/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) playsound(holder.my_atom, pick(list( 'sound/voice/human/malescream_1.ogg', 'sound/voice/human/malescream_2.ogg', 'sound/voice/human/malescream_3.ogg', 'sound/voice/human/malescream_4.ogg', 'sound/voice/human/malescream_5.ogg', 'sound/voice/human/malescream_6.ogg', 'sound/voice/human/femalescream_1.ogg', 'sound/voice/human/femalescream_2.ogg', 'sound/voice/human/femalescream_3.ogg', 'sound/voice/human/femalescream_4.ogg', 'sound/voice/human/femalescream_5.ogg', 'sound/voice/human/wilhelm_scream.ogg')), created_volume*5,TRUE) @@ -515,45 +563,55 @@ /datum/chemical_reaction/hair_dye results = list(/datum/reagent/hair_dye = 5) required_reagents = list(/datum/reagent/colorful_reagent = 1, /datum/reagent/uranium/radium = 1, /datum/reagent/drug/space_drugs = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/barbers_aid results = list(/datum/reagent/barbers_aid = 5) required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/uranium/radium = 1, /datum/reagent/drug/space_drugs = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/concentrated_barbers_aid results = list(/datum/reagent/concentrated_barbers_aid = 2) required_reagents = list(/datum/reagent/barbers_aid = 1, /datum/reagent/toxin/mutagen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/baldium results = list(/datum/reagent/baldium = 1) required_reagents = list(/datum/reagent/uranium/radium = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/lye = 1) required_temp = 395 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/saltpetre results = list(/datum/reagent/saltpetre = 3) required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/nitrogen = 1, /datum/reagent/oxygen = 3) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT /datum/chemical_reaction/lye results = list(/datum/reagent/lye = 3) required_reagents = list(/datum/reagent/sodium = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1) required_temp = 10 //So hercuri still shows life. + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/lye2 results = list(/datum/reagent/lye = 2) required_reagents = list(/datum/reagent/ash = 1, /datum/reagent/water = 1, /datum/reagent/carbon = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/royal_bee_jelly results = list(/datum/reagent/royal_bee_jelly = 5) required_reagents = list(/datum/reagent/toxin/mutagen = 10, /datum/reagent/consumable/honey = 40) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT /datum/chemical_reaction/laughter results = list(/datum/reagent/consumable/laughter = 10) // Fuck it. I'm not touching this one. required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/banana = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/plastic_polymers required_reagents = list(/datum/reagent/fuel/oil = 5, /datum/reagent/toxin/acid = 2, /datum/reagent/ash = 3) required_temp = 374 //lazily consistent with soap & other crafted objects generically created with heat. reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/plastic_polymers/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -563,11 +621,13 @@ /datum/chemical_reaction/pax results = list(/datum/reagent/pax = 3) required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/medicine/synaptizine = 1, /datum/reagent/water = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/yuck results = list(/datum/reagent/yuck = 4) required_reagents = list(/datum/reagent/fuel = 3) required_container = /obj/item/food/deadmouse + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_FOOD | REACTION_TAG_DAMAGING /datum/chemical_reaction/slimejelly @@ -575,11 +635,13 @@ required_reagents = list(/datum/reagent/fuel/oil = 3, /datum/reagent/uranium/radium = 2, /datum/reagent/consumable/tinlux =1) required_container = /obj/item/food/grown/mushroom/glowshroom mix_message = "The mushroom's insides bubble and pop and it becomes very limp." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_PLANT | REACTION_TAG_DAMAGING | REACTION_TAG_TOXIN | REACTION_TAG_SLIME /datum/chemical_reaction/slime_extractification required_reagents = list(/datum/reagent/toxin/slimejelly = 30, /datum/reagent/consumable/frostoil = 5, /datum/reagent/toxin/plasma = 5) mix_message = "The mixture condenses into a ball." reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME /datum/chemical_reaction/slime_extractification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -589,6 +651,7 @@ required_reagents = list(/datum/reagent/metalgen = 1, /datum/reagent/liquid_dark_matter = 1) results = list(/datum/reagent/metalgen = 1) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/metalgen_imprint/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/datum/reagent/metalgen/MM = holder.get_reagent(/datum/reagent/metalgen) @@ -600,43 +663,52 @@ /datum/chemical_reaction/gravitum required_reagents = list(/datum/reagent/wittel = 1, /datum/reagent/sorium = 10) results = list(/datum/reagent/gravitum = 10) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/cellulose_carbonization results = list(/datum/reagent/carbon = 1) required_reagents = list(/datum/reagent/cellulose = 1) required_temp = 512 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_PLANT /datum/chemical_reaction/hydrogen_peroxide results = list(/datum/reagent/hydrogen_peroxide = 3) required_reagents = list(/datum/reagent/water = 1, /datum/reagent/oxygen = 1, /datum/reagent/chlorine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_DAMAGING | REACTION_TAG_BURN /datum/chemical_reaction/acetone_oxide results = list(/datum/reagent/acetone_oxide = 2) required_reagents = list(/datum/reagent/acetone = 2, /datum/reagent/oxygen = 1, /datum/reagent/hydrogen_peroxide = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_DAMAGING | REACTION_TAG_BURN /datum/chemical_reaction/pentaerythritol results = list(/datum/reagent/pentaerythritol = 2) required_reagents = list(/datum/reagent/acetaldehyde = 1, /datum/reagent/toxin/formaldehyde = 3, /datum/reagent/water = 1 ) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/acetaldehyde results = list(/datum/reagent/acetaldehyde = 3) required_reagents = list(/datum/reagent/acetone = 1, /datum/reagent/toxin/formaldehyde = 1, /datum/reagent/water = 1) required_temp = 450 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/holywater results = list(/datum/reagent/water/holywater = 1) required_reagents = list(/datum/reagent/water/hollowwater = 1) required_catalysts = list(/datum/reagent/water/holywater = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_PLANT | REACTION_TAG_OTHER /datum/chemical_reaction/exotic_stabilizer results = list(/datum/reagent/exotic_stabilizer = 2) required_reagents = list(/datum/reagent/plasma_oxide = 1,/datum/reagent/stabilizing_agent = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/silver_solidification required_reagents = list(/datum/reagent/silver = 20, /datum/reagent/carbon = 10) required_temp = 630 mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/silver_solidification/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index ac57ef80053..5a921f8dd86 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -2,6 +2,7 @@ var/strengthdiv = 10 var/modifier = 0 reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EXPLOSIVE | REACTION_TAG_MODERATE | REACTION_TAG_DANGEROUS required_temp = 0 //Prevent impromptu RPGs /datum/chemical_reaction/reagent_explosion/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) @@ -166,6 +167,7 @@ /datum/chemical_reaction/gunpowder results = list(/datum/reagent/gunpowder = 3) required_reagents = list(/datum/reagent/saltpetre = 1, /datum/reagent/medicine/c2/multiver = 1, /datum/reagent/sulfur = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE /datum/chemical_reaction/reagent_explosion/gunpowder_explosion required_reagents = list(/datum/reagent/gunpowder = 1) @@ -180,9 +182,11 @@ /datum/chemical_reaction/thermite results = list(/datum/reagent/thermite = 3) required_reagents = list(/datum/reagent/aluminium = 1, /datum/reagent/iron = 1, /datum/reagent/oxygen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER /datum/chemical_reaction/emp_pulse required_reagents = list(/datum/reagent/uranium = 1, /datum/reagent/iron = 1) // Yes, laugh, it's the best recipe I could think of that makes a little bit of sense + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/emp_pulse/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -194,6 +198,7 @@ /datum/chemical_reaction/beesplosion required_reagents = list(/datum/reagent/consumable/honey = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/uranium/radium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/beesplosion/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = holder.my_atom.drop_location() @@ -216,12 +221,14 @@ /datum/chemical_reaction/stabilizing_agent results = list(/datum/reagent/stabilizing_agent = 3) required_reagents = list(/datum/reagent/iron = 1, /datum/reagent/oxygen = 1, /datum/reagent/hydrogen = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_CHEMICAL | REACTION_TAG_PLANT /datum/chemical_reaction/clf3 results = list(/datum/reagent/clf3 = 4) required_reagents = list(/datum/reagent/chlorine = 1, /datum/reagent/fluorine = 3) required_temp = 424 overheat_temp = 1050 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_DANGEROUS | REACTION_TAG_BURN /datum/chemical_reaction/clf3/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) @@ -236,6 +243,7 @@ modifier = 5 mob_react = FALSE + /datum/chemical_reaction/reagent_explosion/methsplosion/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) for(var/turf/turf in range(1,T)) @@ -250,6 +258,7 @@ /datum/chemical_reaction/sorium results = list(/datum/reagent/sorium = 4) required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/oxygen = 1, /datum/reagent/nitrogen = 1, /datum/reagent/carbon = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/sorium/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -262,6 +271,7 @@ /datum/chemical_reaction/sorium_vortex required_reagents = list(/datum/reagent/sorium = 1) required_temp = 474 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/sorium_vortex/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) @@ -271,6 +281,7 @@ /datum/chemical_reaction/liquid_dark_matter results = list(/datum/reagent/liquid_dark_matter = 3) required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/uranium/radium = 1, /datum/reagent/carbon = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/liquid_dark_matter/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -283,6 +294,7 @@ /datum/chemical_reaction/ldm_vortex required_reagents = list(/datum/reagent/liquid_dark_matter = 1) required_temp = 474 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/ldm_vortex/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) @@ -293,6 +305,7 @@ results = list(/datum/reagent/flash_powder = 3) required_reagents = list(/datum/reagent/aluminium = 1, /datum/reagent/potassium = 1, /datum/reagent/sulfur = 1 ) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/flash_powder/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -314,6 +327,7 @@ /datum/chemical_reaction/flash_powder_flash required_reagents = list(/datum/reagent/flash_powder = 1) required_temp = 374 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/flash_powder_flash/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -333,6 +347,7 @@ results = list(/datum/reagent/smoke_powder = 3) required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/phosphorus = 1) reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/smoke_powder/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -354,6 +369,7 @@ required_temp = 374 mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/smoke_powder_smoke/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -370,6 +386,7 @@ /datum/chemical_reaction/sonic_powder results = list(/datum/reagent/sonic_powder = 3) required_reagents = list(/datum/reagent/oxygen = 1, /datum/reagent/consumable/space_cola = 1, /datum/reagent/phosphorus = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/sonic_powder/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -383,6 +400,7 @@ /datum/chemical_reaction/sonic_powder_deafen required_reagents = list(/datum/reagent/sonic_powder = 1) required_temp = 374 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/sonic_powder_deafen/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -393,6 +411,7 @@ /datum/chemical_reaction/phlogiston results = list(/datum/reagent/phlogiston = 3) required_reagents = list(/datum/reagent/phosphorus = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/stable_plasma = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/phlogiston/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) if(holder.has_reagent(/datum/reagent/stabilizing_agent)) @@ -406,6 +425,7 @@ /datum/chemical_reaction/napalm results = list(/datum/reagent/napalm = 3) required_reagents = list(/datum/reagent/fuel/oil = 1, /datum/reagent/fuel = 1, /datum/reagent/consumable/ethanol = 1 ) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_PLANT /datum/chemical_reaction/cryostylane results = list(/datum/reagent/cryostylane = 3) @@ -415,6 +435,7 @@ optimal_temp = 800 overheat_temp = 0 //Replace with NO_OVERHEAT when part 2 is in thermic_constant = 0 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/cryostylane/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.chem_temp = 20 // cools the fuck down @@ -425,6 +446,7 @@ required_reagents = list(/datum/reagent/cryostylane = 1, /datum/reagent/oxygen = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/cryostylane_oxygen/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.chem_temp = max(holder.chem_temp - 10*created_volume,0) @@ -434,6 +456,7 @@ required_reagents = list(/datum/reagent/pyrosium = 1, /datum/reagent/oxygen = 1) mob_react = FALSE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/pyrosium_oxygen/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.chem_temp += 10*created_volume @@ -446,6 +469,7 @@ overheat_temp = 9999//Replace with NO_OVERHEAT when part 2 is in temp_exponent_factor = 10 thermic_constant = 0 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE /datum/chemical_reaction/pyrosium/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) holder.chem_temp = 20 // also cools the fuck down @@ -456,11 +480,13 @@ required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/silver = 1, /datum/reagent/gunpowder = 1) mix_message = "A jet of sparks flies from the mixture as it merges into a flickering slurry." required_temp = 400 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE /datum/chemical_reaction/energized_jelly results = list(/datum/reagent/teslium/energized_jelly = 2) required_reagents = list(/datum/reagent/toxin/slimejelly = 1, /datum/reagent/teslium = 1) mix_message = "The slime jelly starts glowing intermittently." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DANGEROUS | REACTION_TAG_HEALING | REACTION_TAG_OTHER /datum/chemical_reaction/reagent_explosion/teslium_lightning required_reagents = list(/datum/reagent/teslium = 1, /datum/reagent/water = 1) @@ -469,6 +495,7 @@ mix_message = "The teslium starts to spark as electricity arcs away from it!" mix_sound = 'sound/machines/defib_zap.ogg' var/zap_flags = ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_EXPLOSIVE | REACTION_TAG_DANGEROUS /datum/chemical_reaction/reagent_explosion/teslium_lightning/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/T1 = created_volume * 20 //100 units : Zap 3 times, with powers 2000/5000/12000. Tesla revolvers have a power of 10000 for comparison. @@ -521,3 +548,4 @@ overheat_temp = 5 thermic_constant= -1 H_ion_release = -0.02 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE diff --git a/code/modules/reagents/chemistry/recipes/reaction_agents.dm b/code/modules/reagents/chemistry/recipes/reaction_agents.dm index d104e12f168..833ad2cc52a 100644 --- a/code/modules/reagents/chemistry/recipes/reaction_agents.dm +++ b/code/modules/reagents/chemistry/recipes/reaction_agents.dm @@ -5,7 +5,7 @@ //FermiChem vars: required_temp = 250 optimal_temp = 500 - overheat_temp = 9999 + overheat_temp = NO_OVERHEAT optimal_ph_min = 0 optimal_ph_max = 14 determin_ph_range = 0 @@ -15,6 +15,7 @@ H_ion_release = 0.01 rate_up_lim = 15 purity_min = 0 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /datum/chemical_reaction/acidic_buffer results = list(/datum/reagent/reaction_agent/acidic_buffer = 10) @@ -22,7 +23,7 @@ mix_message = "The solution froths in the beaker." required_temp = 250 optimal_temp = 500 - overheat_temp = 9999 + overheat_temp = NO_OVERHEAT optimal_ph_min = 0 optimal_ph_max = 14 determin_ph_range = 0 @@ -32,6 +33,7 @@ H_ion_release = -0.01 rate_up_lim = 20 purity_min = 0 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// Example competitive reaction (REACTION_COMPETITIVE) ////////////////////////////////// @@ -55,6 +57,7 @@ H_ion_release = 0 rate_up_lim = 4 purity_min = 0.25 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_COMPETITIVE /datum/chemical_reaction/prefactor_b @@ -75,6 +78,7 @@ rate_up_lim = 6 purity_min = 0.35 reaction_flags = REACTION_COMPETITIVE //Competes with /datum/chemical_reaction/prefactor_a/competitive + reaction_tags = REACTION_TAG_MODERATE | REACTION_TAG_DANGEROUS | REACTION_TAG_CHEMICAL | REACTION_TAG_COMPETITIVE /datum/chemical_reaction/prefactor_b/reaction_step(datum/equilibrium/reaction, datum/reagents/holder, delta_t, delta_ph, step_reaction_vol) . = ..() @@ -98,6 +102,7 @@ required_reagents = list(/datum/reagent/prefactor_b = 5) rate_up_lim = 3 reaction_flags = REACTION_COMPETITIVE //Competes with /datum/chemical_reaction/prefactor_b + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_COMPETITIVE //The actual results /datum/chemical_reaction/prefactor_a/purity_tester @@ -105,11 +110,14 @@ required_reagents = list(/datum/reagent/prefactor_a = 5, /datum/reagent/stable_plasma = 5) H_ion_release = 0.05 thermic_constant = 0 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_CHEMICAL | REACTION_TAG_COMPETITIVE + /datum/chemical_reaction/prefactor_b/speed_agent results = list(/datum/reagent/reaction_agent/speed_agent = 5) required_reagents = list(/datum/reagent/prefactor_b = 5, /datum/reagent/stable_plasma = 5) H_ion_release = -0.15 thermic_constant = 0 + reaction_tags = REACTION_TAG_HARD | REACTION_TAG_DANGEROUS | REACTION_TAG_CHEMICAL | REACTION_TAG_COMPETITIVE ////////////////////////////////End example///////////////////////////////////////////////////////////////////////////// diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 3102be75b35..a1ff537858b 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -2,6 +2,7 @@ /datum/chemical_reaction/slime var/deletes_extract = TRUE reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME /datum/chemical_reaction/slime/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) use_slime_core(holder) @@ -91,6 +92,7 @@ required_container = /obj/item/slime_extract/gold required_other = TRUE deletes_extract = FALSE //we do delete, but we don't do so instantly + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimemobspawn/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) @@ -120,6 +122,7 @@ /datum/chemical_reaction/slime/slimemobspawn/spider required_reagents = list(/datum/reagent/spider_extract = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimemobspawn/spider/summon_mobs(datum/reagents/holder, turf/T) T.visible_message("The slime extract begins to vibrate crikey-ingly!") @@ -258,6 +261,7 @@ required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/yellow required_other = TRUE + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimeoverload/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) empulse(get_turf(holder.my_atom), 3, 7) @@ -314,6 +318,7 @@ required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/red required_other = TRUE + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimebloodlust/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) for(var/mob/living/simple_animal/slime/slime in viewers(get_turf(holder.my_atom), null)) @@ -367,6 +372,7 @@ required_container = /obj/item/slime_extract/oil required_other = TRUE deletes_extract = FALSE + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_SLIME | REACTION_TAG_DANGEROUS /datum/chemical_reaction/slime/slimeexplosion/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) diff --git a/code/modules/reagents/chemistry/recipes/toxins.dm b/code/modules/reagents/chemistry/recipes/toxins.dm index dc84a712ebb..3752edb20e9 100644 --- a/code/modules/reagents/chemistry/recipes/toxins.dm +++ b/code/modules/reagents/chemistry/recipes/toxins.dm @@ -3,92 +3,113 @@ results = list(/datum/reagent/toxin/formaldehyde = 3) required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/oxygen = 1, /datum/reagent/silver = 1) required_temp = 420 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_CHEMICAL | REACTION_TAG_BRUTE | REACTION_TAG_TOXIN /datum/chemical_reaction/fentanyl results = list(/datum/reagent/toxin/fentanyl = 1) required_reagents = list(/datum/reagent/drug/space_drugs = 1) required_temp = 674 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_ORGAN | REACTION_TAG_TOXIN /datum/chemical_reaction/cyanide results = list(/datum/reagent/toxin/cyanide = 3) required_reagents = list(/datum/reagent/fuel/oil = 1, /datum/reagent/ammonia = 1, /datum/reagent/oxygen = 1) required_temp = 380 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OXY | REACTION_TAG_TOXIN /datum/chemical_reaction/itching_powder results = list(/datum/reagent/toxin/itching_powder = 3) required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/ammonia = 1, /datum/reagent/medicine/c2/multiver = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_BRUTE /datum/chemical_reaction/facid results = list(/datum/reagent/toxin/acid/fluacid = 4) required_reagents = list(/datum/reagent/toxin/acid = 1, /datum/reagent/fluorine = 1, /datum/reagent/hydrogen = 1, /datum/reagent/potassium = 1) required_temp = 380 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_PLANT | REACTION_TAG_BURN | REACTION_TAG_TOXIN /datum/chemical_reaction/nitracid results = list(/datum/reagent/toxin/acid/nitracid = 2) required_reagents = list(/datum/reagent/toxin/acid/fluacid = 1, /datum/reagent/nitrogen = 1, /datum/reagent/hydrogen_peroxide = 1) required_temp = 480 + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_BURN | REACTION_TAG_TOXIN /datum/chemical_reaction/sulfonal results = list(/datum/reagent/toxin/sulfonal = 3) required_reagents = list(/datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/sulfur = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_TOXIN | REACTION_TAG_OTHER /datum/chemical_reaction/lipolicide results = list(/datum/reagent/toxin/lipolicide = 3) required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/diethylamine = 1, /datum/reagent/medicine/ephedrine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/mutagen results = list(/datum/reagent/toxin/mutagen = 3) required_reagents = list(/datum/reagent/uranium/radium = 1, /datum/reagent/phosphorus = 1, /datum/reagent/chlorine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_PLANT | REACTION_TAG_OTHER /datum/chemical_reaction/lexorin results = list(/datum/reagent/toxin/lexorin = 3) required_reagents = list(/datum/reagent/toxin/plasma = 1, /datum/reagent/hydrogen = 1, /datum/reagent/medicine/salbutamol = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OXY /datum/chemical_reaction/hot_ice_melt results = list(/datum/reagent/toxin/plasma = 12) //One sheet of hot ice makes 200m of plasma required_reagents = list(/datum/reagent/toxin/hot_ice = 1) required_temp = T0C + 30 //Don't burst into flames when you melt thermic_constant = -200//Counter the heat + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_CHEMICAL | REACTION_TAG_TOXIN /datum/chemical_reaction/chloralhydrate results = list(/datum/reagent/toxin/chloralhydrate = 1) required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/chlorine = 3, /datum/reagent/water = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/mutetoxin //i'll just fit this in here snugly between other unfun chemicals :v results = list(/datum/reagent/toxin/mutetoxin = 2) required_reagents = list(/datum/reagent/uranium = 2, /datum/reagent/water = 1, /datum/reagent/carbon = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/zombiepowder results = list(/datum/reagent/toxin/zombiepowder = 2) required_reagents = list(/datum/reagent/toxin/carpotoxin = 5, /datum/reagent/medicine/morphine = 5, /datum/reagent/copper = 5) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/ghoulpowder results = list(/datum/reagent/toxin/ghoulpowder = 2) required_reagents = list(/datum/reagent/toxin/zombiepowder = 1, /datum/reagent/medicine/epinephrine = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/mindbreaker results = list(/datum/reagent/toxin/mindbreaker = 5) required_reagents = list(/datum/reagent/silicon = 1, /datum/reagent/hydrogen = 1, /datum/reagent/medicine/c2/multiver = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/heparin results = list(/datum/reagent/toxin/heparin = 4) required_reagents = list(/datum/reagent/toxin/formaldehyde = 1, /datum/reagent/sodium = 1, /datum/reagent/chlorine = 1, /datum/reagent/lithium = 1) mix_message = "The mixture thins and loses all color." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/rotatium results = list(/datum/reagent/toxin/rotatium = 3) required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/teslium = 1, /datum/reagent/toxin/fentanyl = 1) mix_message = "After sparks, fire, and the smell of mindbreaker, the mix is constantly spinning with no stop in sight." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_TOXIN | REACTION_TAG_OTHER /datum/chemical_reaction/anacea results = list(/datum/reagent/toxin/anacea = 3) required_reagents = list(/datum/reagent/medicine/haloperidol = 1, /datum/reagent/impedrezene = 1, /datum/reagent/uranium/radium = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_TOXIN | REACTION_TAG_OTHER /datum/chemical_reaction/mimesbane results = list(/datum/reagent/toxin/mimesbane = 3) required_reagents = list(/datum/reagent/uranium/radium = 1, /datum/reagent/toxin/mutetoxin = 1, /datum/reagent/consumable/nothing = 1) + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER /datum/chemical_reaction/bonehurtingjuice results = list(/datum/reagent/toxin/bonehurtingjuice = 5) required_reagents = list(/datum/reagent/toxin/mutagen = 1, /datum/reagent/toxin/itching_powder = 3, /datum/reagent/consumable/milk = 1) mix_message = "The mixture suddenly becomes clear and looks a lot like water. You feel a strong urge to drink it." + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_DAMAGING | REACTION_TAG_OTHER diff --git a/code/modules/unit_tests/reagent_id_typos.dm b/code/modules/unit_tests/reagent_id_typos.dm index d6548852fa5..4b82245c39e 100644 --- a/code/modules/unit_tests/reagent_id_typos.dm +++ b/code/modules/unit_tests/reagent_id_typos.dm @@ -3,7 +3,7 @@ /datum/unit_test/reagent_id_typos /datum/unit_test/reagent_id_typos/Run() - build_chemical_reactions_list() + build_chemical_reactions_lists() build_chemical_reagent_list() for(var/I in GLOB.chemical_reactions_list) diff --git a/code/modules/unit_tests/reagent_recipe_collisions.dm b/code/modules/unit_tests/reagent_recipe_collisions.dm index 20e875422f2..0eaefce3f42 100644 --- a/code/modules/unit_tests/reagent_recipe_collisions.dm +++ b/code/modules/unit_tests/reagent_recipe_collisions.dm @@ -3,7 +3,7 @@ /datum/unit_test/reagent_recipe_collisions /datum/unit_test/reagent_recipe_collisions/Run() - build_chemical_reactions_list() + build_chemical_reactions_lists() var/list/reactions = list() for(var/V in GLOB.chemical_reactions_list) reactions += GLOB.chemical_reactions_list[V] diff --git a/tgui/packages/tgui/interfaces/ChemDispenser.js b/tgui/packages/tgui/interfaces/ChemDispenser.js index 3ffc593959e..82cf4157945 100644 --- a/tgui/packages/tgui/interfaces/ChemDispenser.js +++ b/tgui/packages/tgui/interfaces/ChemDispenser.js @@ -8,6 +8,7 @@ import { Window } from '../layouts'; export const ChemDispenser = (props, context) => { const { act, data } = useBackend(context); const recording = !!data.recordingRecipe; + const { recipeReagents = [] } = data; const [hasCol, setHasCol] = useLocalState( context, 'has_col', false); // TODO: Change how this piece of shit is built on server side @@ -35,21 +36,27 @@ export const ChemDispenser = (props, context) => {
+ <> {recording && ( Recording )} -
+ + +
act('search_reagents')} /> + )}> + +
+
+ + + +
+ +
+
+ + + + + + + ); +}; + + +const TagBox = (props, context) => { + const { act, data } = useBackend(context); + const { bitflags } = props; + const { selectedBitflags } = data; + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +const RecipeLibrary = (props, context) => { + const { act, data } = useBackend(context); + const { flagIcons } = props; + const { + selectedBitflags, + currentReagents = [], + master_reaction_list = [], + linkedBeaker, + } = data; + + const [reagentFilter, setReagentFilter] = useLocalState( + context, 'reagentFilter', true); + const [bookmarkMode, setBookmarkMode] = useLocalState( + context, 'bookmarkMode', false); + + const matchReagents = reaction => { + if (!reagentFilter || currentReagents === null) { + return true; + } + let matches = reaction.reactants + .filter(reactant => currentReagents.includes(reactant.id)) + .length; + return matches === currentReagents.length; + }; + + const bookmarkArray = Array.from(bookmarkedReactions); + + const visibleReactions = bookmarkMode + ? bookmarkArray + : master_reaction_list.filter(reaction => ( + (selectedBitflags + ? matchBitflag(selectedBitflags, reaction.bitflags) + : true) + && matchReagents(reaction) + )); + + const addBookmark = bookmark => { + bookmarkedReactions.add(bookmark); + }; + + const removeBookmark = bookmark => { + bookmarkedReactions.delete(bookmark); + }; + + return ( +
+ Linked beaker: {linkedBeaker+" "} +
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/common/ReagentLookup.js b/tgui/packages/tgui/interfaces/common/ReagentLookup.js new file mode 100644 index 00000000000..42cd03a0b0b --- /dev/null +++ b/tgui/packages/tgui/interfaces/common/ReagentLookup.js @@ -0,0 +1,127 @@ +import { useBackend } from '../../backend'; +import { Box, Button, Icon, LabeledList } from '../../components'; + +export const ReagentLookup = (props, context) => { + const { reagent } = props; + const { act } = useBackend(context); + if (!reagent) { + return ( + + No reagent selected! + + ); + } + + return ( + + + + {reagent.name} +