Huge Bundle of Fixes, Update Cooking to current Aurora

Cooking times are now no longer 10-15 minutes per item, the LARGEST items will take around ~4-5 minutes, 6 at the maximum in the case of the superbigbite (one of the most filling food items in the game).
Cooking oil tanks added
Appliances are now constructible instead of being eldritch black magic
Recipes are now reorganized to either fryer/oven/grill based on where they're made (Although recipes_microwave still needs a LOT more sorting)
Critical time bug with cooking fixed, AND you can now upgrade your appliances for even higher efficiencies!
This commit is contained in:
Rykka
2020-07-22 22:14:04 -04:00
parent 575b1f4f33
commit c27b2d2234
26 changed files with 607 additions and 448 deletions

View File

@@ -16,10 +16,10 @@
use_power = USE_POWER_IDLE
idle_power_usage = 5 // Power used when turned on, but not processing anything
active_power_usage = 1000 // Power used when turned on and actively cooking something
var/initial_active_power_usage = 1000
var/cooking_power = 1
var/initial_cooking_power = 1
var/cooking_power = 0 // Effectiveness/speed at cooking
var/cooking_coeff = 0 // Optimal power * proximity to optimal temp; used to calc. cooking power.
var/heating_power = 1000 // Effectiveness at heating up; not used for mixers, should be equal to active_power_usage
var/max_contents = 1 // Maximum number of things this appliance can simultaneously cook
var/on_icon // Icon state used when cooking.
var/off_icon // Icon state used when not cooking.
@@ -29,7 +29,7 @@
var/mobdamagetype = BRUTE // Burn damage for cooking appliances, brute for cereal/candy
var/food_color // Colour of resulting food item.
var/cooked_sound = 'sound/machines/ding.ogg' // Sound played when cooking completes.
var/can_burn_food // Can the object burn food that is left inside?
var/can_burn_food = FALSE // Can the object burn food that is left inside?
var/burn_chance = 10 // How likely is the food to burn?
var/list/cooking_objs = list() // List of things being cooked
@@ -40,18 +40,13 @@
var/container_type = null
var/combine_first = 0//If 1, this appliance will do combinaiton cooking before checking recipes
var/combine_first = FALSE // If TRUE, this appliance will do combination cooking before checking recipes
/obj/machinery/appliance/Initialize()
. = ..()
component_parts = list()
component_parts += /obj/item/weapon/circuitboard/cooking
component_parts += /obj/item/weapon/stock_parts/capacitor
component_parts += /obj/item/weapon/stock_parts/capacitor
component_parts += /obj/item/weapon/stock_parts/capacitor
component_parts += /obj/item/weapon/stock_parts/scanning_module
component_parts += /obj/item/weapon/stock_parts/matter_bin
component_parts += /obj/item/weapon/stock_parts/matter_bin
default_apply_parts()
if(output_options.len)
verbs += /obj/machinery/appliance/proc/choose_output
@@ -228,7 +223,7 @@
else if(istype(check, /obj/item/weapon/disk/nuclear))
to_chat(user, "<span class='warning'>You can't cook that.</span>")
return 0
else if(I.is_crowbar() || I.is_screwdriver()) // You can't cook tools, dummy.
else if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/weapon/storage/part_replacer)) // You can't cook tools, dummy.
return 0
else if(!istype(check) && !istype(check, /obj/item/weapon/holder))
to_chat(user, "<span class='warning'>That's not edible.</span>")
@@ -301,7 +296,7 @@
/obj/machinery/appliance/proc/get_cooking_work(var/datum/cooking_item/CI)
for (var/obj/item/J in CI.container)
oilwork(J, CI)
cookwork_by_item(J, CI)
for (var/r in CI.container.reagents.reagent_list)
var/datum/reagent/R = r
@@ -328,7 +323,7 @@
CI.max_cookwork += buffer*multiplier
//Just a helper to save code duplication in the above
/obj/machinery/appliance/proc/oilwork(var/obj/item/I, var/datum/cooking_item/CI)
/obj/machinery/appliance/proc/cookwork_by_item(var/obj/item/I, var/datum/cooking_item/CI)
var/obj/item/weapon/reagent_containers/food/snacks/S = I
var/work = 0
if (istype(S))
@@ -725,18 +720,13 @@
for(var/obj/item/weapon/stock_parts/P in src.component_parts)
if(istype(P, /obj/item/weapon/stock_parts/scanning_module))
scan_rating += P.rating
scan_rating += P.rating - 1 // Default parts shouldn't mess with stats
// to_world("RefreshParts returned scan rating of [scan_rating] during this step.") // Debug lines, uncomment if you need to test.
else if(istype(P, /obj/item/weapon/stock_parts/capacitor))
cap_rating += P.rating
cap_rating += P.rating - 1 // Default parts shouldn't mess with stats
// to_world("RefreshParts returned cap rating of [cap_rating] during this step.") // Debug lines, uncomment if you need to test.
active_power_usage = initial(active_power_usage) - scan_rating*10
cooking_power = initial(cooking_power) + (scan_rating+cap_rating)/10
/obj/item/weapon/circuitboard/cooking
name = "kitchen appliance circuitry"
desc = "The circuitboard for many kitchen appliances. Not of much use."
origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2)
req_components = list(
/obj/item/weapon/stock_parts/capacitor = 3,
/obj/item/weapon/stock_parts/scanning_module = 1,
/obj/item/weapon/stock_parts/matter_bin = 2)
active_power_usage = initial(active_power_usage) - scan_rating * 25
heating_power = initial(heating_power) + cap_rating * 25
cooking_power = cooking_coeff * (1 + (scan_rating + cap_rating) / 20) // 100% eff. becomes 120%, 140%, 160% w/ better parts, thus rewarding upgrading the appliances during your shift.
// to_world("RefreshParts returned cooking power of [cooking_power] during this step.") // Debug lines, uncomment if you need to test.

View File

@@ -2,27 +2,29 @@
var/temperature = T20C
var/min_temp = 80 + T0C //Minimum temperature to do any cooking
var/optimal_temp = 200 + T0C //Temperature at which we have 100% efficiency. efficiency is lowered on either side of this
var/optimal_power = 0.1//cooking power at 100%
var/optimal_power = 0.6 //cooking power at 100% - This variable determines the MAXIMUM increase in do_cooking_ticks, once math goes through. If you want ticks of 0.5, set it to 0.5, etc.
var/loss = 1 //Temp lost per proc when equalising
var/resistance = 32000 //Resistance to heating. combines with active power usage to determine how long heating takes. 32k by default.
var/resistance = 32000 //Resistance to heating. combines with heating power to determine how long heating takes. 32k by default.
var/light_x = 0
var/light_y = 0
cooking_coeff = 0
cooking_power = 0
mobdamagetype = BURN
can_burn_food = TRUE
/obj/machinery/appliance/cooker/examine(var/mob/user)
. = ..()
if(.) //no need to duplicate adjacency check
if(!stat)
if (temperature < min_temp)
to_chat(user, span("warning", "\The [src] is still heating up and is too cold to cook anything yet."))
to_chat(user, "<span class='warning'>\The [src] is still heating up and is too cold to cook anything yet.</span>")
else
to_chat(user, span("notice", "It is running at [round(get_efficiency(), 0.1)]% efficiency!"))
to_chat(user, "<span class='notice'>It is running at [round(get_efficiency(), 0.1)]% efficiency!</span>")
to_chat(user, "Temperature: [round(temperature - T0C, 0.1)]C / [round(optimal_temp - T0C, 0.1)]C")
else
to_chat(user, span("warning", "It is switched off."))
to_chat(user, "<span class='warning'>It is switched off.</span>")
/obj/machinery/appliance/cooker/list_contents(var/mob/user)
if (cooking_objs.len)
@@ -35,10 +37,10 @@
string += "- [CI.container.label(num)], [report_progress(CI)]</br>"
to_chat(user, string)
else
to_chat(user, span("notice","It is empty."))
to_chat(user, "<span class='notice'>It's empty.</span>")
/obj/machinery/appliance/cooker/proc/get_efficiency()
//RefreshParts()
// to_world("Our cooking_power is [cooking_power] and our efficiency is [(cooking_power / optimal_power) * 100].") // Debug lines, uncomment if you need to test.
return (cooking_power / optimal_power) * 100
/obj/machinery/appliance/cooker/Initialize()
@@ -80,16 +82,25 @@
/obj/machinery/appliance/cooker/proc/update_cooking_power()
var/temp_scale = 0
if(temperature > min_temp)
if(temperature >= optimal_temp) // If we're at or above optimal temp, then we're going to be at 1 for temp scale. No use penalizing you for the cookers increasing heat constantly (until we implement setting a temp on the oven via a menu.)
temp_scale = 1
else
temp_scale = (temperature - min_temp) / (optimal_temp - min_temp) // If we're between min and optimal this will yield a value in the range 0-1
/* // old code for reference, will be useful if/when we implement ovens with configurable temperatures - TODO recipes with optimal temps for cooking per-recipe??
temp_scale = (temperature - min_temp) / (optimal_temp - min_temp) // If we're between min and optimal this will yield a value in the range 0-1
if(temp_scale > 1) // We're above optimal, efficiency goes down as we pass too much over it
if(temp_scale >= 2)
temp_scale = 0
else
temp_scale = 1 - (temp_scale - 1)
*/
cooking_power = optimal_power * temp_scale
// RefreshParts()
cooking_coeff = optimal_power * temp_scale
// to_world("Our cooking_power is [cooking_power] and our tempscale is [temp_scale], and our cooking_coeff is [cooking_coeff] before RefreshParts.") // Debug lines, uncomment if you need to test.
RefreshParts()
// to_world("Our cooking_power is [cooking_power] after RefreshParts.") // Debug lines, uncomment if you need to test.
/obj/machinery/appliance/cooker/proc/heat_up()
if(temperature < optimal_temp)
@@ -97,7 +108,7 @@
playsound(src, 'sound/machines/click.ogg', 20, 1)
use_power = 2.//If we're heating we use the active power
update_icon()
temperature += active_power_usage / resistance
temperature += heating_power / resistance
update_cooking_power()
return 1
else

View File

@@ -10,7 +10,7 @@ fundamental differences
/obj/machinery/appliance/mixer
max_contents = 1
stat = POWEROFF
cooking_power = 0.4
cooking_coeff = 0.75 // Original value 0.4
active_power_usage = 3000
idle_power_usage = 50

View File

@@ -6,7 +6,8 @@
on_icon = "mixer_on"
cook_type = "candied"
appliancetype = CANDYMAKER
cooking_power = 0.6
circuit = /obj/item/weapon/circuitboard/candymachine
cooking_coeff = 1.0 // Original Value 0.6
cooked_sound = 'sound/machines/ding.ogg'
output_options = list(

View File

@@ -8,11 +8,12 @@
off_icon = "cereal_off"
cooked_sound = 'sound/machines/ding.ogg'
appliancetype = CEREALMAKER
circuit = /obj/item/weapon/circuitboard/cerealmaker
output_options = list(
"Cereal" = /obj/item/weapon/reagent_containers/food/snacks/variable/cereal
)
/*
/obj/machinery/appliance/mixer/cereal/change_product_strings(var/obj/item/weapon/reagent_containers/food/snacks/product, var/datum/cooking_item/CI)
. = ..()

View File

@@ -150,6 +150,15 @@
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/clothing/head/cakehat, // This is because we want to allow birthday cakes to be makeable.
/obj/item/organ/internal/brain // As before, needed for braincake
)
/obj/item/weapon/reagent_containers/cooking_container/fryer
name = "fryer basket"
shortname = "basket"

View File

@@ -9,18 +9,20 @@
food_color = "#FFAD33"
cooked_sound = 'sound/machines/ding.ogg'
var/datum/looping_sound/deep_fryer/fry_loop
circuit = /obj/item/weapon/circuitboard/fryer
appliancetype = FRYER
active_power_usage = 12 KILOWATTS
heating_power = 12000
min_temp = 140 + T0C // Same as above, increasing this to just under 2x to make the % increase on efficiency not quite so painful as it would be at 80.
optimal_temp = 400 + T0C // Increasing this to be 2x Oven to allow for a much higher/realistic frying temperatures. Doesn't really do anything but make heating the fryer take a bit longer.
optimal_power = 0.35
optimal_power = 0.95 // .35 higher than the default to give fryers faster cooking speed.
idle_power_usage = 3.6 KILOWATTS
// Power used to maintain temperature once it's heated.
// Going with 25% of the active power. This is a somewhat arbitrary value.
resistance = 20000 // Approx. 8-9 minutes to heat up.
resistance = 60000 // Approx. 10 minutes to heat up.
max_contents = 2
container_type = /obj/item/weapon/reagent_containers/cooking_container/fryer
@@ -29,7 +31,7 @@
var/datum/reagents/oil
var/optimal_oil = 9000 //90 litres of cooking oil
/obj/machinery/appliance/cooker/fryer/Initialize()
. = ..()
fry_loop = new(list(src), FALSE)

View File

@@ -3,24 +3,30 @@
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 = 1
can_burn_food = TRUE
circuit = /obj/item/weapon/circuitboard/grill
cooked_sound = 'sound/machines/ding.ogg'
stat = POWEROFF
appliancetype = 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
max_contents = 3 // Arbitrary number, 3 grill 'racks'
resistance = 8 KILOWATTS // Very fast to heat up.
container_type = /obj/item/weapon/reagent_containers/cooking_container/grill
/* // Test Comment this out too, /cooker does this for us, and this path '/obj/machinery/appliance/grill' is invalid anyways, meaning it does jack shit. - Updated the paths, but I'm basically commenting all this shit out and if the grill works as-normal, none of this stuff is needed.
/obj/machinery/appliance/grill/toggle_power()
set src in view()
set name = "Toggle Power"
@@ -42,12 +48,13 @@
playsound(src, 'sound/machines/click.ogg', 40, 1)
update_icon()
/obj/machinery/appliance/grill/Initialize()
/obj/machinery/appliance/cooker/grill/Initialize()
. = ..()
// cooking_objs += new /datum/cooking_item(new /obj/item/weapon/reagent_containers/cooking_container(src))
cooking = FALSE
/obj/machinery/appliance/grill/has_space(var/obj/item/I)
/obj/machinery/appliance/cooker/grill/has_space(var/obj/item/I)
var/datum/cooking_item/CI = cooking_objs[1]
if (!CI || !CI.container)
return 0
@@ -56,7 +63,8 @@
return CI
return 0
*/
/* // Test comment this out, I don't think this is doing shit anyways.
//Container is not removable
/obj/machinery/appliance/grill/removal_menu(var/mob/user)
if (can_remove_items(user))
@@ -79,14 +87,17 @@
update_icon()
return 1
return 0
*/
/obj/machinery/appliance/grill/update_icon()
/obj/machinery/appliance/grill/update_icon() // TODO: Cooking icon
if(!stat)
icon_state = on_icon
else
icon_state = off_icon
/* // Test remove this too.
/obj/machinery/appliance/grill/process()
if (!stat)
for (var/i in cooking_objs)
do_cooking_tick(i)
do_cooking_tick(i)
*/

View File

@@ -6,15 +6,17 @@
cook_type = "baked"
appliancetype = OVEN
food_color = "#A34719"
can_burn_food = 1
can_burn_food = TRUE
circuit = /obj/item/weapon/circuitboard/oven
cooked_sound = 'sound/machines/ding.ogg'
active_power_usage = 6 KILOWATTS
heating_power = 6000
//Based on a double deck electric convection oven
resistance = 16000
resistance = 30000 // Approx. 12 minutes to heat up.
idle_power_usage = 2 KILOWATTS
//uses ~30% power to stay warm
optimal_power = 0.2
optimal_power = 0.8 // Oven cooks .2 faster than the default speed.
light_x = 2
max_contents = 5
@@ -75,19 +77,27 @@
if(open)
open = FALSE
loss = (active_power_usage / resistance)*0.5
loss = (heating_power / resistance) * 0.5
cooking = TRUE
else
open = TRUE
loss = (active_power_usage / resistance)*4
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)
update_icon()
/obj/machinery/appliance/cooker/oven/proc/manip(var/obj/item/I)
// check if someone's trying to manipulate the machine
if(I.is_crowbar() || I.is_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)
if(!open && !manip(I))
to_chat(user, "<span class='warning'>You can't put anything in while the door is closed!</span>")
return 0
@@ -118,6 +128,7 @@
/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("<span class='notice'>\The [src] pings!</span>")
combination_cook(CI)
return
else