mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
Allergens v2 (#7950)
* Allergens v2 * The eggening Add egg allergen, give it to skrell, apply egg allergen where it belongs. * Update species_languages.dm
This commit is contained in:
@@ -112,6 +112,28 @@
|
||||
update_total()
|
||||
amount = min(amount, get_free_space())
|
||||
|
||||
if(istype(my_atom,/obj/item/weapon/reagent_containers/food)) //The following code is targeted specifically at getting allergen reagents into food items, since for the most part they're not applied by default.
|
||||
var/list/add_reagents = list()
|
||||
var/totalnum = 0
|
||||
|
||||
for(var/item in data) //Try to find the ID
|
||||
var/add_reagent_id = null
|
||||
if(item in SSchemistry.chemical_reagents)
|
||||
add_reagent_id = item
|
||||
else if("[item]juice" in SSchemistry.chemical_reagents)
|
||||
add_reagent_id = "[item]juice"
|
||||
if(add_reagent_id) //If we did find it, add it to our list of reagents to add, and add the number to our total.
|
||||
add_reagents[add_reagent_id] += data[item]
|
||||
totalnum += data[item]
|
||||
|
||||
if(totalnum)
|
||||
var/multconst = amount/totalnum //We're going to add these extra reagents so that they share the ratio described, but only add up to 1x the existing amount at the most
|
||||
for(var/item in add_reagents)
|
||||
add_reagent(item,add_reagents[item]*multconst)
|
||||
|
||||
|
||||
|
||||
|
||||
for(var/datum/reagent/current in reagent_list)
|
||||
if(current.id == id)
|
||||
if(current.id == "blood")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user