Reagent lists (#20652)

* Reagent lists_of_ids

Adds reagent ID list defines. Rather than duping recipes for the botany-alternative chems, just use one of the lists instead.

* that's a lotta comments!

* Electrolyzing!
This commit is contained in:
MadmanMartian
2018-11-22 14:24:31 +00:00
committed by jknpj
parent 4c81ec339b
commit 9352e082dc
21 changed files with 180 additions and 138 deletions

View File

@@ -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)

View File

@@ -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, "<span class='warning'>Your stomach feels a little better now..</span>")
return 1
return 0

View File

@@ -53,6 +53,19 @@
//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
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)
@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -746,7 +746,7 @@
user.simple_message("<span class='warning'>The mixture is rejected by the tool.</span>",
"<span class='warning'>The tool isn't THAT thirsty.</span>")
return
if(!G.reagents.has_any_reagents(list(SACID, FORMIC_ACID), 1))
if(!G.reagents.has_any_reagents(SACIDS, 1))
user.simple_message("<span class='warning'>The tool is not compatible with that.</span>",
"<span class='warning'>The tool won't drink that.</span>")
return

View File

@@ -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

View File

@@ -92,8 +92,7 @@
proc/breathe()
if(reagents)
if(reagents.has_reagent(LEXORIN))
if(reagents && reagents.has_any_reagents(LEXORINS))
return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
return

View File

@@ -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

View File

@@ -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

View File

@@ -54,8 +54,7 @@
if(flags & INVULNERABLE)
return
if(reagents)
if(reagents.has_reagent(LEXORIN))
if(reagents &&reagents.has_any_reagents(LEXORINS))
return
if(!loc)

View File

@@ -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

View File

@@ -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

View File

@@ -235,8 +235,7 @@
if(flags & INVULNERABLE)
return
if(reagents)
if(reagents.has_reagent(LEXORIN))
if(reagents && reagents.has_any_reagents(LEXORINS))
return
if(!loc)

View File

@@ -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

View File

@@ -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)

View File

@@ -41,6 +41,11 @@ var/const/INGEST = 2
if(D.required_reagents && D.required_reagents.len)
for(var/reaction in D.required_reagents)
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
@@ -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,6 +380,14 @@ 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(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++
@@ -413,6 +426,13 @@ 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(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)
@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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, "<span class='warning'>The system electrolyzes!</span>")
spark(src, 5, FALSE)

View File

@@ -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()