Skip to content

Commit

Permalink
Testing/refinement of backyard grilling logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 17, 2024
1 parent 5eab79f commit 3fdb58a
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 29 deletions.
29 changes: 22 additions & 7 deletions code/game/objects/structures/bonfire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
density = FALSE
anchored = TRUE
buckle_lying = FALSE
layer = TURF_LAYER + 0.5 // We want it to layer underneath food and things on top of it.

var/burning = FALSE
var/next_fuel_consumption = 0 // world.time of when next item in fuel list gets eatten to sustain the fire.
var/grill = FALSE
Expand Down Expand Up @@ -35,9 +37,21 @@
. = ..(ml, MAT_SIFWOOD)

/obj/structure/bonfire/attackby(obj/item/W, mob/user)

// Place food on the grill.
if(istype(W, /obj/item/reagent_containers/food/snacks) && grill)
if(user.unEquip(W))
W.dropInto(loc)
// Place it on top of the grill.
W.pixel_x = 0
W.pixel_y = 12
return TRUE

if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
var/obj/item/stack/rods/R = W
var/choice = input(user, "What would you like to construct?", "Bonfire") as null|anything in list("Stake","Grill")
if(!choice || user.incapacitated() || !Adjacent(user))
return TRUE
switch(choice)
if("Stake")
R.use(1)
Expand All @@ -53,16 +67,17 @@
grill = TRUE
to_chat(user, "<span class='notice'>You add a grill to \the [src].</span>")
update_icon()
else
return ..()
return TRUE

else if(istype(W, /obj/item/stack/material/wood) || istype(W, /obj/item/stack/material/log) )
if(istype(W, /obj/item/stack/material/wood) || istype(W, /obj/item/stack/material/log) )
add_fuel(W, user)
return TRUE

else if(W.is_hot())
if(W.is_hot())
ignite()
else
return ..()
return TRUE

return ..()

/obj/structure/bonfire/attack_hand(mob/user)
if(has_buckled_mobs())
Expand Down Expand Up @@ -223,7 +238,7 @@
return
if(grill)
for(var/obj/item/reagent_containers/food/snacks/snack in loc)
snack.grill()
snack.grill(src)
else
burn()

Expand Down
53 changes: 49 additions & 4 deletions code/modules/food/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,35 @@
. = ..()
nutriment_desc = null

// Halfassed version of Crabs' cooking system on Cit, should be folded into that if it is ported to Polaris.
/obj/item/reagent_containers/food/snacks

// Halfassed version of Crabs' cooking system on Cit, should
// be folded into that if it is ported to Polaris.

/// How many SSobj ticks of cooking the food has experienced.
var/backyard_grilling_progress = 0
/// What object type the food cooks into.
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
var/backyard_grilling_threshold = 5
/// How many SSobj ticks it takes for the food to cook.
var/backyard_grilling_threshold = 10
/// The message shown when the food cooks.
var/backyard_grilling_announcement = "smokes and chars!"
/// The span class used for the message above. Burned food defaults to SPAN_DANGER.
var/backyard_grilling_span = "notice"

/obj/item/reagent_containers/food/snacks/proc/grill(var/atom/heat_source)
if(!backyard_grilling_product || !backyard_grilling_threshold)
return
backyard_grilling_progress++
if(backyard_grilling_progress >= backyard_grilling_threshold)
backyard_grilling_progress = 0
var/obj/item/food = new backyard_grilling_product
food.dropInto(loc)
if(backyard_grilling_announcement)
food.visible_message("\The [src] [backyard_grilling_announcement]")
if(istype(food, /obj/item/reagent_containers/food/snacks/badrecipe))
food.visible_message(SPAN_DANGER("\The [src] [backyard_grilling_announcement]"))
else
food.visible_message("<span class='[backyard_grilling_span]'>\The [src] [backyard_grilling_announcement]</span>")
qdel(src)

//Placeholder for effect that trigger on eating that aren't tied to reagents.
Expand Down Expand Up @@ -1031,6 +1044,24 @@
. = ..()
reagents.add_reagent("protein", 2, TASTE_DATA(list("salty meat mush" = 2)))

/obj/item/reagent_containers/food/snacks/donkpocket/grill(var/atom/heat_source)

backyard_grilling_progress++
if(backyard_grilling_progress >= backyard_grilling_threshold)
backyard_grilling_progress = 0

// We're already warm, so we burn.
if(warm)
var/obj/item/reagent_containers/food/snacks/badrecipe/whoops = new
whoops.dropInto(loc)
visible_message(SPAN_DANGER("\The [src] chars and blackens!"))
qdel(src)
return

// Otherwise we just warm up.
heat()
visible_message(SPAN_NOTICE("\The [src] steams gently!"))

/obj/item/reagent_containers/food/snacks/donkpocket/proc/heat()
warm = 1
for(var/reagent in heated_reagents)
Expand Down Expand Up @@ -1615,9 +1646,23 @@
filling_color = "#211F02"
center_of_mass = list("x"=16, "y"=12)
bitesize = 2
backyard_grilling_product = null

/obj/item/reagent_containers/food/snacks/badrecipe/grill(var/atom/heat_source)
return // We are already carbonized.
if(!backyard_grilling_progress) // Smoke on our first grill
// Produce nasty smoke.
var/datum/effect_system/smoke_spread/bad/burntfood/smoke = new /datum/effect_system/smoke_spread/bad/burntfood
playsound(src, 'sound/effects/smoke.ogg', 20, 1)
smoke.attach(src)
smoke.set_up(10, 0, get_turf(src), 300)
smoke.start()
// Set off fire alarms!
var/obj/machinery/firealarm/FA = locate() in get_area(src)
if(FA)
FA.alarm()
backyard_grilling_progress++
if(backyard_grilling_progress >= backyard_grilling_threshold)
qdel(src)

/obj/item/reagent_containers/food/snacks/badrecipe/Initialize()
. = ..()
Expand Down
24 changes: 12 additions & 12 deletions code/modules/food/food/snacks_sif.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
icon = 'icons/obj/food_sivian.dmi'
icon_state = "gumbo"
trash = /obj/item/trash/gumbo_bowl
nutriment_amt = 6
nutriment_amt = 8
nutriment_desc = list(
"smoky fish" = 3,
"spiced vegetables" = 3,
Expand All @@ -36,7 +36,7 @@
bitesize = 3

/obj/item/trash/gumbo_bowl
name = "bowl"
name = "brown bowl"
icon_state = "gumbo_bowl"

/obj/item/reagent_containers/food/snacks/sif_jambalaya
Expand All @@ -45,7 +45,7 @@
gender = PLURAL
icon = 'icons/obj/food_sivian.dmi'
icon_state = "jambalaya"
trash = /obj/item/trash/jambalaya_bowl
trash = /obj/item/trash/jambalaya_plate
nutriment_amt = 2
nutriment_desc = list(
"rich tomato and chili" = 3,
Expand All @@ -63,18 +63,18 @@
reagents.add_reagent("water", 1)
reagents.add_reagent("rice", 1)

/obj/item/trash/jambalaya_bowl
name = "small bowl"
icon_state = "small_blue_bowl"
/obj/item/trash/jambalaya_plate
name = "plate"
icon_state = "blue_plate"

/obj/item/reagent_containers/food/snacks/sif_gerjao_auga
name = "gerjao auga"
desc = "A serving of finely shredded, fermented eyebulbs, similar in consistency to sauerkraut, but with an offputting citrus smell. Goes well with smoked shantak flank."
gender = PLURAL
icon = 'icons/obj/food_sivian.dmi'
icon_state = "gerjao_auga"
trash = /obj/item/trash/gerjao_auga_plate
nutriment_amt = 6
trash = /obj/item/trash/gerjao_auga_bowl
nutriment_amt = 3
nutriment_desc = list(
"sharp vinegar" = 4,
"bitter citrus" = 2,
Expand All @@ -85,11 +85,11 @@

/obj/item/reagent_containers/food/snacks/sif_gerjao_auga/Initialize()
. = ..()
reagents.add_reagent("vinegar", 2)
reagents.add_reagent("vinegar", 1)

/obj/item/trash/gerjao_auga_plate
name = "blue plate"
icon_state = "blue plate"
/obj/item/trash/gerjao_auga_bowl
name = "small bowl"
icon_state = "small_blue_bowl"

/*
/obj/item/reagent_containers/food/snacks/sif_wabback_gratin
Expand Down
10 changes: 6 additions & 4 deletions code/modules/food/recipes_sif.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
/datum/recipe/sif_jambalaya
appliance = OVEN
reagent_mix = RECIPE_REAGENT_REPLACE
result_quantity = 5
result_quantity = 5 // This is a lot, but we have no way to make a big bulk stew item and split it up currently.
reagents = list(
"water" = 5,
"rice" = 10
"rice" = 10,
"spacespice" = 2
)
items = list(
/obj/item/reagent_containers/food/snacks/meat,
Expand Down Expand Up @@ -54,10 +55,11 @@
/datum/recipe/sif_gumbo
appliance = OVEN
reagent_mix = RECIPE_REAGENT_REPLACE
result_quantity = 3
result_quantity = 3 // See jambalaya above.
reagents = list(
"water" = 5,
"rice" = 5
"rice" = 5,
"spacespice" = 2
)
items = list(
/obj/item/reagent_containers/food/snacks/meat,
Expand Down
3 changes: 2 additions & 1 deletion code/modules/hydroponics/seedtypes/flowers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
seed_name = "cavebulbs"
display_name = "cavebulbs"
kitchen_tag = null
chems = list("nutriment" = list(1,10), "spacespice" = list(1,10))

/datum/seed/flower/sunflower/cavebulbs/New()
..()
Expand Down Expand Up @@ -118,4 +119,4 @@
..()
set_trait(TRAIT_IDEAL_LIGHT, 1)
set_trait(TRAIT_PLANT_COLOUR,"#5e0303")
set_trait(TRAIT_CARNIVOROUS,1)
set_trait(TRAIT_CARNIVOROUS,1)
2 changes: 1 addition & 1 deletion code/modules/hydroponics/seedtypes/potato.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
kitchen_tag = "potato"
chems = list("nutriment" = list(1,10), "potatojuice" = list(10,10))
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/bakedpotato
c = "steams as it is baked through."
backyard_grilling_announcement = "steams as it is baked through."

/datum/seed/potato/New()
..()
Expand Down

0 comments on commit 3fdb58a

Please sign in to comment.