Emergency Grill Things (#10212)

This commit is contained in:
Geeves
2020-10-10 00:54:32 +02:00
committed by GitHub
parent 6003581ca6
commit bd8d269c7b
11 changed files with 95 additions and 50 deletions
@@ -42,7 +42,7 @@
// If the machine has multiple output modes, define them here.
var/selected_option
var/list/output_options = list()
var/finish_verb = "pings!"
var/combine_first = FALSE//If 1, this appliance will do combination cooking before checking recipes
/obj/machinery/appliance/Initialize()
@@ -326,8 +326,7 @@
/obj/machinery/appliance/proc/finish_cooking(var/datum/cooking_item/CI)
visible_message("<b>[src]</b> pings!")
audible_message("<b>[src]</b> [finish_verb]")
if(cooked_sound)
playsound(get_turf(src), cooked_sound, 50, 1)
//Check recipes first, a valid recipe overrides other options
@@ -48,7 +48,7 @@
description += "[src] is still heating up and is too cold to cook anything yet."
else
description += "It is running at [round(get_efficiency(), 0.1)]% efficiency!"
description += "Temperature: [round(temperature - T0C, 0.1)]C / [round(optimal_temp - T0C, 0.1)]C"
description += "<br>Temperature: [round(temperature - T0C, 0.1)]C / [round(optimal_temp - T0C, 0.1)]C"
else
description += "It is switched off."
openToolTip(usr, src, params, name, description)
@@ -111,10 +111,13 @@
stat &= ~POWEROFF
use_power = !(stat & POWEROFF) && use_power
if(wasoff != (stat & POWEROFF))
user.visible_message("<b>[user]</b> turns [use_power ? "on" : "off"] [src].", "You turn [use_power ? "on" : "off"] [src].")
activation_message(user)
playsound(src, 'sound/machines/click.ogg', 40, 1)
update_icon()
/obj/machinery/appliance/cooker/proc/activation_message(var/mob/user)
user.visible_message("<b>[user]</b> turns [use_power ? "on" : "off"] [src].", "You turn [use_power ? "on" : "off"] [src].")
/obj/machinery/appliance/cooker/update_icon()
overlays.Cut()
var/image/light
@@ -5,6 +5,7 @@
/obj/item/reagent_containers/cooking_container
icon = 'icons/obj/cooking_machines.dmi'
var/shortname
var/place_verb = "into"
var/max_space = 20//Maximum sum of w-classes of foods in this container at once
volume = 80//Maximum units of reagents
flags = OPENCONTAINER | NOREACT
@@ -61,7 +62,7 @@
if(!user.unEquip(I))
return
I.forceMove(src)
to_chat(user, SPAN_NOTICE("You put [I] into [src]."))
to_chat(user, SPAN_NOTICE("You put [I] [place_verb] [src]."))
return
/obj/item/reagent_containers/cooking_container/verb/empty()
@@ -230,6 +231,22 @@
icon_state = "basket"
appliancetype = FRYER
/obj/item/reagent_containers/cooking_container/grill_grate
name = "grill grate"
shortname = "grate"
place_verb = "onto"
desc = "Primarily used to grill meat, place this on a grill and grab a can of energy drink."
icon_state = "grill_grate"
appliancetype = GRILL
insertable = list(
/obj/item/reagent_containers/food/snacks/meat
)
/obj/item/reagent_containers/cooking_container/grill_grate/can_fit()
if(length(contents) >= 3)
return FALSE
return TRUE
/obj/item/reagent_containers/cooking_container/plate
name = "serving plate"
shortname = "plate"
@@ -1,61 +1,66 @@
/obj/machinery/appliance/grill
/obj/machinery/appliance/cooker/grill
name = "grill"
desc = "Backyard grilling, IN SPACE."
icon_state = "grill_off"
cook_type = "grilled"
appliancetype = GRILL
stat = POWEROFF
food_color = "#a34719"
on_icon = "grill_on"
off_icon = "grill_off"
stat = POWEROFF
finish_verb = "sizzles to completion!"
cooked_sound = 'sound/effects/meatsizzle.ogg'
min_temp = 100 + T0C
optimal_temp = 150 + T0C
temp_settings = 1
max_contents = 1
resistance = 500 // assuming it's a fired grill, it shouldn't take very long to heat
/obj/machinery/appliance/grill/attempt_toggle_power(var/mob/user, ranged = FALSE)
. = ..(user, ranged)
if(use_power)
get_cooking_work(cooking_objs[1])
idle_power_usage = 0
active_power_usage = 0
/obj/machinery/appliance/grill/Initialize()
. = ..()
cooking_objs += new /datum/cooking_item(new /obj/item/reagent_containers/cooking_container(src))
cooking = 0
cooking_coeff = 0.3 // cook it nice and slow
/obj/machinery/appliance/grill/has_space(var/obj/item/I)
var/datum/cooking_item/CI = cooking_objs[1]
if (!CI || !CI.container)
return FALSE
starts_with = list(
/obj/item/reagent_containers/cooking_container/grill_grate
)
if (CI.container.can_fit(I))
return CI
/obj/machinery/appliance/cooker/grill/RefreshParts()
..()
cooking_coeff = 0.3 // we will always cook nice and slow
/obj/machinery/appliance/cooker/grill/get_efficiency()
return (temperature / optimal_temp) * 100
/obj/machinery/appliance/cooker/grill/activation_message(var/mob/user)
user.visible_message("<b>[user]</b> [stat ? "turns off" : "fires up"] \the [src].", "You [stat ? "turn off" : "fire up"] \the [src].")
/obj/machinery/appliance/cooker/grill/has_space(var/obj/item/I)
if(istype(I, /obj/item/reagent_containers/cooking_container))
if(length(cooking_objs) < max_contents)
return TRUE
else
if(length(cooking_objs))
var/datum/cooking_item/CI = cooking_objs[1]
var/obj/item/reagent_containers/cooking_container/grill_grate/G = CI.container
if(G?.can_fit(I))
return CI
return FALSE
//Container is not removable
/obj/machinery/appliance/grill/removal_menu(var/mob/user)
if (!can_remove_items(user))
return FALSE
var/list/menuoptions = list()
for (var/datum/cooking_item/CI in cooking_objs)
if (CI.container?.check_contents() == CONTAINER_EMPTY)
to_chat(user, SPAN_WARNING("There's nothing in [src] to remove!"))
return
for (var/obj/item/I in CI.container)
menuoptions[I.name] = I
var/selection = show_radial_menu(user, src, menuoptions, require_near = TRUE, tooltips = TRUE, no_repeat_close = TRUE)
if (!selection)
return FALSE
var/obj/item/I = menuoptions[selection]
if (!user?.put_in_hands(I))
I.forceMove(get_turf(src))
update_icon()
return TRUE
/obj/machinery/appliance/grill/update_icon()
if (!stat)
/obj/machinery/appliance/cooker/grill/update_icon()
. = ..()
cut_overlays()
if(!stat)
icon_state = on_icon
else
icon_state = off_icon
/obj/machinery/appliance/grill/machinery_process()
if (!stat)
for (var/i in cooking_objs)
do_cooking_tick(i)
if(length(cooking_objs))
var/datum/cooking_item/CI = cooking_objs[1]
var/obj/item/reagent_containers/cooking_container/grill_grate/G = CI.container
if(G)
add_overlay(image('icons/obj/cooking_machines.dmi', "grill"))
var/contents_len = length(G.contents)
if(!contents_len)
return
for(var/i = 1 to contents_len)
add_overlay(image('icons/obj/cooking_machines.dmi', "meat[i]"))
@@ -0,0 +1,7 @@
/decl/recipe/grilled_meat
appliance = GRILL
items = list(
/obj/item/reagent_containers/food/snacks/meat
)
reagents = list(/datum/reagent/sodiumchloride = 1, /datum/reagent/blackpepper = 1, /datum/reagent/spacespice = 1)
result = /obj/item/reagent_containers/food/snacks/meatsteak/grilled
@@ -1511,6 +1511,11 @@
if(76 to INFINITY)
icon_state = "steak"
/obj/item/reagent_containers/food/snacks/meatsteak/grilled
name = "grilled steak"
desc = "A piece of meat grilled to absolute perfection. Sssssssip. This is the life."
reagents_to_add = list(/datum/reagent/nutriment/protein = 6, /datum/reagent/nutriment/triglyceride = 2, /datum/reagent/sodiumchloride = 1, /datum/reagent/blackpepper = 1, /datum/reagent/spacespice = 1)
/obj/item/reagent_containers/food/snacks/spacylibertyduff
name = "spacy liberty duff"
desc = "Jello gelatin, from Alfred Hubbard's cookbook."