Skip to content

Adds some new cooking recipes to the new system #3836

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

Merged
merged 15 commits into from
Nov 1, 2024
Merged
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
6 changes: 3 additions & 3 deletions code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
return TRUE


/datum/component/personal_crafting/proc/construct_item(atom/a, datum/crafting_recipe/R)
/datum/component/personal_crafting/proc/construct_item(atom/a, datum/crafting_recipe/R, time_override = null)
var/list/contents = get_surroundings(a,R.blacklist)
var/send_feedback = 1
if(check_contents(a, R, contents))
Expand All @@ -191,8 +191,8 @@
if(istype(content, R.result))
return ", object already present."
//If we're a mob we'll try a do_after; non mobs will instead instantly construct the item
if(ismob(a) && !do_after(a, R.time, target = a))
return "."
if(ismob(a) && !do_after(a, time_override ? time_override : R.time, target = a))
return ", interrupted."
contents = get_surroundings(a,R.blacklist)
if(!check_contents(a, R, contents))
return ", missing component."
Expand Down
6 changes: 6 additions & 0 deletions code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Behavior that's still missing from this component that original food items had t
RegisterSignal(parent, COMSIG_FOOD_INGREDIENT_ADDED, PROC_REF(edible_ingredient_added))
RegisterSignal(parent, COMSIG_OOZE_EAT_ATOM, PROC_REF(on_ooze_eat))
RegisterSignal(parent, COMSIG_TRY_EAT_TRAIT, PROC_REF(try_eat_trait))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND_SECONDARY, PROC_REF(show_radial_recipes)) //Monkestation edit: CHEWIN COOKING

if(isturf(parent))
RegisterSignal(parent, COMSIG_ATOM_ENTERED, PROC_REF(on_entered))
Expand Down Expand Up @@ -558,6 +559,11 @@ Behavior that's still missing from this component that original food items had t
consumer.applied_food_buffs ++
else if(food_buffs in consumer.status_effects)
eater.apply_status_effect(food_buffs)
var/datum/status_effect/food/effect = locate(food_buffs) in consumer.status_effects
if(effect)
var/obj/item/food = parent
if(food.food_quality != 1) //if we are not the default value
effect.apply_quality(food.food_quality)

to_chat(feeder, span_warning("There is nothing left of [parent], oh no!"))
if(isturf(parent))
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
// Start of a breath chain, calls [carbon/proc/breathe()]
/mob/living/carbon/handle_breathing(seconds_per_tick, times_fired)
if(HAS_TRAIT(src, TRAIT_NOBREATH))
setOxyLoss(0) //idk how because spec life should cover this
losebreath = 0
return

var/next_breath = 4
Expand Down
29 changes: 26 additions & 3 deletions code/modules/reagents/reagent_containers/condiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name = "condiment bottle"
desc = "Just your average condiment bottle."
icon = 'icons/obj/food/containers.dmi'
icon_state = "bottle"
icon_state = "generic_condiment" // monkestation edit: ew should just be a generic bottle.
inhand_icon_state = "beer" //Generic held-item sprite until unique ones are made.
lefthand_file = 'icons/mob/inhands/items/drinks_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/drinks_righthand.dmi'
Expand Down Expand Up @@ -66,7 +66,7 @@
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
return TRUE

/obj/item/reagent_containers/condiment/afterattack(obj/target, mob/user , proximity)
/obj/item/reagent_containers/condiment/afterattack(obj/target, mob/user, proximity, params)
. = ..()
if(!proximity)
return
Expand Down Expand Up @@ -95,6 +95,18 @@
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
to_chat(user, span_notice("You transfer [trans] units of the condiment to [target]."))

var/datum/reagent/main_reagent = reagents.get_master_reagent_id()
var/condiment_overlay = initial(main_reagent.condiment_overlay)
var/overlay_colored = initial(main_reagent.overlay_colored)
if(condiment_overlay && istype (target, /obj/item/food))
var/list/params_list = params2list(params)
var/image/I = image('monkestation/code/modules/brewin_and_chewin/icons/condiment_overlays.dmi', target, condiment_overlay)
I.pixel_x = clamp(text2num(params_list["icon-x"]) - world.icon_size/2 - pixel_x,-world.icon_size/2,world.icon_size/2)
I.pixel_y = clamp(text2num(params_list["icon-y"]) - world.icon_size/2 - pixel_y,-world.icon_size/2,world.icon_size/2)
if (overlay_colored)
I.color = mix_color_from_reagents(reagents.reagent_list)
target.overlays += I

/obj/item/reagent_containers/condiment/enzyme
name = "universal enzyme"
desc = "Used in cooking various dishes."
Expand Down Expand Up @@ -445,7 +457,7 @@
/obj/item/reagent_containers/condiment/pack/attack(mob/M, mob/user, def_zone) //Can't feed these to people directly.
return

/obj/item/reagent_containers/condiment/pack/afterattack(obj/target, mob/user , proximity)
/obj/item/reagent_containers/condiment/pack/afterattack(obj/target, mob/user , proximity, params)
if(!proximity)
return
. |= AFTERATTACK_PROCESSED_ITEM
Expand All @@ -461,6 +473,17 @@
return
else
to_chat(user, span_notice("You tear open [src] above [target] and the condiments drip onto it."))
var/datum/reagent/main_reagent = reagents.get_master_reagent_id()
var/condiment_overlay = initial(main_reagent.condiment_overlay)
var/overlay_colored = initial(main_reagent.overlay_colored)
if(condiment_overlay && istype (target, /obj/item/food))
var/list/params_list = params2list(params)
var/image/I = image('monkestation/code/modules/brewin_and_chewin/icons/condiment_overlays.dmi', target, condiment_overlay)
I.pixel_x = clamp(text2num(params_list["icon-x"]) - world.icon_size/2 - pixel_x,-world.icon_size/2,world.icon_size/2)
I.pixel_y = clamp(text2num(params_list["icon-y"]) - world.icon_size/2 - pixel_y,-world.icon_size/2,world.icon_size/2)
if (overlay_colored)
I.color = mix_color_from_reagents(reagents.reagent_list)
target.overlays += I
src.reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
qdel(src)
return
Expand Down
Binary file modified icons/obj/food/containers.dmi
Binary file not shown.
Binary file modified icons/obj/food/piecake.dmi
Binary file not shown.
17 changes: 16 additions & 1 deletion monkestation/code/datums/status_effects/food_buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
duration = 10 MINUTES
status_type = STATUS_EFFECT_REPLACE
show_duration = TRUE
var/quality_modifier = 1


/datum/status_effect/food/proc/apply_quality(quality)
return

/datum/status_effect/food/on_apply()
if(HAS_TRAIT(owner, TRAIT_GOURMAND))
Expand All @@ -19,6 +22,9 @@
alert_type = /atom/movable/screen/alert/status_effect/food/stamina_increase_t1
var/stam_increase = 10

/datum/status_effect/food/stamina_increase/apply_quality(quality)
stam_increase = stam_increase * (1 + (quality / 50))

/atom/movable/screen/alert/status_effect/food/stamina_increase_t1
name = "Tiny Stamina Increase"
desc = "Increases your stamina by a tiny amount"
Expand Down Expand Up @@ -87,6 +93,9 @@
var/range = RANGE
var/duration_loss = DURATION_LOSS

/datum/status_effect/food/fire_burps/apply_quality(quality)
range = range + round((quality / 40))

/atom/movable/screen/alert/status_effect/food/fire_burps
name = "Firey Burps"
desc = "Lets you burp out a line of fire"
Expand Down Expand Up @@ -191,6 +200,9 @@
alert_type = /atom/movable/screen/alert/status_effect/food/health_increase_t1
var/health_increase = 10

/datum/status_effect/food/health_increase/apply_quality(quality)
health_increase = health_increase * (1 + (quality / 50))

/atom/movable/screen/alert/status_effect/food/health_increase_t1
name = "Small Health Increase"
desc = "You feel slightly heartier"
Expand Down Expand Up @@ -258,6 +270,9 @@
alert_type = /atom/movable/screen/alert/status_effect/food/stam_regen_t1
var/regen_increase = 0.5

/datum/status_effect/food/stam_regen/apply_quality(quality)
regen_increase = regen_increase * (1 + (quality / 20))

/atom/movable/screen/alert/status_effect/food/stam_regen_t1
name = "Small Stamina Regeneration Increase"
desc = "You feel slightly more energetic"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

/datum/component/personal_crafting/proc/craft_until_cant(datum/crafting_recipe/recipe_to_use, mob/chef, turf/craft_location, craft_time)
if(!craft_time)
craft_time = recipe_to_use.time
while(TRUE)
// attempt_craft_loop sleeps, so this won't freeze the server while we craft
if(!attempt_craft_loop(recipe_to_use, chef, craft_location, craft_time))
break
craft_time = max(5, craft_time * 0.75) // speed up the more you craft in a batch

/// Attempts a crafting loop. Returns true if it succeeds, false otherwise
/datum/component/personal_crafting/proc/attempt_craft_loop(datum/crafting_recipe/recipe_to_use, mob/chef, turf/craft_location, craft_time)
var/list/surroundings = get_surroundings(chef)
if(!check_contents(chef, recipe_to_use, surroundings))
chef.balloon_alert_to_viewers("failed to craft, missing ingredients!")
return FALSE

var/atom/movable/result = construct_item(chef, recipe_to_use, craft_time)
if(istext(result))
chef.balloon_alert_to_viewers("failed to craft[result]")
return FALSE
//We made an item and didn't get a fail message
result.forceMove(craft_location)
result.pixel_x = rand(-10, 10)
result.pixel_y = rand(-10, 10)
if(isitem(result))
var/obj/item/item_result = result
item_result.do_drop_animation(chef)
chef.investigate_log("[key_name(chef)] crafted [recipe_to_use]", INVESTIGATE_CRAFTING)
recipe_to_use.on_craft_completion(chef, result)
return TRUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/datum/component/edible/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
if(user.incapacitated() || !user.Adjacent(parent))
return FALSE
return TRUE

/datum/component/edible/proc/show_radial_recipes(atom/parent_atom, mob/user)
SIGNAL_HANDLER
if(!ishuman(user))
return
var/mob/living/carbon/human/chef = user
var/datum/component/personal_crafting/crafting_menu = user.GetComponent(/datum/component/personal_crafting) // we turned crafting into a component so now I have to do this shit to avoid copypaste
if(!crafting_menu)
CRASH("This really needs to be looked into this is not suppose to happen like ever. A human tried to show radial recipes without a crafting component")
var/list/available_recipes = list()
var/list/surroundings = crafting_menu.get_surroundings(chef)
var/list/recipes_radial = list()
var/list/recipes_craft = list()
for(var/recipe in GLOB.cooking_recipes)
var/datum/crafting_recipe/potential_recipe = recipe
if(parent.type in potential_recipe.reqs) // dont show recipes that don't involve this item
if(crafting_menu.check_contents(chef, potential_recipe, surroundings)) // don't show recipes we can't actually make
available_recipes.Add(potential_recipe)
for(var/available_recipe in available_recipes)
var/datum/crafting_recipe/available_recipe_datum = available_recipe
var/atom/craftable_atom = available_recipe_datum.result
recipes_radial.Add(list(initial(craftable_atom.name) = image(icon = initial(craftable_atom.icon), icon_state = initial(craftable_atom.icon_state))))
recipes_craft.Add(list(initial(craftable_atom.name) = available_recipe_datum))
INVOKE_ASYNC(src, PROC_REF(hate_signals_holy_shit), recipes_radial, recipes_craft, chef, crafting_menu)
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN

/datum/component/edible/proc/hate_signals_holy_shit(list/recipes_radial, list/recipes_craft, mob/chef, datum/component/personal_crafting/crafting_menu)
var/recipe_chosen = show_radial_menu(chef, chef, recipes_radial, custom_check = CALLBACK(src, PROC_REF(check_menu), chef), require_near = TRUE, tooltips = TRUE)
if(!recipe_chosen)
return
var/datum/crafting_recipe/chosen_recipe = recipes_craft[recipe_chosen]
chef.balloon_alert_to_viewers("crafting [chosen_recipe.name]")
crafting_menu.craft_until_cant(chosen_recipe, chef, get_turf(parent))

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/datum/chewin_cooking/recipe/ti_hoeh_koe
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/epok_epok
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/doughslice, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/meat/cutlet/chicken, qmod=0.5),
list(CHEWIN_USE_STOVE, J_MED, 10 SECONDS, finish_text="The chicken starts to cook."),
list(CHEWIN_ADD_ITEM, /obj/item/food/grown/potato/wedges, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledegg, qmod=0.5),
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/curry_powder, 3, base=3),
list(CHEWIN_USE_STOVE, J_LO, 10 SECONDS),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/datum/chewin_cooking/recipe/hurricane_rice
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/hurricane_rice
recipe_guide = "Add boiled rice to pan, crack an egg, add vegetables, cook for 15 seconds on high, add soysauce, cook for 5 seconds on high."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/egg, qmod=0.5),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/chili, qmod=0.5),

list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/onion_slice, qmod=0.5),
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/pineappleslice, qmod=0.5),

list(CHEWIN_USE_STOVE, J_HI, 15 SECONDS , finish_text = "You can smell almost finished fried rice, just needs some seasoning!"),
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/soysauce, 3, base=3),
list(CHEWIN_USE_STOVE, J_HI, 5 SECONDS , finish_text = "You can smell fried rice!"),
)

/datum/chewin_cooking/recipe/ikareis
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/ikareis
recipe_guide = "Add boiled rice to pan, some squid ink, add vegetables and sausage, cook for 20 seconds on high."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/canned/squid_ink, qmod=0.5),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/bell_pepper, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/sausage, qmod=0.5),

list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/onion_slice, qmod=0.5),
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/pineappleslice, qmod=0.5, prod_desc = "Extra sweet!"),
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/grown/chili, qmod=0.5, prod_desc = "Extra spicy!"),

list(CHEWIN_USE_STOVE, J_HI, 20 SECONDS , finish_text = "You can smell ikareis!"),
)

/datum/chewin_cooking/recipe/ketchup_fried_rice
name = "Ketchup Fried Rice"
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/ketchup_fried_rice
recipe_guide = "Cook ingredients in a pan."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
list(CHEWIN_ADD_ITEM, /obj/item/food/onion_slice),
list(CHEWIN_ADD_ITEM, /obj/item/food/sausage/american),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/carrot),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/peas),
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/ketchup, 5),
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/worcestershire, 2),
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
)


/datum/chewin_cooking/recipe/mediterranean_fried_rice
name = "Mediterranean Fried Rice"
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/mediterranean_fried_rice
recipe_guide = "Cook ingredients in a pan."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
list(CHEWIN_ADD_ITEM, /obj/item/food/onion_slice),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/herbs),
list(CHEWIN_ADD_ITEM, /obj/item/food/cheese/firm_cheese_slice),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/olive),
list(CHEWIN_ADD_ITEM, /obj/item/food/meatball),
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
)


/datum/chewin_cooking/recipe/egg_fried_rice
name = "Egg Fried Rice"
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/egg_fried_rice
recipe_guide = "Cook ingredients in a pan."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
list(CHEWIN_ADD_ITEM, /obj/item/food/egg),
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/soysauce, 3),
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
)


/datum/chewin_cooking/recipe/bibimbap
name = "Bibimbap"
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/bibimbap
recipe_guide = "Cook ingredients in a pan."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/cucumber),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/mushroom/chanterelle),
list(CHEWIN_ADD_ITEM, /obj/item/food/meat/cutlet),
list(CHEWIN_ADD_ITEM, /obj/item/food/kimchi),
list(CHEWIN_ADD_ITEM, /obj/item/food/egg),
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
)
Loading
Loading