Bugfixes, Feature Tweaks, and Final Touches

Microwave not cooking micros/mice: Fixed
Invalid Recipe datum thanks to /microwave prefix: Fixed
Fryer earsplittingly loud: Fixed
Fryer/Oven continuing to cook even after items removed: Fixed
Oven having 'on' icon state when door closed but off: Fixed
Appliances not scaling cooking time/damage based on size: Fixed
Feature added - Burning Food will set off fire alarms and set off a black cloud of smoke!
Overcook time reduced to allow for less margin of error (IE Actively requires you to pay attention)
Multiple Microwave bugfixes, including multicooking/etc not working, recipe errors, icon state errors, ejection errors.
This commit is contained in:
Rykka
2020-07-17 23:58:33 -04:00
parent 3974d7e87f
commit df7bb084f1
15 changed files with 165 additions and 88 deletions

View File

@@ -230,7 +230,7 @@
return 0
else if(I.is_crowbar() || I.is_screwdriver()) // You can't cook tools, dummy.
return 0
else if(!istype(check) && !istype(check, /obj/item/weapon/holder))
else if(!istype(check) && !istype(check, /obj/item/weapon/holder))
to_chat(user, "<span class='warning'>That's not edible.</span>")
return 0
@@ -349,7 +349,7 @@
else if(istype(I, /obj/item/weapon/holder))
var/obj/item/weapon/holder/H = I
if (H.held_mob)
work += (H.held_mob.mob_size * H.held_mob.mob_size * 2)+2
work += ((H.held_mob.mob_size * H.held_mob.size_multiplier) * (H.held_mob.mob_size * H.held_mob.size_multiplier) * 2)+2
CI.max_cookwork += work
@@ -368,21 +368,27 @@
//If cookwork has gone from above to below 0, then this item finished cooking
finish_cooking(CI)
else if (!CI.burned && CI.cookwork > CI.max_cookwork * CI.overcook_mult)
else if (!CI.burned && CI.cookwork > min(CI.max_cookwork * CI.overcook_mult, CI.max_cookwork + 30))
burn_food(CI)
// Gotta hurt.
for(var/obj/item/weapon/holder/H in CI.container.contents)
var/mob/living/M = H.held_mob
if (M)
M.apply_damage(rand(1,3), mobdamagetype, "chest")
if(M)
M.apply_damage(rand(1,3) * (1/M.size_multiplier), mobdamagetype, pick(BP_ALL))
return TRUE
/obj/machinery/appliance/process()
if (cooking_power > 0 && cooking)
for (var/i in cooking_objs)
do_cooking_tick(i)
if(cooking_power > 0 && cooking)
var/all_done_cooking = TRUE
for(var/datum/cooking_item/CI in cooking_objs)
do_cooking_tick(CI)
if(CI.max_cookwork > 0)
all_done_cooking = FALSE
if(all_done_cooking)
cooking = FALSE
update_icon()
/obj/machinery/appliance/proc/finish_cooking(var/datum/cooking_item/CI)
@@ -540,10 +546,16 @@
// Produce nasty smoke.
visible_message("<span class='danger'>\The [src] vomits a gout of rancid smoke!</span>")
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad
var/datum/effect/effect/system/smoke_spread/bad/burntfood/smoke = new /datum/effect/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()
/obj/machinery/appliance/attack_hand(var/mob/user)
if (cooking_objs.len)
@@ -675,7 +687,7 @@
/datum/cooking_item
var/max_cookwork
var/cookwork
var/overcook_mult = 5
var/overcook_mult = 3 // How long it takes to overcook. This is max_cookwork x overcook mult. If you're changing this, mind that at 3x, a max_cookwork of 30 becomes 90 ticks for the purpose of burning, and a max_cookwork of 4 only has 12 before burning!
var/result_type = 0
var/obj/item/weapon/reagent_containers/cooking_container/container = null
var/combine_target = null

View File

@@ -10,6 +10,7 @@
var/light_x = 0
var/light_y = 0
cooking_power = 0
mobdamagetype = BURN
/obj/machinery/appliance/cooker/examine(var/mob/user)
. = ..()

View File

@@ -218,7 +218,7 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has [cook_type] \the [victim] ([victim.ckey]) in \a [src]</font>")
victim.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [cook_type] in \a [src] by [user.name] ([user.ckey])</font>")
msg_admin_attack("[key_name_admin(user)] [cook_type] \the [victim] ([victim.ckey]) in \a [src]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(victim))
msg_admin_attack("[key_name_admin(user)] [cook_type] \the [victim] ([victim.ckey]) in \a [src]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
//Coat the victim in some oil
oil.trans_to(victim, 40)

View File

@@ -39,6 +39,10 @@
if(!open)
if(!stat)
icon_state = "ovenclosed_on"
if(cooking == TRUE)
icon_state = "ovenclosed_cooking"
else
icon_state = "ovenclosed_on"
else
icon_state = "ovenclosed_off"
else