Skip to content

Commit

Permalink
[MIRROR] BBQ ribs can be grilled & adds qdel checks for grills (#2042)
Browse files Browse the repository at this point in the history
* BBQ ribs can be grilled & adds qdel checks for grills (#81536)

## About The Pull Request
- Fixes #81511. BBQ ribs can be grilled again and takes anywhere between
30 to 40 seconds to get proper grilled ribs or turn into a mouldy mess.
20 seconds would only yield lightly grilled ribs and that's not good.
- Grill checks if the item got deleted to avoid runtimes. Also cook time
is set based on the individual items type & not a constant of 20 seconds

## Changelog
:cl:
fix: Grill checks if the item got deleted to avoid runtimes. Also cook
time is set based on the individual items type & not a constant of 20
seconds
fix: BBQ ribs can be grilled on a grill but now takes anywhere between
30 to 40 seconds to get proper smoked ribs and not lightly smoked ribs
or turn into a mouldy mess on a girddle. Delicious.
/:cl:

---------



* BBQ ribs can be grilled & adds qdel checks for grills

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: SyncIt21 <[email protected]>
Co-authored-by: jimmyl <[email protected]>
  • Loading branch information
4 people authored Feb 19, 2024
1 parent 8038a98 commit 62f04ab
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
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

0 comments on commit 62f04ab

Please sign in to comment.