diff --git a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_food.dm b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_food.dm index 20aecb140c2d..831363f5a523 100644 --- a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_food.dm +++ b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_food.dm @@ -12,6 +12,7 @@ // Microwaving foods ///called on item when microwaved (): (obj/machinery/microwave/M) #define COMSIG_ITEM_MICROWAVE_ACT "microwave_act" + #define COMPONENT_SUCCESFUL_MICROWAVE (1<<0) ///called on item when created through microwaving (): (obj/machinery/microwave/M, cooking_efficiency) #define COMSIG_ITEM_MICROWAVE_COOKED "microwave_cooked" diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index d03963ba719a..520d90cc25cf 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -90,8 +90,6 @@ Behavior that's still missing from this component that original food items had t src.bite_consumption = bite_consumption src.food_flags = food_flags src.foodtypes = foodtypes - src.initial_reagents = initial_reagents - src.tastes = tastes src.eat_time = eat_time src.eatverbs = string_list(eatverbs) src.junkiness = junkiness @@ -232,10 +230,9 @@ Behavior that's still missing from this component that original food items had t if(!microwaved_type) new /obj/item/reagent_containers/food/snacks/badrecipe(parent_turf) - qdel(src) + qdel(parent) return - var/obj/item/result result = new microwaved_type(parent_turf) @@ -245,6 +242,8 @@ Behavior that's still missing from this component that original food items had t SEND_SIGNAL(result, COMSIG_ITEM_MICROWAVE_COOKED, parent, efficiency) SSblackbox.record_feedback("tally", "food_made", 1, result.type) + qdel(parent) + return COMPONENT_SUCCESFUL_MICROWAVE ///Corrects the reagents on the newly cooked food /datum/component/edible/proc/on_microwave_cooked(datum/source, obj/item/source_item, cooking_efficiency = 1) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index df596b973993..88c5df2262da 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -817,7 +817,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb ..() /obj/item/proc/microwave_act(obj/machinery/microwave/M) - SEND_SIGNAL(src, COMSIG_ITEM_MICROWAVE_ACT, M) + if(SEND_SIGNAL(src, COMSIG_ITEM_MICROWAVE_ACT, M) & COMPONENT_SUCCESFUL_MICROWAVE) + return if(istype(M) && M.dirty < 100) M.dirty++ diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index a59a7a30745a..3147ee9a5de4 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -179,15 +179,6 @@ ingMax = 6 icon_state = "rod" -/obj/item/reagent_containers/food/snacks/customizable/pasta - name = "spaghetti" - desc = "Noodles. With stuff. Delicious." - ingredients_placement = INGREDIENTS_SCATTER - ingMax = 6 - icon = 'icons/obj/food/pizzaspaghetti.dmi' - icon_state = "spaghettiboiled" - foodtype = GRAIN - /obj/item/reagent_containers/food/snacks/customizable/pie name = "pie" diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 26b93d2c4642..6ba9ce69d700 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -55,7 +55,7 @@ update_appearance() return 1 -/obj/item/organ/heart/OnEatFrom(eater, feeder) +/obj/item/organ/heart/on_eat_from(eater, feeder) . = ..() beating = FALSE update_appearance() diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index b8871b21524e..72b7fba9d2da 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -38,7 +38,14 @@ /obj/item/organ/Initialize() . = ..() if(organ_flags & ORGAN_EDIBLE) - AddComponent(/datum/component/edible, food_reagents, null, RAW | MEAT | GORE, null, 10, null, null, null, COLOR_PINK, CALLBACK(src, PROC_REF(OnEatFrom))) + AddComponent(/datum/component/edible,\ + initial_reagents = food_reagents,\ + foodtypes = RAW | MEAT | GORE,\ + volume = 10,\ + filling_color = COLOR_PINK,\ + pre_eat = CALLBACK(src, PROC_REF(pre_eat)),\ + on_compost = CALLBACK(src, PROC_REF(pre_compost)),\ + after_eat = CALLBACK(src, PROC_REF(on_eat_from))) ///When you take a bite you cant jam it in for surgery anymore. /obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) @@ -133,8 +140,21 @@ STOP_PROCESSING(SSobj, src) return ..() -/obj/item/organ/proc/OnEatFrom(eater, feeder) - useable = FALSE //You can't use it anymore after eating it you spaztic +// Put any "can we eat this" checks for edible organs here +/obj/item/organ/proc/pre_eat(eater, feeder) + if(iscarbon(eater)) + var/mob/living/carbon/target = eater + for(var/S in target.surgeries) + var/datum/surgery/surgery = S + if(surgery.location == zone) + return FALSE + return TRUE + +/obj/item/organ/proc/pre_compost(user) + return TRUE + +/obj/item/organ/proc/on_eat_from(eater, feeder) + useable = FALSE //You bit it, no more using it /obj/item/organ/item_action_slot_check(slot,mob/user) return //so we don't grant the organ's action to mobs who pick up the organ.