diff --git a/__DEFINES/reagents.dm b/__DEFINES/reagents.dm index 2af346d266a..99ff838c42d 100644 --- a/__DEFINES/reagents.dm +++ b/__DEFINES/reagents.dm @@ -412,3 +412,24 @@ var/list/tachycardics = list(COFFEE, INAPROVALINE, HYPERZINE, HYPOZINE, NITROGLY var/list/bradycardics = list(NEUROTOXIN, CRYOXADONE, CLONEXADONE, SPACE_DRUGS, STOXIN, GREYVODKA, CURARE, MESCALINE, VALERENIC_ACID) //decrease heart rate var/list/heartstopper = list(/*"potassium_phorochloride",*/ ZOMBIEPOWDER) //this stops the heart var/list/cheartstopper = list(/*"potassium_chloride",*/ CHEESYGLOOP) //this stops the heart when overdose is met -- c = conditional + +//Lists of defines +//Preferably have the synthetic (chemist-made) versions first, and alternatives after that. This helps with electrolyzing. + +#define ANTI_TOXINS list(ANTI_TOXIN, ALLICIN) +#define KELOTANES list(KELOTANE, TANNIC_ACID) +#define DERMALINES list(DERMALINE, KATHALAI) +#define BICARIDINES list(BICARIDINE, OPIUM) +#define SPACE_DRUGGS list(SPACE_DRUGS, MESCALINE) +#define SYNAPTIZINES list(SYNAPTIZINE, CYTISINE) +#define HYPERZINES list(HYPERZINE, COCAINE) +#define IMIDAZOLINES list(IMIDAZOLINE, ZEAXANTHIN) +#define STOXINS list(STOXIN, STOXIN2, VALERENIC_ACID) +#define SACIDS list(SACID, FORMIC_ACID) +#define PACIDS list(PACID, PHENOL) +#define NEUROTOXINS list(NEUROTOXIN, CURARE) +#define TOXINS list(TOXIN, SOLANINE) +#define CRYPTOBIOLINS list(CRYPTOBIOLIN, PHYSOSTIGMINE) +#define IMPEDREZENES list(IMPEDREZENE, HYOSCYAMINE) +#define LEXORINS list(LEXORIN, CORIAMYRTIN) +#define DEXALINS list(DEXALIN, THYMOL) \ No newline at end of file diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm index 6f6f170a6b7..e00b75d7f2c 100644 --- a/code/WorkInProgress/Cib/MedicalSideEffects.dm +++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm @@ -94,7 +94,7 @@ H.vomit() /datum/medical_effect/bad_stomach/cure(mob/living/carbon/human/H) - if(H.reagents.has_reagent(ANTI_TOXIN)) + if(H.reagents.has_any_reagents(ANTI_TOXINS)) to_chat(H, "Your stomach feels a little better now..") return 1 return 0 diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 2223bf6a3ba..6278b2aeb4c 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -53,13 +53,26 @@ //Scan the reagents in our recipe machine thingie one by one for shit we need in our recipe (water, hotsauce, salt, etc...) for(var/r_r in reagents) //Get the amount of said reagent we'll need in our recipe and assign it to that variable - var/reagent_amount = avail_reagents.get_reagent_amount(r_r) - //And now, the fun begins. Let's put this in plain words because holy crap - if(!(abs(reagent_amount - reagents[r_r]) < 0.5)) //If the absolute value of the amount of our reagent minus the needed amount of reagents for the recipe is NOT under 0.5 (rounding sanity) - if(reagent_amount > reagents[r_r]) //Let's check if the amount of our reagent is above the needed amount - . = -1 //If so, then we can say that we have more of this reagent that needed - else //Else - return 0 //We don't have what we need, abort, ABORT + if(islist(r_r)) + var/list/L = r_r + var/found = FALSE + for(var/I in L) + var/reagent_amount = avail_reagents.get_reagent_amount(I) + if(!(abs(reagent_amount - reagents[r_r]) < 0.5)) + found = TRUE + if(reagent_amount > reagents[r_r]) + . = -1 + break + if(!found) + return 0//We don't have what we need. + else + var/reagent_amount = avail_reagents.get_reagent_amount(r_r) + //And now, the fun begins. Let's put this in plain words because holy crap + if(!(abs(reagent_amount - reagents[r_r]) < 0.5)) //If the absolute value of the amount of our reagent minus the needed amount of reagents for the recipe is NOT under 0.5 (rounding sanity) + if(reagent_amount > reagents[r_r]) //Let's check if the amount of our reagent is above the needed amount + . = -1 //If so, then we can say that we have more of this reagent that needed + else //Else + return 0 //We don't have what we need, abort, ABORT //Remember that this is a for loop, so we do this for every reagent listed in our recipe //Now, that check was fun, but we need to check for reagents we have not included per se (things not used in our recipe) if((reagents ? (reagents.len) : (0)) < avail_reagents.reagent_list.len) //Given we have reagents in our recipe, are there more reagents in our machine than reagents needed in our recipe ? @@ -99,6 +112,10 @@ for(var/obj/O in (container.contents - result_obj)) //Find all objects (for instance, raw food or beakers) in our machine, excluding the result we just created if(O.reagents) //Little sanity, can't hurt for(var/r_r in reagents_forbidden) //Check forbidden reagents + if(islist(r_r)) + var/list/L = r_r + for(var/I in L) + O.reagents.del_reagent(I) //If we find any, remove O.reagents.del_reagent("[r_r]") //If we find any, remove O.reagents.update_total() //Make sure we're set O.reagents.trans_to(result_obj, O.reagents.total_volume) //If we have reagents in here, squeeze them into the end product diff --git a/code/game/objects/items/gum.dm b/code/game/objects/items/gum.dm index fa999a013ad..b1cb5ee5327 100644 --- a/code/game/objects/items/gum.dm +++ b/code/game/objects/items/gum.dm @@ -107,7 +107,7 @@ var/mob/living/M = get_holder_of_type(src,/mob/living) if(reagents && reagents.total_volume) //Check if it has any reagents at all if(iscarbon(M) && ((src == M.wear_mask) || (loc == M.wear_mask))) //If it's in the human/monkey mouth, transfer reagents to the mob - if(M.reagents.has_reagent(LEXORIN) || M_NO_BREATH in M.mutations || istype(M.loc, /obj/machinery/atmospherics/unary/cryo_cell)) + if(M.reagents.has_any_reagents(LEXORINS) || M_NO_BREATH in M.mutations || istype(M.loc, /obj/machinery/atmospherics/unary/cryo_cell)) reagents.remove_any(REAGENTS_METABOLISM) else if(prob(25)) //So it's not an instarape in case of acid diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index b780e244de9..46f04ef0c20 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -374,7 +374,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM //Oddly specific and snowflakey reagent transfer system below if(reagents && reagents.total_volume) //Check if it has any reagents at all if(iscarbon(M) && ((src == M.wear_mask) || (loc == M.wear_mask))) //If it's in the human/monkey mouth, transfer reagents to the mob - if(M.reagents.has_reagent(LEXORIN) || M_NO_BREATH in M.mutations || istype(M.loc, /obj/machinery/atmospherics/unary/cryo_cell)) + if(M.reagents.has_any_reagents(LEXORINS) || M_NO_BREATH in M.mutations || istype(M.loc, /obj/machinery/atmospherics/unary/cryo_cell)) reagents.remove_any(REAGENTS_METABOLISM) else if(prob(25)) //So it's not an instarape in case of acid diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index eeab99e7a4e..17b4c889eae 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -746,7 +746,7 @@ user.simple_message("The mixture is rejected by the tool.", "The tool isn't THAT thirsty.") return - if(!G.reagents.has_any_reagents(list(SACID, FORMIC_ACID), 1)) + if(!G.reagents.has_any_reagents(SACIDS, 1)) user.simple_message("The tool is not compatible with that.", "The tool won't drink that.") return diff --git a/code/modules/food/recipes_microwave.dm b/code/modules/food/recipes_microwave.dm index 642e54614be..804a617d73d 100644 --- a/code/modules/food/recipes_microwave.dm +++ b/code/modules/food/recipes_microwave.dm @@ -1351,7 +1351,7 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/goldapple, ) result = /obj/item/weapon/reagent_containers/food/snacks/aesirsalad - reagents_forbidden = list(SYNAPTIZINE) + reagents_forbidden = SYNAPTIZINES /datum/recipe/validsalad items = list( @@ -2256,11 +2256,7 @@ return ..() /datum/recipe/reclaimed - reagents = list(VOMIT = 5, ANTI_TOXIN = 1) - result = /obj/item/weapon/reagent_containers/food/snacks/reclaimed - -/datum/recipe/reclaimedallicin - reagents = list(VOMIT = 5, ALLICIN = 1) + reagents = list(VOMIT = 5, ANTI_TOXINS = 1) result = /obj/item/weapon/reagent_containers/food/snacks/reclaimed /datum/recipe/bruisepack @@ -2268,11 +2264,7 @@ result = /obj/item/stack/medical/bruise_pack /datum/recipe/ointment - reagents = list(DERMALINE = 5) - result = /obj/item/stack/medical/ointment - -/datum/recipe/ointmentkathalai - reagents = list(KATHALAI = 5) + reagents = list(DERMALINES = 5) result = /obj/item/stack/medical/ointment /datum/recipe/poachedaloe diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index d1bfbe485bc..65500fe139e 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -92,9 +92,8 @@ proc/breathe() - if(reagents) - if(reagents.has_reagent(LEXORIN)) - return + if(reagents && reagents.has_any_reagents(LEXORINS)) + return if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 98caecfc6b4..f616c7f78c2 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -73,7 +73,7 @@ /mob/living/carbon/alien/larva/proc/breathe() - if(reagents.has_reagent(LEXORIN)) + if(reagents.has_any_reagents(LEXORINS)) return if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index cd5c7354f07..c91e2b68325 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -646,14 +646,14 @@ if(I.flags & SLOWDOWN_WHEN_CARRIED) . *= I.slowdown - if(. > 1 && reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(. > 1 && reagents.has_any_reagents(HYPERZINES)) . = max(1, .*0.4)//we don't hyperzine to make us move faster than the base speed, unless we were already faster. /mob/living/carbon/base_movement_tally() . = ..() if(flying) return // Calculate none of the following because we're technically on a vehicle - if(reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(reagents.has_any_reagents(HYPERZINES)) return // Hyperzine ignores slowdown if(istype(loc, /turf/space)) return // Space ignores slowdown diff --git a/code/modules/mob/living/carbon/complex/life.dm b/code/modules/mob/living/carbon/complex/life.dm index 89b145f7f2f..9f4b0f202da 100644 --- a/code/modules/mob/living/carbon/complex/life.dm +++ b/code/modules/mob/living/carbon/complex/life.dm @@ -54,9 +54,8 @@ if(flags & INVULNERABLE) return - if(reagents) - if(reagents.has_reagent(LEXORIN)) - return + if(reagents &&reagents.has_any_reagents(LEXORINS)) + return if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 64cb13929b2..d5c7da3a0ca 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -9,7 +9,7 @@ if(flying) return // Calculate none of the following because we're technically on a vehicle - if(reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(reagents.has_any_reagents(HYPERZINES)) return // Hyperzine ignores base slowdown if(istype(loc, /turf/space)) return // Space ignores slowdown @@ -57,7 +57,7 @@ /mob/living/carbon/human/movement_tally_multiplier() . = ..() - if(!reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(!reagents.has_any_reagents(HYPERZINES)) if(!shoes) . *= NO_SHOES_SLOWDOWN if(M_FAT in mutations) // hyperzine can't save you, fatty! @@ -71,7 +71,7 @@ . *= MAGBOOTS_SLOWDOWN_HIGH //Chemical magboots, imagine. if(isslimeperson(src)) - if(reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(reagents.has_any_reagents(HYPERZINES)) . *= 2 if(reagents.has_reagent(FROSTOIL)) . *= 5 diff --git a/code/modules/mob/living/carbon/human/life/handle_breath.dm b/code/modules/mob/living/carbon/human/life/handle_breath.dm index 50991bc38a2..00363c33cc3 100644 --- a/code/modules/mob/living/carbon/human/life/handle_breath.dm +++ b/code/modules/mob/living/carbon/human/life/handle_breath.dm @@ -3,7 +3,7 @@ /mob/living/carbon/human/proc/breathe() if(flags & INVULNERABLE) return - if(reagents.has_reagent(LEXORIN)) + if(reagents.has_any_reagents(LEXORINS)) return if(undergoing_hypothermia() == PROFOUND_HYPOTHERMIA) // we're not breathing. see handle_hypothermia.dm for details. return diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 25ab56c3940..3fbfc846f9c 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -235,9 +235,8 @@ if(flags & INVULNERABLE) return - if(reagents) - if(reagents.has_reagent(LEXORIN)) - return + if(reagents && reagents.has_any_reagents(LEXORINS)) + return if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 0bca39019df..18f8d8419c9 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -167,7 +167,7 @@ /mob/living/carbon/monkey/base_movement_tally() . = ..() - if(reagents.has_any_reagents(list(HYPERZINE,COCAINE))) + if(reagents.has_any_reagents(HYPERZINES)) return // Hyperzine ignores slowdown if(istype(loc, /turf/space)) return // Space ignores slowdown diff --git a/code/modules/organs/internal/liver/liver.dm b/code/modules/organs/internal/liver/liver.dm index 5457f6b4ecf..c55c029e75d 100644 --- a/code/modules/organs/internal/liver/liver.dm +++ b/code/modules/organs/internal/liver/liver.dm @@ -30,7 +30,7 @@ src.damage = 0 //High toxins levels are dangerous - if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent(ANTI_TOXIN)) + if(owner.getToxLoss() >= 60 && !owner.reagents.has_any_reagents(ANTI_TOXINS)) //Healthy liver suffers on its own if (src.damage < min_broken_damage) src.damage += 0.2 * process_accuracy @@ -41,7 +41,7 @@ O.damage += 0.2 * process_accuracy //Detox can heal small amounts of damage - if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent(ANTI_TOXIN)) + if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_any_reagents(ANTI_TOXINS)) src.damage -= 0.2 * process_accuracy // Damaged liver means some chemicals are very dangerous @@ -52,7 +52,7 @@ owner.adjustToxLoss(0.1 * process_accuracy) // Can't cope with toxins at all - for(var/toxin in list(TOXIN, PLASMA, SACID, PACID, CYANIDE, LEXORIN, AMATOXIN, CHLORALHYDRATE, CARPOTOXIN, ZOMBIEPOWDER, MINDBREAKER)) + for(var/toxin in list(PLASMA, CYANIDE, AMATOXIN, CHLORALHYDRATE, CARPOTOXIN, ZOMBIEPOWDER, MINDBREAKER)+SACIDS+PACIDS+LEXORINS+TOXINS+LEXORINS) if(owner.reagents.has_reagent(toxin)) owner.adjustToxLoss(0.3 * process_accuracy) diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 470cffa8c3f..cfe0640eef7 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -41,7 +41,12 @@ var/const/INGEST = 2 if(D.required_reagents && D.required_reagents.len) for(var/reaction in D.required_reagents) - reaction_ids += reaction + if(islist(reaction)) + var/list/L = reaction + for(var/content in L) + reaction_ids += content + else + reaction_ids += reaction // Create filters based on each reagent id in the required reagents list for(var/id in reaction_ids) @@ -50,6 +55,7 @@ var/const/INGEST = 2 chemical_reactions_list[id] += D break // Don't bother adding ourselves to other reagent ids, it is redundant. + /datum/reagents/proc/remove_any(var/amount=1) var/total_transfered = 0 var/current_list_element = 1 @@ -354,7 +360,6 @@ trans_to_atmos(var/datum/gas_mixture/target, var/amount=1, var/multiplier=1, var reaction_occured = 0 for(var/datum/reagent/R in reagent_list) // Usually a small list for(var/reaction in chemical_reactions_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id - if(!reaction) continue @@ -375,10 +380,18 @@ trans_to_atmos(var/datum/gas_mixture/target, var/amount=1, var/multiplier=1, var multipliers += 1 //Only once for(var/B in C.required_reagents) - if(!has_reagent(B, C.required_reagents[B])) - break - total_matching_reagents++ - multipliers += round(get_reagent_amount(B) / C.required_reagents[B]) + if(islist(B)) + var/list/L = B + for(var/D in L) + if(!has_reagent(D, C.required_reagents[B])) + continue + total_matching_reagents++ + multipliers += round(get_reagent_amount(D) / C.required_reagents[B]) + else + if(!has_reagent(B, C.required_reagents[B])) + break + total_matching_reagents++ + multipliers += round(get_reagent_amount(B) / C.required_reagents[B]) for(var/B in C.required_catalysts) if(!has_reagent(B, C.required_catalysts[B])) break @@ -413,9 +426,16 @@ trans_to_atmos(var/datum/gas_mixture/target, var/amount=1, var/multiplier=1, var var/multiplier = min(multipliers) var/preserved_data = null for(var/B in C.required_reagents) - if(!preserved_data) - preserved_data = get_data(B) - remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1) + if(islist(B)) + var/list/L = B + for(var/D in L) + if(!preserved_data) + preserved_data = get_data(D) + remove_reagent(D, (multiplier * C.required_reagents[B]), safety = 1) + else + if(!preserved_data) + preserved_data = get_data(B) + remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1) chem_temp += C.reaction_temp_change @@ -613,6 +633,16 @@ trans_to_atmos(var/datum/gas_mixture/target, var/amount=1, var/multiplier=1, var remove_reagent(id, amount, safety) return 1 +/datum/reagents/proc/remove_any_reagents(var/list/reagent_list, var/amount, var/safety) + if(!isnum(amount)) + return 0 + for(var/id in reagent_list) + if(has_reagent(id)) + amount -= remove_reagent(id, amount, safety) + if(amount <= 0) + return 1 + return 0 + /datum/reagents/proc/remove_reagent_by_type(var/reagent_type, var/amount, var/safety) if(!isnum(amount)) return 1 diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index e7b360a413f..4f3f1fea6fd 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -671,12 +671,12 @@ M.drowsyness = max(M.drowsyness - 2 * REM, 0) if(holder.has_any_reagents(list(TOXIN, PLANTBGONE, SOLANINE))) holder.remove_reagents(list(TOXIN, PLANTBGONE, SOLANINE), 2 * REM) - if(holder.has_any_reagents(list(STOXIN, VALERENIC_ACID))) - holder.remove_reagents(list(STOXIN, VALERENIC_ACID), 2 * REM) + if(holder.has_any_reagents(STOXINS)) + holder.remove_reagents(STOXINS, 2 * REM) if(holder.has_reagent(PLASMA)) holder.remove_reagent(PLASMA, REM) - if(holder.has_any_reagents(list(SACID, FORMIC_ACID))) - holder.remove_reagents(list(SACID, FORMIC_ACID), REM) + if(holder.has_any_reagents(SACIDS)) + holder.remove_reagents(SACIDS, REM) if(holder.has_reagent(POTASSIUM_HYDROXIDE)) holder.remove_reagent(POTASSIUM_HYDROXIDE, 2 * REM) if(holder.has_reagent(CYANIDE)) @@ -2537,8 +2537,8 @@ M.adjustOxyLoss(-2 * REM) - if(holder.has_reagent("lexorin")) - holder.remove_reagent("lexorin", 2 * REM) + if(holder.has_any_reagents(LEXORINS)) + holder.remove_reagents(LEXORINS, 2 * REM) /datum/reagent/dexalinp name = "Dexalin Plus" @@ -2556,8 +2556,8 @@ M.adjustOxyLoss(-M.getOxyLoss()) - if(holder.has_reagent("lexorin")) - holder.remove_reagent("lexorin", 2 * REM) + if(holder.has_any_reagents(LEXORINS)) + holder.remove_reagents(LEXORINS, 2 * REM) /datum/reagent/tricordrazine name = "Tricordrazine" @@ -2603,32 +2603,32 @@ M.radiation = 0 M.heal_organ_damage(5,5) M.adjustToxLoss(-5) - if(holder.has_reagent("toxin")) - holder.remove_reagent("toxin", 5) - if(holder.has_reagent("stoxin")) - holder.remove_reagent("stoxin", 5) - if(holder.has_reagent("plasma")) - holder.remove_reagent("plasma", 5) - if(holder.has_reagent("sacid")) - holder.remove_reagent("sacid", 5) - if(holder.has_reagent("pacid")) - holder.remove_reagent("pacid", 5) - if(holder.has_reagent("cyanide")) - holder.remove_reagent("cyanide", 5) - if(holder.has_reagent("lexorin")) - holder.remove_reagent("lexorin", 5) - if(holder.has_reagent("amatoxin")) - holder.remove_reagent("amatoxin", 5) - if(holder.has_reagent("chloralhydrate")) - holder.remove_reagent("chloralhydrate", 5) - if(holder.has_reagent("carpotoxin")) - holder.remove_reagent("carpotoxin", 5) - if(holder.has_reagent("zombiepowder")) - holder.remove_reagent("zombiepowder", 5) - if(holder.has_reagent("mindbreaker")) - holder.remove_reagent("mindbreaker", 5) - if(holder.has_reagent("spiritbreaker")) - holder.remove_reagent("spiritbreaker", 5) + if(holder.has_any_reagents(TOXINS)) + holder.remove_reagents(TOXINS, 5) + if(holder.has_any_reagents(STOXINS)) + holder.remove_reagents(STOXINS, 5) + if(holder.has_reagent(PLASMA)) + holder.remove_reagent(PLASMA, 5) + if(holder.has_any_reagents(SACIDS)) + holder.remove_reagents(SACIDS, 5) + if(holder.has_any_reagents(PACIDS)) + holder.remove_reagent(PACIDS, 5) + if(holder.has_reagent(CYANIDE)) + holder.remove_reagent(CYANIDE, 5) + if(holder.has_any_reagents(LEXORINS)) + holder.remove_reagents(LEXORINS, 5) + if(holder.has_reagent(AMATOXIN)) + holder.remove_reagent(AMATOXIN, 5) + if(holder.has_reagent(CHLORALHYDRATE)) + holder.remove_reagent(CHLORALHYDRATE, 5) + if(holder.has_reagent(CARPOTOXIN)) + holder.remove_reagent(CARPOTOXIN, 5) + if(holder.has_reagent(ZOMBIEPOWDER)) + holder.remove_reagent(ZOMBIEPOWDER, 5) + if(holder.has_reagent(MINDBREAKER)) + holder.remove_reagent(MINDBREAKER, 5) + if(holder.has_reagent(SPIRITBREAKER)) + holder.remove_reagent(SPIRITBREAKER, 5) M.hallucination = 0 M.setBrainLoss(0) M.disabilities = 0 diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 4229a49e0bc..af99c81a364 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -107,7 +107,7 @@ name = "Creatine" id = CREATINE result = CREATINE - required_reagents = list(NUTRIMENT = 1, BICARIDINE = 1, HYPERZINE = 1, MUTAGEN = 1) + required_reagents = list(NUTRIMENT = 1, BICARIDINES = 1, HYPERZINES = 1, MUTAGEN = 1) result_amount = 2 /datum/chemical_reaction/discount @@ -164,7 +164,7 @@ name = "Sterilizine" id = STERILIZINE result = STERILIZINE - required_reagents = list(ETHANOL = 1, ANTI_TOXIN = 1, CHLORINE = 1) + required_reagents = list(ETHANOL = 1, ANTI_TOXINS = 1, CHLORINE = 1) result_amount = 3 /datum/chemical_reaction/inaprovaline @@ -316,7 +316,7 @@ name = "Hyronalin" id = HYRONALIN result = HYRONALIN - required_reagents = list(RADIUM = 1, ANTI_TOXIN = 1) + required_reagents = list(RADIUM = 1, ANTI_TOXINS = 1) result_amount = 2 /datum/chemical_reaction/arithrazine @@ -366,21 +366,21 @@ name = "Tricordrazine" id = TRICORDRAZINE result = TRICORDRAZINE - required_reagents = list(INAPROVALINE = 1, ANTI_TOXIN = 1) + required_reagents = list(INAPROVALINE = 1, ANTI_TOXINS = 1) result_amount = 2 /datum/chemical_reaction/alkysine name = "Alkysine" id = ALKYSINE result = ALKYSINE - required_reagents = list(CHLORINE = 1, NITROGEN = 1, ANTI_TOXIN = 1) + required_reagents = list(CHLORINE = 1, NITROGEN = 1, ANTI_TOXINS = 1) result_amount = 2 /datum/chemical_reaction/alkycosine name = "Alkycosine" id = ALKYCOSINE result = ALKYCOSINE - required_reagents = list(ALKYSINE = 1, BLEACH = 1, ANTI_TOXIN = 1) + required_reagents = list(ALKYSINE = 1, BLEACH = 1, ANTI_TOXINS = 1) required_temp = T0C + 40 result_amount = 4 @@ -417,7 +417,7 @@ name = "Synthocarisol" id = SYNTHOCARISOL result = SYNTHOCARISOL - required_reagents = list(BICARIDINE = 1, INAPROVALINE = 1) + required_reagents = list(BICARIDINES = 1, INAPROVALINE = 1) required_temp = T0C + 77 result_amount = 2 @@ -439,7 +439,7 @@ name = "Cryoxadone" id = CRYOXADONE result = CRYOXADONE - required_reagents = list(DEXALIN = 1, WATER = 1, OXYGEN = 1) + required_reagents = list(DEXALINS = 1, WATER = 1, OXYGEN = 1) result_amount = 3 /datum/chemical_reaction/clonexadone @@ -454,28 +454,28 @@ name = "Spaceacillin" id = SPACEACILLIN result = SPACEACILLIN - required_reagents = list(CRYPTOBIOLIN = 1, INAPROVALINE = 1) + required_reagents = list(CRYPTOBIOLINS = 1, INAPROVALINE = 1) result_amount = 2 /datum/chemical_reaction/imidazoline name = IMIDAZOLINE id = IMIDAZOLINE result = IMIDAZOLINE - required_reagents = list(CARBON = 1, HYDROGEN = 1, ANTI_TOXIN = 1) + required_reagents = list(CARBON = 1, HYDROGEN = 1, ANTI_TOXINS = 1) result_amount = 2 /datum/chemical_reaction/inacusiate name = INACUSIATE id = INACUSIATE result = INACUSIATE - required_reagents = list(WATER = 1, CARBON = 1, ANTI_TOXIN = 1) + required_reagents = list(WATER = 1, CARBON = 1, ANTI_TOXINS = 1) result_amount = 3 /datum/chemical_reaction/ethylredoxrazine name = "Ethylredoxrazine" id = ETHYLREDOXRAZINE result = ETHYLREDOXRAZINE - required_reagents = list(OXYGEN = 1, ANTI_TOXIN = 1, CARBON = 1) + required_reagents = list(OXYGEN = 1, ANTI_TOXINS = 1, CARBON = 1) result_amount = 3 /datum/chemical_reaction/ethanoloxidation @@ -489,14 +489,14 @@ name = "Glycerol" id = GLYCEROL result = GLYCEROL - required_reagents = list(CORNOIL = 3, FORMIC_ACID = 1) + required_reagents = list(CORNOIL = 3, SACIDS = 1) result_amount = 1 /datum/chemical_reaction/nitroglycerin name = "Nitroglycerin Explosion" id = NITROGLYCERIN result = NITROGLYCERIN - required_reagents = list(GLYCEROL = 1, PHENOL = 1, FORMIC_ACID = 1) + required_reagents = list(GLYCEROL = 1, PACIDS = 1, SACIDS = 1) result_amount = 2 alert_admins = ALERT_AMOUNT_ONLY @@ -558,7 +558,7 @@ name = "Napalm" id = "napalm" result = null - required_reagents = list(ALUMINUM = 1, PLASMA = 1, SACID = 1 ) + required_reagents = list(ALUMINUM = 1, PLASMA = 1, SACIDS = 1 ) result_amount = 1 /datum/chemical_reaction/napalm/on_reaction(var/datum/reagents/holder, var/created_volume) @@ -630,28 +630,28 @@ name = "Zombie Powder" id = ZOMBIEPOWDER result = ZOMBIEPOWDER - required_reagents = list(CARPOTOXIN = 5, STOXIN = 5, COPPER = 5) + required_reagents = list(CARPOTOXIN = 5, STOXINS = 5, COPPER = 5) result_amount = 2 /datum/chemical_reaction/rezadone name = "Rezadone" id = REZADONE result = REZADONE - required_reagents = list(CARPOTOXIN = 1, CRYPTOBIOLIN = 1, COPPER = 1) + required_reagents = list(CARPOTOXIN = 1, CRYPTOBIOLINS = 1, COPPER = 1) result_amount = 3 /datum/chemical_reaction/mindbreaker name = "Mindbreaker Toxin" id = MINDBREAKER result = MINDBREAKER - required_reagents = list(SILICON = 1, HYDROGEN = 1, ANTI_TOXIN = 1) + required_reagents = list(SILICON = 1, HYDROGEN = 1, ANTI_TOXINS = 1) result_amount = 5 /datum/chemical_reaction/heartbreaker name = "Heartbreaker Toxin" id = HEARTBREAKER result = HEARTBREAKER - required_reagents = list(MINDBREAKER = 1, DEXALIN = 1) + required_reagents = list(MINDBREAKER = 1, DEXALINS = 1) required_temp = T0C + 37 result_amount = 5 @@ -783,17 +783,7 @@ name = "Plastic" id = "solidplastic" result = null - required_reagents = list(PACID = 10, PLASTICIDE = 20) - result_amount = 10 - -/datum/chemical_reaction/solidification/plastic/product_to_spawn() - return /obj/item/stack/sheet/mineral/plastic - -/datum/chemical_reaction/solidification/plasticphenol - name = "Plastic" - id = "solidplastic" - result = null - required_reagents = list(PHENOL = 10, PLASTICIDE = 20) + required_reagents = list(PACIDS = 10, PLASTICIDE = 20) result_amount = 10 /datum/chemical_reaction/solidification/plastic/product_to_spawn() @@ -900,7 +890,7 @@ name = "Foam surfactant" id = FLUOROSURFACTANT result = FLUOROSURFACTANT - required_reagents = list(FLUORINE = 2, CARBON = 2, SACID = 1) + required_reagents = list(FLUORINE = 2, CARBON = 2, SACIDS = 1) result_amount = 5 @@ -1028,14 +1018,7 @@ name = "Plant-B-Gone" id = PLANTBGONE result = PLANTBGONE - required_reagents = list(TOXIN = 1, WATER = 4) - result_amount = 5 - -/datum/chemical_reaction/plantbgonesolanine - name = "Plant-B-Gone" - id = PLANTBGONE - result = PLANTBGONE - required_reagents = list(SOLANINE = 1, WATER = 4) + required_reagents = list(TOXINS = 1, WATER = 4) result_amount = 5 // Special Reactions for Plasma Beaker @@ -2239,11 +2222,9 @@ name = "Soy Sauce" id = SOYSAUCE result = SOYSAUCE - required_reagents = list(SOYMILK = 4, SACID = 1) + required_reagents = list(SOYMILK = 4, SACIDS = 1) result_amount = 5 -/datum/chemical_reaction/soysauce/natural - required_reagents = list(SOYMILK = 4, FORMIC_ACID = 1) /datum/chemical_reaction/vinegar name = "Vinegar" @@ -2300,7 +2281,7 @@ name = "Cream" id = CREAM result = CREAM - required_reagents = list(MILK = 10,SACID = 1) + required_reagents = list(MILK = 10,SACIDS = 1) result_amount = 5 /datum/chemical_reaction/syntiflesh @@ -2812,7 +2793,7 @@ name = "Acid Spit" id = ACIDSPIT result = ACIDSPIT - required_reagents = list(SACID = 1, WINE = 5) + required_reagents = list(SACIDS = 1, WINE = 5) result_amount = 6 /datum/chemical_reaction/amasec @@ -2847,7 +2828,7 @@ name = "Neurotoxin" id = NEUROTOXIN result = NEUROTOXIN - required_reagents = list(GARGLEBLASTER = 1, STOXIN = 1) + required_reagents = list(GARGLEBLASTER = 1, STOXINS = 1) result_amount = 2 /datum/chemical_reaction/snowwhite @@ -2953,7 +2934,7 @@ name = "Earl's Grey Tea" id = ACIDTEA result = ACIDTEA - required_reagents = list(SACID = 1, TEA = 1) + required_reagents = list(SACIDS = 1, TEA = 1) result_amount = 2 /datum/chemical_reaction/chifir @@ -3079,7 +3060,7 @@ name = "hardcore induced heart attack" id = MEDCORES result = CHEESYGLOOP - required_reagents = list(MEDCORES = 0.1, HYPERZINE = 0.1) + required_reagents = list(MEDCORES = 0.1, HYPERZINES = 0.1) result_amount = 2 /datum/chemical_reaction/lithotorcrazine @@ -3129,7 +3110,7 @@ name = "Activated Charcoal" id = CHARCOAL result = CHARCOAL - required_reagents = list(CARBON = 1, SACID = 2) + required_reagents = list(CARBON = 1, SACIDS = 2) required_temp = T0C + 450 result_amount = 1 @@ -3145,7 +3126,7 @@ name = "Albuterol" id = ALBUTEROL result = ALBUTEROL - required_reagents = list(TRAMADOL = 1, HYPERZINE = 1) + required_reagents = list(TRAMADOL = 1, HYPERZINES = 1) result_amount = 2 /datum/chemical_reaction/saltwater @@ -3262,7 +3243,7 @@ name = "Weed Eater" id = WEED_EATER result = WEED_EATER - required_reagents = list(SPACE_DRUGS = 1, AMATOXIN = 1, PSILOCYBIN = 1, KARMOTRINE = 2) + required_reagents = list(SPACE_DRUGGS = 1, AMATOXIN = 1, PSILOCYBIN = 1, KARMOTRINE = 2) result_amount = 5 /datum/chemical_reaction/lemonlime diff --git a/code/modules/reagents/machinery/electrolyzer.dm b/code/modules/reagents/machinery/electrolyzer.dm index de91eb8f96e..440191e8644 100644 --- a/code/modules/reagents/machinery/electrolyzer.dm +++ b/code/modules/reagents/machinery/electrolyzer.dm @@ -95,11 +95,15 @@ var/amount_to_electrolyze = total_reactions*unreaction.result_amount active.reagents.remove_reagent(unreaction.result,amount_to_electrolyze) //This moves over the reactive bulk, and leaves behind the amount too small to react for(var/E in unreaction.required_reagents) + var/reagent_ID = E + if(islist(E)) + var/list/L = E + reagent_ID = L[1] //the first element should be the synthetic version of the chemical. why don't the lists start at 0? if(primary) - active.reagents.add_reagent(E, unreaction.required_reagents[E]*total_reactions) //Put component amount * reaction count back in primary + active.reagents.add_reagent(reagent_ID, unreaction.required_reagents[E]*total_reactions) //Put component amount * reaction count back in primary primary = 0 else - empty.reagents.add_reagent(E, unreaction.required_reagents[E]*total_reactions) + empty.reagents.add_reagent(reagent_ID, unreaction.required_reagents[E]*total_reactions) investigation_log(I_CHEMS, "was used by [key_name(user)] to electrolyze [amount_to_electrolyze]u of [unreaction.result].") to_chat(user, "The system electrolyzes!") spark(src, 5, FALSE) diff --git a/code/modules/virus2/dishincubator.dm b/code/modules/virus2/dishincubator.dm index 10cef106a8a..995ecea0228 100644 --- a/code/modules/virus2/dishincubator.dm +++ b/code/modules/virus2/dishincubator.dm @@ -208,7 +208,7 @@ if(beaker) if(!beaker.reagents.remove_reagent(VIRUSFOOD,5)) foodsupply += 10 - if(!beaker.reagents.remove_reagent(TOXIN,1)) + if(!beaker.reagents.remove_any_reagents(TOXINS,1)) toxins += 1 src.updateUsrDialog()