Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Мама я спалил сковородку #12560

Draft
wants to merge 22 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "code\stylesheet.dm"
#include "code\world.dm"
#include "code\__datastructures\globals.dm"
#include "code\__defines\__cooking.dm"
#include "code\__defines\__initialization.dm"
#include "code\__defines\__qdel.dm"
#include "code\__defines\__renderer.dm"
Expand Down Expand Up @@ -134,6 +135,7 @@
#include "code\_global_vars\sensitive.dm"
#include "code\_global_vars\sfx.dm"
#include "code\_global_vars\lists\areas.dm"
#include "code\_global_vars\lists\cooking.dm"
#include "code\_global_vars\lists\flavor.dm"
#include "code\_global_vars\lists\locations.dm"
#include "code\_global_vars\lists\logs.dm"
Expand All @@ -142,6 +144,7 @@
#include "code\_global_vars\lists\objects.dm"
#include "code\_global_vars\lists\pipe_dispenser.dm"
#include "code\_global_vars\lists\rcd.dm"
#include "code\_global_vars\lists\reagents.dm"
#include "code\_global_vars\lists\russian.dm"
#include "code\_global_vars\lists\traitor_uplink.dm"
#include "code\_global_vars\lists\wheelcannon.dm"
Expand Down Expand Up @@ -175,6 +178,7 @@
#include "code\_helpers\preferences.dm"
#include "code\_helpers\pronouns.dm"
#include "code\_helpers\radio.dm"
#include "code\_helpers\reagents.dm"
#include "code\_helpers\roundend.dm"
#include "code\_helpers\russian.dm"
#include "code\_helpers\sanitize_values.dm"
Expand Down Expand Up @@ -1842,6 +1846,43 @@
#include "code\modules\clothing\under\jobs\security.dm"
#include "code\modules\clothing\underwear\base.dm"
#include "code\modules\clothing\~custom_clothing\custom_clothing.dm"
#include "code\modules\cooking\cooking.dm"
#include "code\modules\cooking\cooking_catalog.dm"
#include "code\modules\cooking\cooking_init.dm"
#include "code\modules\cooking\cooking_tracker.dm"
#include "code\modules\cooking\food_overrides.dm"
#include "code\modules\cooking\step_defines.dm"
#include "code\modules\cooking\coocking_appliances\appliance_defines.dm"
#include "code\modules\cooking\coocking_appliances\candy.dm"
#include "code\modules\cooking\coocking_appliances\cereal.dm"
#include "code\modules\cooking\coocking_appliances\cooking_circuits.dm"
#include "code\modules\cooking\coocking_appliances\fryer.dm"
#include "code\modules\cooking\coocking_appliances\gibber.dm"
#include "code\modules\cooking\coocking_appliances\grill.dm"
#include "code\modules\cooking\coocking_appliances\icecream.dm"
#include "code\modules\cooking\coocking_appliances\machinery.dm"
#include "code\modules\cooking\coocking_appliances\microwave.dm"
#include "code\modules\cooking\coocking_appliances\oven.dm"
#include "code\modules\cooking\coocking_appliances\smartfridge.dm"
#include "code\modules\cooking\coocking_appliances\stove.dm"
#include "code\modules\cooking\cooking_items\cooking_containers.dm"
#include "code\modules\cooking\cooking_items\dollop.dm"
#include "code\modules\cooking\cooking_items\frosting.dm"
#include "code\modules\cooking\cooking_items\spatula.dm"
#include "code\modules\cooking\recipes\_read_me.dm"
#include "code\modules\cooking\recipes\example_recipes.dm"
#include "code\modules\cooking\recipes\recipe.dm"
#include "code\modules\cooking\recipes\recipe_donuts.dm"
#include "code\modules\cooking\recipes\recipes_to_covert.dm"
#include "code\modules\cooking\step_types\add_item.dm"
#include "code\modules\cooking\step_types\add_produce.dm"
#include "code\modules\cooking\step_types\add_reagent.dm"
#include "code\modules\cooking\step_types\recipe_start.dm"
#include "code\modules\cooking\step_types\use_grill.dm"
#include "code\modules\cooking\step_types\use_item.dm"
#include "code\modules\cooking\step_types\use_oven.dm"
#include "code\modules\cooking\step_types\use_stove.dm"
#include "code\modules\cooking\step_types\use_tool.dm"
#include "code\modules\customitems\item_spawning.dm"
#include "code\modules\detectivework\footprints.dm"
#include "code\modules\detectivework\forensics.dm"
Expand Down
99 changes: 99 additions & 0 deletions code/__defines/__cooking.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
//#define CWJ_DEBUG 1


//Step classifications, for easy reference later.
//If something falls outside these classifications, why would it?
#define CWJ_START 1 //Default step to construct the list.
#define CWJ_ADD_ITEM 2 //Adding an item to a recipe (Ex- adding a slice of bread)
#define CWJ_ADD_REAGENT 3 //Adding a reagent to a recipe (Ex- Adding salt)
#define CWJ_USE_ITEM 4 //Using an item in a recipe (Ex- cutting bread with a knife)
#define CWJ_USE_TOOL 5
#define CWJ_ADD_PRODUCE 6 //Adding Produce to a recipe
#define CWJ_USE_STOVE 7 //Using a stove in a recipe
#define CWJ_USE_GRILL 8 //Using a grill in a recipe
#define CWJ_USE_OVEN 9 //Using a oven in a recipe
#define CWJ_USE_OTHER 10 //Custom Command flag, will take in argument lists.


//Optional flags
#define CWJ_ADD_ITEM_OPTIONAL 200
#define CWJ_ADD_REAGENT_OPTIONAL 300
#define CWJ_USE_ITEM_OPTIONAL 400
#define CWJ_USE_TOOL_OPTIONAL 500
#define CWJ_ADD_PRODUCE_OPTIONAL 600
#define CWJ_USE_STOVE_OPTIONAL 700
#define CWJ_USE_GRILL_OPTIONAL 800
#define CWJ_USE_OVEN_OPTIONAL 900
#define CWJ_OTHER_OPTIONAL 1000


#define CWJ_BEGIN_EXCLUSIVE_OPTIONS 10000 //Beginning an exclusive option list
#define CWJ_END_EXCLUSIVE_OPTIONS 20000 //Ending an exclusive option list
#define CWJ_BEGIN_OPTION_CHAIN 30000 //Beginning an option chain
#define CWJ_END_OPTION_CHAIN 40000 //Ending an option chain

//Recipe state flags
#define CWJ_IS_LAST_STEP 1 //If the step in the recipe is marked as the last step
#define CWJ_IS_OPTIONAL 2 //If the step in the recipe is marked as 'Optional'
#define CWJ_IS_OPTION_CHAIN 4 //If the step in the recipe is marked to be part of an option chain.
#define CWJ_IS_EXCLUSIVE 8 //If the step in the recipe is marked to exclude other options when followed.
#define CWJ_BASE_QUALITY_ENABLED 16
#define CWJ_MAX_QUALITY_ENABLED 32

//Check item use flags
#define CWJ_NO_STEPS 1 //The used object has no valid recipe uses
#define CWJ_CHOICE_CANCEL 2 //The user opted to cancel when given a choice
#define CWJ_SUCCESS 3 //The user decided to use the item and the step was followed
#define CWJ_PARTIAL_SUCCESS 4 //The user decided to use the item but the qualifications for the step was not fulfilled
#define CWJ_COMPLETE 5 //The meal has been completed!
#define CWJ_LOCKOUT 6 //Someone tried starting the function while a prompt was running. Jerk.
#define CWJ_BURNT 7 //The meal was ruined by burning the food somehow.

#define CWJ_CHECK_INVALID 0
#define CWJ_CHECK_VALID 1
#define CWJ_CHECK_FULL 2 //For reagents, nothing can be added to

//Cooking container types
#define PLATE "plate"
#define CUTTING_BOARD "cutting board"
#define PAN "pan"
#define POT "pot"
#define BOWL "bowl"
#define DF_BASKET "deep fryer basket"
#define AF_BASKET "air fryer basket"
#define OVEN "oven"
#define GRILL "grill grate"

//Stove temp settings.
#define J_LO "Low"
#define J_MED "Medium"
#define J_HI "High"

//Just a catalog for the cooking catalog
#define CATALOG_COOKING "cooking"

//Burn times for cooking things on a stove.
//Anything put on a stove for this long becomes a burned mess.
#define CWJ_BURN_TIME_LOW 15 MINUTES
#define CWJ_BURN_TIME_MEDIUM 10 MINUTES
#define CWJ_BURN_TIME_HIGH 5 MINUTES

//Ignite times for reagents interacting with a stove.
//The stove will catch fire if left on too long with flammable reagents in any of its holders.
#define CWJ_IGNITE_TIME_LOW 1 HOUR
#define CWJ_IGNITE_TIME_MEDIUM 30 MINUTES
#define CWJ_IGNITE_TIME_HIGH 15 MINUTES

//Determines how much quality is taken from a food each tick when a 'no recipe' response is made.
#define CWJ_BASE_QUAL_REDUCTION 5

//Food Quality Tiers
#define CWJ_QUALITY_GARBAGE -2
#define CWJ_QUALITY_GROSS -1.5
#define CWJ_QUALITY_MEH 0.5
#define CWJ_QUALITY_NORMAL 1
#define CWJ_QUALITY_GOOD 1.2
#define CWJ_QUALITY_VERY_GOOD 1.4
#define CWJ_QUALITY_CUISINE 1.6
#define CWJ_QUALITY_LEGENDARY 1.8
#define CWJ_QUALITY_ELDRITCH 2.0
19 changes: 19 additions & 0 deletions code/_global_vars/lists/cooking.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//Cooking
//A dictionary of unique step ids that point to other step IDs that should be EXCLUDED if it is present in a recipe_pointer's list of possible steps.
GLOBAL_LIST_EMPTY(cwj_optional_step_exclusion_dictionary)

//A dictionary of all recipes by the basic ingredient
//Format: {base_ingedient_type:{unique_id:recipe}}
GLOBAL_LIST_EMPTY(cwj_recipe_dictionary)

//A dictionary of all recipes full_stop. Used later for assembling the HTML list.
//Format: {recipe_type:{unique_id:recipe}}
GLOBAL_LIST_EMPTY(cwj_recipe_list)

//A dictionary of all steps held within all recipes
//Format: {unique_id:step}
GLOBAL_LIST_EMPTY(cwj_step_dictionary)

//An organized heap of recipes by class and grouping.
//Format: {class_of_step:{step_group_identifier:{unique_id:step}}}
GLOBAL_LIST_EMPTY(cwj_step_dictionary_ordered)
3 changes: 3 additions & 0 deletions code/_global_vars/lists/reagents.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GLOBAL_LIST_EMPTY(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
GLOBAL_LIST_EMPTY(chemical_reactions_list_by_result) //list of all /datum/chemical_reaction datums. But this one indexed by chemical result instead of reagents
GLOBAL_LIST_EMPTY(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
27 changes: 27 additions & 0 deletions code/_helpers/reagents.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/proc/get_reagent_name_by_id(id)
if(!GLOB.chemical_reagents_list.len)
return "REAGENTS NOT INITIALISED"
var/datum/reagent/D = GLOB.chemical_reagents_list[id]
if(D)
return D.name

return "REAGENT NOT FOUND"

/proc/get_reagent_type_by_id(id)
if(!GLOB.chemical_reagents_list.len)
return "REAGENTS NOT INITIALISED"
var/datum/reagent/D = GLOB.chemical_reagents_list[id]
if(D)
return D.type

return "REAGENT NOT FOUND"

/proc/is_reagent_with_id_exist(id)
if(!GLOB.chemical_reagents_list.len)
error("REAGENTS NOT INITIALISED")
return FALSE
var/datum/reagent/D = GLOB.chemical_reagents_list[id]
if(D)
return TRUE

return FALSE
34 changes: 32 additions & 2 deletions code/_helpers/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@ var/next_station_date_change = 1 DAY
/proc/time_stamp()
return time2text(world.timeofday, "hh:mm:ss")

/proc/ticks_to_text(var/ticks)
if(ticks%1 != 0)
return "ERROR"
var/response = ""
var/counter = 0
while(ticks >= 1 DAYS)
ticks -= 1 DAYS
counter++
if(counter)
response += "[counter] Day[counter>1 ? "s" : ""][ticks ? ", " : ""]"
counter=0
while(ticks >= 1 HOURS)
ticks -= 1 HOURS
counter++
if(counter)
response += "[counter] Hour[counter>1 ? "s" : ""][ticks?", ":""]"
counter=0
while(ticks >= 1 MINUTES)
ticks -= 1 MINUTES
counter++
if(counter)
response += "[counter] Minute[counter>1 ? "s" : ""][ticks?", ":""]"
counter=0
while(ticks >= 1 SECONDS)
ticks -= 1 SECONDS
counter++
if(counter)
response += "[counter][ticks?".[ticks]" : ""] Second[counter>1 ? "s" : ""]"
return response

/* Returns 1 if it is the selected month and day */
/proc/isDay(month, day)
if(isnum(month) && isnum(day))
Expand Down Expand Up @@ -127,12 +157,12 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
Example:
/datum/foo
var/last_action = 0

/datum/foo/proc/do()
THROTTLE_SHARED(cooldown, 1 SECOND, last_action)
if(cooldown)
do_something()

/datum/foo/proc/do2()
THROTTLE_SHARED(cooldown, 1 SECOND, last_action)
if(cooldown)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/cooking/coocking_appliances/appliance_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/obj/machinery/cooking_with_jane
name = "Default Cooking Appliance"
desc = "Lookit me, I'm a cool machinery-doo. Hex didn't take his focus pills today."
icon = 'icons/obj/kitchen.dmi'
icon_state = "processor"
density = TRUE
anchored = TRUE
layer = BELOW_OBJ_LAYER
var/cooking = FALSE

18 changes: 18 additions & 0 deletions code/modules/cooking/coocking_appliances/candy.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/obj/machinery/cooker/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"

output_options = list(
"Jawbreaker" = /obj/item/reagent_containers/food/variable/jawbreaker,
"Candy Bar" = /obj/item/reagent_containers/food/candy/variable,
"Sucker" = /obj/item/reagent_containers/food/variable/sucker,
"Jelly" = /obj/item/reagent_containers/food/variable/jelly
)

/obj/machinery/cooker/candy/change_product_appearance()
food_color = get_random_colour(1)
. = ..()
38 changes: 38 additions & 0 deletions code/modules/cooking/coocking_appliances/cereal.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/obj/machinery/cooker/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"
output_options = list("Cereal" = /obj/item/reagent_containers/food/variable/cereal)
selected_option = "Cereal"

/obj/machinery/cooker/cereal/change_product_strings(atom/movable/product, atom/movable/origin)
. = ..()
product.SetName("box of [product.name]")
return product

/obj/machinery/cooker/cereal/change_product_appearance(obj/item/reagent_containers/food/variable/cereal/product, atom/movable/origin)
ClearOverlays()
var/icon/background = icon(product.icon, "[product.icon_state]_filling")
var/origin_color
if(istype(origin, /obj/item/reagent_containers/food))
var/obj/item/reagent_containers/food/S = origin
origin_color = S.filling_color
else
origin_color = origin.color
if(origin_color)
background.Blend(origin_color, ICON_SUBTRACT) // Invert
product.filling_color = origin_color

product.AddOverlays(background)

var/image/food_image = image(origin.icon, origin.icon_state)
food_image.color = origin.color
food_image.CopyOverlays(origin)
food_image.SetTransform(scale = 0.5)
food_image.pixel_y = 2
product.AddOverlays(food_image)
return product
27 changes: 27 additions & 0 deletions code/modules/cooking/coocking_appliances/cooking_circuits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/obj/item/electronics/circuitboard/cooking_with_jane/stove
name = "Circuit board (Stovetop)"
build_path = /obj/machinery/cooking_with_jane/stove
board_type = "machine"
origin_tech = list(TECH_BIO = 1)
req_components = list(
/obj/item/stock_parts/manipulator = 2, //Affects the food quality
)

/obj/item/electronics/circuitboard/cooking_with_jane/oven
name = "Circuit board (Convection Oven)"
build_path = /obj/machinery/cooking_with_jane/oven
board_type = "machine"
origin_tech = list(TECH_BIO = 1)
req_components = list(
/obj/item/stock_parts/micro_laser = 2, //Affects the food quality
)

/obj/item/electronics/circuitboard/cooking_with_jane/grill
name = "Circuit board (Charcoal Grill)"
build_path = /obj/machinery/cooking_with_jane/grill
board_type = "machine"
origin_tech = list(TECH_BIO = 1)
req_components = list(
/obj/item/stock_parts/micro_laser = 2, //Affects the food quality
/obj/item/stock_parts/matter_bin = 2, //Affects wood hopper size
)
Loading
Loading