mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
[TM] [TGUI] Kitchen Improvements (#19165)
* this got a bit... out of hand
* update icon
* extra lines begone
* soundfix
* sirryan review pt1
* fuck I accidently deleted a line
* sirryan pt2
* AA suggestion
* more review
* hooooly crap
* lewcc review
* reviews
* table
* merge master
* Revert "merge master"
This reverts commit c3ec73a0f8.
* bundle css
* reviews and revival
* fuck I missed a file
* steel review
This commit is contained in:
@@ -33,3 +33,36 @@ GLOBAL_DATUM_INIT(firealarm_soundloop, /datum/looping_sound/firealarm, new(list(
|
||||
if(!length(output_atoms))
|
||||
stop()
|
||||
|
||||
///// KITCHEN MACHINERY /////
|
||||
|
||||
/datum/looping_sound/kitchen/microwave
|
||||
start_sound = 'sound/machines/kitchen/microwave_start.ogg'
|
||||
start_length = 10
|
||||
mid_sounds = list('sound/machines/kitchen/microwave_mid1.ogg' = 10, 'sound/machines/kitchen/microwave_mid2.ogg' = 1)
|
||||
mid_length = 15
|
||||
end_sound = 'sound/machines/kitchen/microwave_end.ogg'
|
||||
volume = 100
|
||||
|
||||
/datum/looping_sound/kitchen/deep_fryer
|
||||
start_sound = 'sound/machines/kitchen/deep_fryer_immerse.ogg'
|
||||
start_length = 10
|
||||
mid_sounds = list('sound/machines/kitchen/deep_fryer_1.ogg' = 1, 'sound/machines/kitchen/deep_fryer_2.ogg' = 1)
|
||||
mid_length = 9
|
||||
end_sound = 'sound/machines/kitchen/deep_fryer_emerge.ogg'
|
||||
volume = 5
|
||||
|
||||
/datum/looping_sound/kitchen/oven
|
||||
start_sound = 'sound/machines/kitchen/oven_loop_start.ogg'
|
||||
start_length = 11
|
||||
mid_sounds = list('sound/machines/kitchen/oven_loop_mid.ogg' = 1)
|
||||
mid_length = 12
|
||||
end_sound = 'sound/machines/kitchen/oven_loop_end.ogg'
|
||||
volume = 70
|
||||
|
||||
/datum/looping_sound/kitchen/grill
|
||||
start_sound = 'sound/machines/kitchen/grill_start.ogg'
|
||||
start_length = 13
|
||||
mid_sounds = list('sound/machines/kitchen/grill_mid.ogg' = 1)
|
||||
mid_length = 20
|
||||
end_sound = 'sound/machines/kitchen/grill_end.ogg'
|
||||
volume = 50
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
if(id)
|
||||
amount += reagents.get_reagent_amount(id)
|
||||
reagents.clear_reagents()
|
||||
var/obj/item/reagent_containers/food/snacks/badrecipe/ffuu = new(get_turf(source))
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
var/obj/item/reagent_containers/food/snacks/badrecipe/mysteryfood = new(get_turf(source))
|
||||
mysteryfood.reagents.add_reagent("carbon", amount)
|
||||
mysteryfood.reagents.add_reagent("????", amount / 10)
|
||||
make_dirty(75)
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
var/ant_location
|
||||
/// Time we last checked for ants
|
||||
var/last_ant_time = 0
|
||||
///Name of the food to show up in kitchen machines (microwaves, ovens, etc)
|
||||
var/ingredient_name
|
||||
var/ingredient_name_plural
|
||||
resistance_flags = FLAMMABLE
|
||||
container_type = INJECTABLE
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
bitesize = 3
|
||||
list_reagents = list("plantmatter" = 2)
|
||||
tastes = list("tofu" = 1)
|
||||
ingredient_name = "tofu chunk"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/fried_tofu
|
||||
name = "fried tofu"
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
bitesize = 3
|
||||
list_reagents = list("protein" = 3)
|
||||
tastes = list("meat" = 1)
|
||||
ingredient_name = "slab of meat"
|
||||
ingredient_name_plural = "slabs of meat"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/meat/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/kitchen/knife) || istype(W, /obj/item/scalpel))
|
||||
@@ -353,7 +355,6 @@
|
||||
list_reagents = list("protein" = 1, "egg" = 5)
|
||||
tastes = list("egg" = 1)
|
||||
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom)
|
||||
..()
|
||||
var/turf/T = get_turf(hit_atom)
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
filling_color = "#DEDEAB"
|
||||
list_reagents = list("nutriment" = 4)
|
||||
tastes = list("meat" = 2, "dough" = 2, "laziness" = 1)
|
||||
ingredient_name = "turnover"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/warmdonkpocket
|
||||
name = "warm Donk-pocket"
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
bitesize = 6
|
||||
list_reagents = list("protein" = 3, "carpotoxin" = 2, "vitamin" = 2)
|
||||
tastes = list("white fish" = 1)
|
||||
ingredient_name = "fillet of meat"
|
||||
ingredient_name_plural = "fillets of meat"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/salmonmeat
|
||||
name = "raw salmon"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
recipe_type = RECIPE_CANDY
|
||||
off_icon = "candymaker_off"
|
||||
on_icon = "candymaker_on"
|
||||
broken_icon = "candymaker_broke"
|
||||
dirty_icon = "candymaker_dirty"
|
||||
open_icon = "candymaker_open"
|
||||
|
||||
|
||||
@@ -20,6 +20,15 @@
|
||||
var/has_specials = FALSE
|
||||
///Set to TRUE if the machine supports upgrades / deconstruction, or else it will ignore stuff like screwdrivers and parts exchangers
|
||||
var/upgradeable = FALSE
|
||||
var/datum/looping_sound/kitchen/deep_fryer/soundloop
|
||||
|
||||
/obj/machinery/cooker/Initialize(mapload)
|
||||
. = ..()
|
||||
soundloop = new(list(src), FALSE) // cereal machine, screw off
|
||||
|
||||
/obj/machinery/cooker/Destroy()
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
// checks if the snack has been cooked in a certain way
|
||||
/obj/machinery/cooker/proc/checkCooked(obj/item/reagent_containers/food/snacks/D)
|
||||
@@ -68,6 +77,7 @@
|
||||
|
||||
/obj/machinery/cooker/proc/turnoff(obj/item/olditem)
|
||||
icon_state = officon
|
||||
soundloop.stop()
|
||||
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
on = FALSE
|
||||
qdel(olditem)
|
||||
@@ -79,6 +89,7 @@
|
||||
/obj/machinery/cooker/proc/burn_food(mob/user, obj/item/reagent_containers/props)
|
||||
var/obj/item/reagent_containers/food/snacks/badrecipe/burnt = new(get_turf(src))
|
||||
setRegents(props, burnt)
|
||||
soundloop.stop()
|
||||
to_chat(user, "<span class='warning'>You smell burning coming from [src]!</span>")
|
||||
var/datum/effect_system/smoke_spread/bad/smoke = new // burning things makes smoke!
|
||||
smoke.set_up(5, 0, src)
|
||||
@@ -99,6 +110,7 @@
|
||||
/obj/machinery/cooker/proc/putIn(obj/item/tocook, mob/chef)
|
||||
icon_state = onicon
|
||||
to_chat(chef, "<span class='notice'>You put [tocook] into [src].</span>")
|
||||
soundloop.start()
|
||||
on = TRUE
|
||||
chef.drop_item()
|
||||
tocook.loc = src
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
recipe_type = RECIPE_GRILL
|
||||
off_icon = "grill_off"
|
||||
on_icon = "grill_on"
|
||||
broken_icon = "grill_broke"
|
||||
dirty_icon = "grill_dirty"
|
||||
open_icon = "grill_open"
|
||||
soundloop_type = /datum/looping_sound/kitchen/grill
|
||||
|
||||
// see code/modules/food/recipes_grill.dm for recipes
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define NO_DIRT 0
|
||||
#define MAX_DIRT 100
|
||||
|
||||
/obj/machinery/kitchen_machine
|
||||
name = "Base Kitchen Machine"
|
||||
@@ -10,8 +12,7 @@
|
||||
active_power_usage = 100
|
||||
container_type = OPENCONTAINER
|
||||
var/operating = FALSE // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/dirty = NO_DIRT // = {0..100} Does it need cleaning?
|
||||
var/efficiency = 0
|
||||
var/list/cook_verbs = list("Cooking")
|
||||
//Recipe & Item vars
|
||||
@@ -20,9 +21,11 @@
|
||||
//Icon states
|
||||
var/off_icon
|
||||
var/on_icon
|
||||
var/broken_icon
|
||||
var/dirty_icon
|
||||
var/open_icon
|
||||
///Sound used when starting and ending cooking
|
||||
var/datum/looping_sound/kitchen/soundloop
|
||||
var/soundloop_type
|
||||
|
||||
/*******************
|
||||
* Initialising
|
||||
@@ -30,10 +33,16 @@
|
||||
|
||||
/obj/machinery/kitchen_machine/Initialize(mapload)
|
||||
. = ..()
|
||||
if(soundloop_type)
|
||||
soundloop = new soundloop_type(list(src), FALSE)
|
||||
create_reagents(100)
|
||||
reagents.set_reacting(FALSE)
|
||||
init_lists()
|
||||
|
||||
/obj/machinery/kitchen_machine/Destroy()
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/init_lists()
|
||||
if(!GLOB.cooking_recipes[recipe_type])
|
||||
GLOB.cooking_recipes[recipe_type] = list()
|
||||
@@ -62,53 +71,30 @@
|
||||
/obj/machinery/kitchen_machine/attackby(obj/item/O, mob/user, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(dirty < MAX_DIRT)
|
||||
if(default_deconstruction_screwdriver(user, open_icon, off_icon, O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/wrench))
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(anchored)
|
||||
anchored = FALSE
|
||||
to_chat(user, "<span class='alert'>\The [src] can now be moved.</span>")
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = TRUE
|
||||
to_chat(user, "<span class='alert'>\The [src] is now secured.</span>")
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(user, O)
|
||||
|
||||
if(broken > 0)
|
||||
// Broken == 2 is handled by screwdriver_act
|
||||
if(broken == 1 && istype(O, /obj/item/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message("<span class='notice'>[user] starts to fix part of [src].</span>", "<span class='notice'>You start to fix part of [src].</span>")
|
||||
if(do_after(user, 20 * O.toolspeed, target = src))
|
||||
user.visible_message("<span class='notice'>[user] fixes [src].</span>", "<span class='notice'>You have fixed [src].</span>")
|
||||
icon_state = off_icon
|
||||
broken = 0 // Fix it!
|
||||
dirty = 0 // just to be sure
|
||||
container_type = OPENCONTAINER
|
||||
else
|
||||
to_chat(user, "<span class='alert'>It's broken!</span>")
|
||||
return 1
|
||||
else if(dirty==100) // The machine is all dirty so can't be used!
|
||||
if(dirty == MAX_DIRT) // The machine is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/reagent_containers/spray/cleaner) || istype(O, /obj/item/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message("<span class='notice'>[user] starts to clean [src].</span>", "<span class='notice'>You start to clean [src].</span>")
|
||||
if(do_after(user, 20 * O.toolspeed, target = src))
|
||||
user.visible_message("<span class='notice'>[user] has cleaned [src].</span>", "<span class='notice'>You have cleaned [src].</span>")
|
||||
dirty = 0 // It's clean!
|
||||
broken = 0 // just to be sure
|
||||
icon_state = off_icon
|
||||
dirty = NO_DIRT
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
container_type = OPENCONTAINER
|
||||
return TRUE
|
||||
else //Otherwise bad luck!!
|
||||
to_chat(user, "<span class='alert'>It's dirty!</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
else if(is_type_in_list(O, GLOB.cooking_ingredients[recipe_type]) || istype(O, /obj/item/mixing_bowl))
|
||||
if(contents.len>=max_n_of_items)
|
||||
if(length(contents) >= max_n_of_items)
|
||||
to_chat(user, "<span class='alert'>This [src] is full of ingredients, you cannot put more.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
if(istype(O,/obj/item/stack))
|
||||
var/obj/item/stack/S = O
|
||||
if(S.get_amount() > 1)
|
||||
@@ -121,47 +107,44 @@
|
||||
add_item(O, user)
|
||||
else if(is_type_in_list(O, list(/obj/item/reagent_containers/glass, /obj/item/reagent_containers/food/drinks, /obj/item/reagent_containers/food/condiment)))
|
||||
if(!O.reagents)
|
||||
return 1
|
||||
return TRUE
|
||||
for(var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if(!(R.id in GLOB.cooking_reagents[recipe_type]))
|
||||
to_chat(user, "<span class='alert'>Your [O] contains components unsuitable for cookery.</span>")
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
return TRUE
|
||||
else if(istype(O,/obj/item/grab))
|
||||
return special_attack(O, user)
|
||||
else
|
||||
to_chat(user, "<span class='alert'>You have no idea what you can cook with [O].</span>")
|
||||
return 1
|
||||
updateUsrDialog()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(operating || broken != 2)
|
||||
/obj/machinery/kitchen_machine/wrench_act(mob/living/user, obj/item/I)
|
||||
if(operating)
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] starts to fix part of [src].</span>", "<span class='notice'>You start to fix part of [src].</span>")
|
||||
if(do_after(user, 20 * I.toolspeed, target = src))
|
||||
I.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] fixes part of [src].</span>", "<span class='notice'>You have fixed part of [src].</span>")
|
||||
broken = 1 // Fix it a bit
|
||||
|
||||
I.play_tool_sound(src)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='alert'>[src] can now be moved.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='alert'>[src] is now secured.</span>")
|
||||
anchored = !anchored
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/add_item(obj/item/I, mob/user)
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='notice'>\The [I] is stuck to your hand, you cannot put it in [src]</span>")
|
||||
//return 0
|
||||
else
|
||||
I.forceMove(src)
|
||||
user.visible_message("<span class='notice'>[user] adds [I] to [src].</span>", "<span class='notice'>You add [I] to [src].</span>")
|
||||
to_chat(user, "<span class='notice'>[I] is stuck to your hand, you cannot put it in [src]</span>")
|
||||
return
|
||||
|
||||
I.forceMove(src)
|
||||
user.visible_message("<span class='notice'>[user] adds [I] to [src].</span>", "<span class='notice'>You add [I] to [src].</span>")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/machinery/kitchen_machine/attack_ai(mob/user)
|
||||
return 0
|
||||
|
||||
/obj/machinery/kitchen_machine/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/special_attack(obj/item/grab/G, mob/user)
|
||||
to_chat(user, "<span class='alert'>This is ridiculous. You can not fit [G.affecting] in this [src].</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/********************
|
||||
* Machine Menu *
|
||||
@@ -169,38 +152,34 @@
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/format_content_descs()
|
||||
. = ""
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
var/list/items_counts = list()
|
||||
var/list/name_overrides = list()
|
||||
for(var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if(istype(O,/obj/item/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if(istype(O,/obj/item/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if(istype(O,/obj/item/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if(istype(O,/obj/item/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if(istype(O,/obj/item/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
if(istype(O, /obj/item/reagent_containers/food))
|
||||
var/obj/item/reagent_containers/food/food = O
|
||||
if(!items_counts[display_name])
|
||||
if(food.ingredient_name)
|
||||
name_overrides[display_name] = food.ingredient_name
|
||||
else
|
||||
name_overrides[display_name] = display_name
|
||||
else
|
||||
if(food.ingredient_name_plural)
|
||||
name_overrides[display_name] = food.ingredient_name_plural
|
||||
else if(items_counts[display_name] == 1) // Must only add "s" once or you get stuff like "eggsssss"
|
||||
name_overrides[display_name] = "[name_overrides[display_name]]s" //name_overrides[display_name] Will be set on the first time as the singular form
|
||||
|
||||
items_counts[display_name]++
|
||||
|
||||
for(var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if(!(O in items_measures))
|
||||
. += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
if(!(O in name_overrides))
|
||||
. += {"<b>[capitalize(O)]:</b> [N] [lowertext(O)]\s<br>"}
|
||||
else
|
||||
if(N==1)
|
||||
. += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
. += {"<b>[capitalize(O)]:</b> [N] [name_overrides[O]]<br>"}
|
||||
else
|
||||
. += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
. += {"<b>[capitalize(O)]:</b> [N] [name_overrides[O]]<br>"}
|
||||
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
@@ -209,38 +188,7 @@
|
||||
if(R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
|
||||
. += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
|
||||
/obj/machinery/kitchen_machine/interact(mob/user) // The microwave Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(broken > 0)
|
||||
dat = {"<code>Bzzzzttttt</code>"}
|
||||
else if(operating)
|
||||
dat = {"<code>[pick(cook_verbs)] in progress!<BR>Please wait...!</code>"}
|
||||
else if(dirty==100)
|
||||
dat = {"<code>This [src] is dirty!<BR>Please clean it before use!</code>"}
|
||||
else
|
||||
dat += format_content_descs()
|
||||
if(dat)
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
else
|
||||
dat = {"<B>[src] is empty</B><BR>"}
|
||||
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=[UID()];action=cook'>Turn on!</A><BR>\
|
||||
<A href='?src=[UID()];action=dispose'>Eject ingredients!</A><BR>\
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, name, name, 400, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open(0)
|
||||
onclose(user, "[name]")
|
||||
return
|
||||
|
||||
|
||||
. += {"<b>[display_name]:</b> [R.volume] unit\s<br>"}
|
||||
|
||||
/************************************
|
||||
* Machine Menu Handling/Cooking *
|
||||
@@ -250,7 +198,7 @@
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if(reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if(!has_cookables()) //dry run
|
||||
if(!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
@@ -263,7 +211,7 @@
|
||||
//This only runs if there is a single recipe source to be made and it is a failure (the machine was loaded with only 1 mixing bowl that results in failure OR was directly loaded with ingredients that results in failure).
|
||||
//If there are multiple sources, this bit gets skipped.
|
||||
dirty += 1
|
||||
if(prob(max(10,dirty*5))) //chance to get so dirty we require cleaning before next use
|
||||
if(prob(max(10, dirty * 5) || has_extra_item())) // 5% failure per failed recipee, maxed at 10%, or it has an extra item
|
||||
if(!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
@@ -272,14 +220,7 @@
|
||||
muck_finish()
|
||||
fail()
|
||||
return
|
||||
else if(has_extra_item()) //if extra items present, break down and require repair before next use
|
||||
if(!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
fail()
|
||||
return
|
||||
else //otherwise just stop without requiring cleaning/repair
|
||||
else //otherwise just stop without requiring cleaning
|
||||
if(!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
@@ -296,6 +237,15 @@
|
||||
return
|
||||
make_recipes(recipes_to_make)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/dispose(mob/user)
|
||||
for(var/obj/O in contents)
|
||||
O.forceMove(loc)
|
||||
if(reagents.total_volume)
|
||||
dirty++
|
||||
reagents.clear_reagents()
|
||||
to_chat(user, "<span class='notice'>You eject the contents of [src].</span>")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
//choose_recipes(): picks out recipes for the machine and any mixing bowls it may contain.
|
||||
//builds a list of the selected recipes to be made in a later proc by associating the "source" of the ingredients (mixing bowl, machine) with the recipe for that source
|
||||
/obj/machinery/kitchen_machine/proc/choose_recipes()
|
||||
@@ -354,64 +304,51 @@
|
||||
/obj/machinery/kitchen_machine/proc/wzhzhzh(seconds)
|
||||
for(var/i=1 to seconds)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
return FALSE
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/has_extra_item()
|
||||
for(var/obj/O in contents)
|
||||
if(!is_type_in_list(O, list(/obj/item/reagent_containers/food, /obj/item/grown, /obj/item/mixing_bowl)))
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/start()
|
||||
visible_message("<span class='notice'>\The [src] turns on.</span>", "<span class='notice'>You hear \a [src].</span>")
|
||||
visible_message("<span class='notice'>[src] turns on.</span>", blind_message = "<span class='notice'>You hear \a [src].</span>")
|
||||
if(soundloop)
|
||||
soundloop.start()
|
||||
else
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
operating = TRUE
|
||||
icon_state = on_icon
|
||||
updateUsrDialog()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/finish_sound()
|
||||
if(soundloop)
|
||||
soundloop.stop()
|
||||
else
|
||||
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/abort()
|
||||
operating = FALSE // Turn it off again aferwards
|
||||
icon_state = off_icon
|
||||
updateUsrDialog()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/stop()
|
||||
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
finish_sound()
|
||||
operating = FALSE // Turn it off again aferwards
|
||||
icon_state = off_icon
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/dispose()
|
||||
for(var/obj/O in contents)
|
||||
O.forceMove(loc)
|
||||
if(reagents.total_volume)
|
||||
dirty++
|
||||
reagents.clear_reagents()
|
||||
to_chat(usr, "<span class='notice'>You dispose of \the [src]'s contents.</span>")
|
||||
updateUsrDialog()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/muck_start()
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
icon_state = dirty_icon // Make it look dirty!!
|
||||
dirty = MAX_DIRT // Make it dirty so it can't be used until cleaned
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/muck_finish()
|
||||
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
visible_message("<span class='alert'>\The [src] gets covered in muck!</span>")
|
||||
dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
visible_message("<span class='alert'>[src] gets covered in muck!</span>")
|
||||
flags = null //So you can't add condiments
|
||||
icon_state = dirty_icon // Make it look dirty too
|
||||
operating = FALSE // Turn it off again aferwards
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/broke()
|
||||
do_sparks(2, 1, src)
|
||||
icon_state = broken_icon // Make it look all busted up and shit
|
||||
visible_message("<span class='alert'>[src] breaks!</span>") //Let them know they're stupid
|
||||
broken = 2 // Make it broken so it can't be used util fixed
|
||||
flags = null //So you can't add condiments
|
||||
operating = FALSE // Turn it off again aferwards
|
||||
updateUsrDialog()
|
||||
stop()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/fail()
|
||||
var/amount = 0
|
||||
@@ -419,45 +356,149 @@
|
||||
mb.fail(src)
|
||||
mb.forceMove(get_turf(src))
|
||||
for(var/obj/O in contents)
|
||||
amount++
|
||||
if(O.reagents) //this is reagents in inserted objects (like chems in produce)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if(id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
if(O.reagents?.total_volume)
|
||||
amount += O.reagents.total_volume
|
||||
qdel(O)
|
||||
if(reagents && reagents.total_volume) //this is directly-added reagents (like water added directly into the machine)
|
||||
var/id = reagents.get_master_reagent_id()
|
||||
if(id)
|
||||
amount += reagents.get_reagent_amount(id)
|
||||
if(reagents?.total_volume)
|
||||
amount += reagents.total_volume
|
||||
reagents.clear_reagents()
|
||||
if(amount)
|
||||
var/obj/item/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
ffuu.forceMove(get_turf(src))
|
||||
var/obj/item/reagent_containers/food/snacks/badrecipe/mysteryfood = new(src)
|
||||
mysteryfood.reagents.add_reagent("carbon", amount / 2)
|
||||
mysteryfood.reagents.add_reagent("????", amount / 15)
|
||||
mysteryfood.forceMove(get_turf(src))
|
||||
|
||||
/obj/machinery/kitchen_machine/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
/obj/machinery/kitchen_machine/update_icon_state()
|
||||
. = ..()
|
||||
if(dirty == MAX_DIRT)
|
||||
icon_state = dirty_icon
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(operating)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if("cook")
|
||||
cook()
|
||||
|
||||
if("dispose")
|
||||
dispose()
|
||||
return
|
||||
icon_state = on_icon
|
||||
else
|
||||
icon_state = off_icon
|
||||
|
||||
/obj/machinery/kitchen_machine/build_reagent_description(mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/kitchen_machine/examine(mob/user, infix = "", suffix = "")
|
||||
/obj/machinery/kitchen_machine/examine(mob/user)
|
||||
. = ..()
|
||||
var/dat = format_content_descs()
|
||||
if(dat)
|
||||
. += "It contains: <BR>[dat]"
|
||||
. += "It contains: <br>[dat]"
|
||||
|
||||
/obj/machinery/kitchen_machine/attack_hand(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER) || panel_open || !anchored)
|
||||
return
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/kitchen_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "KitchenMachine", name, 400, 300, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/kitchen_machine/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["operating"] = operating
|
||||
data["inactive"] = FALSE
|
||||
data["no_eject"] = FALSE
|
||||
data["tooltip"] = ""
|
||||
if(dirty >= MAX_DIRT)
|
||||
data["inactive"] = TRUE
|
||||
data["tooltip"] = "It's too dirty."
|
||||
else if(!has_cookables())
|
||||
data["inactive"] = TRUE
|
||||
data["no_eject"] = TRUE
|
||||
data["tooltip"] = "There are no contents."
|
||||
|
||||
var/list/items_counts = list()
|
||||
var/list/name_overrides = list()
|
||||
for(var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if(istype(O, /obj/item/reagent_containers/food))
|
||||
var/obj/item/reagent_containers/food/food = O
|
||||
if(!items_counts[display_name])
|
||||
if(food.ingredient_name)
|
||||
name_overrides[display_name] = food.ingredient_name
|
||||
else
|
||||
name_overrides[display_name] = display_name
|
||||
else
|
||||
if(food.ingredient_name_plural)
|
||||
name_overrides[display_name] = food.ingredient_name_plural
|
||||
else
|
||||
name_overrides[display_name] = "[name_overrides[display_name]]\s" //name_overrides[display_name] Will be set on the first time as the singular form
|
||||
|
||||
items_counts[display_name]++
|
||||
|
||||
data["ingredients"] = list()
|
||||
for(var/food in items_counts)
|
||||
var/N = items_counts[food]
|
||||
var/units
|
||||
if(!(food in name_overrides))
|
||||
units = "[lowertext(food)]"
|
||||
else
|
||||
units = "[name_overrides[food]]"
|
||||
|
||||
var/list/data_pr = list(
|
||||
"name" = capitalize(food),
|
||||
"amount" = N,
|
||||
"units" = units
|
||||
)
|
||||
|
||||
data["ingredients"] += list(data_pr)
|
||||
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if(R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if(R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
|
||||
var/unitamt = "unit"
|
||||
if(R.volume > 1)
|
||||
unitamt = "units"
|
||||
|
||||
var/list/data_pr = list(
|
||||
"name" = display_name,
|
||||
"amount" = R.volume,
|
||||
"units" = unitamt
|
||||
)
|
||||
|
||||
data["ingredients"] += list(data_pr)
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/kitchen_machine/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["name"] = name
|
||||
return data
|
||||
|
||||
/obj/machinery/kitchen_machine/ui_act(action, params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("cook")
|
||||
cook()
|
||||
if("eject")
|
||||
dispose(ui.user)
|
||||
|
||||
/obj/machinery/kitchen_machine/AltClick(mob/user)
|
||||
if(dirty >= MAX_DIRT)
|
||||
to_chat(user, "<span class='warning'>It's too dirty.</span>")
|
||||
return
|
||||
if(!has_cookables())
|
||||
to_chat(user, "<span class='warning'>It's empty!</span>")
|
||||
return
|
||||
|
||||
cook()
|
||||
to_chat(user, "<span class='notice'>You activate [src].</span>")
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/has_cookables()
|
||||
return reagents.total_volume > 0 || length(contents)
|
||||
|
||||
#undef NO_DIRT
|
||||
#undef MAX_DIRT
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
recipe_type = RECIPE_MICROWAVE
|
||||
off_icon = "mw"
|
||||
on_icon = "mw1"
|
||||
broken_icon = "mwb"
|
||||
dirty_icon = "mwbloody"
|
||||
open_icon = "mw-o"
|
||||
pass_flags = PASSTABLE
|
||||
soundloop_type = /datum/looping_sound/kitchen/microwave
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
recipe_type = RECIPE_OVEN
|
||||
off_icon = "oven_off"
|
||||
on_icon = "oven_on"
|
||||
broken_icon = "oven_broke"
|
||||
dirty_icon = "oven_dirty"
|
||||
open_icon = "oven_open"
|
||||
soundloop_type = /datum/looping_sound/kitchen/oven
|
||||
|
||||
// see code/modules/food/recipes_oven.dm for recipes
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,101 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Section, Table, Flex, Icon, Dimmer } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const KitchenMachine = (props, context) => {
|
||||
const { data } = useBackend(context);
|
||||
const { ingredients } = data;
|
||||
|
||||
return (
|
||||
<Window resizable>
|
||||
<Window.Content scrollable display="flex" className="Layout__content--flexColumn">
|
||||
<Operating/>
|
||||
<KitchenTop/>
|
||||
<Section title="Ingredients" flexGrow={1}>
|
||||
<Table className="Ingredient__Table">
|
||||
{ingredients.map((product) => (
|
||||
<Table.Row tr={5} key={product.name}>
|
||||
<td>
|
||||
<Table.Cell bold>{product.name}</Table.Cell>
|
||||
</td>
|
||||
<td>
|
||||
<Table.Cell collapsing textAlign="center">
|
||||
{product.amount} {product.units}
|
||||
</Table.Cell>
|
||||
</td>
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table>
|
||||
</Section>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
|
||||
const KitchenTop = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const {
|
||||
inactive,
|
||||
tooltip
|
||||
} = data;
|
||||
|
||||
return (
|
||||
<Section title="Controls">
|
||||
<Flex>
|
||||
<Flex.Item width="50%" mr="3px">
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
icon="power-off"
|
||||
disabled={inactive}
|
||||
tooltip={inactive ? tooltip : ""}
|
||||
tooltipPosition="bottom"
|
||||
content="Activate"
|
||||
onClick={() => act('cook')}
|
||||
/>
|
||||
</Flex.Item>
|
||||
<Flex.Item width="50%">
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
icon="eject"
|
||||
disabled={inactive}
|
||||
tooltip={inactive ? tooltip : ""}
|
||||
tooltipPosition="bottom"
|
||||
content="Eject Contents"
|
||||
onClick={() => act('eject')}
|
||||
/>
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
|
||||
const Operating = (props, context) => {
|
||||
const { data } = useBackend(context);
|
||||
const {
|
||||
operating,
|
||||
name
|
||||
} = data;
|
||||
|
||||
if (operating) {
|
||||
return (
|
||||
<Dimmer>
|
||||
<Flex mb="30px">
|
||||
<Flex.Item
|
||||
bold
|
||||
color="silver"
|
||||
textAlign="center">
|
||||
<Icon
|
||||
name="spinner"
|
||||
spin
|
||||
size={4}
|
||||
mb="15px"
|
||||
/><br />
|
||||
The {name} is processing...
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Dimmer>
|
||||
);
|
||||
}
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
@use '../colors.scss';
|
||||
|
||||
.Ingredient__Table {
|
||||
tr:nth-child(even) {
|
||||
background-color: #333;
|
||||
}
|
||||
td {
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@
|
||||
@include meta.load-css('./interfaces/CameraConsole.scss');
|
||||
@include meta.load-css('./interfaces/Contractor.scss');
|
||||
@include meta.load-css('./interfaces/ExosuitFabricator.scss');
|
||||
@include meta.load-css('./interfaces/KitchenMachine.scss');
|
||||
@include meta.load-css('./interfaces/LibraryComputer.scss');
|
||||
@include meta.load-css('./interfaces/Newscaster.scss');
|
||||
@include meta.load-css('./interfaces/NuclearBomb.scss');
|
||||
|
||||
Reference in New Issue
Block a user