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 all 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
51 changes: 40 additions & 11 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 Down Expand Up @@ -915,17 +917,6 @@
#include "code\game\machinery\embedded_controller\embedded_controller_base.dm"
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
#include "code\game\machinery\embedded_controller\simple_docking_controller.dm"
#include "code\game\machinery\kitchen\gibber.dm"
#include "code\game\machinery\kitchen\icecream.dm"
#include "code\game\machinery\kitchen\microwave.dm"
#include "code\game\machinery\kitchen\smartfridge.dm"
#include "code\game\machinery\kitchen\cooking_machines\_cooker.dm"
#include "code\game\machinery\kitchen\cooking_machines\_cooker_output.dm"
#include "code\game\machinery\kitchen\cooking_machines\candy.dm"
#include "code\game\machinery\kitchen\cooking_machines\cereal.dm"
#include "code\game\machinery\kitchen\cooking_machines\fryer.dm"
#include "code\game\machinery\kitchen\cooking_machines\grill.dm"
#include "code\game\machinery\kitchen\cooking_machines\oven.dm"
#include "code\game\machinery\pipe\construction.dm"
#include "code\game\machinery\pipe\dispenser_recipes.dm"
#include "code\game\machinery\pipe\pipe_dispenser.dm"
Expand Down Expand Up @@ -1842,6 +1833,44 @@
#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\cooking_circuits.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_burgers.dm"
#include "code\modules\cooking\recipes\recipe_donuts.dm"
#include "code\modules\cooking\recipes\recipe_hotdogs.dm"
#include "code\modules\cooking\recipes\recipe_pastry.dm"
#include "code\modules\cooking\recipes\recipe_unsorted.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
103 changes: 103 additions & 0 deletions code/__defines/__cooking.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#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"

//Tools qualities
#define QUALITY_CUTTING "cutting"
#define QUALITY_HAMMERING "hammering"

//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)
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
3 changes: 1 addition & 2 deletions code/datums/trading/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@
/obj/item/reagent_containers/food/grown = TRADER_BLACKLIST_ALL,
/obj/item/reagent_containers/food/human = TRADER_BLACKLIST_ALL,
/obj/item/reagent_containers/food/sliceable/braincake = TRADER_BLACKLIST,
/obj/item/reagent_containers/food/meat/human = TRADER_BLACKLIST,
/obj/item/reagent_containers/food/variable = TRADER_BLACKLIST_ALL
/obj/item/reagent_containers/food/meat/human = TRADER_BLACKLIST
)

/datum/trader/ship/bakery
Expand Down
Loading
Loading