Skip to content

Commit

Permalink
Merge pull request #9318 from MistakeNot4892/food
Browse files Browse the repository at this point in the history
Backyard grilling and some Sivian cuisine.
  • Loading branch information
Spookerton committed Jan 17, 2024
2 parents 163d896 + 23756fd commit d7e8246
Show file tree
Hide file tree
Showing 22 changed files with 378 additions and 37 deletions.
45 changes: 31 additions & 14 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 @@ -46,23 +60,24 @@
to_chat(user, "<span class='notice'>You add a rod to \the [src].</span>")
var/mutable_appearance/rod_underlay = mutable_appearance('icons/obj/structures.dmi', "bonfire_rod")
rod_underlay.pixel_y = 16
rod_underlay.appearance_flags = RESET_COLOR|PIXEL_SCALE|TILE_BOUND
rod_underlay.appearance_flags = RESET_COLOR | PIXEL_SCALE | TILE_BOUND | KEEP_APART
underlays += rod_underlay
if("Grill")
R.use(1)
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 @@ -193,14 +208,14 @@
if(4.6 to 10)
state = "bonfire_hot"
var/image/I = image(icon, state)
I.appearance_flags = RESET_COLOR
I.appearance_flags = RESET_COLOR | KEEP_APART
add_overlay(I)

if(has_buckled_mobs() && get_fuel_amount() >= 5)
I = image(icon, "bonfire_intense")
I.pixel_y = 13
I.layer = MOB_LAYER + 0.1
I.appearance_flags = RESET_COLOR
I.appearance_flags = RESET_COLOR | KEEP_APART
add_overlay(I)

var/light_strength = max(get_fuel_amount() / 2, 2)
Expand All @@ -210,10 +225,9 @@

if(grill)
var/image/grille_image = image(icon, "bonfire_grill")
grille_image.appearance_flags = RESET_COLOR
grille_image.appearance_flags = RESET_COLOR | KEEP_APART
add_overlay(grille_image)


/obj/structure/bonfire/process()
if(!check_oxygen())
extinguish()
Expand All @@ -222,7 +236,10 @@
if(!consume_fuel(pop(contents)))
extinguish()
return
if(!grill)
if(grill)
for(var/obj/item/reagent_containers/food/snacks/snack in loc)
snack.grill(src)
else
burn()

if(burning)
Expand Down Expand Up @@ -384,7 +401,7 @@
if(6.6 to 10)
state = "fireplace_intense" //don't need to throw a corpse inside to make it burn hotter.
var/image/I = image(icon, state)
I.appearance_flags = RESET_COLOR
I.appearance_flags = RESET_COLOR | KEEP_APART
add_overlay(I)

var/light_strength = max(get_fuel_amount() / 2, 2)
Expand Down Expand Up @@ -423,4 +440,4 @@

/obj/structure/fireplace/water_act(amount)
if(prob(amount * 10))
extinguish()
extinguish()
7 changes: 5 additions & 2 deletions code/modules/economy/price_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,10 @@
/obj/item/reagent_containers/food/snacks/cubancarp
price_tag = 5

/obj/item/reagent_containers/food/snacks/loadedbakedpotato
/obj/item/reagent_containers/food/snacks/bakedpotato
price_tag = 3

/obj/item/reagent_containers/food/snacks/bakedpotato/loaded
price_tag = 5

/obj/item/reagent_containers/food/snacks/fries
Expand Down Expand Up @@ -1026,4 +1029,4 @@
//******************************//

/datum/reagent/ethanol/euphoria
price_tag = 30
price_tag = 30
119 changes: 110 additions & 9 deletions code/modules/food/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,37 @@
. = ..()
nutriment_desc = null

/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
/// 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)
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.
/obj/item/reagent_containers/food/snacks/proc/On_Consume(var/mob/M)
if(!usr)
Expand Down Expand Up @@ -943,10 +974,13 @@
center_of_mass = list("x"=16, "y"=10)
bitesize = 6

/obj/item/reagent_containers/food/snacks/xenomeat/proc/add_venom()
reagents.add_reagent("pacid",6)

/obj/item/reagent_containers/food/snacks/xenomeat/Initialize()
. = ..()
reagents.add_reagent("protein", 6, TASTE_DATA(list("faintly metallic meat" = 6)))
reagents.add_reagent("pacid",6)
add_venom()

/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat // Substitute for recipes requiring xeno meat.
name = "spider meat"
Expand All @@ -955,11 +989,21 @@
filling_color = "#43DE18"
center_of_mass = list("x"=16, "y"=10)
bitesize = 6
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred
backyard_grilling_announcement = "smokes as the poison burns away."

/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/Initialize()
. = ..()
/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/add_venom()
..()
reagents.add_reagent("spidertoxin",6)
reagents.remove_reagent("pacid",6)

/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred
name = "charred spider meat"
desc = "A slab of green meat with char lines. The poison has been burned out of it."
color = COLOR_LIGHT_RED
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe

/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred/add_venom()
return

/obj/item/reagent_containers/food/snacks/meatball
name = "meatball"
Expand Down Expand Up @@ -1001,6 +1045,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 @@ -1464,16 +1526,23 @@
unpopped = max(0, unpopped-1)
. = ..()

/obj/item/reagent_containers/food/snacks/loadedbakedpotato
name = "loaded baked potato"
/obj/item/reagent_containers/food/snacks/bakedpotato
name = "baked potato"
desc = "Totally baked."
icon_state = "loadedbakedpotato"
icon_state = "bakedpotato"
filling_color = "#9C7A68"
center_of_mass = list("x"=16, "y"=10)
nutriment_amt = 6
nutriment_desc = list("baked potato" = 3)
nutriment_allergens = ALLERGEN_VEGETABLE
bitesize = 2

/obj/item/reagent_containers/food/snacks/bakedpotato/loaded
name = "loaded baked potato"
icon_state = "loadedbakedpotato"
nutriment_amt = 12
nutriment_desc = list("baked potato" = 3, "cheese" = 3)
nutriment_allergens = ALLERGEN_VEGETABLE|ALLERGEN_DAIRY
bitesize = 2

/obj/item/reagent_containers/food/snacks/fries
name = "skinny fries"
Expand Down Expand Up @@ -1578,6 +1647,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)
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 Expand Up @@ -2107,6 +2193,8 @@
nutriment_desc = list("bread" = 3, "cheese" = 3)
nutriment_allergens = ALLERGEN_DAIRY
bitesize = 2
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/toastedsandwich
backyard_grilling_announcement = "is toasted golden brown."

/obj/item/reagent_containers/food/snacks/clubsandwich
name = "club sandwich"
Expand Down Expand Up @@ -3592,6 +3680,8 @@
nutriment_amt = 4
nutriment_desc = list("uncooked dough" = 3)
nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_EGGS //We're going to call the egg a gameplay abstraction for the mostpart, but for now you JUST put an egg in here...=
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/bun
backyard_grilling_announcement = "is baked into a simple bun."

// Dough + rolling pin = flat dough
/obj/item/reagent_containers/food/snacks/dough/attackby(obj/item/W as obj, mob/user as mob)
Expand All @@ -3612,7 +3702,8 @@
nutriment_desc = list("raw dough" = 3)
center_of_mass = list("x"=16, "y"=16)
nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_EGGS

backyard_grilling_product = /obj/item/reagent_containers/food/snacks/flatbread
backyard_grilling_announcement = "is baked into a simple flatbread."

/obj/item/reagent_containers/food/snacks/doughslice
name = "dough slice"
Expand Down Expand Up @@ -3736,6 +3827,8 @@
icon_state = "rawcutlet"
bitesize = 1
center_of_mass = list("x"=17, "y"=20)
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/cutlet
backyard_grilling_announcement = "sizzles as it is grilled through."

/obj/item/reagent_containers/food/snacks/rawcutlet/Initialize()
. = ..()
Expand All @@ -3760,6 +3853,8 @@
icon_state = "rawmeatball"
bitesize = 2
center_of_mass = list("x"=16, "y"=15)
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/meatball
backyard_grilling_announcement = "sizzles as it is grilled through."

/obj/item/reagent_containers/food/snacks/rawmeatball/Initialize()
. = ..()
Expand Down Expand Up @@ -3796,6 +3891,8 @@
nutriment_amt = 3
nutriment_desc = list("raw potato" = 3)
nutriment_allergens = ALLERGEN_VEGETABLE
// This probably should need a container and oil
// backyard_grilling_product = /obj/item/reagent_containers/food/snacks/fries

/obj/item/reagent_containers/food/snacks/rawsunflower
name = "sunflower seeds"
Expand All @@ -3807,6 +3904,8 @@
nutriment_amt = 1
nutriment_desc = list("starch" = 3)
nutriment_allergens = ALLERGEN_SEEDS
// This probably should need a container and oil
// backyard_grilling_product = /obj/item/reagent_containers/food/snacks/roastedsunflower

/obj/item/reagent_containers/food/snacks/frostbelle
name = "frostbelle bud"
Expand Down Expand Up @@ -4233,6 +4332,8 @@
nutriment_amt = 2
nutriment_desc = list("tartness" = 1)
w_class = ITEMSIZE_TINY
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/roast_sifpod
backyard_grilling_announcement = "crackles and pops as the roast hull splits open."

/obj/item/reagent_containers/food/snacks/siffruit/Initialize()
. = ..()
Expand Down
Loading

0 comments on commit d7e8246

Please sign in to comment.