"
for(var/V in stored_food)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index e02c3c1334..e5c5a4f933 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
@@ -176,7 +176,7 @@
newmeat.name = "[sourcename] [newmeat.name]"
if(istype(newmeat))
newmeat.subjectname = sourcename
- newmeat.reagents.add_reagent ("nutriment", sourcenutriment / meat_produced) // Thehehe. Fat guys go first
+ newmeat.reagents.add_reagent (/datum/reagent/consumable/nutriment, sourcenutriment / meat_produced) // Thehehe. Fat guys go first
if(sourcejob)
newmeat.subjectjob = sourcejob
allmeat[i] = newmeat
diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
index 8db6956da9..1a33ce26db 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
@@ -39,23 +39,23 @@
/obj/machinery/icecream_vat/proc/get_ingredient_list(type)
switch(type)
if(ICECREAM_CHOCOLATE)
- return list("milk", "ice", "cocoa")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/coco)
if(ICECREAM_STRAWBERRY)
- return list("milk", "ice", "berryjuice")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/berryjuice)
if(ICECREAM_CUSTOM)
- return list("milk", "ice")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice)
if(ICECREAM_PEACH)
- return list("milk", "ice", "peachjuice")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/peachjuice)
if(ICECREAM_GRAPE)
- return list("milk", "ice", "grapejuice")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/grapejuice)
if(ICECREAM_BLUE)
- return list("milk", "ice", "singulo")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/ethanol/singulo)
if(CONE_WAFFLE)
- return list("flour", "sugar")
+ return list(/datum/reagent/consumable/flour, /datum/reagent/consumable/sugar)
if(CONE_CHOC)
- return list("flour", "sugar", "cocoa")
+ return list(/datum/reagent/consumable/flour, /datum/reagent/consumable/sugar, /datum/reagent/consumable/coco)
else //ICECREAM_VANILLA
- return list("milk", "ice", "vanilla")
+ return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/vanilla)
/obj/machinery/icecream_vat/proc/get_flavour_name(flavour_type)
@@ -113,7 +113,7 @@
dat += "
VAT CONTENT"
for(var/datum/reagent/R in reagents.reagent_list)
dat += "[R.name]: [R.volume]"
- dat += "
Purge"
+ dat += "
Purge"
dat += "
Refresh Close"
var/datum/browser/popup = new(user, "icecreamvat","Icecream Vat", 700, 500, src)
@@ -132,7 +132,7 @@
else
I.add_ice_cream(flavour_name)
if(I.reagents.total_volume < 10)
- I.reagents.add_reagent("sugar", 10 - I.reagents.total_volume)
+ I.reagents.add_reagent(/datum/reagent/consumable/sugar, 10 - I.reagents.total_volume)
updateDialog()
else
to_chat(user, "
There is not enough ice cream left!")
@@ -244,9 +244,9 @@
icon_state = "icecream_cone_[cone_name]"
switch (cone_type)
if ("waffle")
- reagents.add_reagent("nutriment", 1)
+ reagents.add_reagent(/datum/reagent/consumable/nutriment, 1)
if ("chocolate")
- reagents.add_reagent("cocoa", 1) // chocolate ain't as nutritious kids
+ reagents.add_reagent(/datum/reagent/consumable/coco, 1) // chocolate ain't as nutritious kids
desc = "Delicious [cone_name] cone, but no ice cream."
@@ -256,31 +256,31 @@
switch (flavour_name) // adding the actual reagents advertised in the ingredient list
if ("vanilla")
desc = "A delicious [cone_type] cone filled with vanilla ice cream. All the other ice creams take content from it."
- reagents.add_reagent("vanilla", 3)
+ reagents.add_reagent(/datum/reagent/consumable/vanilla, 3)
filling_color = "#ECE1C1"
if ("chocolate")
desc = "A delicious [cone_type] cone filled with chocolate ice cream. Surprisingly, made with real cocoa."
- reagents.add_reagent("cocoa", 3)
+ reagents.add_reagent(/datum/reagent/consumable/coco, 3)
filling_color = "#93673B"
if ("strawberry")
desc = "A delicious [cone_type] cone filled with strawberry ice cream. Definitely not made with real strawberries."
- reagents.add_reagent("berryjuice", 3)
+ reagents.add_reagent(/datum/reagent/consumable/berryjuice, 3)
filling_color = "#EFB4B4"
if ("peach")
desc = "A delicious [cone_type] cone filled with peach ice cream. Definitely made with real peaches!"
- reagents.add_reagent("peachjuice", 3)
+ reagents.add_reagent(/datum/reagent/consumable/peachjuice, 3)
filling_color = "#E78108"
if ("grape")
desc = "A delicious [cone_type] cone filled with grape ice cream. Surprisingly, made with real pink grape, likely not real sugarcanes used."
- reagents.add_reagent("grapejuice", 3)
+ reagents.add_reagent(/datum/reagent/consumable/grapejuice, 3)
filling_color = "#FF1493"
if ("blue")
desc = "A delicious [cone_type] cone filled with blue ice cream. Made with real... blue?"
- reagents.add_reagent("singulo", 3)
+ reagents.add_reagent(/datum/reagent/consumable/ethanol/singulo, 3)
filling_color = "#ACBCED"
if ("mob")
desc = "A suspicious [cone_type] cone filled with bright red ice cream. That's probably not strawberry..."
- reagents.add_reagent("liquidgibs", 3)
+ reagents.add_reagent(/datum/reagent/liquidgibs, 3)
filling_color = "#EFB4B4"
if ("custom")
if(R && R.total_volume >= 4) //consumable reagents have stronger taste so higher volume will allow non-food flavourings to break through better.
diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index 4efac6f508..e4d36b29d2 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -134,8 +134,8 @@
if(istype(O, /obj/item/reagent_containers/spray))
var/obj/item/reagent_containers/spray/clean_spray = O
- if(clean_spray.reagents.has_reagent("cleaner", clean_spray.amount_per_transfer_from_this))
- clean_spray.reagents.remove_reagent("cleaner", clean_spray.amount_per_transfer_from_this,1)
+ if(clean_spray.reagents.has_reagent(/datum/reagent/space_cleaner, clean_spray.amount_per_transfer_from_this))
+ clean_spray.reagents.remove_reagent(/datum/reagent/space_cleaner, clean_spray.amount_per_transfer_from_this,1)
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
user.visible_message("[user] has cleaned \the [src].", "
You clean \the [src].")
dirty = 0
diff --git a/code/modules/food_and_drinks/recipes/drinks_recipes.dm b/code/modules/food_and_drinks/recipes/drinks_recipes.dm
index 9dbddfb519..73d4a4f514 100644
--- a/code/modules/food_and_drinks/recipes/drinks_recipes.dm
+++ b/code/modules/food_and_drinks/recipes/drinks_recipes.dm
@@ -404,8 +404,8 @@
var/datum/reagent/consumable/ethanol/neurotoxin/Nt = locate(/datum/reagent/consumable/ethanol/neurotoxin) in my_atom.reagents.reagent_list
var/cached_volume = Nt.volume
if(Nt.purity < 0.5)
- holder.remove_reagent(src.id, cached_volume)
- holder.add_reagent("neuroweak", cached_volume)
+ holder.remove_reagent(type, cached_volume)
+ holder.add_reagent(/datum/reagent/consumable/ethanol/neuroweak, cached_volume)
*/
/datum/chemical_reaction/neurotoxin/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)//reduced size
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index d71e7c0f6a..f7294ff87a 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -95,7 +95,7 @@
last_poof = world.realtime
var/datum/reagents/R = new/datum/reagents(100)//Hey, just in case.
var/datum/effect_system/smoke_spread/chem/s = new()
- R.add_reagent("secretcatchem", 10)
+ R.add_reagent(/datum/reagent/fermi/secretcatchem, 10)
s.set_up(R, 0, loc)
s.start()
visible_message("
[src] disappears in a puff of smoke!")
@@ -181,7 +181,7 @@
visible_message("
[src] raises an eyebrown,
\"It's 4 candies for that [gender]! Thems the rules!\"")
return
visible_message("
[src] waves their arms around,
\"Off comes your head, a pumpkin taking it's stead!\"")
- C.reagents.add_reagent("pumpkinmutationtoxin", 5)
+ C.reagents.add_reagent(/datum/reagent/mutationtoxin/pumpkinhead, 5)
sleep(20)
poof()
return
@@ -340,7 +340,7 @@
C.equip_to_slot(jaqc_latern, SLOT_HEAD, 1, 1)
if(4)
visible_message("
[src] waves their arms around,
\"In your body there's something amiss, you'll find it's a chem made by my sis!\"")
- C.reagents.add_reagent("eigenstate", 30)
+ C.reagents.add_reagent(/datum/reagent/fermi/eigenstate, 30)
if(5)
visible_message("
[src] waves their arms around,
\"A new familiar for me, and you'll see it's thee!\"")
C.reagents.add_reagent("secretcatchem", 30)
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index e7faff0209..5bb2936c1e 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -9,7 +9,7 @@
disease_amount = 0
volume = 10
amount_per_transfer_from_this = 0
- list_reagents = list("honey" = 5)
+ list_reagents = list(/datum/reagent/consumable/honey = 5)
grind_results = list()
var/honey_color = ""
@@ -31,10 +31,10 @@
/obj/item/reagent_containers/honeycomb/proc/set_reagent(reagent)
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
- if(istype(R))
+ if(R)
name = "honeycomb ([R.name])"
honey_color = R.color
- reagents.add_reagent(R.id,5)
+ reagents.add_reagent(reagent,5)
else
honey_color = ""
update_icon()
\ No newline at end of file
diff --git a/code/modules/hydroponics/fermenting_barrel.dm b/code/modules/hydroponics/fermenting_barrel.dm
index e9001322d3..ab6625b46d 100644
--- a/code/modules/hydroponics/fermenting_barrel.dm
+++ b/code/modules/hydroponics/fermenting_barrel.dm
@@ -33,7 +33,7 @@
data["tastes"] = list(fruit.wine_flavor = 1)
else
data["tastes"] = list(fruit.tastes[1] = 1)
- reagents.add_reagent("fruit_wine", amount, data)
+ reagents.add_reagent(/datum/reagent/consumable/ethanol/fruit_wine, amount, data)
qdel(fruit)
playsound(src, 'sound/effects/bubbles.ogg', 50, TRUE)
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index 660f1e17e4..bfd4204912 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -148,16 +148,16 @@
if(grind_results&&grind_results.len)
for(var/i in 1 to grind_results.len)
grind_results[grind_results[i]] = nutriment
- reagents.del_reagent("nutriment")
- reagents.del_reagent("vitamin")
+ reagents.del_reagent(/datum/reagent/consumable/nutriment)
+ reagents.del_reagent(/datum/reagent/consumable/nutriment/vitamin)
/obj/item/reagent_containers/food/snacks/grown/on_juice()
- var/nutriment = reagents.get_reagent_amount("nutriment")
+ var/nutriment = reagents.get_reagent_amount(/datum/reagent/consumable/nutriment)
if(juice_results&&juice_results.len)
for(var/i in 1 to juice_results.len)
juice_results[juice_results[i]] = nutriment
- reagents.del_reagent("nutriment")
- reagents.del_reagent("vitamin")
+ reagents.del_reagent(/datum/reagent/consumable/nutriment)
+ reagents.del_reagent(/datum/reagent/consumable/nutriment/vitamin)
// For item-containing growns such as eggy or gatfruit
/obj/item/reagent_containers/food/snacks/grown/shell/attack_self(mob/user)
diff --git a/code/modules/hydroponics/grown/cocoa_vanilla.dm b/code/modules/hydroponics/grown/cocoa_vanilla.dm
index 44373515c6..7e8baa9487 100644
--- a/code/modules/hydroponics/grown/cocoa_vanilla.dm
+++ b/code/modules/hydroponics/grown/cocoa_vanilla.dm
@@ -97,7 +97,7 @@
/obj/item/reagent_containers/food/snacks/grown/bungopit/Initialize()
. =..()
reagents.clear_reagents()
- reagents.add_reagent("bungotoxin", seed.potency * 0.10) //More than this will kill at too low potency
- reagents.add_reagent("nutriment", seed.potency * 0.04)
+ reagents.add_reagent(/datum/reagent/toxin/bungotoxin, seed.potency * 0.10) //More than this will kill at too low potency
+ reagents.add_reagent(/datum/reagent/consumable/nutriment, seed.potency * 0.04)
diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm
index 6ceb69536d..7325dc5b5c 100644
--- a/code/modules/hydroponics/grown/kudzu.dm
+++ b/code/modules/hydroponics/grown/kudzu.dm
@@ -58,7 +58,7 @@
/obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/S)
var/list/temp_mut_list = list()
- if(S.has_reagent("sterilizine", 5))
+ if(S.has_reagent(/datum/reagent/space_cleaner/sterilizine, 5))
for(var/datum/spacevine_mutation/SM in mutations)
if(SM.quality == NEGATIVE)
temp_mut_list += SM
@@ -66,7 +66,7 @@
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()
- if(S.has_reagent("welding_fuel", 5))
+ if(S.has_reagent(/datum/reagent/fuel, 5))
for(var/datum/spacevine_mutation/SM in mutations)
if(SM.quality == POSITIVE)
temp_mut_list += SM
@@ -74,7 +74,7 @@
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()
- if(S.has_reagent("phenol", 5))
+ if(S.has_reagent(/datum/reagent/phenol, 5))
for(var/datum/spacevine_mutation/SM in mutations)
if(SM.quality == MINOR_NEGATIVE)
temp_mut_list += SM
@@ -82,16 +82,16 @@
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()
- if(S.has_reagent("blood", 15))
+ if(S.has_reagent(/datum/reagent/blood, 15))
adjust_production(rand(15, -5))
- if(S.has_reagent("amatoxin", 5))
+ if(S.has_reagent(/datum/reagent/toxin/amatoxin, 5))
adjust_production(rand(5, -15))
- if(S.has_reagent("plasma", 5))
+ if(S.has_reagent(/datum/reagent/toxin/plasma, 5))
adjust_potency(rand(5, -15))
- if(S.has_reagent("holywater", 10))
+ if(S.has_reagent(/datum/reagent/water/holywater, 10))
adjust_potency(rand(15, -5))
diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm
index bac480bee6..3769f9eacc 100644
--- a/code/modules/hydroponics/grown/replicapod.dm
+++ b/code/modules/hydroponics/grown/replicapod.dm
@@ -31,7 +31,7 @@
/obj/item/seeds/replicapod/on_reagent_change(changetype)
if(changetype == ADD_REAGENT)
- var/datum/reagent/blood/B = reagents.has_reagent("blood")
+ var/datum/reagent/blood/B = reagents.has_reagent(/datum/reagent/blood)
if(B)
if(B.data["mind"] && B.data["cloneable"])
mind = B.data["mind"]
@@ -47,7 +47,7 @@
else
visible_message("
The [src] rejects the sample!")
- if(!reagents.has_reagent("blood"))
+ if(!reagents.has_reagent(/datum/reagent/blood))
mind = null
ckey = null
realName = null
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 59a9725383..0b6834c408 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -470,7 +470,7 @@
myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines
// Requires 5 mutagen to possibly change species.// Poor man's mutagen.
- if(S.has_reagent("mutagen", 5) || S.has_reagent("radium", 10) || S.has_reagent("uranium", 10))
+ if(S.has_reagent(/datum/reagent/toxin/mutagen, 5) || S.has_reagent(/datum/reagent/radium, 10) || S.has_reagent(/datum/reagent/uranium, 10))
switch(rand(100))
if(91 to 100)
adjustHealth(-10)
@@ -491,214 +491,214 @@
to_chat(user, "
Nothing happens...")
// 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen
- else if(S.has_reagent("mutagen", 2) || S.has_reagent("radium", 5) || S.has_reagent("uranium", 5))
+ else if(S.has_reagent(/datum/reagent/toxin/mutagen, 2) || S.has_reagent(/datum/reagent/radium, 5) || S.has_reagent(/datum/reagent/uranium, 5))
hardmutate()
- else if(S.has_reagent("mutagen", 1) || S.has_reagent("radium", 2) || S.has_reagent("uranium", 2))
+ else if(S.has_reagent(/datum/reagent/toxin/mutagen, 1) || S.has_reagent(/datum/reagent/radium, 2) || S.has_reagent(/datum/reagent/uranium, 2))
mutate()
// After handling the mutating, we now handle the damage from adding crude radioactives...
- if(S.has_reagent("uranium", 1))
- adjustHealth(-round(S.get_reagent_amount("uranium") * 1))
- adjustToxic(round(S.get_reagent_amount("uranium") * 2))
- if(S.has_reagent("radium", 1))
- adjustHealth(-round(S.get_reagent_amount("radium") * 1))
- adjustToxic(round(S.get_reagent_amount("radium") * 3)) // Radium is harsher (OOC: also easier to produce)
+ if(S.has_reagent(/datum/reagent/uranium, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/uranium) * 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/uranium) * 2))
+ if(S.has_reagent(/datum/reagent/radium, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/radium) * 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/radium) * 3)) // Radium is harsher (OOC: also easier to produce)
// Nutriments
- if(S.has_reagent("eznutriment", 1))
+ if(S.has_reagent(/datum/reagent/plantnutriment/eznutriment, 1))
yieldmod = 1
mutmod = 1
- adjustNutri(round(S.get_reagent_amount("eznutriment") * 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/eznutriment) * 1))
- if(S.has_reagent("left4zednutriment", 1))
+ if(S.has_reagent(/datum/reagent/plantnutriment/left4zednutriment, 1))
yieldmod = 0
mutmod = 2
- adjustNutri(round(S.get_reagent_amount("left4zednutriment") * 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/left4zednutriment) * 1))
- if(S.has_reagent("robustharvestnutriment", 1))
+ if(S.has_reagent(/datum/reagent/plantnutriment/robustharvestnutriment, 1))
yieldmod = 1.3
mutmod = 0
- adjustNutri(round(S.get_reagent_amount("robustharvestnutriment") *1 ))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/robustharvestnutriment) *1 ))
// Ambrosia Gaia produces earthsblood.
- if(S.has_reagent("earthsblood"))
- self_sufficiency_progress += S.get_reagent_amount("earthsblood")
+ if(S.has_reagent(/datum/reagent/medicine/earthsblood))
+ self_sufficiency_progress += S.get_reagent_amount(/datum/reagent/medicine/earthsblood)
if(self_sufficiency_progress >= self_sufficiency_req)
become_self_sufficient()
else if(!self_sustaining)
to_chat(user, "
[src] warms as it might on a spring day under a genuine Sun.")
// Antitoxin binds shit pretty well. So the tox goes significantly down
- if(S.has_reagent("charcoal", 1))
- adjustToxic(-round(S.get_reagent_amount("charcoal") * 2))
+ if(S.has_reagent(/datum/reagent/medicine/charcoal, 1))
+ adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/charcoal) * 2))
// Toxins, not good for anything
- if(S.has_reagent("toxin", 1))
- adjustToxic(round(S.get_reagent_amount("toxin") * 2))
+ if(S.has_reagent(/datum/reagent/toxin, 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin) * 2))
// Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now...
- if(S.has_reagent("milk", 1))
- adjustNutri(round(S.get_reagent_amount("milk") * 0.1))
- adjustWater(round(S.get_reagent_amount("milk") * 0.9))
+ if(S.has_reagent(/datum/reagent/consumable/milk, 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.1))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.9))
// Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay?
- if(S.has_reagent("beer", 1))
- adjustHealth(-round(S.get_reagent_amount("beer") * 0.05))
- adjustNutri(round(S.get_reagent_amount("beer") * 0.25))
- adjustWater(round(S.get_reagent_amount("beer") * 0.7))
+ if(S.has_reagent(/datum/reagent/consumable/ethanol/beer, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.05))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.25))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.7))
// Fluorine one of the most corrosive and deadly gasses
- if(S.has_reagent("fluorine", 1))
- adjustHealth(-round(S.get_reagent_amount("fluorine") * 2))
- adjustToxic(round(S.get_reagent_amount("fluorine") * 2.5))
- adjustWater(-round(S.get_reagent_amount("fluorine") * 0.5))
+ if(S.has_reagent(/datum/reagent/fluorine, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 2))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/fluorine) * 2.5))
+ adjustWater(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 0.5))
adjustWeeds(-rand(1,4))
// Chlorine one of the most corrosive and deadly gasses
- if(S.has_reagent("chlorine", 1))
- adjustHealth(-round(S.get_reagent_amount("chlorine") * 1))
- adjustToxic(round(S.get_reagent_amount("chlorine") * 1.5))
- adjustWater(-round(S.get_reagent_amount("chlorine") * 0.5))
+ if(S.has_reagent(/datum/reagent/chlorine, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/chlorine) * 1.5))
+ adjustWater(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 0.5))
adjustWeeds(-rand(1,3))
// White Phosphorous + water -> phosphoric acid. That's not a good thing really.
// Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much.
- if(S.has_reagent("phosphorus", 1))
- adjustHealth(-round(S.get_reagent_amount("phosphorus") * 0.75))
- adjustNutri(round(S.get_reagent_amount("phosphorus") * 0.1))
- adjustWater(-round(S.get_reagent_amount("phosphorus") * 0.5))
+ if(S.has_reagent(/datum/reagent/phosphorus, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.75))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.1))
+ adjustWater(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.5))
adjustWeeds(-rand(1,2))
// Plants should not have sugar, they can't use it and it prevents them getting water/nutients, it is good for mold though...
- if(S.has_reagent("sugar", 1))
+ if(S.has_reagent(/datum/reagent/consumable/sugar, 1))
adjustWeeds(rand(1,2))
adjustPests(rand(1,2))
- adjustNutri(round(S.get_reagent_amount("sugar") * 0.1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sugar) * 0.1))
// It is water!
- if(S.has_reagent("water", 1))
- adjustWater(round(S.get_reagent_amount("water") * 1))
+ if(S.has_reagent(/datum/reagent/water, 1))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/water) * 1))
// Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~
- if(S.has_reagent("holywater", 1))
- adjustWater(round(S.get_reagent_amount("holywater") * 1))
- adjustHealth(round(S.get_reagent_amount("holywater") * 0.1))
+ if(S.has_reagent(/datum/reagent/water/holywater, 1))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 0.1))
// A variety of nutrients are dissolved in club soda, without sugar.
// These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth.
- if(S.has_reagent("sodawater", 1))
- adjustWater(round(S.get_reagent_amount("sodawater") * 1))
- adjustHealth(round(S.get_reagent_amount("sodawater") * 0.1))
- adjustNutri(round(S.get_reagent_amount("sodawater") * 0.1))
+ if(S.has_reagent(/datum/reagent/consumable/sodawater, 1))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1))
// Sulphuric Acid
- if(S.has_reagent("sacid", 1))
- adjustHealth(-round(S.get_reagent_amount("sacid") * 1))
- adjustToxic(round(S.get_reagent_amount("sacid") * 1.5))
+ if(S.has_reagent(/datum/reagent/toxin/acid, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1.5))
adjustWeeds(-rand(1,2))
// Acid
- if(S.has_reagent("facid", 1))
- adjustHealth(-round(S.get_reagent_amount("facid") * 2))
- adjustToxic(round(S.get_reagent_amount("facid") * 3))
+ if(S.has_reagent(/datum/reagent/toxin/acid/fluacid, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 2))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 3))
adjustWeeds(-rand(1,4))
// Plant-B-Gone is just as bad
- if(S.has_reagent("plantbgone", 1))
- adjustHealth(-round(S.get_reagent_amount("plantbgone") * 5))
- adjustToxic(round(S.get_reagent_amount("plantbgone") * 6))
+ if(S.has_reagent(/datum/reagent/toxin/plantbgone, 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 5))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 6))
adjustWeeds(-rand(4,8))
// Napalm, not known for being good for anything organic
- if(S.has_reagent("napalm", 1))
+ if(S.has_reagent(/datum/reagent/napalm, 1))
if(!(myseed.resistance_flags & FIRE_PROOF))
- adjustHealth(-round(S.get_reagent_amount("napalm") * 6))
- adjustToxic(round(S.get_reagent_amount("napalm") * 7))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7))
adjustWeeds(-rand(5,9))
//Weed Spray
- if(S.has_reagent("weedkiller", 1))
- adjustToxic(round(S.get_reagent_amount("weedkiller") * 0.5))
+ if(S.has_reagent(/datum/reagent/toxin/plantbgone/weedkiller, 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone/weedkiller) * 0.5))
//old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts
adjustWeeds(-rand(1,2))
//Pest Spray
- if(S.has_reagent("pestkiller", 1))
- adjustToxic(round(S.get_reagent_amount("pestkiller") * 0.5))
+ if(S.has_reagent(/datum/reagent/toxin/pestkiller, 1))
+ adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/pestkiller) * 0.5))
adjustPests(-rand(1,2))
// Healing
- if(S.has_reagent("cryoxadone", 1))
- adjustHealth(round(S.get_reagent_amount("cryoxadone") * 3))
- adjustToxic(-round(S.get_reagent_amount("cryoxadone") * 3))
+ if(S.has_reagent(/datum/reagent/medicine/cryoxadone, 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3))
+ adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3))
// Ammonia is bad ass.
- if(S.has_reagent("ammonia", 1))
- adjustHealth(round(S.get_reagent_amount("ammonia") * 0.5))
- adjustNutri(round(S.get_reagent_amount("ammonia") * 1))
+ if(S.has_reagent(/datum/reagent/ammonia, 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.5))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/ammonia) * 1))
if(myseed)
- myseed.adjust_yield(round(S.get_reagent_amount("ammonia") * 0.01))
+ myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.01))
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
- if(S.has_reagent("saltpetre", 1))
- var/salt = S.get_reagent_amount("saltpetre")
+ if(S.has_reagent(/datum/reagent/saltpetre, 1))
+ var/salt = S.get_reagent_amount(/datum/reagent/saltpetre)
adjustHealth(round(salt * 0.25))
if (myseed)
myseed.adjust_production(-round(salt/100)-prob(salt%100))
myseed.adjust_potency(round(salt*0.5))
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
- if(S.has_reagent("ash", 1))
- adjustHealth(round(S.get_reagent_amount("ash") * 0.25))
- adjustNutri(round(S.get_reagent_amount("ash") * 0.5))
+ if(S.has_reagent(/datum/reagent/ash, 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/ash) * 0.25))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/ash) * 0.5))
adjustWeeds(-1)
// Diethylamine is more bad ass, and pests get hurt by the corrosive nature of it, not the plant.
- if(S.has_reagent("diethylamine", 1))
- adjustHealth(round(S.get_reagent_amount("diethylamine") * 1))
- adjustNutri(round(S.get_reagent_amount("diethylamine") * 2))
+ if(S.has_reagent(/datum/reagent/diethylamine, 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 2))
if(myseed)
- myseed.adjust_yield(round(S.get_reagent_amount("diethylamine") * 0.02))
+ myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 0.02))
adjustPests(-rand(1,2))
// Nutriment Compost, effectively
- if(S.has_reagent("nutriment", 1))
- adjustHealth(round(S.get_reagent_amount("nutriment") * 0.5))
- adjustNutri(round(S.get_reagent_amount("nutriment") * 1))
+ if(S.has_reagent(/datum/reagent/consumable/nutriment, 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 0.5))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 1))
// Virusfood Compost for EVERYTHING
- if(S.has_reagent("virusfood", 1))
- adjustNutri(round(S.get_reagent_amount("virusfood") * 0.5))
- adjustHealth(-round(S.get_reagent_amount("virusfood") * 0.5))
+ if(S.has_reagent(/datum/reagent/toxin/mutagen/mutagenvirusfood, 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5))
// Blood
- if(S.has_reagent("blood", 1))
- adjustNutri(round(S.get_reagent_amount("blood") * 1))
+ if(S.has_reagent(/datum/reagent/blood, 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/blood) * 1))
adjustPests(rand(2,4))
// Strange reagent
- if(S.has_reagent("strangereagent", 1))
+ if(S.has_reagent(/datum/reagent/medicine/strange_reagent, 1))
spawnplant()
// Honey, Pests are dieing of sugar, so is the plant
- if(S.has_reagent("honey", 1))
+ if(S.has_reagent(/datum/reagent/consumable/honey, 1))
adjustPests(-rand(2,5))
- adjustHealth(-round(S.get_reagent_amount("honey") * 1))
+ adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/honey) * 1))
// Buzz Fuzz, a drink seemingly made for plants...
- if(S.has_reagent("buzz_fuzz", 1))
+ if(S.has_reagent(/datum/reagent/consumable/buzz_fuzz, 1))
adjustPests(-rand(2,5))
- adjustHealth(round(S.get_reagent_amount("buzz_fuzz") * 0.1))
- adjustNutri(round(S.get_reagent_amount("buzz_fuzz") * 0.5))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/buzz_fuzz) * 0.1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/buzz_fuzz) * 0.5))
// Adminordrazine the best stuff there is. For testing/debugging.
- if(S.has_reagent("adminordrazine", 1))
- adjustWater(round(S.get_reagent_amount("adminordrazine") * 1))
- adjustHealth(round(S.get_reagent_amount("adminordrazine") * 1))
- adjustNutri(round(S.get_reagent_amount("adminordrazine") * 1))
+ if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 1))
+ adjustWater(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
+ adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
+ adjustNutri(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
adjustPests(-rand(1,5))
adjustWeeds(-rand(1,5))
- if(S.has_reagent("adminordrazine", 5))
+ if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 5))
switch(rand(100))
if(66 to 100)
mutatespecie()
diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm
index 3597ed5be6..65230d1f21 100644
--- a/code/modules/hydroponics/plant_genes.dm
+++ b/code/modules/hydroponics/plant_genes.dm
@@ -228,7 +228,7 @@
var/obj/item/seeds/seed = G.seed
var/stun_len = seed.potency * rate
- if(!istype(G, /obj/item/grown/bananapeel) && (!G.reagents || !G.reagents.has_reagent("lube")))
+ if(!istype(G, /obj/item/grown/bananapeel) && (!G.reagents || !G.reagents.has_reagent(/datum/reagent/lube)))
stun_len /= 3
G.AddComponent(/datum/component/slippery, min(stun_len,140), NONE, CALLBACK(src, .proc/handle_slip, G))
@@ -412,7 +412,7 @@
pocell.name = "[G.name] battery"
pocell.desc = "A rechargeable plant-based power cell. This one has a rating of [DisplayEnergy(pocell.maxcharge)], and you should not swallow it."
- if(G.reagents.has_reagent("plasma", 2))
+ if(G.reagents.has_reagent(/datum/reagent/toxin/plasma, 2))
pocell.rigged = TRUE
qdel(G)
diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm
index 4132719389..1105a23ea5 100644
--- a/code/modules/hydroponics/seeds.dm
+++ b/code/modules/hydroponics/seeds.dm
@@ -195,7 +195,7 @@
var/list/data = null
if(rid == "blood") // Hack to make blood in plants always O-
data = list("blood_type" = "O-")
- if(rid == "nutriment" || rid == "vitamin")
+ if(rid == /datum/reagent/consumable/nutriment || rid == /datum/reagent/consumable/nutriment/vitamin)
// apple tastes of apple.
data = T.tastes
diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm
index 40ed235863..4b6b8723dd 100644
--- a/code/modules/integrated_electronics/passive/power.dm
+++ b/code/modules/integrated_electronics/passive/power.dm
@@ -96,7 +96,8 @@
activators = list("push ref" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
var/volume = 60
- var/list/fuel = list("plasma" = 50000, "welding_fuel" = 15000, "carbon" = 10000, "ethanol" = 10000, "nutriment" = 8000)
+ var/list/fuel = list(/datum/reagent/toxin/plasma = 50000, /datum/reagent/fuel = 15000, /datum/reagent/carbon = 10000,
+ /datum/reagent/consumable/ethanol = 10000, /datum/reagent/consumable/nutriment = 8000)
var/multi = 1
var/lfwb =TRUE
@@ -119,7 +120,7 @@
if(assembly)
if(assembly.battery)
var/bp = 5000
- if(reagents.get_reagent_amount("blood")) //only blood is powerful enough to power the station(c)
+ if(reagents.get_reagent_amount(/datum/reagent/blood)) //only blood is powerful enough to power the station(c)
var/datum/reagent/blood/B = locate() in reagents.reagent_list
if(lfwb)
if(B && B.data["cloneable"])
@@ -127,7 +128,7 @@
if(M && (M.stat != DEAD) && (M.client))
bp = 500000
if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > bp)
- if(reagents.remove_reagent("blood", 1))
+ if(reagents.remove_reagent(/datum/reagent/blood, 1))
assembly.give_power(bp)
for(var/I in fuel)
if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > fuel[I])
diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm
index 4077f21ea9..34b1fa392f 100644
--- a/code/modules/mining/lavaland/ash_flora.dm
+++ b/code/modules/mining/lavaland/ash_flora.dm
@@ -218,7 +218,7 @@
else if(contents.len >= 20)
to_chat(user, "
You can't add more ingredients to [src]!")
else
- if(reagents.has_reagent("water", 10)) //are we starting a soup or a salad?
+ if(reagents.has_reagent(/datum/reagent/water, 10)) //are we starting a soup or a salad?
var/obj/item/reagent_containers/food/snacks/customizable/A = new/obj/item/reagent_containers/food/snacks/customizable/soup/ashsoup(get_turf(src))
A.initialize_custom_food(src, S, user)
else
diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm
index 8195b3d84b..89c438f419 100644
--- a/code/modules/mob/living/blood.dm
+++ b/code/modules/mob/living/blood.dm
@@ -155,7 +155,7 @@
if(iscarbon(AM))
var/mob/living/carbon/C = AM
if(blood_id == C.get_blood_id())//both mobs have the same blood substance
- if(blood_id == "blood" || blood_id == "jellyblood") //normal blood
+ if(blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) //normal blood
if(blood_data["viruses"])
for(var/thing in blood_data["viruses"])
var/datum/disease/D = thing
diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm
index d1ace36b8c..4ed539adc2 100644
--- a/code/modules/mob/living/bloodcrawl.dm
+++ b/code/modules/mob/living/bloodcrawl.dm
@@ -73,7 +73,7 @@
if(victim.stat == CONSCIOUS)
src.visible_message("
[victim] kicks free of the blood pool just before entering it!", null, "
You hear splashing and struggling.")
- else if(victim.reagents && victim.reagents.has_reagent("demonsblood"))
+ else if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/consumable/ethanol/demonsblood))
visible_message("
Something prevents [victim] from entering the pool!", "
A strange force is blocking [victim] from entering!", "
You hear a splash and a thud.")
else
victim.forceMove(src)
@@ -104,7 +104,7 @@
if(!victim)
return FALSE
- if(victim.reagents && victim.reagents.has_reagent("devilskiss"))
+ if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/consumable/ethanol/devilskiss))
to_chat(src, "
AAH! THEIR FLESH! IT BURNS!")
adjustBruteLoss(25) //I can't use adjustHealth() here because bloodcrawl affects /mob/living and adjustHealth() only affects simple mobs
var/found_bloodpool = FALSE
diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm
index 48e79a9050..f2ea4f2b01 100644
--- a/code/modules/mob/living/brain/brain_item.dm
+++ b/code/modules/mob/living/brain/brain_item.dm
@@ -102,16 +102,16 @@
if(istype(O, /obj/item/organ_storage)) //BUG_PROBABLE_CAUSE
return //Borg organ bags shouldn't be killing brains
- if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains
+ if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent(/datum/reagent/medicine/neurine)) //Neurine fixes dead brains
. = TRUE //don't do attack animation.
var/cached_Bdamage = brainmob?.health
- var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine")
- var/datum/reagent/medicine/mannitol/M1 = reagents.has_reagent("mannitol")
+ var/datum/reagent/medicine/neurine/N = reagents.has_reagent(/datum/reagent/medicine/neurine)
+ var/datum/reagent/medicine/mannitol/M1 = reagents.has_reagent(/datum/reagent/medicine/mannitol)
- if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch.
+ if(O.reagents.has_reagent(/datum/reagent/medicine/mannitol))//Just a quick way to bolster the effects if someone mixes up a batch.
N.volume *= (M1.volume*0.5)
- if(!O.reagents.has_reagent("neurine", 10))
+ if(!O.reagents.has_reagent(/datum/reagent/medicine/neurine, 10))
to_chat(user, "
There's not enough neurine in [O] to restore [src]!")
return
@@ -134,14 +134,14 @@
gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
return
- if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("mannitol")) //attempt to heal the brain
+ if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent(/datum/reagent/medicine/mannitol)) //attempt to heal the brain
. = TRUE //don't do attack animation.
- var/datum/reagent/medicine/mannitol/M = reagents.has_reagent("mannitol")
+ var/datum/reagent/medicine/mannitol/M = reagents.has_reagent(/datum/reagent/medicine/mannitol)
if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing
to_chat(user, "
[src] is far too damaged, you'll have to use neurine on it!")
return
- if(!O.reagents.has_reagent("mannitol", 10))
+ if(!O.reagents.has_reagent(/datum/reagent/medicine/mannitol, 10))
to_chat(user, "
There's not enough mannitol in [O] to restore [src]!")
return
diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm
index e4e8f06cfa..35751e4b86 100644
--- a/code/modules/mob/living/carbon/alien/organs.dm
+++ b/code/modules/mob/living/carbon/alien/organs.dm
@@ -27,7 +27,7 @@
/obj/item/organ/alien/prepare_eat()
var/obj/S = ..()
- S.reagents.add_reagent("sacid", 10)
+ S.reagents.add_reagent(/datum/reagent/toxin/acid, 10)
return S
@@ -46,7 +46,7 @@
/obj/item/organ/alien/plasmavessel/prepare_eat()
var/obj/S = ..()
- S.reagents.add_reagent("plasma", storedPlasma/10)
+ S.reagents.add_reagent(/datum/reagent/toxin/plasma, storedPlasma/10)
return S
/obj/item/organ/alien/plasmavessel/large
diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
index 0bfd23cbff..4b9383eadf 100644
--- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
+++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
@@ -18,7 +18,7 @@
/obj/item/organ/body_egg/alien_embryo/prepare_eat()
var/obj/S = ..()
- S.reagents.add_reagent("sacid", 10)
+ S.reagents.add_reagent(/datum/reagent/toxin/acid, 10)
return S
/obj/item/organ/body_egg/alien_embryo/on_life()
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 6ecedba3be..b83bbb65f0 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -181,7 +181,7 @@
if(HAS_TRAIT(src, TRAIT_PACIFISM))
to_chat(src, "
You gently let go of [throwable_mob].")
return
-
+
adjustStaminaLossBuffered(25)//CIT CHANGE - throwing an entire person shall be very tiring
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
var/turf/end_T = get_turf(target)
@@ -517,7 +517,7 @@
add_splatter_floor(T)
if(stun)
adjustBruteLoss(3)
- else if(src.reagents.has_reagent("blazaam"))
+ else if(src.reagents.has_reagent(/datum/reagent/consumable/ethanol/blazaam))
if(T)
T.add_vomit_floor(src, VOMIT_PURPLE)
else
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index 9dcc5276e5..45e7637741 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -240,7 +240,7 @@
shock_damage *= dna.species.siemens_coeff
if(shock_damage<1 && !override)
return 0
- if(reagents.has_reagent("teslium"))
+ if(reagents.has_reagent(/datum/reagent/teslium))
shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
if(illusion)
adjustStaminaLoss(shock_damage)
@@ -316,18 +316,18 @@
else
return
-
+
else if(check_zone(M.zone_selected) == "r_arm" || check_zone(M.zone_selected) == "l_arm")
M.visible_message( \
"
[M] shakes [src]'s hand.", \
"
You shake [src]'s hand.", )
-
+
else if(check_zone(M.zone_selected) == "mouth") // I ADDED BOOP-EH-DEH-NOSEH - Jon
M.visible_message( \
"
[M] boops [src]'s nose.", \
"
You boop [src] on the nose.", )
playsound(src, 'sound/items/Nose_boop.ogg', 50, 0)
-
+
else
M.visible_message("
[M] hugs [src] to make [p_them()] feel better!", \
"
You hug [src] to make [p_them()] feel better!")
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 310ab6beeb..d1a483bb1d 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -255,7 +255,7 @@
else
msg += "
[t_He] [t_is] bleeding!\n"
- if(reagents.has_reagent("teslium"))
+ if(reagents.has_reagent(/datum/reagent/teslium))
msg += "[t_He] [t_is] emitting a gentle blue glow!\n"
if(islist(stun_absorption))
@@ -278,7 +278,7 @@
if(91.01 to INFINITY)
msg += "[t_He] [t_is] a shitfaced, slobbering wreck.\n"
- if(reagents.has_reagent("astral"))
+ if(reagents.has_reagent(/datum/reagent/fermi/astral))
if(mind)
msg += "[t_He] has wild, spacey eyes and they have a strange, abnormal look to them.\n"
else
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 67d7cb585e..e24f734a13 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1267,7 +1267,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
if(chem.id == exotic_blood)
H.blood_volume = min(H.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM)
- H.reagents.del_reagent(chem.id)
+ H.reagents.del_reagent(chem.type)
return 1
return FALSE
diff --git a/code/modules/mob/living/carbon/human/species_types/dwarves.dm b/code/modules/mob/living/carbon/human/species_types/dwarves.dm
index 946bffbdbc..9c28b8a0b7 100644
--- a/code/modules/mob/living/carbon/human/species_types/dwarves.dm
+++ b/code/modules/mob/living/carbon/human/species_types/dwarves.dm
@@ -7,18 +7,18 @@ GLOBAL_LIST_INIT(dwarf_last, world.file2list("strings/names/dwarf_last.txt")) //
id = "dwarf" //Also called Homo sapiens pumilionis
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,NO_UNDERWEAR)
- inherent_traits = list()
+ inherent_traits = list()
default_features = list("mcolor" = "FFF", "wings" = "None")
limbs_id = "human"
use_skintones = 1
say_mod = "bellows" //high energy, EXTRA BIOLOGICAL FUEL
- damage_overlay_type = "human"
+ damage_overlay_type = "human"
skinned_type = /obj/item/stack/sheet/animalhide/human
liked_food = ALCOHOL | MEAT | DAIRY //Dwarves like alcohol, meat, and dairy products.
disliked_food = JUNKFOOD | FRIED //Dwarves hate foods that have no nutrition other than alcohol.
mutant_organs = list(/obj/item/organ/dwarfgland) //Dwarven alcohol gland, literal gland warrior
mutantliver = /obj/item/organ/liver/dwarf //Dwarven super liver (Otherwise they r doomed)
-
+
/mob/living/carbon/human/species/dwarf //species admin spawn path
race = /datum/species/dwarf //and the race the path is set to.
@@ -30,7 +30,7 @@ GLOBAL_LIST_INIT(dwarf_last, world.file2list("strings/names/dwarf_last.txt")) //
/datum/species/dwarf/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
var/dwarf_hair = pick("Beard (Dwarf)", "Beard (Very Long)", "Beard (Long)") //beard roullette
- var/mob/living/carbon/human/H = C
+ var/mob/living/carbon/human/H = C
H.facial_hair_style = dwarf_hair
H.update_hair()
H.transform = H.transform.Scale(1, 0.8) //We use scale, and yeah. Dwarves can become gnomes with DWARFISM.
@@ -95,7 +95,7 @@ GLOBAL_LIST_INIT(dwarf_last, world.file2list("strings/names/dwarf_last.txt")) //
/obj/item/organ/dwarfgland/prepare_eat()
var/obj/S = ..()
- S.reagents.add_reagent("ethanol", stored_alcohol/10)
+ S.reagents.add_reagent(/datum/reagent/consumable/ethanol, stored_alcohol/10)
return S
/obj/item/organ/dwarfgland/on_life() //Primary loop to hook into to start delayed loops for other loops..
@@ -108,8 +108,8 @@ GLOBAL_LIST_INIT(dwarf_last, world.file2list("strings/names/dwarf_last.txt")) //
return //We make sure they are not dead, so they don't increment any tickers.
dwarf_eth_ticker++
dwarf_filth_ticker++
-
- if(dwarf_filth_ticker >= 4) //Should be around 4-8 seconds since a tick is around 2 seconds.
+
+ if(dwarf_filth_ticker >= 4) //Should be around 4-8 seconds since a tick is around 2 seconds.
dwarf_filth_cycle() //On_life will adjust regarding other factors, so we are along for the ride.
dwarf_filth_ticker = 0 //We set the ticker back to 0 to go again.
if(dwarf_eth_ticker >= 1) //Alcohol reagent check should be around 2 seconds, since a tick is around 2 seconds.
diff --git a/code/modules/mob/living/carbon/human/species_types/flypeople.dm b/code/modules/mob/living/carbon/human/species_types/flypeople.dm
index 0c3bcc2b00..426213161e 100644
--- a/code/modules/mob/living/carbon/human/species_types/flypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/flypeople.dm
@@ -13,9 +13,9 @@
exotic_bloodtype = "BUG"
/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "pestkiller")
+ if(chem.type == /datum/reagent/toxin/pestkiller)
H.adjustToxLoss(3)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
return 1
diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm
index 3d6c5092e1..1f681cda9f 100644
--- a/code/modules/mob/living/carbon/human/species_types/golems.dm
+++ b/code/modules/mob/living/carbon/human/species_types/golems.dm
@@ -305,9 +305,9 @@
H.take_overall_damage(2,0)
/datum/species/golem/wood/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "plantbgone")
+ if(chem.type == /datum/reagent/toxin/plantbgone)
H.adjustToxLoss(3)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
return 1
//Radioactive
@@ -619,14 +619,14 @@
C.RemoveSpell(dominate)
/datum/species/golem/runic/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "holywater")
+ if(chem.type == /datum/reagent/water/holywater)
H.adjustFireLoss(4)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
- if(chem.id == "unholywater")
+ if(chem.id == /datum/reagent/fuel/unholywater)
H.adjustBruteLoss(-4)
H.adjustFireLoss(-4)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
/datum/species/golem/clockwork
diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm
index ceadb28115..f42c36fe32 100644
--- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm
@@ -47,9 +47,9 @@
QDEL_NULL(mush)
/datum/species/mush/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "weedkiller")
+ if(chem.type == /datum/reagent/toxin/plantbgone/weedkiller)
H.adjustToxLoss(3)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
return TRUE
/datum/species/mush/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour)
diff --git a/code/modules/mob/living/carbon/human/species_types/podpeople.dm b/code/modules/mob/living/carbon/human/species_types/podpeople.dm
index f0dd48c6c1..66eb207670 100644
--- a/code/modules/mob/living/carbon/human/species_types/podpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/podpeople.dm
@@ -47,9 +47,9 @@
H.take_overall_damage(2,0)
/datum/species/pod/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "plantbgone")
+ if(chem.type == /datum/reagent/toxin/plantbgone)
H.adjustToxLoss(3)
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
return 1
/datum/species/pod/on_hit(obj/item/projectile/P, mob/living/carbon/human/H)
diff --git a/code/modules/mob/living/carbon/human/species_types/synths.dm b/code/modules/mob/living/carbon/human/species_types/synths.dm
index 5cd1a599ad..0335e08922 100644
--- a/code/modules/mob/living/carbon/human/species_types/synths.dm
+++ b/code/modules/mob/living/carbon/human/species_types/synths.dm
@@ -36,9 +36,9 @@
UnregisterSignal(H, COMSIG_MOB_SAY)
/datum/species/synth/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
- if(chem.id == "synthflesh")
+ if(chem.type == /datum/reagent/medicine/synthflesh)
chem.reaction_mob(H, TOUCH, 2 ,0) //heal a little
- H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
+ H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM)
return 1
else
return ..()
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 0061c7ed70..9e9d440574 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -80,7 +80,7 @@
//Second link in a breath chain, calls check_breath()
/mob/living/carbon/proc/breathe()
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
- if(reagents.has_reagent("lexorin"))
+ if(reagents.has_reagent(/datum/reagent/toxin/lexorin))
return
if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
return
@@ -156,7 +156,7 @@
//CRIT
if(!breath || (breath.total_moles() == 0) || !lungs)
- if(reagents.has_reagent("epinephrine") && lungs)
+ if(reagents.has_reagent(/datum/reagent/medicine/epinephrine) && lungs)
return
adjustOxyLoss(1)
@@ -357,7 +357,7 @@
return
// No decay if formaldehyde in corpse or when the corpse is charred
- if(reagents.has_reagent("formaldehyde", 15) || HAS_TRAIT(src, TRAIT_HUSK))
+ if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK))
return
// Also no decay if corpse chilled or not organic/undead
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index fe041dd0a6..14c3a76307 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -66,7 +66,7 @@
. = ..()
remove_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE)
var/amount
- if(reagents.has_reagent("morphine"))
+ if(reagents.has_reagent(/datum/reagent/medicine/morphine))
amount = -1
if(amount)
add_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 78542ab052..c2a307950c 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -1225,7 +1225,7 @@
clamp_unconscious_to = 0,
clamp_immobility_to = 0,
reset_misc = TRUE,
- healing_chems = list("inaprovaline" = 3, "synaptizine" = 10, "regen_jelly" = 10, "stimulants" = 10),
+ healing_chems = list(/datum/reagent/medicine/inaprovaline = 3, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/regen_jelly = 10, /datum/reagent/medicine/stimulants = 10),
message = "
You feel a surge of energy!",
stamina_buffer_boost = 0, //restores stamina buffer rather than just health
scale_stamina_loss_recovery, //defaults to null. if this is set, restores loss * this stamina. make sure it's a fraction.
@@ -1252,5 +1252,5 @@
updatehealth()
update_stamina()
update_canmove()
- for(var/chem in healing_chems)
- reagents.add_reagent(chem, healing_chems[chem])
+ if(healing_chems)
+ reagents.add_reagent_list(healing_chems)
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 722c984309..ab32f4d66e 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -369,7 +369,7 @@
to_chat(src, "
You resist Nar'Sie's influence... but not all of it. Run!")
adjustBruteLoss(35)
if(src && reagents)
- reagents.add_reagent("heparin", 5)
+ reagents.add_reagent(/datum/reagent/toxin/heparin, 5)
return FALSE
if(GLOB.cult_narsie && GLOB.cult_narsie.souls_needed[src])
GLOB.cult_narsie.souls_needed -= src
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index ece7fe9ecb..d934550149 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -751,17 +751,17 @@
var/obj/item/reagent_containers/O = locate(/obj/item/reagent_containers/food/condiment/enzyme) in basic_modules
var/obj/item/lightreplacer/LR = locate(/obj/item/lightreplacer) in basic_modules
if(O)
- O.reagents.add_reagent("enzyme", 2 * coeff)
+ O.reagents.add_reagent(/datum/reagent/consumable/enzyme, 2 * coeff)
if(LR)
for(var/i in 1 to coeff)
LR.Charge(R)
var/obj/item/reagent_containers/spray/cyborg_drying/CD = locate(/obj/item/reagent_containers/spray/cyborg_drying) in basic_modules
if(CD)
- CD.reagents.add_reagent("drying_agent", 5 * coeff)
+ CD.reagents.add_reagent(/datum/reagent/drying_agent, 5 * coeff)
var/obj/item/reagent_containers/spray/cyborg_lube/CL = locate(/obj/item/reagent_containers/spray/cyborg_lube) in emag_modules
if(CL)
- CL.reagents.add_reagent("lube", 2 * coeff)
+ CL.reagents.add_reagent(/datum/reagent/lube, 2 * coeff)
/obj/item/robot_module/butler/be_transformed_to(obj/item/robot_module/old_module)
var/mob/living/silicon/robot/R = loc
diff --git a/code/modules/mob/living/simple_animal/astral.dm b/code/modules/mob/living/simple_animal/astral.dm
index 3d0c335989..472cbd7414 100644
--- a/code/modules/mob/living/simple_animal/astral.dm
+++ b/code/modules/mob/living/simple_animal/astral.dm
@@ -44,7 +44,7 @@
if(isliving(A))
if(ishuman(A))
var/mob/living/carbon/human/H = A
- if(H.reagents.has_reagent("astral") && !H.mind)
+ if(H.reagents.has_reagent(/datum/reagent/fermi/astral) && !H.mind)
var/datum/reagent/fermi/astral/As = locate(/datum/reagent/fermi/astral) in H.reagents.reagent_list
if(As.originalmind == src.mind && As.current_cycle < 10 && H.stat != DEAD) //So you can return to your body.
to_chat(src, "
The intensity of the astrogen in your body is too much allow you to return to yourself yet!")
diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm
index fed770d0b0..13e9299b1d 100644
--- a/code/modules/mob/living/simple_animal/bot/medbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/medbot.dm
@@ -43,17 +43,17 @@
var/declare_cooldown = 0 //Prevents spam of critical patient alerts.
var/stationary_mode = 0 //If enabled, the Medibot will not move automatically.
//Setting which reagents to use to treat what by default. By id.
- var/treatment_brute_avoid = "tricordrazine"
- var/treatment_brute = "bicaridine"
+ var/treatment_brute_avoid = /datum/reagent/medicine/tricordrazine
+ var/treatment_brute = /datum/reagent/medicine/bicaridine
var/treatment_oxy_avoid = null
- var/treatment_oxy = "dexalin"
- var/treatment_fire_avoid = "tricordrazine"
- var/treatment_fire = "kelotane"
- var/treatment_tox_avoid = "tricordrazine"
- var/treatment_tox = "charcoal"
- var/treatment_tox_toxlover = "toxin"
+ var/treatment_oxy = /datum/reagent/medicine/dexalin
+ var/treatment_fire_avoid = /datum/reagent/medicine/tricordrazine
+ var/treatment_fire = /datum/reagent/medicine/kelotane
+ var/treatment_tox_avoid = /datum/reagent/medicine/tricordrazine
+ var/treatment_tox = /datum/reagent/medicine/charcoal
+ var/treatment_tox_toxlover = /datum/reagent/toxin
var/treatment_virus_avoid = null
- var/treatment_virus = "spaceacillin"
+ var/treatment_virus = /datum/reagent/medicine/spaceacillin
var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible.
var/shut_up = 0 //self explanatory :)
@@ -61,9 +61,9 @@
name = "\improper Mysterious Medibot"
desc = "International Medibot of mystery."
skin = "bezerk"
- treatment_brute = "tricordrazine"
- treatment_fire = "tricordrazine"
- treatment_tox = "tricordrazine"
+ treatment_brute = /datum/reagent/medicine/tricordrazine
+ treatment_fire = /datum/reagent/medicine/tricordrazine
+ treatment_tox = /datum/reagent/medicine/tricordrazine
/mob/living/simple_animal/bot/medbot/derelict
name = "\improper Old Medibot"
@@ -71,13 +71,13 @@
skin = "bezerk"
heal_threshold = 0
declare_crit = 0
- treatment_oxy = "pancuronium"
+ treatment_oxy = /datum/reagent/toxin/pancuronium
treatment_brute_avoid = null
- treatment_brute = "pancuronium"
+ treatment_brute = /datum/reagent/toxin/pancuronium
treatment_fire_avoid = null
- treatment_fire = "sodium_thiopental"
+ treatment_fire = /datum/reagent/toxin/sodium_thiopental
treatment_tox_avoid = null
- treatment_tox = "sodium_thiopental"
+ treatment_tox = /datum/reagent/toxin/sodium_thiopental
/mob/living/simple_animal/bot/medbot/update_icon()
cut_overlays()
@@ -369,8 +369,9 @@
//If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS.
if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15))))
- for(var/datum/reagent/R in reagent_glass.reagents.reagent_list)
- if(!C.reagents.has_reagent(R.id))
+ for(var/A in reagent_glass.reagents.reagent_list)
+ var/datum/reagent/R = A
+ if(!C.reagents.has_reagent(R.type))
return TRUE
//They're injured enough for it!
@@ -477,8 +478,9 @@
//If the patient is injured but doesn't have our special reagent in them then we should give it to them first
if(reagent_id && use_beaker && reagent_glass && reagent_glass.reagents.total_volume)
- for(var/datum/reagent/R in reagent_glass.reagents.reagent_list)
- if(!C.reagents.has_reagent(R.id))
+ for(var/A in reagent_glass.reagents.reagent_list)
+ var/datum/reagent/R = A
+ if(!C.reagents.has_reagent(R.type))
reagent_id = "internal_beaker"
break
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index c0a9a2082f..b033d4ecc0 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -54,7 +54,7 @@
var/atom/Tsec = drop_location()
new /obj/item/stock_parts/cell/potato(Tsec)
var/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/S = new(Tsec)
- S.reagents.add_reagent("whiskey", 15)
+ S.reagents.add_reagent(/datum/reagent/consumable/ethanol/whiskey, 15)
S.on_reagent_change(ADD_REAGENT)
..()
diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm
index 3cbf036270..53ec3a64d3 100644
--- a/code/modules/mob/living/simple_animal/friendly/cat.dm
+++ b/code/modules/mob/living/simple_animal/friendly/cat.dm
@@ -292,8 +292,8 @@
/mob/living/simple_animal/pet/cat/cak/attack_hand(mob/living/L)
..()
if(L.a_intent == INTENT_HARM && L.reagents && !stat)
- L.reagents.add_reagent("nutriment", 0.4)
- L.reagents.add_reagent("vitamin", 0.4)
+ L.reagents.add_reagent(/datum/reagent/consumable/nutriment, 0.4)
+ L.reagents.add_reagent(/datum/reagent/consumable/nutriment/vitamin, 0.4)
//Cat made
/mob/living/simple_animal/pet/cat/custom_cat
diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
index b2971e8d01..76f8093e38 100644
--- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
+++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
@@ -455,12 +455,12 @@
/obj/item/udder/Initialize()
create_reagents(50)
- reagents.add_reagent("milk", 20)
+ reagents.add_reagent(/datum/reagent/consumable/milk, 20)
. = ..()
/obj/item/udder/proc/generateMilk()
if(prob(5))
- reagents.add_reagent("milk", rand(5, 10))
+ reagents.add_reagent(/datum/reagent/consumable/milk, rand(5, 10))
/obj/item/udder/proc/milkAnimal(obj/O, mob/user)
var/obj/item/reagent_containers/glass/G = O
diff --git a/code/modules/mob/living/simple_animal/friendly/snake.dm b/code/modules/mob/living/simple_animal/friendly/snake.dm
index 2f37857902..95838c9acb 100644
--- a/code/modules/mob/living/simple_animal/friendly/snake.dm
+++ b/code/modules/mob/living/simple_animal/friendly/snake.dm
@@ -1,6 +1,6 @@
/mob/living/simple_animal/hostile/retaliate/poison
var/poison_per_bite = 0
- var/poison_type = "toxin"
+ var/poison_type = /datum/reagent/toxin
/mob/living/simple_animal/hostile/retaliate/poison/AttackingTarget()
. = ..()
diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm
index 89c4f70f69..d0497bf6ce 100644
--- a/code/modules/mob/living/simple_animal/hostile/bees.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bees.dm
@@ -140,7 +140,7 @@
var/mob/living/L = target
if(L.reagents)
beegent.reaction_mob(L, INJECT)
- L.reagents.add_reagent(beegent.id, rand(1,5))
+ L.reagents.add_reagent(beegent.type, rand(1,5))
/mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R)
@@ -225,7 +225,7 @@
if(. && beegent && isliving(target))
var/mob/living/L = target
beegent.reaction_mob(L, TOUCH)
- L.reagents.add_reagent(beegent.id, rand(1,5))
+ L.reagents.add_reagent(beegent.type, rand(1,5))
//PEASENT BEES
@@ -236,7 +236,7 @@
/mob/living/simple_animal/hostile/poison/bees/proc/reagent_incompatible(mob/living/simple_animal/hostile/poison/bees/B)
if(!B)
return FALSE
- if(B.beegent && beegent && B.beegent.id != beegent.id || B.beegent && !beegent || !B.beegent && beegent)
+ if(B.beegent && beegent && B.beegent.type != beegent.type || B.beegent && !beegent || !B.beegent && beegent)
return TRUE
return FALSE
@@ -253,9 +253,10 @@
/obj/item/queen_bee/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = I
- if(S.reagents.has_reagent("royal_bee_jelly")) //checked twice, because I really don't want royal bee jelly to be duped
- if(S.reagents.has_reagent("royal_bee_jelly",5))
- S.reagents.remove_reagent("royal_bee_jelly", 5)
+ var/jelly_amount = S.reagents.get_reagent_amount(/datum/reagent/royal_bee_jelly)
+ if(jelly_amount)
+ if(jelly_amount >= 5)
+ S.reagents.remove_reagent(/datum/reagent/royal_bee_jelly, 5)
var/obj/item/queen_bee/qb = new(user.drop_location())
qb.queen = new(qb)
if(queen && queen.beegent)
@@ -266,8 +267,8 @@
to_chat(user, "
You don't have enough royal bee jelly to split a bee in two!")
else
var/datum/reagent/R = GLOB.chemical_reagents_list[S.reagents.get_master_reagent_id()]
- if(R && S.reagents.has_reagent(R.id, 5))
- S.reagents.remove_reagent(R.id,5)
+ if(R && S.reagents.has_reagent(R.type, 5))
+ S.reagents.remove_reagent(R.type,5)
queen.assign_reagent(R)
user.visible_message("
[user] injects [src]'s genome with [R.name], mutating it's DNA!","
You inject [src]'s genome with [R.name], mutating it's DNA!")
name = queen.name
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index 69209f7266..2e7c0ff455 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -6,7 +6,7 @@
/mob/living/simple_animal/hostile/poison
var/poison_per_bite = 5
- var/poison_type = "toxin"
+ var/poison_type = /datum/reagent/toxin
/mob/living/simple_animal/hostile/poison/AttackingTarget()
. = ..()
@@ -158,7 +158,7 @@
melee_damage_upper = 1
poison_per_bite = 12
move_to_delay = 4
- poison_type = "venom" //all in venom, glass cannon. you bite 5 times and they are DEFINITELY dead, but 40 health and you are extremely obvious. Ambush, maybe?
+ poison_type = /datum/reagent/toxin/venom //all in venom, glass cannon. you bite 5 times and they are DEFINITELY dead, but 40 health and you are extremely obvious. Ambush, maybe?
speed = 1
gold_core_spawnable = NO_SPAWN
@@ -217,7 +217,7 @@
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
maxbodytemp = 1500
- poison_type = "frostoil"
+ poison_type = /datum/reagent/consumable/frostoil
color = rgb(114,228,250)
gold_core_spawnable = NO_SPAWN
@@ -226,7 +226,7 @@
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
maxbodytemp = 1500
- poison_type = "frostoil"
+ poison_type = /datum/reagent/consumable/frostoil
color = rgb(114,228,250)
gold_core_spawnable = NO_SPAWN
@@ -235,7 +235,7 @@
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
maxbodytemp = 1500
- poison_type = "frostoil"
+ poison_type = /datum/reagent/consumable/frostoil
color = rgb(114,228,250)
gold_core_spawnable = NO_SPAWN
diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
index d1e8f1f49e..68b5c123d7 100644
--- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
+++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
@@ -42,7 +42,7 @@
..()
if(iscarbon(target))
var/mob/living/carbon/C = target
- C.reagents.add_reagent("leaper_venom", 5)
+ C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5)
return
if(isanimal(target))
var/mob/living/simple_animal/L = target
@@ -96,7 +96,7 @@
L.Knockdown(50)
if(iscarbon(L))
var/mob/living/carbon/C = L
- C.reagents.add_reagent("leaper_venom", 5)
+ C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5)
if(isanimal(L))
var/mob/living/simple_animal/A = L
A.adjustHealth(25)
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
index 910e9c3c4a..9e9fbaeab8 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
@@ -131,7 +131,7 @@
/obj/item/udder/gutlunch/generateMilk()
if(prob(60))
- reagents.add_reagent("cream", rand(2, 5))
+ reagents.add_reagent(/datum/reagent/consumable/cream, rand(2, 5))
if(prob(45))
- reagents.add_reagent("salglu_solution", rand(2,5))
+ reagents.add_reagent(/datum/reagent/medicine/salglu_solution, rand(2,5))
diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm
index 514edf896b..47ad018b67 100644
--- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm
@@ -185,6 +185,6 @@
var/counter
for(counter=0, counter<=powerlevel, counter++)
var/obj/item/reagent_containers/food/snacks/hugemushroomslice/S = new /obj/item/reagent_containers/food/snacks/hugemushroomslice(src.loc)
- S.reagents.add_reagent("mushroomhallucinogen", powerlevel)
- S.reagents.add_reagent("omnizine", powerlevel)
- S.reagents.add_reagent("synaptizine", powerlevel)
+ S.reagents.add_reagent(/datum/reagent/drug/mushroomhallucinogen, powerlevel)
+ S.reagents.add_reagent(/datum/reagent/medicine/omnizine, powerlevel)
+ S.reagents.add_reagent(/datum/reagent/medicine/synaptizine, powerlevel)
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index d1e10ea693..333428b406 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -141,9 +141,9 @@
. = ..()
remove_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE)
var/amount = 0
- if(reagents.has_reagent("morphine")) // morphine slows slimes down
+ if(reagents.has_reagent(/datum/reagent/medicine/morphine)) // morphine slows slimes down
amount = 2
- if(reagents.has_reagent("frostoil")) // Frostoil also makes them move VEEERRYYYYY slow
+ if(reagents.has_reagent(/datum/reagent/consumable/frostoil)) // Frostoil also makes them move VEEERRYYYYY slow
amount = 5
if(amount)
add_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount)
diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm
index 816ae58749..89f5d20e70 100644
--- a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm
+++ b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm
@@ -4,7 +4,7 @@
if(!ninjacost(0,N_ADRENALINE))
var/mob/living/carbon/human/H = affecting
- H.do_adrenaline(150, TRUE, 0, 0, TRUE, list("inaprovaline" = 3, "synaptizine" = 10, "omnizine" = 10), "
You feel a sudden surge of energy!")
+ H.do_adrenaline(150, TRUE, 0, 0, TRUE, list(/datum/reagent/medicine/inaprovaline = 3, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/omnizine = 10), "
You feel a sudden surge of energy!")
H.say(pick("A CORNERED FOX IS MORE DANGEROUS THAN A JACKAL!","HURT ME MOOORRREEE!","IMPRESSIVE!"), forced = "ninjaboost")
@@ -15,5 +15,5 @@
/obj/item/clothing/suit/space/space_ninja/proc/ninjaboost_after()
var/mob/living/carbon/human/H = affecting
- H.reagents.add_reagent("radium", a_transfer)
+ H.reagents.add_reagent(/datum/reagent/radium, a_transfer)
to_chat(H, "
You are beginning to feel the after-effect of the injection.")
diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm
index 0496a2f1c3..ed920a57d1 100644
--- a/code/modules/ninja/suit/suit_attackby.dm
+++ b/code/modules/ninja/suit/suit_attackby.dm
@@ -5,13 +5,13 @@
return ..()
if(istype(I, /obj/item/reagent_containers/glass))//If it's a glass beaker.
- if(I.reagents.has_reagent("radium", a_transfer) && a_boost < a_maxamount)
- I.reagents.remove_reagent("radium", a_transfer)
+ if(I.reagents.has_reagent(/datum/reagent/radium, a_transfer) && a_boost < a_maxamount)
+ I.reagents.remove_reagent(/datum/reagent/radium, a_transfer)
a_boost++;
to_chat(U, "
There are now [a_boost] adrenaline boosts remaining.")
return
- if(I.reagents.has_reagent("smoke_powder", a_transfer) && s_bombs < s_maxamount)
- I.reagents.remove_reagent("smoke_powder", a_transfer)
+ if(I.reagents.has_reagent(/datum/reagent/smoke_powder, a_transfer) && s_bombs < s_maxamount)
+ I.reagents.remove_reagent(/datum/reagent/smoke_powder, a_transfer)
s_bombs++;
to_chat(U, "
There are now [s_bombs] smoke bombs remaining.")
return
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 7567fc1a52..d4d63b2e66 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -165,9 +165,9 @@
/obj/item/pen/sleepy/Initialize()
. = ..()
create_reagents(45, OPENCONTAINER)
- reagents.add_reagent("chloralhydrate", 20)
- reagents.add_reagent("mutetoxin", 15)
- reagents.add_reagent("tirizene", 10)
+ reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 20)
+ reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 15)
+ reagents.add_reagent(/datum/reagent/toxin/staminatoxin, 10)
/*
* (Alan) Edaggers
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index ded99d6fa6..4692a1a598 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -106,7 +106,7 @@
/obj/item/stock_parts/cell/on_reagent_change(changetype)
..()
- rigged = reagents?.has_reagent("plasma", 5) ? TRUE : FALSE //has_reagent returns the reagent datum
+ rigged = reagents?.has_reagent(/datum/reagent/toxin/plasma, 5) ? TRUE : FALSE //has_reagent returns the reagent datum
/obj/item/stock_parts/cell/proc/explode()
var/turf/T = get_turf(src.loc)
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index cdbaa29a3b..fbe262c5e3 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -789,7 +789,7 @@
to_chat(user, "
You inject the solution into \the [src].")
- if(S.reagents.has_reagent("plasma", 5))
+ if(S.reagents.has_reagent(/datum/reagent/toxin/plasma, 5))
rigged = 1
diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm
index ab463163f0..a8d3934208 100644
--- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm
+++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm
@@ -134,8 +134,8 @@
/obj/item/ammo_casing/shotgun/dart/bioterror/Initialize()
. = ..()
- reagents.add_reagent("neurotoxin", 6)
- reagents.add_reagent("spore", 6)
- reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT
- reagents.add_reagent("coniine", 6)
- reagents.add_reagent("sodium_thiopental", 6)
+ reagents.add_reagent(/datum/reagent/toxin/fentanyl, 6)
+ reagents.add_reagent(/datum/reagent/toxin/spore, 6)
+ reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 6) //;HELP OPS IN MAINT
+ reagents.add_reagent(/datum/reagent/toxin/coniine, 6)
+ reagents.add_reagent(/datum/reagent/toxin/sodium_thiopental, 6)
diff --git a/code/modules/projectiles/projectile/bullets/dart_syringe.dm b/code/modules/projectiles/projectile/bullets/dart_syringe.dm
index bdbf706448..5e32401645 100644
--- a/code/modules/projectiles/projectile/bullets/dart_syringe.dm
+++ b/code/modules/projectiles/projectile/bullets/dart_syringe.dm
@@ -31,9 +31,9 @@
/obj/item/projectile/bullet/dart/metalfoam/Initialize()
. = ..()
- reagents.add_reagent("aluminium", 15)
- reagents.add_reagent("foaming_agent", 5)
- reagents.add_reagent("facid", 5)
+ reagents.add_reagent(/datum/reagent/aluminium, 15)
+ reagents.add_reagent(/datum/reagent/foaming_agent, 5)
+ reagents.add_reagent(/datum/reagent/toxin/acid, 5)
/obj/item/projectile/bullet/dart/syringe
name = "syringe"
@@ -52,20 +52,19 @@
if(blocked != 100)
if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..(target, blocked, TRUE)
- for(var/datum/reagent/R in reagents.reagent_list) //OD prevention time!
- if(istype(R, /datum/reagent/medicine)) //Is this a medicine?
- if(M.reagents.has_reagent(R.id))
- if(R.overdose_threshold == 0 || emptrig == TRUE) //Is there a possible OD?
- M.reagents.add_reagent(R.id, R.volume)
- else
- var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - M.reagents.get_reagent_amount(R.id)) -1)
- M.reagents.add_reagent(R.id, transVol)
+ for(var/datum/reagent/medicine/R in reagents.reagent_list) //OD prevention time!
+ if(M.reagents.has_reagent(R.type))
+ if(R.overdose_threshold == 0 || emptrig == TRUE) //Is there a possible OD?
+ M.reagents.add_reagent(R.type, R.volume)
else
- if(!R.overdose_threshold == 0)
- var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1)
- M.reagents.add_reagent(R.id, transVol)
- else
- M.reagents.add_reagent(R.id, R.volume)
+ var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - M.reagents.get_reagent_amount(R.id)) -1)
+ M.reagents.add_reagent(R.type, transVol)
+ else
+ if(!R.overdose_threshold == 0)
+ var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1)
+ M.reagents.add_reagent(R.type, transVol)
+ else
+ M.reagents.add_reagent(R.type, R.volume)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index efb6bdecfd..15a62825e7 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -332,11 +332,11 @@
//Description, OD, Addict, Meta
outstring += "[R.description] |
- Metabolism rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
- if(R.impure_chem && R.impure_chem != "fermiTox")
+ if(R.impure_chem && R.impure_chem != /datum/reagent/impure/fermiTox)
R3 = GLOB.chemical_reagents_list[R.impure_chem]
outstring += "- Impure chem:[R3.name]
"
- if(R.inverse_chem && R.impure_chem != "fermiTox")
+ if(R.inverse_chem && R.impure_chem != /datum/reagent/impure/fermiTox)
R3 = GLOB.chemical_reagents_list[R.inverse_chem]
outstring += "- Inverse chem:[R3.name]
[(R3.inverse_chem_val?"- Inverse purity: [R3.inverse_chem_val]
":"")] "
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index d540cd02fe..bf3c4220b4 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -11,13 +11,13 @@
for(var/path in paths)
var/datum/reagent/D = new path()
- GLOB.chemical_reagents_list[D.id] = D
+ GLOB.chemical_reagents_list[path] = D
/proc/build_chemical_reactions_list()
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list
// It is filtered into multiple lists within a list.
// For example:
- // chemical_reaction_list["plasma"] is a list of all reactions relating to plasma
+ // chemical_reaction_list[/datum/reagent/toxin/plasma] is a list of all reactions relating to plasma
if(GLOB.chemical_reactions_list)
return
@@ -32,14 +32,11 @@
var/datum/chemical_reaction/D = new path()
var/list/reaction_ids = list()
- if(!D.id)
- continue
-
if(D.required_reagents && D.required_reagents.len)
for(var/reaction in D.required_reagents)
reaction_ids += reaction
- // Create filters based on each reagent id in the required reagents list
+ // Create filters based on each reagent type in the required reagents list
for(var/id in reaction_ids)
if(!GLOB.chemical_reactions_list[id])
GLOB.chemical_reactions_list[id] = list()
@@ -63,7 +60,7 @@
var/targetVol = 0 //the target volume, i.e. the total amount that can be created during a fermichem reaction.
var/reactedVol = 0 //how much of the reagent is reacted during a fermireaction
var/fermiIsReacting = FALSE //that prevents multiple reactions from occurring (i.e. add_reagent calls to process_reactions(), this stops any extra reactions.)
- var/fermiReactID //ID of the chem being made during a fermireaction, kept here so it's cache isn't lost between loops/procs.
+ var/fermiReactID //instance of the chem reaction used during a fermireaction, kept here so it's cache isn't lost between loops/procs.
/datum/reagents/New(maximum=100, new_flags)
maximum_volume = maximum
@@ -96,7 +93,7 @@
var/list/data = list()
for(var/r in reagent_list) //no reagents will be left behind
var/datum/reagent/R = r
- data += "[R.id] ([round(R.volume, CHEMICAL_QUANTISATION_LEVEL)]u)"
+ data += "[R.type] ([round(R.volume, CHEMICAL_QUANTISATION_LEVEL)]u)"
//Using IDs because SOME chemicals (I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
return english_list(data)
@@ -117,7 +114,7 @@
current_list_element = 1
var/datum/reagent/R = cached_reagents[current_list_element]
- remove_reagent(R.id, 1)
+ remove_reagent(R.type, 1)
current_list_element++
total_transfered++
@@ -132,7 +129,7 @@
var/part = amount / total_volume
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- remove_reagent(R.id, R.volume * part, ignore_pH = TRUE)
+ remove_reagent(R.type, R.volume * part, ignore_pH = TRUE)
pH = REAGENT_NORMAL_PH
update_total()
handle_reactions()
@@ -152,15 +149,15 @@
/datum/reagents/proc/get_master_reagent_id()
var/list/cached_reagents = reagent_list
- var/id
+ var/max_type
var/max_volume = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
if(R.volume > max_volume)
max_volume = R.volume
- id = R.id
+ max_type = R.type
- return id
+ return max_type
/datum/reagents/proc/get_master_reagent()
var/list/cached_reagents = reagent_list
@@ -198,9 +195,9 @@
trans_data = copy_data(T)
- R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
+ R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
- remove_reagent(T.id, transfer_amount, ignore_pH = TRUE)
+ remove_reagent(T.type, transfer_amount, ignore_pH = TRUE)
update_total()
R.update_total()
@@ -232,7 +229,7 @@
var/copy_amount = T.volume * part
if(preserve_data)
trans_data = T.data
- R.add_reagent(T.id, copy_amount * multiplier, trans_data)
+ R.add_reagent(T.type, copy_amount * multiplier, trans_data)
src.update_total()
R.update_total()
@@ -256,12 +253,12 @@
var/trans_data = null
for (var/CR in cached_reagents)
var/datum/reagent/current_reagent = CR
- if(current_reagent.id == reagent)
+ if(current_reagent.type == reagent)
if(preserve_data)
trans_data = current_reagent.data
- R.add_reagent(current_reagent.id, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
+ R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
- remove_reagent(current_reagent.id, amount, 1)
+ remove_reagent(current_reagent.type, amount, 1)
break
src.update_total()
@@ -313,18 +310,21 @@
var/datum/reagent/R = addiction
if(C && R)
R.addiction_stage++
- if(1 <= R.addiction_stage && R.addiction_stage <= R.addiction_stage1_end)
- need_mob_update += R.addiction_act_stage1(C)
- else if(R.addiction_stage1_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage2_end)
- need_mob_update += R.addiction_act_stage2(C)
- else if(R.addiction_stage2_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage3_end)
- need_mob_update += R.addiction_act_stage3(C)
- else if(R.addiction_stage3_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage4_end)
- need_mob_update += R.addiction_act_stage4(C)
- else if(R.addiction_stage4_end <= R.addiction_stage)
- to_chat(C, "You feel like you've gotten over your need for [R.name].")
- SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.id]_addiction")
- cached_addictions.Remove(R)
+ switch(R.addiction_stage)
+ if(1 to R.addiction_stage1_end)
+ need_mob_update += R.addiction_act_stage1(C)
+ if(R.addiction_stage1_end to R.addiction_stage2_end)
+ need_mob_update += R.addiction_act_stage2(C)
+ if(R.addiction_stage2_end to R.addiction_stage3_end)
+ need_mob_update += R.addiction_act_stage3(C)
+ if(R.addiction_stage3_end to R.addiction_stage4_end)
+ need_mob_update += R.addiction_act_stage4(C)
+ if(R.addiction_stage4_end to INFINITY)
+ to_chat(C, "You feel like you've gotten over your need for [R.name].")
+ SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_addiction")
+ cached_addictions.Remove(R)
+ else
+ SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose")
addiction_tick++
if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates.
C.updatehealth()
@@ -381,7 +381,7 @@
reaction_occurred = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- for(var/reaction in cached_reactions[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id
+ for(var/reaction in cached_reactions[R.type]) // Was a big list but now it should be smaller since we filtered it with our reagent type
if(!reaction)
continue
@@ -630,7 +630,7 @@
deltapH = 1
//This should never proc:
else
- WARNING("[my_atom] attempted to determine FermiChem pH for '[C.id]' which broke for some reason! ([usr])")
+ WARNING("[my_atom] attempted to determine FermiChem pH for '[C.type]' which broke for some reason! ([usr])")
//Calculate DeltaT (Deviation of T from optimal)
if (cached_temp < C.OptimalTempMax && cached_temp >= C.OptimalTempMin)
@@ -679,7 +679,7 @@
//Above should reduce yeild based on holder purity.
//Purity Check
for(var/datum/reagent/R in my_atom.reagents.reagent_list)
- if(P == R.id)
+ if(P == R.type)
if (R.purity < C.PurityMin)//If purity is below the min, blow it up.
fermiIsReacting = FALSE
SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[P] explosion"))
@@ -724,7 +724,7 @@
return cachedPurity/i
/datum/reagents/proc/uncache_purity(id)
- var/datum/reagent/R = has_reagent("[id]")
+ var/datum/reagent/R = has_reagent(id)
if(!R)
return
if(R.cached_purity == 1)
@@ -735,15 +735,15 @@
var/list/cached_reagents = reagent_list
for(var/_reagent in cached_reagents)
var/datum/reagent/R = _reagent
- if(R.id != reagent)
- del_reagent(R.id)
+ if(R.type != reagent)
+ del_reagent(R.type)
update_total()
/datum/reagents/proc/del_reagent(reagent)
var/list/cached_reagents = reagent_list
for(var/_reagent in cached_reagents)
var/datum/reagent/R = _reagent
- if(R.id == reagent)
+ if(R.type == reagent)
if(my_atom && isliving(my_atom))
var/mob/living/M = my_atom
if(R.metabolizing)
@@ -763,9 +763,9 @@
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
if(R.volume <= 0)//For clarity
- del_reagent(R.id)
+ del_reagent(R.type)
if((R.volume < 0.01) && !fermiIsReacting)
- del_reagent(R.id)
+ del_reagent(R.type)
else
total_volume += R.volume
if(!reagent_list || !total_volume)
@@ -776,7 +776,7 @@
var/list/cached_reagents = reagent_list
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- del_reagent(R.id)
+ del_reagent(R.type)
pH = REAGENT_NORMAL_PH
return 0
@@ -842,13 +842,13 @@
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
return FALSE
- if (D.id == "water" && !no_react && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany.
+ if (D.type == /datum/reagent/water && !no_react && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany.
if (pH < 2)
SSblackbox.record_feedback("tally", "fermi_chem", 1, "water-acid explosions")
var/datum/effect_system/smoke_spread/chem/s = new
var/turf/T = get_turf(my_atom)
var/datum/reagents/R = new/datum/reagents(3000)
- R.add_reagent("fermiAcid", amount)
+ R.add_reagent(/datum/reagent/fermi/fermiAcid, amount)
for (var/datum/reagent/reagentgas in reagent_list)
R.add_reagent(reagentgas, amount/5)
remove_reagent(reagentgas, amount/5)
@@ -895,7 +895,7 @@
//add the reagent to the existing if it exists
for(var/A in cached_reagents)
var/datum/reagent/R = A
- if (R.id == reagent) //IF MERGING
+ if (R.type == reagent) //IF MERGING
//Add amount and equalize purity
R.volume += round(amount, CHEMICAL_QUANTISATION_LEVEL)
R.purity = ((R.purity * R.volume) + (other_purity * amount)) /((R.volume + amount)) //This should add the purity to the product
@@ -937,7 +937,7 @@
return TRUE
-/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list("toxin" = 10, "beer" = 15)
+/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list(/datum/reagent/toxin = 10, /datum/reagent/consumable/ethanol/beer = 15)
for(var/r_id in list_reagents)
var/amt = list_reagents[r_id]
add_reagent(r_id, amt, data)
@@ -959,7 +959,7 @@
for(var/A in cached_reagents)
var/datum/reagent/R = A
- if (R.id == reagent)
+ if (R.type == reagent)
if((total_volume - amount) <= 0)//Because this can result in 0, I don't want it to crash.
pH = REAGENT_NORMAL_PH
//In practice this is really confusing and players feel like it randomly melts their beakers, but I'm not sure how else to handle it. We'll see how it goes and I can remove this if it confuses people.
@@ -986,7 +986,7 @@
var/list/cached_reagents = reagent_list
for(var/_reagent in cached_reagents)
var/datum/reagent/R = _reagent
- if (R.id == reagent)
+ if (R.type == reagent)
if(!amount)
return R
else
@@ -1001,7 +1001,7 @@
var/list/cached_reagents = reagent_list
for(var/_reagent in cached_reagents)
var/datum/reagent/R = _reagent
- if (R.id == reagent)
+ if (R.type == reagent)
return round(R.volume, CHEMICAL_QUANTISATION_LEVEL)
return 0
@@ -1034,7 +1034,7 @@
// We found a match, proceed to remove the reagent. Keep looping, we might find other reagents of the same type.
if(matches)
// Have our other proc handle removement
- has_removed_reagent = remove_reagent(R.id, amount, safety)
+ has_removed_reagent = remove_reagent(R.type, amount, safety)
return has_removed_reagent
@@ -1043,14 +1043,14 @@
var/list/cached_reagents = reagent_list
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- if(R.id == reagent_id)
+ if(R.type == reagent_id)
return R.data
/datum/reagents/proc/set_data(reagent_id, new_data)
var/list/cached_reagents = reagent_list
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- if(R.id == reagent_id)
+ if(R.type == reagent_id)
R.data = new_data
/datum/reagents/proc/copy_data(datum/reagent/current_reagent)
@@ -1143,12 +1143,12 @@
reagents = new/datum/reagents(max_vol, flags)
reagents.my_atom = src
-/proc/get_random_reagent_id() // Returns a random reagent ID minus blacklisted reagents
+/proc/get_random_reagent_id() // Returns a random reagent type minus blacklisted reagents
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.can_synth))
- random_reagents += initial(R.id)
+ random_reagents += R
var/picked_reagent = pick(random_reagents)
return picked_reagent
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index 2c5d7aa3e2..256f86bb53 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -1,3 +1,16 @@
+/proc/translate_legacy_chem_id(id)
+ switch (id)
+ if ("sacid")
+ return "sulphuricacid"
+ if ("facid")
+ return "fluorosulfuricacid"
+ if ("co2")
+ return "carbondioxide"
+ if ("mine_salve")
+ return "minerssalve"
+ else
+ return ckey(id)
+
/obj/machinery/chem_dispenser
name = "chem dispenser"
desc = "Creates and dispenses chemicals."
@@ -21,65 +34,66 @@
var/macrotier = 1
var/obj/item/reagent_containers/beaker = null
var/list/dispensable_reagents = list(
- "hydrogen",
- "lithium",
- "carbon",
- "nitrogen",
- "oxygen",
- "fluorine",
- "sodium",
- "aluminium",
- "silicon",
- "phosphorus",
- "sulfur",
- "chlorine",
- "potassium",
- "iron",
- "copper",
- "mercury",
- "radium",
- "water",
- "ethanol",
- "sugar",
- "sacid",
- "welding_fuel",
- "silver",
- "iodine",
- "bromine",
- "stable_plasma"
+ /datum/reagent/hydrogen,
+ /datum/reagent/lithium,
+ /datum/reagent/carbon,
+ /datum/reagent/nitrogen,
+ /datum/reagent/oxygen,
+ /datum/reagent/fluorine,
+ /datum/reagent/sodium,
+ /datum/reagent/aluminium,
+ /datum/reagent/silicon,
+ /datum/reagent/phosphorus,
+ /datum/reagent/sulfur,
+ /datum/reagent/chlorine,
+ /datum/reagent/potassium,
+ /datum/reagent/iron,
+ /datum/reagent/copper,
+ /datum/reagent/mercury,
+ /datum/reagent/radium,
+ /datum/reagent/water,
+ /datum/reagent/consumable/ethanol,
+ /datum/reagent/consumable/sugar,
+ /datum/reagent/toxin/acid,
+ /datum/reagent/fuel,
+ /datum/reagent/silver,
+ /datum/reagent/iodine,
+ /datum/reagent/bromine,
+ /datum/reagent/stable_plasma
)
//these become available once upgraded.
var/list/upgrade_reagents = list(
- "oil",
- "ammonia",
- "ash"
+ /datum/reagent/oil,
+ /datum/reagent/ammonia,
+ /datum/reagent/ash
)
var/list/upgrade_reagents2 = list(
- "acetone",
- "phenol",
- "diethylamine"
+ /datum/reagent/acetone,
+ /datum/reagent/phenol,
+ /datum/reagent/diethylamine
)
var/list/upgrade_reagents3 = list(
- "mine_salve",
- "toxin"
+ /datum/reagent/medicine/mine_salve,
+ /datum/reagent/toxin
)
var/list/emagged_reagents = list(
- "space_drugs",
- "plasma",
- "frostoil",
- "carpotoxin",
- "histamine",
- "morphine"
+ /datum/reagent/drug/space_drugs,
+ /datum/reagent/toxin/plasma,
+ /datum/reagent/consumable/frostoil,
+ /datum/reagent/toxin/carpotoxin,
+ /datum/reagent/toxin/histamine,
+ /datum/reagent/medicine/morphine
)
var/list/saved_recipes = list()
/obj/machinery/chem_dispenser/Initialize()
. = ..()
- dispensable_reagents = sortList(dispensable_reagents)
+ for(var/list/L in list(dispensable_reagents, emagged_reagents, upgrade_reagents, upgrade_reagents2, upgrade_reagents3))
+ L = sortList(L, /proc/cmp_reagents_asc)
update_icon()
/obj/machinery/chem_dispenser/Destroy()
@@ -235,7 +249,7 @@
if("dispense")
if(!is_operational() || QDELETED(cell))
return
- var/reagent = params["reagent"]
+ var/reagent = GLOB.name2reagent[params["reagent"]]
if(beaker && dispensable_reagents.Find(reagent))
var/datum/reagents/R = beaker.reagents
var/free = R.maximum_volume - R.total_volume
@@ -267,7 +281,7 @@
var/res = get_macro_resolution()
for(var/key in chemicals_to_dispense) // i suppose you could edit the list locally before passing it
var/list/keysplit = splittext(key," ")
- var/r_id = keysplit[1]
+ var/r_id = GLOB.name2reagent[translate_legacy_chem_id(keysplit[1])]
if(beaker && dispensable_reagents.Find(r_id)) // but since we verify we have the reagent, it'll be fine
var/datum/reagents/R = beaker.reagents
var/free = R.maximum_volume - R.total_volume
@@ -299,7 +313,8 @@
var/resmismatch = FALSE
for(var/reagents in first_process)
var/list/reagent = splittext(reagents, "=")
- if(dispensable_reagents.Find(reagent[1]))
+ var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent[1])]
+ if(dispensable_reagents.Find(reagent_id))
if (!resmismatch && !check_macro_part(reagents, res))
resmismatch = TRUE
continue
@@ -475,45 +490,45 @@
nopower_state = null
pass_flags = PASSTABLE
dispensable_reagents = list(
- "water",
- "ice",
- "coffee",
- "cream",
- "tea",
- "icetea",
- "cola",
- "spacemountainwind",
- "dr_gibb",
- "space_up",
- "tonic",
- "sodawater",
- "lemon_lime",
- "pwr_game",
- "shamblers",
- "sugar",
- "orangejuice",
- "grenadine",
- "limejuice",
- "tomatojuice",
- "lemonjuice",
- "menthol"
+ /datum/reagent/water,
+ /datum/reagent/consumable/ice,
+ /datum/reagent/consumable/coffee,
+ /datum/reagent/consumable/cream,
+ /datum/reagent/consumable/tea,
+ /datum/reagent/consumable/icetea,
+ /datum/reagent/consumable/space_cola,
+ /datum/reagent/consumable/spacemountainwind,
+ /datum/reagent/consumable/dr_gibb,
+ /datum/reagent/consumable/space_up,
+ /datum/reagent/consumable/tonic,
+ /datum/reagent/consumable/sodawater,
+ /datum/reagent/consumable/lemon_lime,
+ /datum/reagent/consumable/pwr_game,
+ /datum/reagent/consumable/shamblers,
+ /datum/reagent/consumable/sugar,
+ /datum/reagent/consumable/orangejuice,
+ /datum/reagent/consumable/grenadine,
+ /datum/reagent/consumable/limejuice,
+ /datum/reagent/consumable/tomatojuice,
+ /datum/reagent/consumable/lemonjuice,
+ /datum/reagent/consumable/menthol
)
upgrade_reagents = list(
- "mushroomhallucinogen",
- "nothing",
- "cryoxadone"
+ /datum/reagent/drug/mushroomhallucinogen,
+ /datum/reagent/consumable/nothing,
+ /datum/reagent/medicine/cryoxadone
)
upgrade_reagents2 = list(
- "banana",
- "berryjuice"
+ /datum/reagent/consumable/banana,
+ /datum/reagent/consumable/berryjuice
)
upgrade_reagents3 = null
emagged_reagents = list(
- "thirteenloko",
- "changelingsting",
- "whiskeycola",
- "mindbreaker",
- "tirizene"
+ /datum/reagent/consumable/ethanol/thirteenloko,
+ /datum/reagent/consumable/ethanol/changelingsting,
+ /datum/reagent/consumable/ethanol/whiskey_cola,
+ /datum/reagent/toxin/mindbreaker,
+ /datum/reagent/toxin/staminatoxin
)
@@ -542,39 +557,39 @@
icon_state = "booze_dispenser"
circuit = /obj/item/circuitboard/machine/chem_dispenser/drinks/beer
dispensable_reagents = list(
- "beer",
- "kahlua",
- "whiskey",
- "wine",
- "vodka",
- "gin",
- "rum",
- "tequila",
- "vermouth",
- "cognac",
- "ale",
- "absinthe",
- "hcider",
- "creme_de_menthe",
- "creme_de_cacao",
- "triple_sec",
- "sake",
- "applejack"
+ /datum/reagent/consumable/ethanol/beer,
+ /datum/reagent/consumable/ethanol/kahlua,
+ /datum/reagent/consumable/ethanol/whiskey,
+ /datum/reagent/consumable/ethanol/wine,
+ /datum/reagent/consumable/ethanol/vodka,
+ /datum/reagent/consumable/ethanol/gin,
+ /datum/reagent/consumable/ethanol/rum,
+ /datum/reagent/consumable/ethanol/tequila,
+ /datum/reagent/consumable/ethanol/vermouth,
+ /datum/reagent/consumable/ethanol/cognac,
+ /datum/reagent/consumable/ethanol/ale,
+ /datum/reagent/consumable/ethanol/absinthe,
+ /datum/reagent/consumable/ethanol/hcider,
+ /datum/reagent/consumable/ethanol/creme_de_menthe,
+ /datum/reagent/consumable/ethanol/creme_de_cacao,
+ /datum/reagent/consumable/ethanol/triple_sec,
+ /datum/reagent/consumable/ethanol/sake,
+ /datum/reagent/consumable/ethanol/applejack
)
upgrade_reagents = list(
- "ethanol",
- "fernet"
+ /datum/reagent/consumable/ethanol,
+ /datum/reagent/consumable/ethanol/fernet
)
upgrade_reagents2 = null
upgrade_reagents3 = null
emagged_reagents = list(
- "iron",
- "alexander",
- "clownstears",
- "minttoxin",
- "atomicbomb",
- "aphro",
- "aphro+"
+ /datum/reagent/iron,
+ /datum/reagent/consumable/ethanol/alexander,
+ /datum/reagent/consumable/clownstears,
+ /datum/reagent/toxin/minttoxin,
+ /datum/reagent/consumable/ethanol/atomicbomb,
+ /datum/reagent/drug/aphrodisiac,
+ /datum/reagent/drug/aphrodisiacplus
)
/obj/machinery/chem_dispenser/drinks/beer/fullupgrade //fully ugpraded stock parts, emagged
@@ -598,9 +613,9 @@
/obj/machinery/chem_dispenser/mutagen
name = "mutagen dispenser"
desc = "Creates and dispenses mutagen."
- dispensable_reagents = list("mutagen")
+ dispensable_reagents = list(/datum/reagent/toxin/mutagen)
upgrade_reagents = null
- emagged_reagents = list("plasma")
+ emagged_reagents = list(/datum/reagent/toxin/plasma)
/obj/machinery/chem_dispenser/mutagensaltpeter
@@ -609,19 +624,19 @@
flags_1 = NODECONSTRUCT_1
dispensable_reagents = list(
- "mutagen",
- "saltpetre",
- "eznutriment",
- "left4zednutriment",
- "robustharvestnutriment",
- "water",
- "plantbgone",
- "weedkiller",
- "pestkiller",
- "cryoxadone",
- "ammonia",
- "ash",
- "diethylamine")
+ /datum/reagent/toxin/mutagen,
+ /datum/reagent/saltpetre,
+ /datum/reagent/plantnutriment/eznutriment,
+ /datum/reagent/plantnutriment/left4zednutriment,
+ /datum/reagent/plantnutriment/robustharvestnutriment,
+ /datum/reagent/water,
+ /datum/reagent/toxin/plantbgone,
+ /datum/reagent/toxin/plantbgone/weedkiller,
+ /datum/reagent/toxin/pestkiller,
+ /datum/reagent/medicine/cryoxadone,
+ /datum/reagent/ammonia,
+ /datum/reagent/ash,
+ /datum/reagent/diethylamine)
//same as above.
upgrade_reagents = null
upgrade_reagents2 = null
@@ -667,46 +682,46 @@
working_state = null
nopower_state = null
dispensable_reagents = list(
- "hydrogen",
- "lithium",
- "carbon",
- "nitrogen",
- "oxygen",
- "fluorine",
- "sodium",
- "aluminium",
- "silicon",
- "phosphorus",
- "sulfur",
- "chlorine",
- "potassium",
- "iron",
- "copper",
- "mercury",
- "radium",
- "water",
- "ethanol",
- "sugar",
- "sacid",
- "welding_fuel",
- "silver",
- "iodine",
- "bromine",
- "stable_plasma",
- "oil",
- "ammonia",
- "ash",
- "acetone",
- "phenol",
- "diethylamine",
- "mine_salve",
- "toxin",
- "space_drugs",
- "plasma",
- "frostoil",
- "uranium",
- "histamine",
- "morphine"
+ /datum/reagent/hydrogen,
+ /datum/reagent/lithium,
+ /datum/reagent/carbon,
+ /datum/reagent/nitrogen,
+ /datum/reagent/oxygen,
+ /datum/reagent/fluorine,
+ /datum/reagent/sodium,
+ /datum/reagent/aluminium,
+ /datum/reagent/silicon,
+ /datum/reagent/phosphorus,
+ /datum/reagent/sulfur,
+ /datum/reagent/chlorine,
+ /datum/reagent/potassium,
+ /datum/reagent/iron,
+ /datum/reagent/copper,
+ /datum/reagent/mercury,
+ /datum/reagent/radium,
+ /datum/reagent/water,
+ /datum/reagent/consumable/ethanol,
+ /datum/reagent/consumable/sugar,
+ /datum/reagent/toxin/acid,
+ /datum/reagent/fuel,
+ /datum/reagent/silver,
+ /datum/reagent/iodine,
+ /datum/reagent/bromine,
+ /datum/reagent/stable_plasma,
+ /datum/reagent/oil,
+ /datum/reagent/ammonia,
+ /datum/reagent/ash,
+ /datum/reagent/acetone,
+ /datum/reagent/phenol,
+ /datum/reagent/diethylamine,
+ /datum/reagent/medicine/mine_salve,
+ /datum/reagent/toxin,
+ /datum/reagent/drug/space_drugs,
+ /datum/reagent/toxin/plasma,
+ /datum/reagent/consumable/frostoil,
+ /datum/reagent/uranium,
+ /datum/reagent/toxin/histamine,
+ /datum/reagent/medicine/morphine
)
/obj/machinery/chem_dispenser/abductor/Initialize()
@@ -719,4 +734,4 @@
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
component_parts += new /obj/item/stack/sheet/glass(null)
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
- RefreshParts()
\ No newline at end of file
+ RefreshParts()
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index 1ac62ba651..4770e392cf 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -214,34 +214,34 @@
if("transferToBuffer")
if(beaker)
- var/id = params["id"]
+ var/reagent = GLOB.name2reagent[params["id"]]
var/amount = text2num(params["amount"])
if (amount > 0)
end_fermi_reaction()
- beaker.reagents.trans_id_to(src, id, amount)
+ beaker.reagents.trans_id_to(src, reagent, amount)
. = TRUE
else if (amount == -1) // -1 means custom amount
useramount = input("Enter the Amount you want to transfer:", name, useramount) as num|null
if (useramount > 0)
end_fermi_reaction()
- beaker.reagents.trans_id_to(src, id, useramount)
+ beaker.reagents.trans_id_to(src, reagent, useramount)
. = TRUE
if("transferFromBuffer")
- var/id = params["id"]
+ var/reagent = GLOB.name2reagent[params["id"]]
var/amount = text2num(params["amount"])
if (amount > 0)
if(mode)
- reagents.trans_id_to(beaker, id, amount)
+ reagents.trans_id_to(beaker, reagent, amount)
. = TRUE
else
- reagents.remove_reagent(id, amount)
+ reagents.remove_reagent(reagent, amount)
. = TRUE
else if (amount == -1) // -1 means custom amount
useramount = input("Enter the Amount you want to transfer:", name, useramount) as num|null
if (useramount > 0)
end_fermi_reaction()
- reagents.trans_id_to(beaker, id, useramount)
+ reagents.trans_id_to(beaker, reagent, useramount)
. = TRUE
if("toggleMode")
@@ -423,7 +423,7 @@
//END CITADEL ADDITIONS
if("analyzeBeak")
- var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]]
+ var/datum/reagent/R = GLOB.name2reagent[params["id"]]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
@@ -434,11 +434,11 @@
state = "Gas"
var/const/P = 3 //The number of seconds between life ticks
var/T = initial(R.metabolization_rate) * (60 / P)
- var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
+ var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.type)
if(Rcr && Rcr.FermiChem)
fermianalyze = TRUE
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
- var/datum/reagent/targetReagent = beaker.reagents.has_reagent("[R.id]")
+ var/datum/reagent/targetReagent = beaker.reagents.has_reagent(R.type)
if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
@@ -450,7 +450,7 @@
return
if("analyzeBuff")
- var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]]
+ var/datum/reagent/R = GLOB.name2reagent[params["id"]]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
@@ -463,9 +463,9 @@
var/T = initial(R.metabolization_rate) * (60 / P)
if(istype(R, /datum/reagent/fermi))
fermianalyze = TRUE
- var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
+ var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.type)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
- var/datum/reagent/targetReagent = reagents.has_reagent("[R.id]")
+ var/datum/reagent/targetReagent = reagents.has_reagent(R.type)
if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
index daac5a5d1c..5e0bc39368 100644
--- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
@@ -8,8 +8,8 @@
flags_1 = NODECONSTRUCT_1
use_power = NO_POWER_USE
var/static/list/shortcuts = list(
- "meth" = "methamphetamine",
- "tricord" = "tricordrazine"
+ "meth" = /datum/reagent/drug/methamphetamine,
+ "tricord" = /datum/reagent/medicine/tricordrazine
)
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
@@ -31,13 +31,13 @@
beaker = null
. = TRUE
if("input")
- var/input_reagent = replacetext(lowertext(input("Enter the name of any liquid", "Input") as text), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
+ var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
if(shortcuts[input_reagent])
input_reagent = shortcuts[input_reagent]
else
input_reagent = find_reagent(input_reagent)
- if(!input_reagent || !GLOB.chemical_reagents_list[input_reagent])
- say("OUT OF RANGE")
+ if(!input_reagent)
+ say("REAGENT NOT FOUND")
return
else
if(!beaker)
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index 6ae0a682d8..68ce6e490f 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -144,9 +144,9 @@
var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list
if(B)
data["has_blood"] = TRUE
- data["blood"] = list()
- data["blood"]["dna"] = B.data["blood_DNA"] || "none"
- data["blood"]["type"] = B.data["blood_type"] || "none"
+ data[/datum/reagent/blood] = list()
+ data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none"
+ data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none"
data["viruses"] = get_viruses_data(B)
data["resistances"] = get_resistance_data(B)
if(SYMPTOM_DETAILS)
@@ -192,7 +192,7 @@
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
B.name = "[A.name] culture bottle"
B.desc = "A small bottle. Contains [A.agent] culture in synthblood medium."
- B.reagents.add_reagent("blood", 20, data)
+ B.reagents.add_reagent(/datum/reagent/blood, 20, data)
wait = TRUE
update_icon()
var/turf/source_turf = get_turf(src)
@@ -204,7 +204,7 @@
var/datum/disease/D = SSdisease.archive_diseases[id]
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
B.name = "[D.name] vaccine bottle"
- B.reagents.add_reagent("vaccine", 15, list(id))
+ B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id))
wait = TRUE
update_icon()
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 200)
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index 98cfd877b2..7e1b7ec018 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -299,18 +299,18 @@
/obj/machinery/reagentgrinder/proc/mix_complete()
if(beaker?.reagents.total_volume)
//Recipe to make Butter
- var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF, 1)
- beaker.reagents.remove_reagent("milk", MILK_TO_BUTTER_COEFF * butter_amt)
+ var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/milk) / MILK_TO_BUTTER_COEFF, 1)
+ beaker.reagents.remove_reagent(/datum/reagent/consumable/milk, MILK_TO_BUTTER_COEFF * butter_amt)
for(var/i in 1 to butter_amt)
new /obj/item/reagent_containers/food/snacks/butter(drop_location())
//Recipe to make Mayonnaise
- if (beaker.reagents.has_reagent("eggyolk"))
- var/amount = beaker.reagents.get_reagent_amount("eggyolk")
- beaker.reagents.remove_reagent("eggyolk", amount)
- beaker.reagents.add_reagent("mayonnaise", amount)
+ if (beaker.reagents.has_reagent(/datum/reagent/consumable/eggyolk))
+ var/amount = beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggyolk)
+ beaker.reagents.remove_reagent(/datum/reagent/consumable/eggyolk, amount)
+ beaker.reagents.add_reagent(/datum/reagent/consumable/mayonnaise, amount)
//Moonsugar for skooma
- if(beaker.reagents.has_reagent("sugar") && beaker.reagents.has_reagent("moonshine"))
- var/amount = min(beaker.reagents.get_reagent_amount("sugar"), beaker.reagents.get_reagent_amount("moonshine"))
- beaker.reagents.remove_reagent("sugar", amount)
- beaker.reagents.remove_reagent("moonshine", amount)
- beaker.reagents.add_reagent("moonsugar", amount*2)
+ if(beaker.reagents.has_reagent(/datum/reagent/consumable/sugar) && beaker.reagents.has_reagent(/datum/reagent/consumable/ethanol/moonshine))
+ var/amount = min(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/sugar), beaker.reagents.get_reagent_amount(/datum/reagent/consumable/ethanol/moonshine))
+ beaker.reagents.remove_reagent(/datum/reagent/consumable/sugar, amount)
+ beaker.reagents.remove_reagent(/datum/reagent/consumable/ethanol/moonshine, amount)
+ beaker.reagents.add_reagent(/datum/reagent/moonsugar, amount*2)
diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm
index da41ac9dc4..007bcb145d 100644
--- a/code/modules/reagents/chemistry/reagents.dm
+++ b/code/modules/reagents/chemistry/reagents.dm
@@ -1,5 +1,14 @@
#define REM REAGENTS_EFFECT_MULTIPLIER
+GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
+
+/proc/build_name2reagent()
+ . = list()
+ for (var/t in subtypesof(/datum/reagent))
+ var/datum/reagent/R = t
+ if (length(initial(R.name)))
+ .[ckey(initial(R.name))] = t
+
//Various reagents
//Toxin & acid reagents
//Hydroponics stuff
@@ -58,7 +67,7 @@
var/modifier = CLAMP((1 - touch_protection), 0, 1)
var/amount = round(reac_volume*modifier, 0.1)
if(amount >= 0.5)
- M.reagents.add_reagent(id, amount)
+ M.reagents.add_reagent(type, amount)
return 1
/datum/reagent/proc/reaction_obj(obj/O, volume)
@@ -70,7 +79,7 @@
/datum/reagent/proc/on_mob_life(mob/living/carbon/M)
current_cycle++
if(holder)
- holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
+ holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
return
//called when a mob processes chems when dead.
@@ -79,7 +88,7 @@
return
current_cycle++
if(holder)
- holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
+ holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
return
// Called when this reagent is first added to a mob
@@ -98,9 +107,9 @@
return
if ((inverse_chem_val > purity) && (inverse_chem))//Turns all of a added reagent into the inverse chem
- M.reagents.remove_reagent(id, amount, FALSE)
+ M.reagents.remove_reagent(type, amount, FALSE)
M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity)
- var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]")
+ var/datum/reagent/R = M.reagents.has_reagent(inverse_chem)
if(R.chemical_flags & REAGENT_SNEAKYNAME)
R.name = name//Negative effects are hidden
if(R.chemical_flags & REAGENT_INVISIBLE)
@@ -110,7 +119,7 @@
else if (impure_chem)
var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem
if(!(chemical_flags & REAGENT_SPLITRETAINVOL))
- M.reagents.remove_reagent(id, (impureVol), FALSE)
+ M.reagents.remove_reagent(type, (impureVol), FALSE)
M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [id]")
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [impure_chem]")
@@ -149,9 +158,9 @@
return
if ((inverse_chem_val > purity) && (inverse_chem)) //INVERT
- M.reagents.remove_reagent(id, amount, FALSE)
+ M.reagents.remove_reagent(type, amount, FALSE)
M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity)
- var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]")
+ var/datum/reagent/R = M.reagents.has_reagent(inverse_chem)
if(R.chemical_flags & REAGENT_SNEAKYNAME)
R.name = name//Negative effects are hidden
if(R.chemical_flags & REAGENT_INVISIBLE)
@@ -161,7 +170,7 @@
else if (impure_chem) //SPLIT
var/impureVol = amount * (1 - purity)
if(!(chemical_flags & REAGENT_SPLITRETAINVOL))
- M.reagents.remove_reagent(id, impureVol, FALSE)
+ M.reagents.remove_reagent(type, impureVol, FALSE)
M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity)
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [id]")
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [impure_chem]")
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index fd28ff9c47..5d24508b9e 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -662,7 +662,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_life(mob/living/carbon/M)
if(QDELETED(light_holder))
- M.reagents.del_reagent("tequilasunrise") //If we lost our light object somehow, remove the reagent
+ M.reagents.del_reagent(type) //If we lost our light object somehow, remove the reagent
else if(light_holder.loc != M)
light_holder.forceMove(M)
return ..()
@@ -1456,9 +1456,9 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_name = "Neurotoxin"
glass_desc = "A drink that is guaranteed to knock you silly."
//SplitChem = TRUE
- impure_chem = "neuroweak"
+ impure_chem = /datum/reagent/consumable/ethanol/neuroweak
inverse_chem_val = 0.5 //Clear conversion
- inverse_chem = "neuroweak"
+ inverse_chem = /datum/reagent/consumable/ethanol/neuroweak
value = 4
/datum/reagent/consumable/ethanol/neurotoxin/proc/pickt()
@@ -1468,12 +1468,12 @@ All effects don't start immediately, but rather get worse over time; the rate is
M.set_drugginess(50)
M.dizziness +=2
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 150)
- if(prob(20) && !holder.has_reagent("neuroweak"))
+ if(prob(20) && !holder.has_reagent(/datum/reagent/consumable/ethanol/neuroweak))
M.adjustStaminaLoss(10)
M.drop_all_held_items()
to_chat(M, "You cant feel your hands!")
if(current_cycle > 5)
- if(prob(20) && !holder.has_reagent("neuroweak"))
+ if(prob(20) && !holder.has_reagent(/datum/reagent/consumable/ethanol/neuroweak))
var/t = pickt()
ADD_TRAIT(M, t, type)
M.adjustStaminaLoss(10)
@@ -1504,12 +1504,12 @@ All effects don't start immediately, but rather get worse over time; the rate is
value = 3
/datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M)
- if(holder.has_reagent("neurotoxin"))
+ if(holder.has_reagent(/datum/reagent/consumable/ethanol/neurotoxin))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150)
- M.reagents.remove_reagent("neurotoxin", 1.5 * REAGENTS_METABOLISM, FALSE)
- if(holder.has_reagent("fentanyl"))
+ M.reagents.remove_reagent(/datum/reagent/consumable/ethanol/neurotoxin, 1.5 * REAGENTS_METABOLISM, FALSE)
+ else if(holder.has_reagent(/datum/reagent/toxin/fentanyl))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150)
- M.reagents.remove_reagent("fentanyl", 0.75 * REAGENTS_METABOLISM, FALSE)
+ M.reagents.remove_reagent(/datum/reagent/toxin/fentanyl, 0.75 * REAGENTS_METABOLISM, FALSE)
else
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -0.5*REM, 150)
M.dizziness +=2
@@ -1862,7 +1862,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/alexander/on_mob_life(mob/living/L)
..()
if(mighty_shield && !(mighty_shield in L.contents)) //If you had a shield and lose it, you lose the reagent as well. Otherwise this is just a normal drink.
- L.reagents.del_reagent("alexander")
+ L.reagents.del_reagent(type)
/datum/reagent/consumable/ethanol/alexander/on_mob_end_metabolize(mob/living/L)
if(mighty_shield)
diff --git a/code/modules/reagents/chemistry/reagents/blob_reagents.dm b/code/modules/reagents/chemistry/reagents/blob_reagents.dm
index ada4cd8d8e..b5993a8783 100644
--- a/code/modules/reagents/chemistry/reagents/blob_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/blob_reagents.dm
@@ -195,8 +195,8 @@
reac_volume = ..()
M.adjust_drugginess(reac_volume)
if(M.reagents)
- M.reagents.add_reagent("regenerative_materia", 0.2*reac_volume)
- M.reagents.add_reagent("spore", 0.2*reac_volume)
+ M.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 0.2*reac_volume)
+ M.reagents.add_reagent(/datum/reagent/toxin/spore, 0.2*reac_volume)
M.apply_damage(0.7*reac_volume, TOX)
/datum/reagent/blob/regenerative_materia/on_mob_life(mob/living/carbon/C)
@@ -339,9 +339,9 @@
/datum/reagent/blob/cryogenic_poison/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O)
reac_volume = ..()
if(M.reagents)
- M.reagents.add_reagent("frostoil", 0.3*reac_volume)
- M.reagents.add_reagent("ice", 0.3*reac_volume)
- M.reagents.add_reagent("cryogenic_poison", 0.3*reac_volume)
+ M.reagents.add_reagent(/datum/reagent/consumable/frostoil, 0.3*reac_volume)
+ M.reagents.add_reagent(/datum/reagent/consumable/ice, 0.3*reac_volume)
+ M.reagents.add_reagent(/datum/reagent/blob/cryogenic_poison, 0.3*reac_volume)
M.apply_damage(0.2*reac_volume, BRUTE)
/datum/reagent/blob/cryogenic_poison/on_mob_life(mob/living/carbon/M)
diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
index 957ea1b986..f852e84914 100644
--- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
@@ -227,8 +227,8 @@
if(M.getBruteLoss() && prob(20))
M.heal_bodypart_damage(1,0, 0)
. = 1
- if(holder.has_reagent("capsaicin"))
- holder.remove_reagent("capsaicin", 2)
+ if(holder.has_reagent(/datum/reagent/consumable/capsaicin))
+ holder.remove_reagent(/datum/reagent/consumable/capsaicin, 2)
..()
/datum/reagent/consumable/soymilk
@@ -285,8 +285,8 @@
M.AdjustSleeping(-40, FALSE)
//310.15 is the normal bodytemp.
M.adjust_bodytemperature(25 * TEMPERATURE_DAMAGE_COEFFICIENT, 0, BODYTEMP_NORMAL)
- if(holder.has_reagent("frostoil"))
- holder.remove_reagent("frostoil", 5)
+ if(holder.has_reagent(/datum/reagent/consumable/frostoil))
+ holder.remove_reagent(/datum/reagent/consumable/frostoil, 5)
..()
. = 1
@@ -523,9 +523,9 @@
glass_desc = "Stinging with flavour."
/datum/reagent/consumable/buzz_fuzz/on_mob_life(mob/living/carbon/M)
- M.reagents.add_reagent("sugar",1)
+ M.reagents.add_reagent(/datum/reagent/consumable/sugar,1)
if(prob(5))
- M.reagents.add_reagent("honey",1)
+ M.reagents.add_reagent(/datum/reagent/consumable/honey,1)
..()
/datum/reagent/consumable/buzz_fuzz/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 4d02706a3c..3da430b16d 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -19,7 +19,7 @@
/datum/reagent/consumable/on_mob_life(mob/living/carbon/M)
current_cycle++
M.nutrition += nutriment_factor
- holder.remove_reagent(src.id, metabolization_rate)
+ holder.remove_reagent(type, metabolization_rate)
/datum/reagent/consumable/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(method == INGEST)
@@ -121,7 +121,7 @@
O.loc.visible_message("[O] rapidly fries as it's splashed with hot oil! Somehow.")
var/obj/item/reagent_containers/food/snacks/deepfryholder/F = new(O.drop_location(), O)
F.fry(volume)
- F.reagents.add_reagent("cooking_oil", reac_volume)
+ F.reagents.add_reagent(/datum/reagent/consumable/cooking_oil, reac_volume)
/datum/reagent/consumable/cooking_oil/reaction_mob(mob/living/M, method = TOUCH, reac_volume, show_message = 1, touch_protection = 0)
if(!istype(M))
@@ -216,8 +216,8 @@
switch(current_cycle)
if(1 to 15)
heating = 5 * TEMPERATURE_DAMAGE_COEFFICIENT
- if(holder.has_reagent("cryostylane"))
- holder.remove_reagent("cryostylane", 5)
+ if(holder.has_reagent(/datum/reagent/cryostylane))
+ holder.remove_reagent(/datum/reagent/cryostylane, 5)
if(isslime(M))
heating = rand(5,20)
if(15 to 25)
@@ -249,8 +249,8 @@
switch(current_cycle)
if(1 to 15)
cooling = -10 * TEMPERATURE_DAMAGE_COEFFICIENT
- if(holder.has_reagent("capsaicin"))
- holder.remove_reagent("capsaicin", 5)
+ if(holder.has_reagent(/datum/reagent/consumable/capsaicin))
+ holder.remove_reagent(/datum/reagent/consumable/capsaicin, 5)
if(isslime(M))
cooling = -rand(5,20)
if(15 to 25)
@@ -538,7 +538,7 @@
var/obj/effect/decal/cleanable/flour/reagentdecal = new/obj/effect/decal/cleanable/flour(T)
reagentdecal = locate() in T //Might have merged with flour already there.
if(reagentdecal)
- reagentdecal.reagents.add_reagent("flour", reac_volume)
+ reagentdecal.reagents.add_reagent(/datum/reagent/consumable/flour, reac_volume)
/datum/reagent/consumable/cherryjelly
name = "Cherry Jelly"
@@ -603,7 +603,7 @@
taste_description = "sweet slime"
/datum/reagent/consumable/corn_syrup/on_mob_life(mob/living/carbon/M)
- holder.add_reagent("sugar", 3)
+ holder.add_reagent(/datum/reagent/consumable/sugar, 3)
..()
/datum/reagent/consumable/honey
@@ -617,7 +617,7 @@
taste_description = "sweetness"
/datum/reagent/consumable/honey/on_mob_life(mob/living/carbon/M)
- M.reagents.add_reagent("sugar",3)
+ M.reagents.add_reagent(/datum/reagent/consumable/sugar,3)
if(prob(55))
M.adjustBruteLoss(-1*REM, 0)
M.adjustFireLoss(-1*REM, 0)
@@ -767,7 +767,7 @@
/* //We don't have ethereals here, so I'll just comment it out.
/datum/reagent/consumable/liquidelectricity/reaction_mob(mob/living/M, method=TOUCH, reac_volume) //can't be on life because of the way blood works.
if((method == INGEST || method == INJECT || method == PATCH) && iscarbon(M))
-
+
var/mob/living/carbon/C = M
var/obj/item/organ/stomach/ethereal/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
if(istype(stomach))
diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
index d8ff084227..2e2cdf2bf1 100644
--- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
@@ -13,7 +13,7 @@
/datum/reagent/medicine/on_mob_life(mob/living/carbon/M)
current_cycle++
- holder.remove_reagent(src.id, metabolization_rate / M.metabolism_efficiency) //medicine reagents stay longer if you have a better metabolism
+ holder.remove_reagent(type, metabolization_rate / M.metabolism_efficiency) //medicine reagents stay longer if you have a better metabolism
/datum/reagent/medicine/leporazine
name = "Leporazine"
@@ -95,8 +95,8 @@
M.AdjustStun(-20, 0)
M.AdjustKnockdown(-20, 0)
M.AdjustUnconscious(-20, 0)
- if(holder.has_reagent("mindbreaker"))
- holder.remove_reagent("mindbreaker", 5)
+ if(holder.has_reagent(/datum/reagent/toxin/mindbreaker))
+ holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5)
M.hallucination = max(0, M.hallucination - 10)
if(prob(30))
M.adjustToxLoss(1, 0)
@@ -112,10 +112,10 @@
/datum/reagent/medicine/synaphydramine/on_mob_life(mob/living/carbon/M)
M.drowsyness = max(M.drowsyness-5, 0)
- if(holder.has_reagent("mindbreaker"))
- holder.remove_reagent("mindbreaker", 5)
- if(holder.has_reagent("histamine"))
- holder.remove_reagent("histamine", 5)
+ if(holder.has_reagent(/datum/reagent/toxin/mindbreaker))
+ holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5)
+ if(holder.has_reagent(/datum/reagent/toxin/histamine))
+ holder.remove_reagent(/datum/reagent/toxin/histamine, 5)
M.hallucination = max(0, M.hallucination - 10)
if(prob(30))
M.adjustToxLoss(1, 0)
@@ -374,12 +374,12 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/salglu_solution/overdose_process(mob/living/M)
if(prob(3))
to_chat(M, "You feel salty.")
- holder.add_reagent("sodiumchloride", 1)
- holder.remove_reagent("salglu_solution", 0.5)
+ holder.add_reagent(/datum/reagent/consumable/sodiumchloride, 1)
+ holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5)
else if(prob(3))
to_chat(M, "You feel sweet.")
- holder.add_reagent("sugar", 1)
- holder.remove_reagent("salglu_solution", 0.5)
+ holder.add_reagent(/datum/reagent/consumable/sugar, 1)
+ holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5)
if(prob(33))
M.adjustBruteLoss(0.5*REM, 0)
M.adjustFireLoss(0.5*REM, 0)
@@ -473,9 +473,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/charcoal/on_mob_life(mob/living/carbon/M)
M.adjustToxLoss(-2*REM, 0)
. = 1
- for(var/datum/reagent/R in M.reagents.reagent_list)
+ for(var/A in M.reagents.reagent_list)
+ var/datum/reagent/R = A
if(R != src)
- M.reagents.remove_reagent(R.id,1)
+ M.reagents.remove_reagent(R.type,1)
..()
/datum/reagent/medicine/omnizine
@@ -516,9 +517,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
pH = 1.5
/datum/reagent/medicine/calomel/on_mob_life(mob/living/carbon/M)
- for(var/datum/reagent/R in M.reagents.reagent_list)
+ for(var/A in M.reagents.reagent_list)
+ var/datum/reagent/R = A
if(R != src)
- M.reagents.remove_reagent(R.id,2.5)
+ M.reagents.remove_reagent(R.type,2.5)
if(M.health > 20)
M.adjustToxLoss(2.5*REM, 0)
. = 1
@@ -565,9 +567,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/pen_acid/on_mob_life(mob/living/carbon/M)
M.radiation -= max(M.radiation-RAD_MOB_SAFE, 0)/50
M.adjustToxLoss(-2*REM, 0, healtoxinlover)
- for(var/datum/reagent/R in M.reagents.reagent_list)
+ for(var/A in M.reagents.reagent_list)
+ var/datum/reagent/R = A
if(R != src)
- M.reagents.remove_reagent(R.id,2)
+ M.reagents.remove_reagent(R.type,2)
..()
. = 1
@@ -708,7 +711,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
if(prob(10))
M.drowsyness += 1
M.jitteriness -= 1
- M.reagents.remove_reagent("histamine",3)
+ M.reagents.remove_reagent(/datum/reagent/toxin/histamine,3)
..()
/datum/reagent/medicine/morphine
@@ -966,8 +969,8 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/neurine/on_mob_life(mob/living/carbon/C)
- if(holder.has_reagent("neurotoxin"))
- holder.remove_reagent("neurotoxin", 5)
+ if(holder.has_reagent(/datum/reagent/consumable/ethanol/neurotoxin))
+ holder.remove_reagent(/datum/reagent/consumable/ethanol/neurotoxin, 5)
if(prob(15))
C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC)
..()
@@ -1058,7 +1061,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/insulin/on_mob_life(mob/living/carbon/M)
if(M.AdjustSleeping(-20, FALSE))
. = 1
- M.reagents.remove_reagent("sugar", 3)
+ M.reagents.remove_reagent(/datum/reagent/consumable/sugar, 3)
..()
//Trek Chems, used primarily by medibots. Only heals a specific damage type, but is very efficient.
@@ -1132,7 +1135,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/antitoxin/on_mob_life(mob/living/carbon/M)
M.adjustToxLoss(-2*REM, 0)
for(var/datum/reagent/toxin/R in M.reagents.reagent_list)
- M.reagents.remove_reagent(R.id,1)
+ M.reagents.remove_reagent(R.type,1)
..()
. = 1
@@ -1302,7 +1305,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/haloperidol/on_mob_life(mob/living/carbon/M)
for(var/datum/reagent/drug/R in M.reagents.reagent_list)
- M.reagents.remove_reagent(R.id,5)
+ M.reagents.remove_reagent(R.type,5)
M.drowsyness += 2
if(M.jitteriness >= 3)
M.jitteriness -= 3
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index 512b8a21a1..648435ba4d 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -62,7 +62,7 @@
if(data["blood_DNA"])
B.blood_DNA[data["blood_DNA"]] = data["blood_type"]
if(!B.reagents)
- B.reagents.add_reagent(id, reac_volume)
+ B.reagents.add_reagent(type, reac_volume)
B.update_icon()
/datum/reagent/blood/on_new(list/data)
@@ -392,9 +392,9 @@
remove_servant_of_ratvar(M)
M.jitteriness = 0
M.stuttering = 0
- holder.remove_reagent(id, volume) // maybe this is a little too perfect and a max() cap on the statuses would be better??
+ holder.del_reagent(type) // maybe this is a little too perfect and a max() cap on the statuses would be better??
return
- holder.remove_reagent(id, 0.4) //fixed consumption to prevent balancing going out of whack
+ holder.remove_reagent(type, 0.4) //fixed consumption to prevent balancing going out of whack
/datum/reagent/water/holywater/reaction_turf(turf/T, reac_volume)
..()
@@ -414,7 +414,7 @@
/datum/reagent/fuel/unholywater/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(method == TOUCH || method == VAPOR)
- M.reagents.add_reagent(id,reac_volume/4)
+ M.reagents.add_reagent(type, reac_volume/4)
return
return ..()
@@ -437,7 +437,7 @@
M.adjustFireLoss(2, 0)
M.adjustOxyLoss(2, 0)
M.adjustBruteLoss(2, 0)
- holder.remove_reagent(id, 1)
+ holder.remove_reagent(type, 1)
return TRUE
/datum/reagent/hellwater //if someone has this in their system they've really pissed off an eldrich god
@@ -452,7 +452,7 @@
M.adjustToxLoss(1, 0)
M.adjustFireLoss(1, 0) //Hence the other damages... ain't I a bastard?
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 150)
- holder.remove_reagent(id, 1)
+ holder.remove_reagent(type, 1)
pH = 0.1
/datum/reagent/fuel/holyoil //Its oil
@@ -481,7 +481,7 @@
M.adjustToxLoss(3, 0)
M.adjustOxyLoss(2, 0)
M.adjustStaminaLoss(10, 0)
- holder.remove_reagent(id, 1)
+ holder.remove_reagent(type, 1)
return TRUE
//We only get 30u to start with...
@@ -815,7 +815,7 @@
to_chat(H, "Your jelly shifts and morphs, turning you into another subspecies!")
var/species_type = pick(subtypesof(/datum/species/jelly))
H.set_species(species_type)
- H.reagents.del_reagent(id)
+ H.reagents.del_reagent(type)
switch(current_cycle)
if(1 to 6)
@@ -830,7 +830,7 @@
if(20 to INFINITY)
var/species_type = pick(subtypesof(/datum/species/jelly))
H.set_species(species_type)
- H.reagents.del_reagent(id)
+ H.reagents.del_reagent(type)
to_chat(H, "You've become \a jellyperson!")
/datum/reagent/mulligan
@@ -1089,7 +1089,7 @@
var/obj/effect/decal/cleanable/greenglow/GG = locate() in T.contents
if(!GG)
GG = new/obj/effect/decal/cleanable/greenglow(T)
- GG.reagents.add_reagent("radium", reac_volume)
+ GG.reagents.add_reagent(/datum/reagent/radium, reac_volume)
/datum/reagent/space_cleaner/sterilizine
name = "Sterilizine"
@@ -1127,7 +1127,7 @@
/datum/reagent/iron/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(M.has_bane(BANE_IRON)) //If the target is weak to cold iron, then poison them.
if(holder && holder.chem_temp < 100) // COLD iron.
- M.reagents.add_reagent("toxin", reac_volume)
+ M.reagents.add_reagent(/datum/reagent/toxin, reac_volume)
..()
/datum/reagent/iron/overdose_start(mob/living/M)
@@ -1159,7 +1159,7 @@
/datum/reagent/silver/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(M.has_bane(BANE_SILVER))
- M.reagents.add_reagent("toxin", reac_volume)
+ M.reagents.add_reagent(/datum/reagent/toxin, reac_volume)
..()
/datum/reagent/uranium
@@ -1181,7 +1181,7 @@
var/obj/effect/decal/cleanable/greenglow/GG = locate() in T.contents
if(!GG)
GG = new/obj/effect/decal/cleanable/greenglow(T)
- GG.reagents.add_reagent("uranium", reac_volume)
+ GG.reagents.add_reagent(/datum/reagent/uranium, reac_volume)
/datum/reagent/bluespace
name = "Bluespace Dust"
@@ -1527,7 +1527,7 @@
/datum/reagent/stimulum/on_mob_life(mob/living/carbon/M)
M.adjustStaminaLoss(-2*REM, 0)
current_cycle++
- holder.remove_reagent(id, 0.99) //Gives time for the next tick of life().
+ holder.remove_reagent(type, 0.99) //Gives time for the next tick of life().
. = TRUE //Update status effects.
/datum/reagent/nitryl
diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
index c170858d98..758db841f2 100644
--- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
@@ -190,8 +190,8 @@
/datum/reagent/cryostylane/on_mob_life(mob/living/carbon/M) //TODO: code freezing into an ice cube
- if(M.reagents.has_reagent("oxygen"))
- M.reagents.remove_reagent("oxygen", 0.5)
+ if(M.reagents.has_reagent(/datum/reagent/oxygen))
+ M.reagents.remove_reagent(/datum/reagent/oxygen, 0.5)
M.adjust_bodytemperature(-15)
..()
@@ -209,8 +209,8 @@
taste_description = "bitterness"
/datum/reagent/pyrosium/on_mob_life(mob/living/carbon/M)
- if(M.reagents.has_reagent("oxygen"))
- M.reagents.remove_reagent("oxygen", 0.5)
+ if(M.reagents.has_reagent(/datum/reagent/oxygen))
+ M.reagents.remove_reagent(/datum/reagent/oxygen, 0.5)
M.adjust_bodytemperature(15)
..()
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index f97204b45e..c839326f78 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -66,8 +66,8 @@
pH = 4
/datum/reagent/toxin/plasma/on_mob_life(mob/living/carbon/C)
- if(holder.has_reagent("epinephrine"))
- holder.remove_reagent("epinephrine", 2*REM)
+ if(holder.has_reagent(/datum/reagent/medicine/epinephrine))
+ holder.remove_reagent(/datum/reagent/medicine/epinephrine, 2*REM)
C.adjustPlasma(20)
return ..()
@@ -437,8 +437,8 @@
/datum/reagent/toxin/formaldehyde/on_mob_life(mob/living/carbon/M)
if(prob(5))
- holder.add_reagent("histamine", pick(5,15))
- holder.remove_reagent("formaldehyde", 1.2)
+ holder.add_reagent(/datum/reagent/toxin/histamine, pick(5,15))
+ holder.remove_reagent(type, 1.2)
else
return ..()
@@ -456,8 +456,8 @@
M.adjustBruteLoss((0.3*volume)*REM, 0)
. = 1
if(prob(15))
- M.reagents.add_reagent("histamine", pick(5,10))
- M.reagents.remove_reagent("venom", 1.1)
+ M.reagents.add_reagent(/datum/reagent/toxin/histamine, pick(5,10))
+ M.reagents.remove_reagent(type, 1.1)
else
..()
@@ -518,7 +518,7 @@
/datum/reagent/toxin/itching_powder/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(method == TOUCH || method == VAPOR)
- M.reagents.add_reagent("itching_powder", reac_volume)
+ M.reagents.add_reagent(/datum/reagent/toxin/itching_powder, reac_volume)
/datum/reagent/toxin/itching_powder/on_mob_life(mob/living/carbon/M)
if(prob(15))
@@ -534,8 +534,8 @@
M.adjustBruteLoss(0.2*REM, 0)
. = 1
if(prob(3))
- M.reagents.add_reagent("histamine",rand(1,3))
- M.reagents.remove_reagent("itching_powder",1.2)
+ M.reagents.add_reagent(/datum/reagent/toxin/histamine,rand(1,3))
+ M.reagents.remove_reagent(type,1.2)
return
..()
@@ -680,7 +680,7 @@
C.vomit(10, prob(10), prob(50), rand(0,4), TRUE, prob(30))
for(var/datum/reagent/toxin/R in C.reagents.reagent_list)
if(R != src)
- C.reagents.remove_reagent(R.id,1)
+ C.reagents.remove_reagent(R.type,1)
/datum/reagent/toxin/spewium/overdose_process(mob/living/carbon/C)
. = ..()
@@ -799,10 +799,10 @@
/datum/reagent/toxin/anacea/on_mob_life(mob/living/carbon/M)
var/remove_amt = 5
- if(holder.has_reagent("calomel") || holder.has_reagent("pen_acid") || holder.has_reagent("pen_jelly"))
+ if(holder.has_reagent(/datum/reagent/medicine/calomel) || holder.has_reagent(/datum/reagent/medicine/pen_acid) || holder.has_reagent(/datum/reagent/medicine/pen_acid/pen_jelly))
remove_amt = 0.5
for(var/datum/reagent/medicine/R in M.reagents.reagent_list)
- M.reagents.remove_reagent(R.id,remove_amt)
+ M.reagents.remove_reagent(R.type,remove_amt)
return ..()
//ACID
@@ -869,7 +869,7 @@
/datum/reagent/toxin/delayed/on_mob_life(mob/living/carbon/M)
if(current_cycle > delay)
- holder.remove_reagent(id, actual_metaboliztion_rate * M.metabolism_efficiency)
+ holder.remove_reagent(type, actual_metaboliztion_rate * M.metabolism_efficiency)
M.adjustToxLoss(actual_toxpwr*REM, 0)
if(prob(10))
M.Knockdown(20, 0)
diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm
index 607e0b5a4e..f5e12426e1 100644
--- a/code/modules/reagents/chemistry/recipes/medicine.dm
+++ b/code/modules/reagents/chemistry/recipes/medicine.dm
@@ -70,10 +70,10 @@
/datum/chemical_reaction/synthtissue
name = "Synthtissue"
- id = "synthtissue"
- results = list("synthtissue" = 5)
- required_reagents = list("synthflesh" = 1)
- required_catalysts = list("sugar" = 0.1)
+ id = /datum/reagent/synthtissue
+ results = list(/datum/reagent/synthtissue = 5)
+ required_reagents = list(/datum/reagent/medicine/synthflesh = 1)
+ required_catalysts = list(/datum/reagent/consumable/sugar = 0.1)
//FermiChem vars:
OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions
OptimalTempMax = 315 // Upper end for above
@@ -91,13 +91,13 @@
PurityMin = 0
/datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity)
- var/datum/reagent/synthtissue/St = holder.has_reagent("synthtissue")
- var/datum/reagent/N = holder.has_reagent("sugar")
+ var/datum/reagent/synthtissue/St = holder.has_reagent(/datum/reagent/synthtissue)
+ var/datum/reagent/N = holder.has_reagent(/datum/reagent/consumable/sugar)
if(!St)
return
if(holder.chem_temp > 320)
var/temp_ratio = 1-(330 - holder.chem_temp)/10
- holder.remove_reagent(src.id, added_volume*temp_ratio)
+ holder.remove_reagent(id, added_volume*temp_ratio)
if(St.purity < 1)
St.volume *= St.purity
St.purity = 1
diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
index ad1efc1da7..cda27505aa 100644
--- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
+++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
@@ -33,9 +33,9 @@
strengthdiv = 2
/datum/chemical_reaction/reagent_explosion/nitroglycerin/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
- holder.remove_reagent("nitroglycerin", created_volume*2)
+ holder.remove_reagent(/datum/reagent/nitroglycerin, created_volume*2)
..()
/datum/chemical_reaction/reagent_explosion/nitroglycerin_explosion
@@ -191,9 +191,9 @@
required_reagents = list("mercury" = 1, "oxygen" = 1, "nitrogen" = 1, "carbon" = 1)
/datum/chemical_reaction/sorium/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
- holder.remove_reagent("sorium", created_volume*4)
+ holder.remove_reagent(/datum/reagent/sorium, created_volume*4)
var/turf/T = get_turf(holder.my_atom)
var/range = CLAMP(sqrt(created_volume*4), 1, 6)
goonchem_vortex(T, 1, range)
@@ -216,9 +216,9 @@
required_reagents = list("stable_plasma" = 1, "radium" = 1, "carbon" = 1)
/datum/chemical_reaction/liquid_dark_matter/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
- holder.remove_reagent("liquid_dark_matter", created_volume*3)
+ holder.remove_reagent(/datum/reagent/liquid_dark_matter, created_volume*3)
var/turf/T = get_turf(holder.my_atom)
var/range = CLAMP(sqrt(created_volume*3), 1, 6)
goonchem_vortex(T, 0, range)
@@ -241,7 +241,7 @@
required_reagents = list("aluminium" = 1, "potassium" = 1, "sulfur" = 1 )
/datum/chemical_reaction/flash_powder/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
var/location = get_turf(holder.my_atom)
do_sparks(2, TRUE, location)
@@ -255,7 +255,7 @@
C.Knockdown(60)
else
C.Stun(100)
- holder.remove_reagent("flash_powder", created_volume*3)
+ holder.remove_reagent(/datum/reagent/flash_powder, created_volume*3)
/datum/chemical_reaction/flash_powder_flash
name = "Flash powder activation"
@@ -284,9 +284,9 @@
required_reagents = list("potassium" = 1, "sugar" = 1, "phosphorus" = 1)
/datum/chemical_reaction/smoke_powder/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
- holder.remove_reagent("smoke_powder", created_volume*3)
+ holder.remove_reagent(/datum/reagent/smoke_powder, created_volume*3)
var/smoke_radius = round(sqrt(created_volume * 1.5), 1)
var/location = get_turf(holder.my_atom)
var/datum/effect_system/smoke_spread/chem/S = new
@@ -301,7 +301,7 @@
/datum/chemical_reaction/smoke_powder_smoke
name = "smoke_powder_smoke"
id = "smoke_powder_smoke"
- required_reagents = list("smoke_powder" = 1)
+ required_reagents = list(/datum/reagent/smoke_powder = 1)
required_temp = 374
mob_react = FALSE
@@ -324,9 +324,9 @@
required_reagents = list("oxygen" = 1, "cola" = 1, "phosphorus" = 1)
/datum/chemical_reaction/sonic_powder/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
- holder.remove_reagent("sonic_powder", created_volume*3)
+ holder.remove_reagent(/datum/reagent/sonic_powder, created_volume*3)
var/location = get_turf(holder.my_atom)
playsound(location, 'sound/effects/bang.ogg', 25, 1)
for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/3, location))
@@ -351,7 +351,7 @@
required_reagents = list("phosphorus" = 1, "sacid" = 1, "stable_plasma" = 1)
/datum/chemical_reaction/phlogiston/on_reaction(datum/reagents/holder, created_volume)
- if(holder.has_reagent("stabilizing_agent"))
+ if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return
var/turf/open/T = get_turf(holder.my_atom)
if(istype(T))
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index 618b74fffb..83fe560638 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -27,7 +27,7 @@
if(spawned_disease)
var/datum/disease/F = new spawned_disease()
var/list/data = list("blood_DNA" = "UNKNOWN DNA", "blood_type" = "SY","viruses"= list(F))
- reagents.add_reagent("blood", disease_amount, data)
+ reagents.add_reagent(/datum/reagent/blood, disease_amount, data)
add_initial_reagents()
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index 61449fc153..2f5fb067ea 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -13,12 +13,12 @@
/obj/item/reagent_containers/blood/Initialize()
. = ..()
if(blood_type != null)
- reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_colour"=color, "blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
+ reagents.add_reagent(/datum/reagent/blood, 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_colour"=color, "blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
update_icon()
/obj/item/reagent_containers/blood/on_reagent_change(changetype)
if(reagents)
- var/datum/reagent/blood/B = reagents.has_reagent("blood")
+ var/datum/reagent/blood/B = reagents.has_reagent(/datum/reagent/blood)
if(B && B.data && B.data["blood_type"])
blood_type = B.data["blood_type"]
color_to_apply = bloodtype_to_color(blood_type)
diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm
index 2bd5fb2d9f..b1443534d6 100644
--- a/code/modules/reagents/reagent_containers/borghydro.dm
+++ b/code/modules/reagents/reagent_containers/borghydro.dm
@@ -26,7 +26,8 @@ Borg Hypospray
var/bypass_protection = 0 //If the hypospray can go through armor or thick material
var/list/datum/reagents/reagent_list = list()
- var/list/reagent_ids = list("dexalin", "kelotane", "bicaridine", "antitoxin", "epinephrine", "spaceacillin", "salglu_solution")
+ var/list/reagent_ids = list(/datum/reagent/medicine/dexalin, /datum/reagent/medicine/kelotane, /datum/reagent/medicine/bicaridine, /datum/reagent/medicine/antitoxin,
+ /datum/reagent/medicine/epinephrine, /datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salglu_solution)
var/accepts_reagent_upgrades = TRUE //If upgrades can increase number of reagents dispensed.
var/list/modes = list() //Basically the inverse of reagent_ids. Instead of having numbers as "keys" and strings as values it has strings as keys and numbers as values.
//Used as list for input() in shakers.
@@ -141,19 +142,19 @@ Borg Hypospray
/obj/item/reagent_containers/borghypo/hacked
icon_state = "borghypo_s"
- reagent_ids = list ("facid", "mutetoxin", "cyanide", "sodium_thiopental", "heparin", "lexorin")
+ reagent_ids = list (/datum/reagent/toxin/acid, /datum/reagent/toxin/mutetoxin, /datum/reagent/toxin/cyanide, /datum/reagent/toxin/sodium_thiopental, /datum/reagent/toxin/heparin, /datum/reagent/toxin/lexorin)
accepts_reagent_upgrades = FALSE
/obj/item/reagent_containers/borghypo/clown
name = "laughter injector"
desc = "Keeps the crew happy and productive!"
- reagent_ids = list("laughter")
+ reagent_ids = list(/datum/reagent/consumable/laughter)
accepts_reagent_upgrades = FALSE
/obj/item/reagent_containers/borghypo/clown/hacked
name = "laughter injector"
desc = "Keeps the crew so happy they don't work!"
- reagent_ids = list("superlaughter")
+ reagent_ids = list(/datum/reagent/consumable/superlaughter)
accepts_reagent_upgrades = FALSE
/obj/item/reagent_containers/borghypo/syndicate
@@ -162,7 +163,7 @@ Borg Hypospray
icon_state = "borghypo_s"
charge_cost = 20
recharge_time = 2
- reagent_ids = list("syndicate_nanites", "potass_iodide", "morphine")
+ reagent_ids = list(/datum/reagent/medicine/syndicate_nanites, /datum/reagent/medicine/potass_iodide, /datum/reagent/medicine/morphine)
bypass_protection = 1
accepts_reagent_upgrades = FALSE
@@ -179,7 +180,14 @@ Borg Shaker
recharge_time = 3
accepts_reagent_upgrades = FALSE
- reagent_ids = list("beer", "orangejuice", "grenadine", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale", "milk", "coffee", "banana", "lemonjuice")
+ reagent_ids = list(/datum/reagent/consumable/ethanol/beer, /datum/reagent/consumable/orangejuice, /datum/reagent/consumable/grenadine,
+ /datum/reagent/consumable/limejuice, /datum/reagent/consumable/tomatojuice, /datum/reagent/consumable/space_cola,
+ /datum/reagent/consumable/tonic, /datum/reagent/consumable/sodawater, /datum/reagent/consumable/ice,
+ /datum/reagent/consumable/cream, /datum/reagent/consumable/ethanol/whiskey, /datum/reagent/consumable/ethanol/vodka,
+ /datum/reagent/consumable/ethanol/rum, /datum/reagent/consumable/ethanol/gin, /datum/reagent/consumable/ethanol/tequila,
+ /datum/reagent/consumable/ethanol/vermouth, /datum/reagent/consumable/ethanol/wine, /datum/reagent/consumable/ethanol/kahlua,
+ /datum/reagent/consumable/ethanol/cognac, /datum/reagent/consumable/ethanol/ale, /datum/reagent/consumable/milk,
+ /datum/reagent/consumable/coffee, /datum/reagent/consumable/banana, /datum/reagent/consumable/lemonjuice)
/obj/item/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user)
return //Can't inject stuff with a shaker, can we? //not with that attitude
@@ -235,22 +243,24 @@ Borg Shaker
recharge_time = 3
accepts_reagent_upgrades = FALSE
- reagent_ids = list("fakebeer", "fernet")
+ reagent_ids = list(/datum/reagent/toxin/fakebeer, /datum/reagent/consumable/ethanol/fernet)
/obj/item/reagent_containers/borghypo/peace
name = "Peace Hypospray"
- reagent_ids = list("dizzysolution","tiresolution","synthpax")
+ reagent_ids = list(/datum/reagent/peaceborg_confuse, /datum/reagent/peaceborg_tire, /datum/reagent/pax/peaceborg)
accepts_reagent_upgrades = FALSE
/obj/item/reagent_containers/borghypo/peace/hacked
desc = "Everything's peaceful in death!"
icon_state = "borghypo_s"
- reagent_ids = list("dizzysolution","tiresolution","synthpax","tirizene","sulfonal","sodium_thiopental","cyanide","fentanyl")
+ reagent_ids = list(/datum/reagent/peaceborg_confuse, /datum/reagent/peaceborg_tire, /datum/reagent/pax/peaceborg,
+ /datum/reagent/toxin/staminatoxin,/datum/reagent/toxin/sulfonal,/datum/reagent/toxin/sodium_thiopental,
+ /datum/reagent/toxin/cyanide,/datum/reagent/toxin/fentanyl)
accepts_reagent_upgrades = FALSE
/obj/item/reagent_containers/borghypo/epi
name = "epinephrine injector"
desc = "An advanced chemical synthesizer and injection system, designed to stabilize patients."
- reagent_ids = list("epinephrine")
+ reagent_ids = list(/datum/reagent/medicine/epinephrine)
accepts_reagent_upgrades = FALSE
diff --git a/code/modules/reagents/reagent_containers/bottle.dm b/code/modules/reagents/reagent_containers/bottle.dm
index 0ee131bc14..cb7addb95d 100644
--- a/code/modules/reagents/reagent_containers/bottle.dm
+++ b/code/modules/reagents/reagent_containers/bottle.dm
@@ -142,8 +142,9 @@
/obj/item/reagent_containers/glass/bottle/traitor/Initialize()
. = ..()
- extra_reagent = pick("polonium", "histamine", "formaldehyde", "venom", "fentanyl", "cyanide")
- reagents.add_reagent("[extra_reagent]", 3)
+ extra_reagent = pick(/datum/reagent/toxin/polonium, /datum/reagent/toxin/histamine, /datum/reagent/toxin/formaldehyde,
+ /datum/reagent/toxin/venom, /datum/reagent/toxin/fentanyl, /datum/reagent/toxin/cyanide)
+ reagents.add_reagent(extra_reagent, 3)
/obj/item/reagent_containers/glass/bottle/polonium
name = "polonium bottle"
diff --git a/code/modules/reagents/reagent_containers/hypovial.dm b/code/modules/reagents/reagent_containers/hypovial.dm
index ba5ce48a4a..73557d9b14 100644
--- a/code/modules/reagents/reagent_containers/hypovial.dm
+++ b/code/modules/reagents/reagent_containers/hypovial.dm
@@ -5,7 +5,6 @@
desc = "A hypovial compatible with most hyposprays."
icon_state = "hypovial"
spillable = FALSE
- var/comes_with = list() //Easy way of doing this.
volume = 10
possible_transfer_amounts = list(1,2,5,10)
obj_flags = UNIQUE_RENAME
@@ -24,8 +23,6 @@
. = ..()
if(!icon_state)
icon_state = "hypovial"
- for(var/R in comes_with)
- reagents.add_reagent(R,comes_with[R])
update_icon()
@@ -116,84 +113,84 @@
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine
name = "red hypovial (bicaridine)"
icon_state = "hypovial-b"
- comes_with = list("bicaridine" = 30)
+ list_reagents = list("bicaridine" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin
name = "green hypovial (Anti-Tox)"
icon_state = "hypovial-a"
- comes_with = list("antitoxin" = 30)
+ list_reagents = list("antitoxin" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane
name = "orange hypovial (kelotane)"
icon_state = "hypovial-k"
- comes_with = list("kelotane" = 30)
+ list_reagents = list("kelotane" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin
name = "blue hypovial (dexalin)"
icon_state = "hypovial-d"
- comes_with = list("dexalin" = 30)
+ list_reagents = list("dexalin" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord
name = "hypovial (tricordrazine)"
icon_state = "hypovial"
- comes_with = list("tricordrazine" = 30)
+ list_reagents = list("tricordrazine" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction
name = "pink hypovial (breast treatment)"
icon_state = "hypovial-pink"
- comes_with = list("BEsmaller_hypo" = 30)
+ list_reagents = list("BEsmaller_hypo" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction
name = "pink hypovial (penis treatment)"
icon_state = "hypovial-pink"
- comes_with = list("PEsmaller_hypo" = 30)
+ list_reagents = list("PEsmaller_hypo" = 30)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/CMO
name = "deluxe hypovial"
icon_state = "hypoviallarge-cmos"
- comes_with = list("omnizine" = 20, "leporazine" = 20, "atropine" = 20)
+ list_reagents = list("omnizine" = 20, "leporazine" = 20, "atropine" = 20)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/bicaridine
name = "large red hypovial (bicaridine)"
icon_state = "hypoviallarge-b"
- comes_with = list("bicaridine" = 60)
+ list_reagents = list("bicaridine" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/antitoxin
name = "large green hypovial (anti-tox)"
icon_state = "hypoviallarge-a"
- comes_with = list("antitoxin" = 60)
+ list_reagents = list("antitoxin" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/kelotane
name = "large orange hypovial (kelotane)"
icon_state = "hypoviallarge-k"
- comes_with = list("kelotane" = 60)
+ list_reagents = list("kelotane" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/dexalin
name = "large blue hypovial (dexalin)"
icon_state = "hypoviallarge-d"
- comes_with = list("dexalin" = 60)
+ list_reagents = list("dexalin" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/charcoal
name = "large black hypovial (charcoal)"
icon_state = "hypoviallarge-t"
- comes_with = list("charcoal" = 60)
+ list_reagents = list("charcoal" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/tricord
name = "large hypovial (tricord)"
icon_state = "hypoviallarge"
- comes_with = list("tricordrazine" = 60)
+ list_reagents = list("tricordrazine" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/salglu
name = "large green hypovial (salglu)"
icon_state = "hypoviallarge-a"
- comes_with = list("salglu_solution" = 60)
+ list_reagents = list("salglu_solution" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/synthflesh
name = "large orange hypovial (synthflesh)"
icon_state = "hypoviallarge-k"
- comes_with = list("synthflesh" = 60)
+ list_reagents = list("synthflesh" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat
name = "combat hypovial"
icon_state = "hypoviallarge-t"
- comes_with = list("epinephrine" = 3, "omnizine" = 19, "leporazine" = 19, "atropine" = 19) //Epinephrine's main effect here is to kill suff damage, so we don't need much given atropine
+ list_reagents = list("epinephrine" = 3, "omnizine" = 19, "leporazine" = 19, "atropine" = 19) //Epinephrine's main effect here is to kill suff damage, so we don't need much given atropine
diff --git a/code/modules/reagents/reagent_containers/rags.dm b/code/modules/reagents/reagent_containers/rags.dm
index d09b18f244..696117a0c1 100644
--- a/code/modules/reagents/reagent_containers/rags.dm
+++ b/code/modules/reagents/reagent_containers/rags.dm
@@ -73,9 +73,9 @@
if(M.fire_stacks)
var/minus_plus = M.fire_stacks < 0 ? 1 : -1
var/amount = min(abs(M.fire_stacks), soak_efficiency)
- var/r_id = "fuel"
+ var/r_id = /datum/reagent/fuel
if(M.fire_stacks < 0)
- r_id = "water"
+ r_id = /datum/reagent/water
reagents.add_reagent(r_id, amount * 0.3)
M.adjust_fire_stacks(minus_plus * amount)
M.wash_cream()
diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm
index ddbc6cf92b..048cebcf3e 100644
--- a/code/modules/reagents/reagent_containers/spray.dm
+++ b/code/modules/reagents/reagent_containers/spray.dm
@@ -52,13 +52,13 @@
user.changeNext_move(CLICK_CD_RANGE*2)
user.newtonian_move(get_dir(A, user))
var/turf/T = get_turf(src)
- if(reagents.has_reagent("sacid"))
+ if(reagents.has_reagent(/datum/reagent/toxin/acid))
message_admins("[ADMIN_LOOKUPFLW(user)] fired sulphuric acid from \a [src] at [ADMIN_VERBOSEJMP(T)].")
log_game("[key_name(user)] fired sulphuric acid from \a [src] at [AREACOORD(T)].")
- if(reagents.has_reagent("facid"))
+ if(reagents.has_reagent(/datum/reagent/toxin/acid/fluacid))
message_admins("[ADMIN_LOOKUPFLW(user)] fired Fluacid from \a [src] at [ADMIN_VERBOSEJMP(T)].")
log_game("[key_name(user)] fired Fluacid from \a [src] at [AREACOORD(T)].")
- if(reagents.has_reagent("lube"))
+ if(reagents.has_reagent(/datum/reagent/lube))
message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [ADMIN_VERBOSEJMP(T)].")
log_game("[key_name(user)] fired Space lube from \a [src] at [AREACOORD(T)].")
return
@@ -235,9 +235,9 @@
/obj/item/reagent_containers/spray/waterflower/cyborg
reagent_flags = NONE
volume = 100
- list_reagents = list("water" = 100)
+ list_reagents = list(/datum/reagent/water = 100)
var/generate_amount = 5
- var/generate_type = "water"
+ var/generate_type = /datum/reagent/water
var/last_generate = 0
var/generate_delay = 10 //deciseconds
can_fill_from_container = FALSE
@@ -245,9 +245,9 @@
/obj/item/reagent_containers/spray/waterflower/cyborg/hacked
name = "nova flower"
desc = "This doesn't look safe at all..."
- list_reagents = list("clf3" = 3)
+ list_reagents = list(/datum/reagent/clf3 = 3)
volume = 3
- generate_type = "clf3"
+ generate_type = /datum/reagent/clf3
generate_amount = 1
generate_delay = 40 //deciseconds
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 0964b67490..03aaa99477 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -8,7 +8,7 @@
pressure_resistance = 2*ONE_ATMOSPHERE
max_integrity = 300
var/tank_volume = 1000 //In units, how much the dispenser can hold
- var/reagent_id = "water" //The ID of the reagent that the dispenser uses
+ var/reagent_id = /datum/reagent/water //The ID of the reagent that the dispenser uses
/obj/structure/reagent_dispensers/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
@@ -58,7 +58,7 @@
name = "firefighting foam tank"
desc = "A tank full of firefighting foam."
icon_state = "foam"
- reagent_id = "firefighting_foam"
+ reagent_id = /datum/reagent/firefighting_foam
tank_volume = 500
/obj/structure/reagent_dispensers/water_cooler
@@ -99,7 +99,7 @@
name = "fuel tank"
desc = "A tank full of industrial welding fuel. Do not consume."
icon_state = "fuel"
- reagent_id = "welding_fuel"
+ reagent_id = /datum/reagent/fuel
/obj/structure/reagent_dispensers/fueltank/high //Unused - Good for ghost roles
name = "high-capacity fuel tank"
@@ -136,12 +136,12 @@
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/weldingtool))
- if(!reagents.has_reagent("welding_fuel"))
+ if(!reagents.has_reagent(/datum/reagent/fuel))
to_chat(user, "[src] is out of fuel!")
return
var/obj/item/weldingtool/W = I
if(!W.welding)
- if(W.reagents.has_reagent("welding_fuel", W.max_fuel))
+ if(W.reagents.has_reagent(/datum/reagent/fuel, W.max_fuel))
to_chat(user, "Your [W.name] is already full!")
return
reagents.trans_to(W, W.max_fuel)
@@ -171,7 +171,7 @@
icon_state = "pepper"
anchored = TRUE
density = FALSE
- reagent_id = "condensedcapsaicin"
+ reagent_id = /datum/reagent/consumable/condensedcapsaicin
/obj/structure/reagent_dispensers/peppertank/Initialize()
. = ..()
@@ -191,7 +191,7 @@
desc = "A huge metal vat with a tap on the front. Filled with cooking oil for use in frying food."
icon_state = "vat"
anchored = TRUE
- reagent_id = "cooking_oil"
+ reagent_id = /datum/reagent/consumable/cooking_oil
////////
//Kegs//
@@ -201,7 +201,7 @@
name = "beer keg"
desc = "Beer is liquid bread, it's good for you..."
icon_state = "beer"
- reagent_id = "beer"
+ reagent_id = /datum/reagent/consumable/ethanol/beer
/obj/structure/reagent_dispensers/beerkeg/blob_act(obj/structure/blob/B)
explosion(src.loc,0,3,5,7,10)
@@ -213,42 +213,41 @@
desc = "A keg."
icon = 'modular_citadel/icons/obj/objects.dmi'
icon_state = "keg"
- reagent_id = "water"
/obj/structure/reagent_dispensers/keg/mead
name = "keg of mead"
desc = "A keg of mead."
icon_state = "orangekeg"
- reagent_id = "mead"
+ reagent_id = /datum/reagent/consumable/ethanol/mead
/obj/structure/reagent_dispensers/keg/aphro
name = "keg of aphrodisiac"
desc = "A keg of aphrodisiac."
icon_state = "pinkkeg"
- reagent_id = "aphro"
+ reagent_id = /datum/reagent/drug/aphrodisiac
tank_volume = 150
/obj/structure/reagent_dispensers/keg/aphro/strong
name = "keg of strong aphrodisiac"
desc = "A keg of strong and addictive aphrodisiac."
- reagent_id = "aphro+"
+ reagent_id = /datum/reagent/drug/aphrodisiacplus
tank_volume = 120
/obj/structure/reagent_dispensers/keg/milk
name = "keg of milk"
desc = "It's not quite what you were hoping for."
icon_state = "whitekeg"
- reagent_id = "milk"
+ reagent_id = /datum/reagent/consumable/milk
/obj/structure/reagent_dispensers/keg/semen
name = "keg of semen"
desc = "Dear lord, where did this even come from?"
icon_state = "whitekeg"
- reagent_id = "semen"
+ reagent_id = /datum/reagent/consumable/semen
/obj/structure/reagent_dispensers/keg/gargle
name = "keg of pan galactic gargleblaster"
desc = "A keg of... wow that's a long name."
icon_state = "bluekeg"
- reagent_id = "gargleblaster"
+ reagent_id = /datum/reagent/consumable/ethanol/gargle_blaster
tank_volume = 100
\ No newline at end of file
diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm
index 05e4c667f6..20242c9165 100644
--- a/code/modules/research/designs/biogenerator_designs.dm
+++ b/code/modules/research/designs/biogenerator_designs.dm
@@ -7,7 +7,7 @@
id = "milk"
build_type = BIOGENERATOR
materials = list(MAT_BIOMASS = 20)
- make_reagents = list("milk" = 10)
+ make_reagents = list(/datum/reagent/consumable/milk = 10)
category = list("initial","Food")
/datum/design/cream
@@ -15,7 +15,7 @@
id = "cream"
build_type = BIOGENERATOR
materials = list(MAT_BIOMASS = 30)
- make_reagents = list("cream" = 10)
+ make_reagents = list(/datum/reagent/consumable/cream = 10)
category = list("initial","Food")
/datum/design/milk_carton
@@ -39,7 +39,7 @@
id = "black_pepper"
build_type = BIOGENERATOR
materials = list(MAT_BIOMASS = 25)
- make_reagents = list("blackpepper" = 10)
+ make_reagents = list(/datum/reagent/consumable/blackpepper = 10)
category = list("initial","Food")
/datum/design/pepper_mill
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 05c4a7cd93..b25ee9bb2d 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -271,7 +271,7 @@
if(!T.density)
if(prob(EFFECT_PROB_VERYHIGH) && !(locate(/obj/effect/decal/cleanable/greenglow) in T))
var/obj/effect/decal/cleanable/reagentdecal = new/obj/effect/decal/cleanable/greenglow(T)
- reagentdecal.reagents.add_reagent("radium", 7)
+ reagentdecal.reagents.add_reagent(/datum/reagent/radium, 7)
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
var/savedName = "[exp_on]"
ejectItem(TRUE)
@@ -291,7 +291,9 @@
new /obj/item/stack/sheet/mineral/plasma(get_turf(pick(oview(1,src))))
else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
visible_message("[src] destroys [exp_on], leaking dangerous gas!")
- chosenchem = pick("carbon","radium","toxin","condensedcapsaicin","mushroomhallucinogen","space_drugs","ethanol","beepskysmash")
+ chosenchem = pick(/datum/reagent/carbon,/datum/reagent/radium,/datum/reagent/toxin,
+ /datum/reagent/consumable/condensedcapsaicin,/datum/reagent/drug/mushroomhallucinogen,
+ /datum/reagent/drug/space_drugs,/datum/reagent/consumable/ethanol,/datum/reagent/consumable/ethanol/beepsky_smash)
var/datum/reagents/R = new/datum/reagents(50)
R.my_atom = src
R.add_reagent(chosenchem , 50)
@@ -304,7 +306,7 @@
ejectItem(TRUE)
else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
visible_message("[src]'s chemical chamber has sprung a leak!")
- chosenchem = pick("mutationtoxin","nanomachines","sacid")
+ chosenchem = pick(/datum/reagent/mutationtoxin,/datum/reagent/nanomachines,/datum/reagent/toxin/acid)
var/datum/reagents/R = new/datum/reagents(50)
R.my_atom = src
R.add_reagent(chosenchem , 50)
@@ -331,7 +333,7 @@
visible_message("[src]'s emergency coolant system gives off a small ding!")
playsound(src, 'sound/machines/ding.ogg', 50, 1)
var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src))))
- chosenchem = pick("plasma","capsaicin","ethanol")
+ chosenchem = pick(/datum/reagent/toxin/plasma,/datum/reagent/consumable/capsaicin,/datum/reagent/consumable/ethanol)
C.reagents.remove_any(25)
C.reagents.add_reagent(chosenchem , 50)
C.name = "Cup of Suspicious Liquid"
@@ -380,7 +382,7 @@
visible_message("[src]'s emergency coolant system gives off a small ding!")
var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src))))
playsound(src, 'sound/machines/ding.ogg', 50, 1) //Ding! Your death coffee is ready!
- chosenchem = pick("uranium","frostoil","ephedrine")
+ chosenchem = pick(/datum/reagent/uranium,/datum/reagent/consumable/frostoil,/datum/reagent/medicine/ephedrine)
C.reagents.remove_any(25)
C.reagents.add_reagent(chosenchem , 50)
C.name = "Cup of Suspicious Liquid"
@@ -390,7 +392,7 @@
visible_message("[src] malfunctions, shattering [exp_on] and releasing a dangerous cloud of coolant!")
var/datum/reagents/R = new/datum/reagents(50)
R.my_atom = src
- R.add_reagent("frostoil" , 50)
+ R.add_reagent(/datum/reagent/consumable/frostoil, 50)
investigate_log("Experimentor has released frostoil gas.", INVESTIGATE_EXPERIMENTOR)
var/datum/effect_system/smoke_spread/chem/smoke = new
smoke.set_up(R, 0, src, silent = TRUE)
diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm
index 78f636d948..9ba45fb1a3 100644
--- a/code/modules/research/machinery/_production.dm
+++ b/code/modules/research/machinery/_production.dm
@@ -222,7 +222,7 @@
l += "Chemical Storage:
"
for(var/datum/reagent/R in reagents.reagent_list)
l += "[R.name]: [R.volume]"
- l += "Purge"
+ l += "Purge"
l += "
"
return l
diff --git a/code/modules/research/nanites/nanite_programs/buffing.dm b/code/modules/research/nanites/nanite_programs/buffing.dm
index be12d06ede..dde61ec378 100644
--- a/code/modules/research/nanites/nanite_programs/buffing.dm
+++ b/code/modules/research/nanites/nanite_programs/buffing.dm
@@ -35,7 +35,7 @@
host_mob.adjustStaminaLoss(-10) //stimulants give stamina heal now
host_mob.lying = 0
host_mob.update_canmove()
- host_mob.reagents.add_reagent("stimulants", 1.5)
+ host_mob.reagents.add_reagent(/datum/reagent/medicine/stimulants, 1.5)
/datum/nanite_program/hardening
name = "Dermal Hardening"
diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm
index e2e1661ab7..53da4d65c4 100644
--- a/code/modules/research/nanites/nanite_programs/healing.dm
+++ b/code/modules/research/nanites/nanite_programs/healing.dm
@@ -64,7 +64,7 @@
if(R.id == "nanite_b_gone")
host_mob.adjustToxLoss(4)
continue
- host_mob.reagents.remove_reagent(R.id,1)
+ host_mob.reagents.remove_reagent(R.type,1)
/datum/nanite_program/brain_heal
name = "Neural Regeneration"
@@ -164,7 +164,7 @@
/datum/nanite_program/purging_advanced/active_effect()
host_mob.adjustToxLoss(-1, forced = TRUE)
for(var/datum/reagent/toxin/R in host_mob.reagents.reagent_list)
- host_mob.reagents.remove_reagent(R.id,1)
+ host_mob.reagents.remove_reagent(R.type,1)
/datum/nanite_program/regenerative_advanced
name = "Bio-Reconstruction"
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 38a5282aef..6cd54dd941 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -394,7 +394,7 @@ Nothing else in the console has ID requirements.
l += "