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

[MIRROR] BBQ ribs can be grilled & adds qdel checks for grills #2042

Merged
merged 1 commit into from
Feb 19, 2024
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
13 changes: 13 additions & 0 deletions code/game/objects/items/food/meatdish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,19 @@
foodtypes = MEAT | SUGAR
crafting_complexity = FOOD_COMPLEXITY_2

///Special private component to handle how bbq is grilled, not meant to be used anywhere else
/datum/component/grillable/bbq

/datum/component/grillable/bbq/finish_grilling(atom/grill_source)
//when on a grill allow it to roast without deleting itself
if(istype(grill_source, /obj/machinery/grill))
grill_source.visible_message(span_notice("[parent] is grilled to perfection!"))
else //when on a girddle allow it to burn into an mouldy mess
return ..()

/obj/item/food/bbqribs/make_grillable()
AddComponent(/datum/component/grillable/bbq, /obj/item/food/badrecipe, rand(30 SECONDS, 40 SECONDS), FALSE)

/obj/item/food/meatclown
name = "meat clown"
desc = "A delicious, round piece of meat clown. How horrifying."
Expand Down
16 changes: 13 additions & 3 deletions code/modules/food_and_drinks/machinery/grill.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
..()

/obj/machinery/grill/process(seconds_per_tick)
..()
update_appearance()
if(grill_fuel <= 0)
return
Expand All @@ -90,7 +89,11 @@
smoke.start()
if(grilled_item)
SEND_SIGNAL(grilled_item, COMSIG_ITEM_GRILL_PROCESS, src, seconds_per_tick)
grill_time += seconds_per_tick
if(QDELETED(grilled_item))
grilled_item = null
finish_grill()
return
grill_time += seconds_per_tick * 10 //convert to deciseconds
grilled_item.reagents.add_reagent(/datum/reagent/consumable/char, 0.5 * seconds_per_tick)
grill_fuel -= GRILL_FUELUSAGE_ACTIVE * seconds_per_tick
grilled_item.AddComponent(/datum/component/sizzle)
Expand Down Expand Up @@ -125,9 +128,16 @@

/obj/machinery/grill/proc/finish_grill()
if(!QDELETED(grilled_item))
if(grill_time >= 20)
var/time_limit = 20 SECONDS
//when items grill themselves in their own unique ways we want to follow their constraints
var/datum/component/grillable/custom_grilling = grilled_item.GetComponent(/datum/component/grillable)
if(!isnull(custom_grilling))
time_limit = custom_grilling.required_cook_time

if(grill_time >= time_limit)
grilled_item.AddElement(/datum/element/grilled_item, grill_time)
UnregisterSignal(grilled_item, COMSIG_ITEM_GRILLED)

grill_time = 0
grill_loop.stop()

Expand Down
Loading