Adds general-purpose cooking oil, replaces usages of corn oil

This commit is contained in:
Casey
2021-11-18 16:38:05 -05:00
committed by Chompstation Bot
parent e6f330182b
commit c2441330b6
9 changed files with 553 additions and 28 deletions

View File

@@ -13,13 +13,13 @@
appliancetype = FRYER
active_power_usage = 12 KILOWATTS
heating_power = 12 KILOWATTS
light_y = 15
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.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.
@@ -33,11 +33,11 @@
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)
oil = new/datum/reagents(optimal_oil * 1.25, src)
var/variance = rand()*0.15
// Fryer is always a little below full, but its usually negligible
@@ -45,18 +45,18 @@
if(prob(20))
// Sometimes the fryer will start with much less than full oil, significantly impacting efficiency until filled
variance = rand()*0.5
oil.add_reagent("cornoil", optimal_oil*(1 - variance))
oil.add_reagent("cookingoil", optimal_oil*(1 - variance))
/obj/machinery/appliance/cooker/fryer/Destroy()
QDEL_NULL(fry_loop)
QDEL_NULL(oil)
return ..()
/obj/machinery/appliance/cooker/fryer/examine(var/mob/user)
. = ..()
if(Adjacent(user))
to_chat(user, "Oil Level: [oil.total_volume]/[optimal_oil]")
/obj/machinery/appliance/cooker/fryer/update_icon() // We add our own version of the proc to use the special fryer double-lights.
cut_overlays()
var/image/light
@@ -69,7 +69,7 @@
light.pixel_x = light_x
light.pixel_y = light_y
add_overlay(light)
/obj/machinery/appliance/cooker/fryer/heat_up()
if (..())
//Set temperature of oil reagent
@@ -102,7 +102,7 @@
cooking_power *= oil_efficiency
/obj/machinery/appliance/cooker/fryer/update_icon()
if(!stat)
..()
@@ -119,7 +119,7 @@
if(fry_loop)
fry_loop.stop(src)
..()
//Fryer gradually infuses any cooked food with oil. Moar calories
//This causes a slow drop in oil levels, encouraging refill after extended use
/obj/machinery/appliance/cooker/fryer/do_cooking_tick(var/datum/cooking_item/CI)
@@ -177,13 +177,13 @@
return
// user.visible_message("<span class='danger'>\The [user] starts pushing \the [victim] into \the [src]!</span>")
//Removed delay on this action in favour of a cooldown after it
//If you can lure someone close to the fryer and grab them then you deserve success.
//And a delay on this kind of niche action just ensures it never happens
//Cooldown ensures it can't be spammed to instakill someone
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*3)
fry_loop.start(src)
if(!do_mob(user, victim, 20))
@@ -239,9 +239,9 @@
//Coat the victim in some oil
oil.trans_to(victim, 40)
fry_loop.stop()
/obj/machinery/appliance/cooker/fryer/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/reagent_containers/glass) && I.reagents)
if (I.reagents.total_volume <= 0 && oil)