Moar whitespace normalization [MDB IGNORE] (#7750)

Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
Drathek
2024-02-16 01:54:47 -08:00
committed by GitHub
parent eecf6bbff9
commit 3995338290
1177 changed files with 550902 additions and 550902 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,160 +1,160 @@
// Wrapper obj for cooked food. Appearance is set in the cooking code, not on spawn.
/obj/item/weapon/reagent_containers/food/snacks/variable
name = "cooked food"
icon = 'icons/obj/food_custom.dmi'
desc = "If you can see this description then something is wrong. Please report the bug on the tracker."
bitesize = 2
var/size = 5 //The quantity of reagents which is considered "normal" for this kind of food
//These objects will change size depending on the ratio of reagents to this value
var/min_scale = 0.5
var/max_scale = 2
var/scale = 1
w_class = 2
var/prefix
/obj/item/weapon/reagent_containers/food/snacks/variable/Initialize()
. = ..()
if (reagents)
reagents.maximum_volume = size*8 + 10
else
create_reagents(size*8 + 10)
/obj/item/weapon/reagent_containers/food/snacks/variable/update_icon()
if (reagents && reagents.total_volume)
var/ratio = reagents.total_volume / size
scale = ratio**(1/3) //Scaling factor is square root of desired area
scale = clamp(scale, min_scale, max_scale)
else
scale = min_scale
var/matrix/M = matrix()
M.Scale(scale)
src.transform = M
w_class *= scale
if (!prefix)
if (scale == min_scale)
prefix = "tiny"
else if (scale <= 0.8)
prefix = "small"
else
if (scale >= 1.2)
prefix = "large"
if (scale >= 1.4)
prefix = "extra large"
if (scale >= 1.6)
prefix = "huge"
if (scale >= max_scale)
prefix = "massive"
name = "[prefix] [name]"
/obj/item/weapon/reagent_containers/food/snacks/variable/pizza
name = "personal pizza"
desc = "A personalized pan pizza meant for only one person."
icon_state = "personal_pizza"
size = 20
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/bread
name = "bread"
desc = "Tasty bread."
icon_state = "breadcustom"
size = 40
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/pie
name = "pie"
desc = "Tasty pie."
icon_state = "piecustom"
size = 25
/obj/item/weapon/reagent_containers/food/snacks/variable/cake
name = "cake"
desc = "A popular band."
icon_state = "cakecustom"
size = 40
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/pocket
name = "hot pocket"
desc = "You wanna put a bangin- oh, nevermind."
icon_state = "donk"
size = 8
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/kebab
name = "kebab"
desc = "Remove this!"
icon_state = "kabob"
size = 10
/obj/item/weapon/reagent_containers/food/snacks/variable/waffles
name = "waffles"
desc = "Made with love."
icon_state = "waffles"
size = 12
/obj/item/weapon/reagent_containers/food/snacks/variable/cookie
name = "cookie"
desc = "Sugar snap!"
icon_state = "cookie"
size = 6
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/donut
name = "filled donut"
desc = "Donut eat this!" // kill me
icon_state = "donut"
size = 8
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker
name = "flavored jawbreaker"
desc = "It's like cracking a molar on a rainbow."
icon_state = "jawbreaker"
size = 4
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/candybar
name = "flavored chocolate bar"
desc = "Made in a factory downtown."
icon_state = "bar"
size = 6
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/sucker
name = "flavored sucker"
desc = "Suck, suck, suck."
icon_state = "sucker"
size = 4
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/jelly
name = "jelly"
desc = "All your friends will be jelly."
icon_state = "jellycustom"
size = 8
/obj/item/weapon/reagent_containers/food/snacks/variable/cereal
name = "cereal"
desc = "Crispy and flaky"
icon_state = "cereal_box"
size = 30
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/cereal/Initialize()
. =..()
name = pick(list("flakes", "krispies", "crunch", "pops", "O's", "crisp", "loops", "jacks", "clusters"))
/obj/item/weapon/reagent_containers/food/snacks/variable/mob
desc = "Poor little thing."
size = 5
w_class = 1
// Wrapper obj for cooked food. Appearance is set in the cooking code, not on spawn.
/obj/item/weapon/reagent_containers/food/snacks/variable
name = "cooked food"
icon = 'icons/obj/food_custom.dmi'
desc = "If you can see this description then something is wrong. Please report the bug on the tracker."
bitesize = 2
var/size = 5 //The quantity of reagents which is considered "normal" for this kind of food
//These objects will change size depending on the ratio of reagents to this value
var/min_scale = 0.5
var/max_scale = 2
var/scale = 1
w_class = 2
var/prefix
/obj/item/weapon/reagent_containers/food/snacks/variable/Initialize()
. = ..()
if (reagents)
reagents.maximum_volume = size*8 + 10
else
create_reagents(size*8 + 10)
/obj/item/weapon/reagent_containers/food/snacks/variable/update_icon()
if (reagents && reagents.total_volume)
var/ratio = reagents.total_volume / size
scale = ratio**(1/3) //Scaling factor is square root of desired area
scale = clamp(scale, min_scale, max_scale)
else
scale = min_scale
var/matrix/M = matrix()
M.Scale(scale)
src.transform = M
w_class *= scale
if (!prefix)
if (scale == min_scale)
prefix = "tiny"
else if (scale <= 0.8)
prefix = "small"
else
if (scale >= 1.2)
prefix = "large"
if (scale >= 1.4)
prefix = "extra large"
if (scale >= 1.6)
prefix = "huge"
if (scale >= max_scale)
prefix = "massive"
name = "[prefix] [name]"
/obj/item/weapon/reagent_containers/food/snacks/variable/pizza
name = "personal pizza"
desc = "A personalized pan pizza meant for only one person."
icon_state = "personal_pizza"
size = 20
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/bread
name = "bread"
desc = "Tasty bread."
icon_state = "breadcustom"
size = 40
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/pie
name = "pie"
desc = "Tasty pie."
icon_state = "piecustom"
size = 25
/obj/item/weapon/reagent_containers/food/snacks/variable/cake
name = "cake"
desc = "A popular band."
icon_state = "cakecustom"
size = 40
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/pocket
name = "hot pocket"
desc = "You wanna put a bangin- oh, nevermind."
icon_state = "donk"
size = 8
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/kebab
name = "kebab"
desc = "Remove this!"
icon_state = "kabob"
size = 10
/obj/item/weapon/reagent_containers/food/snacks/variable/waffles
name = "waffles"
desc = "Made with love."
icon_state = "waffles"
size = 12
/obj/item/weapon/reagent_containers/food/snacks/variable/cookie
name = "cookie"
desc = "Sugar snap!"
icon_state = "cookie"
size = 6
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/donut
name = "filled donut"
desc = "Donut eat this!" // kill me
icon_state = "donut"
size = 8
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker
name = "flavored jawbreaker"
desc = "It's like cracking a molar on a rainbow."
icon_state = "jawbreaker"
size = 4
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/candybar
name = "flavored chocolate bar"
desc = "Made in a factory downtown."
icon_state = "bar"
size = 6
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/sucker
name = "flavored sucker"
desc = "Suck, suck, suck."
icon_state = "sucker"
size = 4
w_class = 1
/obj/item/weapon/reagent_containers/food/snacks/variable/jelly
name = "jelly"
desc = "All your friends will be jelly."
icon_state = "jellycustom"
size = 8
/obj/item/weapon/reagent_containers/food/snacks/variable/cereal
name = "cereal"
desc = "Crispy and flaky"
icon_state = "cereal_box"
size = 30
w_class = 3
/obj/item/weapon/reagent_containers/food/snacks/variable/cereal/Initialize()
. =..()
name = pick(list("flakes", "krispies", "crunch", "pops", "O's", "crisp", "loops", "jacks", "clusters"))
/obj/item/weapon/reagent_containers/food/snacks/variable/mob
desc = "Poor little thing."
size = 5
w_class = 1
var/kitchen_tag = "animal"

View File

@@ -1,155 +1,155 @@
/*
The mixer subtype is used for the candymaker and cereal maker. They are similar to cookers but with a few
fundamental differences
1. They have a single container which cant be removed. it will eject multiple contents
2. Items can't be added or removed once the process starts
3. Items are all placed in the same container when added directly
4. They do combining mode only. And will always combine the entire contents of the container into an output
*/
/obj/machinery/appliance/mixer
max_contents = 1
stat = POWEROFF
cooking_coeff = 0.75 // Original value 0.4
active_power_usage = 3000
idle_power_usage = 50
var/datum/looping_sound/mixer/mixer_loop
/obj/machinery/appliance/mixer/examine(var/mob/user)
. = ..()
if(Adjacent(user))
. += "<span class='notice'>It is currently set to make a [selected_option]</span>"
/obj/machinery/appliance/mixer/Initialize()
. = ..()
cooking_objs += new /datum/cooking_item(new /obj/item/weapon/reagent_containers/cooking_container(src))
cooking = FALSE
selected_option = pick(output_options)
mixer_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/Destroy()
. = ..()
QDEL_NULL(mixer_loop)
//Mixers cannot-not do combining mode. So the default option is removed from this. A combine target must be chosen
/obj/machinery/appliance/mixer/choose_output()
set src in view(1)
set name = "Choose output"
set category = "Object"
if (!isliving(usr))
return
if (!usr.IsAdvancedToolUser())
to_chat(usr, "<span class='notice'>You can't operate [src].</span>")
return
if(output_options.len)
var/choice = tgui_input_list(usr, "What specific food do you wish to make with \the [src]?", "Food Output Choice", output_options)
if(!choice)
return
else
selected_option = choice
to_chat(usr, "<span class='notice'>You prepare \the [src] to make \a [selected_option].</span>")
var/datum/cooking_item/CI = cooking_objs[1]
CI.combine_target = selected_option
/obj/machinery/appliance/mixer/has_space(var/obj/item/I)
var/datum/cooking_item/CI = cooking_objs[1]
if (!CI || !CI.container)
return 0
if (CI.container.can_fit(I))
return CI
return 0
/obj/machinery/appliance/mixer/can_remove_items(var/mob/user, show_warning = TRUE)
if(stat)
return 1
else
if(show_warning)
to_chat(user, "<span class='warning'>You can't remove ingredients while it's turned on! Turn it off first or wait for it to finish.</span>")
return 0
//Container is not removable
/obj/machinery/appliance/mixer/removal_menu(var/mob/user)
if (can_remove_items(user))
var/list/menuoptions = list()
for(var/datum/cooking_item/CI as anything in cooking_objs)
if (CI.container)
if (!CI.container.check_contents())
to_chat(user, "<span class='filter_notice'>There's nothing in [src] you can remove!</span>")
return
for (var/obj/item/I in CI.container)
menuoptions[I.name] = I
var/selection = tgui_input_list(user, "Which item would you like to remove? If you want to remove chemicals, use an empty beaker.", "Remove ingredients", menuoptions)
if (selection)
var/obj/item/I = menuoptions[selection]
if (!user || !user.put_in_hands(I))
I.forceMove(get_turf(src))
update_icon()
return 1
return 0
/obj/machinery/appliance/mixer/toggle_power()
set src in view(1)
set name = "Toggle Power"
set category = "Object"
var/datum/cooking_item/CI = cooking_objs[1]
if(!CI.container.check_contents())
to_chat("<span class='filter_notice'>There's nothing in it! Add ingredients before turning [src] on!</span>")
return
if(stat & POWEROFF)//Its turned off
stat &= ~POWEROFF
if(usr)
usr.visible_message("<span class='filter_notice'>[usr] turns the [src] on.</span>", "<span class='filter_notice'>You turn on \the [src].</span>")
get_cooking_work(CI)
use_power = 2
else //Its on, turn it off
stat |= POWEROFF
use_power = 0
if(usr)
usr.visible_message("<span class='filter_notice'>[usr] turns the [src] off.</span>", "<span class='filter_notice'>You turn off \the [src].</span>")
playsound(src, 'sound/machines/click.ogg', 40, 1)
update_icon()
/obj/machinery/appliance/mixer/can_insert(var/obj/item/I, var/mob/user)
if(!stat)
to_chat(user, "<span class='warning'>,You can't add items while \the [src] is running. Wait for it to finish or turn the power off to abort.</span>")
return 0
else
return ..()
/obj/machinery/appliance/mixer/finish_cooking(var/datum/cooking_item/CI)
..()
stat |= POWEROFF
playsound(src, 'sound/machines/click.ogg', 40, 1)
use_power = 0
CI.reset()
update_icon()
/obj/machinery/appliance/mixer/update_icon()
if (!stat)
icon_state = on_icon
if(mixer_loop)
mixer_loop.start(src)
else
icon_state = off_icon
if(mixer_loop)
mixer_loop.stop(src)
/obj/machinery/appliance/mixer/process()
if (!stat)
for (var/i in cooking_objs)
/*
The mixer subtype is used for the candymaker and cereal maker. They are similar to cookers but with a few
fundamental differences
1. They have a single container which cant be removed. it will eject multiple contents
2. Items can't be added or removed once the process starts
3. Items are all placed in the same container when added directly
4. They do combining mode only. And will always combine the entire contents of the container into an output
*/
/obj/machinery/appliance/mixer
max_contents = 1
stat = POWEROFF
cooking_coeff = 0.75 // Original value 0.4
active_power_usage = 3000
idle_power_usage = 50
var/datum/looping_sound/mixer/mixer_loop
/obj/machinery/appliance/mixer/examine(var/mob/user)
. = ..()
if(Adjacent(user))
. += "<span class='notice'>It is currently set to make a [selected_option]</span>"
/obj/machinery/appliance/mixer/Initialize()
. = ..()
cooking_objs += new /datum/cooking_item(new /obj/item/weapon/reagent_containers/cooking_container(src))
cooking = FALSE
selected_option = pick(output_options)
mixer_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/Destroy()
. = ..()
QDEL_NULL(mixer_loop)
//Mixers cannot-not do combining mode. So the default option is removed from this. A combine target must be chosen
/obj/machinery/appliance/mixer/choose_output()
set src in view(1)
set name = "Choose output"
set category = "Object"
if (!isliving(usr))
return
if (!usr.IsAdvancedToolUser())
to_chat(usr, "<span class='notice'>You can't operate [src].</span>")
return
if(output_options.len)
var/choice = tgui_input_list(usr, "What specific food do you wish to make with \the [src]?", "Food Output Choice", output_options)
if(!choice)
return
else
selected_option = choice
to_chat(usr, "<span class='notice'>You prepare \the [src] to make \a [selected_option].</span>")
var/datum/cooking_item/CI = cooking_objs[1]
CI.combine_target = selected_option
/obj/machinery/appliance/mixer/has_space(var/obj/item/I)
var/datum/cooking_item/CI = cooking_objs[1]
if (!CI || !CI.container)
return 0
if (CI.container.can_fit(I))
return CI
return 0
/obj/machinery/appliance/mixer/can_remove_items(var/mob/user, show_warning = TRUE)
if(stat)
return 1
else
if(show_warning)
to_chat(user, "<span class='warning'>You can't remove ingredients while it's turned on! Turn it off first or wait for it to finish.</span>")
return 0
//Container is not removable
/obj/machinery/appliance/mixer/removal_menu(var/mob/user)
if (can_remove_items(user))
var/list/menuoptions = list()
for(var/datum/cooking_item/CI as anything in cooking_objs)
if (CI.container)
if (!CI.container.check_contents())
to_chat(user, "<span class='filter_notice'>There's nothing in [src] you can remove!</span>")
return
for (var/obj/item/I in CI.container)
menuoptions[I.name] = I
var/selection = tgui_input_list(user, "Which item would you like to remove? If you want to remove chemicals, use an empty beaker.", "Remove ingredients", menuoptions)
if (selection)
var/obj/item/I = menuoptions[selection]
if (!user || !user.put_in_hands(I))
I.forceMove(get_turf(src))
update_icon()
return 1
return 0
/obj/machinery/appliance/mixer/toggle_power()
set src in view(1)
set name = "Toggle Power"
set category = "Object"
var/datum/cooking_item/CI = cooking_objs[1]
if(!CI.container.check_contents())
to_chat("<span class='filter_notice'>There's nothing in it! Add ingredients before turning [src] on!</span>")
return
if(stat & POWEROFF)//Its turned off
stat &= ~POWEROFF
if(usr)
usr.visible_message("<span class='filter_notice'>[usr] turns the [src] on.</span>", "<span class='filter_notice'>You turn on \the [src].</span>")
get_cooking_work(CI)
use_power = 2
else //Its on, turn it off
stat |= POWEROFF
use_power = 0
if(usr)
usr.visible_message("<span class='filter_notice'>[usr] turns the [src] off.</span>", "<span class='filter_notice'>You turn off \the [src].</span>")
playsound(src, 'sound/machines/click.ogg', 40, 1)
update_icon()
/obj/machinery/appliance/mixer/can_insert(var/obj/item/I, var/mob/user)
if(!stat)
to_chat(user, "<span class='warning'>,You can't add items while \the [src] is running. Wait for it to finish or turn the power off to abort.</span>")
return 0
else
return ..()
/obj/machinery/appliance/mixer/finish_cooking(var/datum/cooking_item/CI)
..()
stat |= POWEROFF
playsound(src, 'sound/machines/click.ogg', 40, 1)
use_power = 0
CI.reset()
update_icon()
/obj/machinery/appliance/mixer/update_icon()
if (!stat)
icon_state = on_icon
if(mixer_loop)
mixer_loop.start(src)
else
icon_state = off_icon
if(mixer_loop)
mixer_loop.stop(src)
/obj/machinery/appliance/mixer/process()
if (!stat)
for (var/i in cooking_objs)
do_cooking_tick(i)

View File

@@ -1,54 +1,54 @@
/obj/machinery/appliance/mixer/candy
name = "candy machine"
desc = "Get yer candied cheese wheels here!"
icon_state = "mixer_off"
off_icon = "mixer_off"
on_icon = "mixer_on"
cook_type = "candied"
appliancetype = CANDYMAKER
var/datum/looping_sound/candymaker/candymaker_loop
circuit = /obj/item/weapon/circuitboard/candymachine
cooking_coeff = 1.0 // Original Value 0.6
output_options = list(
"Jawbreaker" = /obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker,
"Candy Bar" = /obj/item/weapon/reagent_containers/food/snacks/variable/candybar,
"Sucker" = /obj/item/weapon/reagent_containers/food/snacks/variable/sucker,
"Jelly" = /obj/item/weapon/reagent_containers/food/snacks/variable/jelly
)
/obj/machinery/appliance/mixer/candy/Initialize()
. = ..()
candymaker_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/candy/Destroy()
. = ..()
QDEL_NULL(candymaker_loop)
/obj/machinery/appliance/mixer/candy/update_icon()
. = ..()
if(!stat)
icon_state = on_icon
if(candymaker_loop)
candymaker_loop.start(src)
else
icon_state = off_icon
if(candymaker_loop)
candymaker_loop.stop(src)
/obj/machinery/appliance/mixer/candy/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
food_color = get_random_colour(1)
. = ..()
/obj/machinery/appliance/mixer/candy/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
/obj/machinery/appliance/mixer/candy
name = "candy machine"
desc = "Get yer candied cheese wheels here!"
icon_state = "mixer_off"
off_icon = "mixer_off"
on_icon = "mixer_on"
cook_type = "candied"
appliancetype = CANDYMAKER
var/datum/looping_sound/candymaker/candymaker_loop
circuit = /obj/item/weapon/circuitboard/candymachine
cooking_coeff = 1.0 // Original Value 0.6
output_options = list(
"Jawbreaker" = /obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker,
"Candy Bar" = /obj/item/weapon/reagent_containers/food/snacks/variable/candybar,
"Sucker" = /obj/item/weapon/reagent_containers/food/snacks/variable/sucker,
"Jelly" = /obj/item/weapon/reagent_containers/food/snacks/variable/jelly
)
/obj/machinery/appliance/mixer/candy/Initialize()
. = ..()
candymaker_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/candy/Destroy()
. = ..()
QDEL_NULL(candymaker_loop)
/obj/machinery/appliance/mixer/candy/update_icon()
. = ..()
if(!stat)
icon_state = on_icon
if(candymaker_loop)
candymaker_loop.start(src)
else
icon_state = off_icon
if(candymaker_loop)
candymaker_loop.stop(src)
/obj/machinery/appliance/mixer/candy/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
food_color = get_random_colour(1)
. = ..()
/obj/machinery/appliance/mixer/candy/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()

View File

@@ -1,96 +1,96 @@
/obj/machinery/appliance/mixer/cereal
name = "cereal maker"
desc = "Now with Dann O's available!"
icon = 'icons/obj/cooking_machines.dmi'
icon_state = "cereal_off"
cook_type = "cerealized"
on_icon = "cereal_on"
off_icon = "cereal_off"
appliancetype = CEREALMAKER
var/datum/looping_sound/cerealmaker/cerealmaker_loop
circuit = /obj/item/weapon/circuitboard/cerealmaker
output_options = list(
"Cereal" = /obj/item/weapon/reagent_containers/food/snacks/variable/cereal
)
/obj/machinery/appliance/mixer/cereal/Initialize()
. = ..()
cerealmaker_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/cereal/Destroy()
. = ..()
QDEL_NULL(cerealmaker_loop)
/*
/obj/machinery/appliance/mixer/cereal/change_product_strings(var/obj/item/weapon/reagent_containers/food/snacks/product, var/datum/cooking_item/CI)
. = ..()
product.name = "box of [CI.object.name] cereal"
/obj/machinery/appliance/mixer/cereal/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
product.icon = 'icons/obj/food.dmi'
product.icon_state = "cereal_box"
product.filling_color = CI.object.color
var/image/food_image = image(CI.object.icon, CI.object.icon_state)
food_image.color = CI.object.color
food_image.add_overlay(CI.object.overlays)
food_image.transform *= 0.7
product.add_overlay(food_image)
*/
/obj/machinery/appliance/mixer/cereal/update_icon()
. = ..()
if(!stat)
icon_state = on_icon
if(cerealmaker_loop)
cerealmaker_loop.start(src)
else
icon_state = off_icon
if(cerealmaker_loop)
cerealmaker_loop.stop(src)
/obj/machinery/appliance/mixer/cereal/combination_cook(var/datum/cooking_item/CI)
var/list/images = list()
var/num = 0
for(var/obj/item/I in CI.container)
if (istype(I, /obj/item/weapon/reagent_containers/food/snacks/variable/cereal))
//Images of cereal boxes on cereal boxes is dumb
continue
var/image/food_image = image(I.icon, I.icon_state)
food_image.color = I.color
food_image.add_overlay(I.overlays)
food_image.transform *= 0.7 - (num * 0.05)
food_image.pixel_x = rand(-2,2)
food_image.pixel_y = rand(-3,5)
if (!images[I.icon_state])
images[I.icon_state] = food_image
num++
if (num > 3)
continue
var/obj/item/weapon/reagent_containers/food/snacks/result = ..()
result.color = result.filling_color
for (var/i in images)
result.overlays += images[i]
/obj/machinery/appliance/mixer/cereal/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()
/obj/machinery/appliance/mixer/cereal
name = "cereal maker"
desc = "Now with Dann O's available!"
icon = 'icons/obj/cooking_machines.dmi'
icon_state = "cereal_off"
cook_type = "cerealized"
on_icon = "cereal_on"
off_icon = "cereal_off"
appliancetype = CEREALMAKER
var/datum/looping_sound/cerealmaker/cerealmaker_loop
circuit = /obj/item/weapon/circuitboard/cerealmaker
output_options = list(
"Cereal" = /obj/item/weapon/reagent_containers/food/snacks/variable/cereal
)
/obj/machinery/appliance/mixer/cereal/Initialize()
. = ..()
cerealmaker_loop = new(list(src), FALSE)
/obj/machinery/appliance/mixer/cereal/Destroy()
. = ..()
QDEL_NULL(cerealmaker_loop)
/*
/obj/machinery/appliance/mixer/cereal/change_product_strings(var/obj/item/weapon/reagent_containers/food/snacks/product, var/datum/cooking_item/CI)
. = ..()
product.name = "box of [CI.object.name] cereal"
/obj/machinery/appliance/mixer/cereal/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
product.icon = 'icons/obj/food.dmi'
product.icon_state = "cereal_box"
product.filling_color = CI.object.color
var/image/food_image = image(CI.object.icon, CI.object.icon_state)
food_image.color = CI.object.color
food_image.add_overlay(CI.object.overlays)
food_image.transform *= 0.7
product.add_overlay(food_image)
*/
/obj/machinery/appliance/mixer/cereal/update_icon()
. = ..()
if(!stat)
icon_state = on_icon
if(cerealmaker_loop)
cerealmaker_loop.start(src)
else
icon_state = off_icon
if(cerealmaker_loop)
cerealmaker_loop.stop(src)
/obj/machinery/appliance/mixer/cereal/combination_cook(var/datum/cooking_item/CI)
var/list/images = list()
var/num = 0
for(var/obj/item/I in CI.container)
if (istype(I, /obj/item/weapon/reagent_containers/food/snacks/variable/cereal))
//Images of cereal boxes on cereal boxes is dumb
continue
var/image/food_image = image(I.icon, I.icon_state)
food_image.color = I.color
food_image.add_overlay(I.overlays)
food_image.transform *= 0.7 - (num * 0.05)
food_image.pixel_x = rand(-2,2)
food_image.pixel_y = rand(-3,5)
if (!images[I.icon_state])
images[I.icon_state] = food_image
num++
if (num > 3)
continue
var/obj/item/weapon/reagent_containers/food/snacks/result = ..()
result.color = result.filling_color
for (var/i in images)
result.overlays += images[i]
/obj/machinery/appliance/mixer/cereal/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()

View File

@@ -1,221 +1,221 @@
//Cooking containers are used in ovens and fryers, to hold multiple ingredients for a recipe.
//They work fairly similar to the microwave - acting as a container for objects and reagents,
//which can be checked against recipe requirements in order to cook recipes that require several things
/obj/item/weapon/reagent_containers/cooking_container
icon = 'icons/obj/cooking_machines.dmi'
var/shortname
var/max_space = 20//Maximum sum of w-classes of foods in this container at once
var/max_reagents = 80//Maximum units of reagents
var/food_items = 0 // Used for icon updates
flags = OPENCONTAINER | NOREACT
var/list/insertable = list(
/obj/item/weapon/reagent_containers/food/snacks,
/obj/item/weapon/holder,
/obj/item/weapon/paper,
/obj/item/clothing/head/wizard,
/obj/item/clothing/head/cakehat,
/obj/item/clothing/mask/gas/clown_hat,
/obj/item/clothing/head/beret
)
/obj/item/weapon/reagent_containers/cooking_container/Initialize()
. = ..()
create_reagents(max_reagents)
flags |= OPENCONTAINER | NOREACT
/obj/item/weapon/reagent_containers/cooking_container/examine(var/mob/user)
. = ..()
if (contents.len)
var/string = "It contains....</br>"
for (var/atom/movable/A in contents)
string += "[A.name] </br>"
. += "<span class='notice'>[string]</span>"
if (reagents.total_volume)
. += "<span class='notice'>It contains [reagents.total_volume]u of reagents.</span>"
/obj/item/weapon/reagent_containers/cooking_container/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/gripper))
var/obj/item/weapon/gripper/GR = I
if(GR.wrapped)
GR.wrapped.forceMove(get_turf(src))
attackby(GR.wrapped, user)
if(QDELETED(GR.wrapped))
GR.wrapped = null
if(GR?.wrapped.loc != src)
GR.wrapped = null
return
for (var/possible_type in insertable)
if (istype(I, possible_type))
if (!can_fit(I))
to_chat(user, "<span class='warning'>There's no more space in the [src] for that!</span>")
return 0
if(!user.unEquip(I) && !isturf(I.loc))
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You put the [I] into the [src].</span>")
food_items += 1
update_icon()
return
/obj/item/weapon/reagent_containers/cooking_container/verb/empty()
set src in oview(1)
set name = "Empty Container"
set category = "Object"
set desc = "Removes items from the container, excluding reagents."
do_empty(usr)
/obj/item/weapon/reagent_containers/cooking_container/proc/do_empty(mob/user)
if (!isliving(user))
//Here we only check for ghosts. Animals are intentionally allowed to remove things from oven trays so they can eat it
return
if (user.stat || user.restrained())
to_chat(user, "<span class='notice'>You are in no fit state to do this.</span>")
return
if (!Adjacent(user))
to_chat(user, "<span class='filter_notice'>You can't reach [src] from here.</span>")
return
if (!contents.len)
to_chat(user, "<span class='warning'>There's nothing in the [src] you can remove!</span>")
return
for (var/atom/movable/A in contents)
A.forceMove(get_turf(src))
to_chat(user, "<span class='notice'>You remove all the solid items from the [src].</span>")
/obj/item/weapon/reagent_containers/cooking_container/proc/check_contents()
if (contents.len == 0)
if (!reagents || reagents.total_volume == 0)
return 0//Completely empty
else if (contents.len == 1)
if (!reagents || reagents.total_volume == 0)
return 1//Contains only a single object which can be extracted alone
return 2//Contains multiple objects and/or reagents
/obj/item/weapon/reagent_containers/cooking_container/AltClick(var/mob/user)
do_empty(user)
food_items = 0
update_icon()
//Deletes contents of container.
//Used when food is burned, before replacing it with a burned mess
/obj/item/weapon/reagent_containers/cooking_container/proc/clear()
for (var/atom/a in contents)
qdel(a)
if (reagents)
reagents.clear_reagents()
/obj/item/weapon/reagent_containers/cooking_container/proc/label(var/number, var/CT = null)
//This returns something like "Fryer basket 1 - empty"
//The latter part is a brief reminder of contents
//This is used in the removal menu
. = shortname
if (!isnull(number))
.+= " [number]"
.+= " - "
if (CT)
.+=CT
else if (contents.len)
for (var/obj/O in contents)
.+=O.name//Just append the name of the first object
return
else if (reagents && reagents.total_volume > 0)
var/datum/reagent/R = reagents.get_master_reagent()
.+=R.name//Append name of most voluminous reagent
return
else
. += "empty"
/obj/item/weapon/reagent_containers/cooking_container/proc/can_fit(var/obj/item/I)
var/total = 0
for (var/obj/item/J in contents)
total += J.w_class
if((max_space - total) >= I.w_class)
return 1
//Takes a reagent holder as input and distributes its contents among the items in the container
//Distribution is weighted based on the volume already present in each item
/obj/item/weapon/reagent_containers/cooking_container/proc/soak_reagent(var/datum/reagents/holder)
var/total = 0
var/list/weights = list()
for (var/obj/item/I in contents)
if (I.reagents && I.reagents.total_volume)
total += I.reagents.total_volume
weights[I] = I.reagents.total_volume
if (total > 0)
for (var/obj/item/I in contents)
if (weights[I])
holder.trans_to(I, weights[I] / total)
/obj/item/weapon/reagent_containers/cooking_container/update_icon()
overlays.Cut()
if(food_items)
var/image/filling = image('icons/obj/cooking_machines.dmi', src, "[icon_state]10")
var/percent = round((food_items / max_space) * 100)
switch(percent)
if(0 to 2) filling.icon_state = "[icon_state]"
if(3 to 24) filling.icon_state = "[icon_state]1"
if(25 to 49) filling.icon_state = "[icon_state]2"
if(50 to 74) filling.icon_state = "[icon_state]3"
if(75 to 79) filling.icon_state = "[icon_state]4"
if(80 to INFINITY) filling.icon_state = "[icon_state]5"
overlays += filling
/obj/item/weapon/reagent_containers/cooking_container/oven
name = "oven dish"
shortname = "shelf"
desc = "Put ingredients in this; designed for use with an oven. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "ovendish"
max_space = 30
max_reagents = 120
/obj/item/weapon/reagent_containers/cooking_container/oven/Initialize()
. = ..()
// We add to the insertable list specifically for the oven trays, to allow specialty cakes.
insertable += list(
/obj/item/organ/internal/brain // As before, needed for braincake
)
/obj/item/weapon/reagent_containers/cooking_container/fryer
name = "fryer basket"
shortname = "basket"
desc = "Put ingredients in this; designed for use with a deep fryer. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "basket"
/obj/item/weapon/reagent_containers/cooking_container/grill
name = "grill rack"
shortname = "rack"
desc = "Put ingredients 'in'/on this; designed for use with a grill. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "grillrack"
/obj/item/weapon/reagent_containers/cooking_container/grill/Initialize()
. = ..()
// Needed for the special recipes of the grill
insertable += list(
/obj/item/organ/internal/brain,
/obj/item/robot_parts/head,
/obj/item/weapon/ectoplasm,
/obj/item/weapon/holder/mouse,
/obj/item/stack/rods
)
//Cooking containers are used in ovens and fryers, to hold multiple ingredients for a recipe.
//They work fairly similar to the microwave - acting as a container for objects and reagents,
//which can be checked against recipe requirements in order to cook recipes that require several things
/obj/item/weapon/reagent_containers/cooking_container
icon = 'icons/obj/cooking_machines.dmi'
var/shortname
var/max_space = 20//Maximum sum of w-classes of foods in this container at once
var/max_reagents = 80//Maximum units of reagents
var/food_items = 0 // Used for icon updates
flags = OPENCONTAINER | NOREACT
var/list/insertable = list(
/obj/item/weapon/reagent_containers/food/snacks,
/obj/item/weapon/holder,
/obj/item/weapon/paper,
/obj/item/clothing/head/wizard,
/obj/item/clothing/head/cakehat,
/obj/item/clothing/mask/gas/clown_hat,
/obj/item/clothing/head/beret
)
/obj/item/weapon/reagent_containers/cooking_container/Initialize()
. = ..()
create_reagents(max_reagents)
flags |= OPENCONTAINER | NOREACT
/obj/item/weapon/reagent_containers/cooking_container/examine(var/mob/user)
. = ..()
if (contents.len)
var/string = "It contains....</br>"
for (var/atom/movable/A in contents)
string += "[A.name] </br>"
. += "<span class='notice'>[string]</span>"
if (reagents.total_volume)
. += "<span class='notice'>It contains [reagents.total_volume]u of reagents.</span>"
/obj/item/weapon/reagent_containers/cooking_container/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/gripper))
var/obj/item/weapon/gripper/GR = I
if(GR.wrapped)
GR.wrapped.forceMove(get_turf(src))
attackby(GR.wrapped, user)
if(QDELETED(GR.wrapped))
GR.wrapped = null
if(GR?.wrapped.loc != src)
GR.wrapped = null
return
for (var/possible_type in insertable)
if (istype(I, possible_type))
if (!can_fit(I))
to_chat(user, "<span class='warning'>There's no more space in the [src] for that!</span>")
return 0
if(!user.unEquip(I) && !isturf(I.loc))
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You put the [I] into the [src].</span>")
food_items += 1
update_icon()
return
/obj/item/weapon/reagent_containers/cooking_container/verb/empty()
set src in oview(1)
set name = "Empty Container"
set category = "Object"
set desc = "Removes items from the container, excluding reagents."
do_empty(usr)
/obj/item/weapon/reagent_containers/cooking_container/proc/do_empty(mob/user)
if (!isliving(user))
//Here we only check for ghosts. Animals are intentionally allowed to remove things from oven trays so they can eat it
return
if (user.stat || user.restrained())
to_chat(user, "<span class='notice'>You are in no fit state to do this.</span>")
return
if (!Adjacent(user))
to_chat(user, "<span class='filter_notice'>You can't reach [src] from here.</span>")
return
if (!contents.len)
to_chat(user, "<span class='warning'>There's nothing in the [src] you can remove!</span>")
return
for (var/atom/movable/A in contents)
A.forceMove(get_turf(src))
to_chat(user, "<span class='notice'>You remove all the solid items from the [src].</span>")
/obj/item/weapon/reagent_containers/cooking_container/proc/check_contents()
if (contents.len == 0)
if (!reagents || reagents.total_volume == 0)
return 0//Completely empty
else if (contents.len == 1)
if (!reagents || reagents.total_volume == 0)
return 1//Contains only a single object which can be extracted alone
return 2//Contains multiple objects and/or reagents
/obj/item/weapon/reagent_containers/cooking_container/AltClick(var/mob/user)
do_empty(user)
food_items = 0
update_icon()
//Deletes contents of container.
//Used when food is burned, before replacing it with a burned mess
/obj/item/weapon/reagent_containers/cooking_container/proc/clear()
for (var/atom/a in contents)
qdel(a)
if (reagents)
reagents.clear_reagents()
/obj/item/weapon/reagent_containers/cooking_container/proc/label(var/number, var/CT = null)
//This returns something like "Fryer basket 1 - empty"
//The latter part is a brief reminder of contents
//This is used in the removal menu
. = shortname
if (!isnull(number))
.+= " [number]"
.+= " - "
if (CT)
.+=CT
else if (contents.len)
for (var/obj/O in contents)
.+=O.name//Just append the name of the first object
return
else if (reagents && reagents.total_volume > 0)
var/datum/reagent/R = reagents.get_master_reagent()
.+=R.name//Append name of most voluminous reagent
return
else
. += "empty"
/obj/item/weapon/reagent_containers/cooking_container/proc/can_fit(var/obj/item/I)
var/total = 0
for (var/obj/item/J in contents)
total += J.w_class
if((max_space - total) >= I.w_class)
return 1
//Takes a reagent holder as input and distributes its contents among the items in the container
//Distribution is weighted based on the volume already present in each item
/obj/item/weapon/reagent_containers/cooking_container/proc/soak_reagent(var/datum/reagents/holder)
var/total = 0
var/list/weights = list()
for (var/obj/item/I in contents)
if (I.reagents && I.reagents.total_volume)
total += I.reagents.total_volume
weights[I] = I.reagents.total_volume
if (total > 0)
for (var/obj/item/I in contents)
if (weights[I])
holder.trans_to(I, weights[I] / total)
/obj/item/weapon/reagent_containers/cooking_container/update_icon()
overlays.Cut()
if(food_items)
var/image/filling = image('icons/obj/cooking_machines.dmi', src, "[icon_state]10")
var/percent = round((food_items / max_space) * 100)
switch(percent)
if(0 to 2) filling.icon_state = "[icon_state]"
if(3 to 24) filling.icon_state = "[icon_state]1"
if(25 to 49) filling.icon_state = "[icon_state]2"
if(50 to 74) filling.icon_state = "[icon_state]3"
if(75 to 79) filling.icon_state = "[icon_state]4"
if(80 to INFINITY) filling.icon_state = "[icon_state]5"
overlays += filling
/obj/item/weapon/reagent_containers/cooking_container/oven
name = "oven dish"
shortname = "shelf"
desc = "Put ingredients in this; designed for use with an oven. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "ovendish"
max_space = 30
max_reagents = 120
/obj/item/weapon/reagent_containers/cooking_container/oven/Initialize()
. = ..()
// We add to the insertable list specifically for the oven trays, to allow specialty cakes.
insertable += list(
/obj/item/organ/internal/brain // As before, needed for braincake
)
/obj/item/weapon/reagent_containers/cooking_container/fryer
name = "fryer basket"
shortname = "basket"
desc = "Put ingredients in this; designed for use with a deep fryer. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "basket"
/obj/item/weapon/reagent_containers/cooking_container/grill
name = "grill rack"
shortname = "rack"
desc = "Put ingredients 'in'/on this; designed for use with a grill. Warranty void if used incorrectly. Alt click to remove contents."
icon_state = "grillrack"
/obj/item/weapon/reagent_containers/cooking_container/grill/Initialize()
. = ..()
// Needed for the special recipes of the grill
insertable += list(
/obj/item/organ/internal/brain,
/obj/item/robot_parts/head,
/obj/item/weapon/ectoplasm,
/obj/item/weapon/holder/mouse,
/obj/item/stack/rods
)

View File

@@ -1,58 +1,58 @@
/obj/machinery/appliance/cooker/grill
name = "grill"
desc = "Backyard grilling, IN SPACE."
icon_state = "grill_off"
cook_type = "grilled"
appliancetype = GRILL
food_color = "#A34719"
on_icon = "grill_on"
off_icon = "grill_off"
can_burn_food = TRUE
var/datum/looping_sound/grill/grill_loop
circuit = /obj/item/weapon/circuitboard/grill
active_power_usage = 4 KILOWATTS
heating_power = 4000
idle_power_usage = 2 KILOWATTS
optimal_power = 1.2 // Things on the grill cook .6 faster - this is now the fastest appliance to heat and to cook on. BURGERS GO SIZZLE.
stat = POWEROFF // Starts turned off.
// Grill is faster to heat and setup than the rest.
optimal_temp = 120 + T0C
min_temp = 60 + T0C
resistance = 8 KILOWATTS // Very fast to heat up.
max_contents = 3 // Arbitrary number, 3 grill 'racks'
container_type = /obj/item/weapon/reagent_containers/cooking_container/grill
/obj/machinery/appliance/cooker/grill/Initialize()
. = ..()
grill_loop = new(list(src), FALSE)
/obj/machinery/appliance/cooker/grill/Destroy()
QDEL_NULL(grill_loop)
return ..()
/obj/machinery/appliance/cooker/grill/update_icon() // TODO: Cooking icon
if(!stat)
icon_state = on_icon
if(cooking == TRUE)
if(grill_loop)
grill_loop.start(src)
else
if(grill_loop)
grill_loop.stop(src)
else
icon_state = off_icon
if(grill_loop)
grill_loop.stop(src)
/obj/machinery/appliance/cooker/grill/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
/obj/machinery/appliance/cooker/grill
name = "grill"
desc = "Backyard grilling, IN SPACE."
icon_state = "grill_off"
cook_type = "grilled"
appliancetype = GRILL
food_color = "#A34719"
on_icon = "grill_on"
off_icon = "grill_off"
can_burn_food = TRUE
var/datum/looping_sound/grill/grill_loop
circuit = /obj/item/weapon/circuitboard/grill
active_power_usage = 4 KILOWATTS
heating_power = 4000
idle_power_usage = 2 KILOWATTS
optimal_power = 1.2 // Things on the grill cook .6 faster - this is now the fastest appliance to heat and to cook on. BURGERS GO SIZZLE.
stat = POWEROFF // Starts turned off.
// Grill is faster to heat and setup than the rest.
optimal_temp = 120 + T0C
min_temp = 60 + T0C
resistance = 8 KILOWATTS // Very fast to heat up.
max_contents = 3 // Arbitrary number, 3 grill 'racks'
container_type = /obj/item/weapon/reagent_containers/cooking_container/grill
/obj/machinery/appliance/cooker/grill/Initialize()
. = ..()
grill_loop = new(list(src), FALSE)
/obj/machinery/appliance/cooker/grill/Destroy()
QDEL_NULL(grill_loop)
return ..()
/obj/machinery/appliance/cooker/grill/update_icon() // TODO: Cooking icon
if(!stat)
icon_state = on_icon
if(cooking == TRUE)
if(grill_loop)
grill_loop.start(src)
else
if(grill_loop)
grill_loop.stop(src)
else
icon_state = off_icon
if(grill_loop)
grill_loop.stop(src)
/obj/machinery/appliance/cooker/grill/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()

View File

@@ -1,165 +1,165 @@
/obj/machinery/appliance/cooker/oven
name = "oven"
desc = "Cookies are ready, dear."
icon = 'icons/obj/cooking_machines.dmi'
icon_state = "ovenopen"
cook_type = "baked"
appliancetype = OVEN
food_color = "#A34719"
can_burn_food = TRUE
var/datum/looping_sound/oven/oven_loop
circuit = /obj/item/weapon/circuitboard/oven
active_power_usage = 6 KILOWATTS
heating_power = 6 KILOWATTS
//Based on a double deck electric convection oven
resistance = 12 KILOWATTS // Approx. 12 minutes to heat up.
idle_power_usage = 2 KILOWATTS
//uses ~30% power to stay warm
optimal_power = 0.8 // Oven cooks .2 faster than the default speed.
light_x = 3
light_y = 4
max_contents = 5
container_type = /obj/item/weapon/reagent_containers/cooking_container/oven
stat = POWEROFF //Starts turned off
var/open = FALSE // Start closed just so people don't try to preheat with it open, lol.
output_options = list(
"Pizza" = /obj/item/weapon/reagent_containers/food/snacks/variable/pizza,
"Bread" = /obj/item/weapon/reagent_containers/food/snacks/variable/bread,
"Pie" = /obj/item/weapon/reagent_containers/food/snacks/variable/pie,
"Cake" = /obj/item/weapon/reagent_containers/food/snacks/variable/cake,
"Hot Pocket" = /obj/item/weapon/reagent_containers/food/snacks/variable/pocket,
"Kebab" = /obj/item/weapon/reagent_containers/food/snacks/variable/kebab,
"Waffles" = /obj/item/weapon/reagent_containers/food/snacks/variable/waffles,
"Cookie" = /obj/item/weapon/reagent_containers/food/snacks/variable/cookie,
"Donut" = /obj/item/weapon/reagent_containers/food/snacks/variable/donut,
)
/obj/machinery/appliance/cooker/oven/Initialize()
. = ..()
oven_loop = new(list(src), FALSE)
/obj/machinery/appliance/cooker/oven/Destroy()
QDEL_NULL(oven_loop)
return ..()
/obj/machinery/appliance/cooker/oven/update_icon()
if(!open)
if(!stat)
icon_state = "ovenclosed_on"
if(cooking == TRUE)
icon_state = "ovenclosed_cooking"
if(oven_loop)
oven_loop.start(src)
else
icon_state = "ovenclosed_on"
if(oven_loop)
oven_loop.stop(src)
else
icon_state = "ovenclosed_off"
if(oven_loop)
oven_loop.stop(src)
else
icon_state = "ovenopen"
if(oven_loop)
oven_loop.stop(src)
..()
/obj/machinery/appliance/cooker/oven/AltClick(var/mob/user)
try_toggle_door(user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
/obj/machinery/appliance/cooker/oven/verb/toggle_door()
set src in oview(1)
set category = "Object"
set name = "Open/close oven door"
try_toggle_door(usr)
/obj/machinery/appliance/cooker/oven/proc/try_toggle_door(mob/user)
if(!isliving(usr) || isAI(user))
return
if(!usr.IsAdvancedToolUser())
to_chat(user, "<span class='notice'>You lack the dexterity to do that.</span>")
return
if(!Adjacent(usr))
to_chat(user, "<span class='notice'>You can't reach the [src] from there, get closer!</span>")
return
if(open)
open = FALSE
loss = (heating_power / resistance) * 0.5
cooking = TRUE
else
open = TRUE
loss = (heating_power / resistance) * 4
//When the oven door is opened, heat is lost MUCH faster and you stop cooking (because the door is open)
cooking = FALSE
playsound(src, 'sound/machines/hatch_open.ogg', 20, 1)
to_chat(user, "<span class='notice'>You [open? "open":"close"] the oven door</span>")
update_icon()
/obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I)
// check if someone's trying to manipulate the machine
if(I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer))
return TRUE
else
return FALSE
/obj/machinery/appliance/cooker/oven/can_insert(var/obj/item/I, var/mob/user)
if(!open && !manip(I))
to_chat(user, "<span class='warning'>You can't put anything in while the door is closed!</span>")
return 0
else
return ..()
//If an oven's door is open it will lose heat every proc, even if it also gained it
//But dont call equalize twice in one stack. A return value of -1 from the parent indicates equalize was already called
/obj/machinery/appliance/cooker/oven/heat_up()
.=..()
if(open && . != -1)
var/turf/T = get_turf(src)
if(temperature > T.temperature)
equalize_temperature()
/obj/machinery/appliance/cooker/oven/can_remove_items(var/mob/user, show_warning = TRUE)
if(!open)
if(show_warning)
to_chat(user, "<span class='warning'>You can't take anything out while the door is closed!</span>")
return 0
else
return ..()
//Oven has lots of recipes and combine options. The chance for interference is high, so
//If a combine target is set the oven will do it instead of checking recipes
/obj/machinery/appliance/cooker/oven/finish_cooking(var/datum/cooking_item/CI)
if(CI.combine_target)
CI.result_type = 3//Combination type. We're making something out of our ingredients
visible_message("<b>\The [src]</b> pings!")
combination_cook(CI)
return
else
..()
/obj/machinery/appliance/cooker/oven/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()
/obj/machinery/appliance/cooker/oven
name = "oven"
desc = "Cookies are ready, dear."
icon = 'icons/obj/cooking_machines.dmi'
icon_state = "ovenopen"
cook_type = "baked"
appliancetype = OVEN
food_color = "#A34719"
can_burn_food = TRUE
var/datum/looping_sound/oven/oven_loop
circuit = /obj/item/weapon/circuitboard/oven
active_power_usage = 6 KILOWATTS
heating_power = 6 KILOWATTS
//Based on a double deck electric convection oven
resistance = 12 KILOWATTS // Approx. 12 minutes to heat up.
idle_power_usage = 2 KILOWATTS
//uses ~30% power to stay warm
optimal_power = 0.8 // Oven cooks .2 faster than the default speed.
light_x = 3
light_y = 4
max_contents = 5
container_type = /obj/item/weapon/reagent_containers/cooking_container/oven
stat = POWEROFF //Starts turned off
var/open = FALSE // Start closed just so people don't try to preheat with it open, lol.
output_options = list(
"Pizza" = /obj/item/weapon/reagent_containers/food/snacks/variable/pizza,
"Bread" = /obj/item/weapon/reagent_containers/food/snacks/variable/bread,
"Pie" = /obj/item/weapon/reagent_containers/food/snacks/variable/pie,
"Cake" = /obj/item/weapon/reagent_containers/food/snacks/variable/cake,
"Hot Pocket" = /obj/item/weapon/reagent_containers/food/snacks/variable/pocket,
"Kebab" = /obj/item/weapon/reagent_containers/food/snacks/variable/kebab,
"Waffles" = /obj/item/weapon/reagent_containers/food/snacks/variable/waffles,
"Cookie" = /obj/item/weapon/reagent_containers/food/snacks/variable/cookie,
"Donut" = /obj/item/weapon/reagent_containers/food/snacks/variable/donut,
)
/obj/machinery/appliance/cooker/oven/Initialize()
. = ..()
oven_loop = new(list(src), FALSE)
/obj/machinery/appliance/cooker/oven/Destroy()
QDEL_NULL(oven_loop)
return ..()
/obj/machinery/appliance/cooker/oven/update_icon()
if(!open)
if(!stat)
icon_state = "ovenclosed_on"
if(cooking == TRUE)
icon_state = "ovenclosed_cooking"
if(oven_loop)
oven_loop.start(src)
else
icon_state = "ovenclosed_on"
if(oven_loop)
oven_loop.stop(src)
else
icon_state = "ovenclosed_off"
if(oven_loop)
oven_loop.stop(src)
else
icon_state = "ovenopen"
if(oven_loop)
oven_loop.stop(src)
..()
/obj/machinery/appliance/cooker/oven/AltClick(var/mob/user)
try_toggle_door(user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
/obj/machinery/appliance/cooker/oven/verb/toggle_door()
set src in oview(1)
set category = "Object"
set name = "Open/close oven door"
try_toggle_door(usr)
/obj/machinery/appliance/cooker/oven/proc/try_toggle_door(mob/user)
if(!isliving(usr) || isAI(user))
return
if(!usr.IsAdvancedToolUser())
to_chat(user, "<span class='notice'>You lack the dexterity to do that.</span>")
return
if(!Adjacent(usr))
to_chat(user, "<span class='notice'>You can't reach the [src] from there, get closer!</span>")
return
if(open)
open = FALSE
loss = (heating_power / resistance) * 0.5
cooking = TRUE
else
open = TRUE
loss = (heating_power / resistance) * 4
//When the oven door is opened, heat is lost MUCH faster and you stop cooking (because the door is open)
cooking = FALSE
playsound(src, 'sound/machines/hatch_open.ogg', 20, 1)
to_chat(user, "<span class='notice'>You [open? "open":"close"] the oven door</span>")
update_icon()
/obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I)
// check if someone's trying to manipulate the machine
if(I.has_tool_quality(TOOL_CROWBAR) || I.has_tool_quality(TOOL_SCREWDRIVER) || istype(I, /obj/item/weapon/storage/part_replacer))
return TRUE
else
return FALSE
/obj/machinery/appliance/cooker/oven/can_insert(var/obj/item/I, var/mob/user)
if(!open && !manip(I))
to_chat(user, "<span class='warning'>You can't put anything in while the door is closed!</span>")
return 0
else
return ..()
//If an oven's door is open it will lose heat every proc, even if it also gained it
//But dont call equalize twice in one stack. A return value of -1 from the parent indicates equalize was already called
/obj/machinery/appliance/cooker/oven/heat_up()
.=..()
if(open && . != -1)
var/turf/T = get_turf(src)
if(temperature > T.temperature)
equalize_temperature()
/obj/machinery/appliance/cooker/oven/can_remove_items(var/mob/user, show_warning = TRUE)
if(!open)
if(show_warning)
to_chat(user, "<span class='warning'>You can't take anything out while the door is closed!</span>")
return 0
else
return ..()
//Oven has lots of recipes and combine options. The chance for interference is high, so
//If a combine target is set the oven will do it instead of checking recipes
/obj/machinery/appliance/cooker/oven/finish_cooking(var/datum/cooking_item/CI)
if(CI.combine_target)
CI.result_type = 3//Combination type. We're making something out of our ingredients
visible_message("<b>\The [src]</b> pings!")
combination_cook(CI)
return
else
..()
/obj/machinery/appliance/cooker/oven/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O)) //CHOMPedit - Allows for deconstruction
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
..()