Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newfood duplication fix + cleans up edibility #9919

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
///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"

Expand Down
7 changes: 3 additions & 4 deletions code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,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
Expand Down Expand Up @@ -229,10 +227,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)
Expand All @@ -242,6 +239,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)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
..()

/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++

Expand Down
17 changes: 0 additions & 17 deletions code/modules/food_and_drinks/food/customizables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,6 @@
////////////// Customizable Food Types /////////////////////////////
/////////////////////////////////////////////////////////////////////////////

/obj/item/reagent_containers/food/snacks/customizable/burger
name = "burger"
desc = "A timeless classic."
ingredients_placement = INGREDIENTS_STACKPLUSTOP
icon = 'icons/obj/food/burgerbread.dmi'
icon_state = "custburg"
foodtype = GRAIN

/obj/item/reagent_containers/food/snacks/customizable/kebab
name = "kebab"
desc = "Delicious food on a stick."
Expand All @@ -168,15 +160,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/spaghetti.dmi'
icon_state = "spaghettiboiled"
foodtype = GRAIN

/obj/item/reagent_containers/food/snacks/customizable/pie
name = "pie"
ingMax = 6
Expand Down
1 change: 0 additions & 1 deletion code/modules/food_and_drinks/food/snacks/dough.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
icon = 'icons/obj/food/burgerbread.dmi'
icon_state = "bun"
list_reagents = list(/datum/reagent/consumable/nutriment = 1)
custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/burger
filling_color = "#CD853F"
tastes = list("bun" = 1) // the bun tastes of bun.
foodtype = GRAIN
Expand Down
9 changes: 7 additions & 2 deletions code/modules/surgery/organs/organ_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
/obj/item/organ/Initialize()
. = ..()
if(organ_flags & ORGAN_EDIBLE)
AddComponent(/datum/component/edible, initial_reagents = food_reagents, foodtypes = RAW | MEAT | GORE, \
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)))
AddComponent(/datum/component/edible,\
initial_reagents = food_reagents,\
foodtypes = RAW | MEAT | GORE,\
volume = 10,\
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)))

/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE, pref_load = FALSE)
if(!iscarbon(M) || owner == M)
Expand Down