Burned mess from culinary disasters is once again toxic. (#92394)

## About The Pull Request
When an item is cooked, reagents are generally cleared from the
resulting object and the reagents of the source object are transferred
to it instead. This means burned mess won't have its toxins when cooked,
locking you out of one or two chemistry recipes that require it while
also making the item generally not toxic at all.
So to fix it, we simply have to replace all or most of the consumable
reagents inside the burned mess with bad food, via component signals.

## Why It's Good For The Game
Fixing an issue with food and chemistry.

## Changelog

🆑
fix: burned mess made with a microwave, oven or griddle once again
toxins.
/🆑

---------

Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
This commit is contained in:
Ghom
2025-08-19 22:30:38 -04:00
committed by nevimer
co-authored by _0Steven
parent 5ba2d7522f
commit 7ff0a19883
5 changed files with 29 additions and 7 deletions
+19 -5
View File
@@ -194,9 +194,28 @@
/obj/item/food/badrecipe/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_ITEM_GRILL_PROCESS, PROC_REF(OnGrill))
RegisterSignals(src, list(COMSIG_ITEM_GRILLED_RESULT, COMSIG_ITEM_BAKED_RESULT, COMSIG_ITEM_MICROWAVE_COOKED_FROM), PROC_REF(convert_to_bad_food))
if(stink_particles)
add_shared_particles(stink_particles)
///Prevents grilling burnt shit from well, burning.
/obj/item/food/badrecipe/proc/OnGrill()
SIGNAL_HANDLER
return COMPONENT_HANDLED_GRILLING
/**
* The bad food reagent is cleared when cooked rather than just spawned and the reagents of the item this is from are transferred to this instead,
* So we want to convert most of the consumable reagents into bad food, which is what makes the burned mess a bad thing to eat, taste aside.
*/
/obj/item/food/badrecipe/proc/convert_to_bad_food(atom/source)
SIGNAL_HANDLER
var/bad_food_amount = 0
for(var/datum/reagent/consumable/food_reagent in reagents.reagent_list)
var/amount_to_remove = food_reagent.volume * rand(6, 8) * 0.1 //around 60% to 80% of the volume is to be converted.
reagents.remove_reagent(food_reagent.type, amount_to_remove, safety = FALSE)
bad_food_amount += amount_to_remove
reagents.add_reagent(/datum/reagent/toxin/bad_food, bad_food_amount, reagtemp = reagents.chem_temp)
/obj/item/food/badrecipe/Destroy(force)
if (stink_particles)
remove_shared_particles(stink_particles)
@@ -227,11 +246,6 @@
. = ..()
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOLD, CELL_VIRUS_TABLE_GENERIC, rand(2, 4), 25)
///Prevents grilling burnt shit from well, burning.
/obj/item/food/badrecipe/proc/OnGrill()
SIGNAL_HANDLER
return COMPONENT_HANDLED_GRILLING
/obj/item/food/spidereggs
name = "spider eggs"
desc = "A cluster of juicy spider eggs. A great side dish for when you care not for your health."