Skip to content

Commit a9ddbc9

Browse files
authored
Adds some new cooking recipes to the new system (#3836)
* a weird bug fix, and some cooking recipes * Update asphyxiation.dm * moves files into folders adds more martian recipes to new system * fixes, and the re-implementation of secondary action food crafting * Update edible_component_additions.dm * fixes * applies quality to the food * Update food_buffs.dm * scaling quality * condiment overlays * makes packs work aswell * replaces the generic condiment with an actual bottle * removed the whipcream dollop from pumpkin pie so chefs can add their own * forgot params * Update condiment.dm
1 parent 68ac140 commit a9ddbc9

File tree

28 files changed

+513
-50
lines changed

28 files changed

+513
-50
lines changed

code/datums/components/crafting/crafting.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
return TRUE
182182

183183

184-
/datum/component/personal_crafting/proc/construct_item(atom/a, datum/crafting_recipe/R)
184+
/datum/component/personal_crafting/proc/construct_item(atom/a, datum/crafting_recipe/R, time_override = null)
185185
var/list/contents = get_surroundings(a,R.blacklist)
186186
var/send_feedback = 1
187187
if(check_contents(a, R, contents))
@@ -191,8 +191,8 @@
191191
if(istype(content, R.result))
192192
return ", object already present."
193193
//If we're a mob we'll try a do_after; non mobs will instead instantly construct the item
194-
if(ismob(a) && !do_after(a, R.time, target = a))
195-
return "."
194+
if(ismob(a) && !do_after(a, time_override ? time_override : R.time, target = a))
195+
return ", interrupted."
196196
contents = get_surroundings(a,R.blacklist)
197197
if(!check_contents(a, R, contents))
198198
return ", missing component."

code/datums/components/food/edible.dm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Behavior that's still missing from this component that original food items had t
9292
RegisterSignal(parent, COMSIG_FOOD_INGREDIENT_ADDED, PROC_REF(edible_ingredient_added))
9393
RegisterSignal(parent, COMSIG_OOZE_EAT_ATOM, PROC_REF(on_ooze_eat))
9494
RegisterSignal(parent, COMSIG_TRY_EAT_TRAIT, PROC_REF(try_eat_trait))
95+
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND_SECONDARY, PROC_REF(show_radial_recipes)) //Monkestation edit: CHEWIN COOKING
9596

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

562568
to_chat(feeder, span_warning("There is nothing left of [parent], oh no!"))
563569
if(isturf(parent))

code/modules/mob/living/carbon/life.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
// Start of a breath chain, calls [carbon/proc/breathe()]
5555
/mob/living/carbon/handle_breathing(seconds_per_tick, times_fired)
5656
if(HAS_TRAIT(src, TRAIT_NOBREATH))
57+
setOxyLoss(0) //idk how because spec life should cover this
58+
losebreath = 0
5759
return
5860

5961
var/next_breath = 4

code/modules/reagents/reagent_containers/condiment.dm

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name = "condiment bottle"
1010
desc = "Just your average condiment bottle."
1111
icon = 'icons/obj/food/containers.dmi'
12-
icon_state = "bottle"
12+
icon_state = "generic_condiment" // monkestation edit: ew should just be a generic bottle.
1313
inhand_icon_state = "beer" //Generic held-item sprite until unique ones are made.
1414
lefthand_file = 'icons/mob/inhands/items/drinks_lefthand.dmi'
1515
righthand_file = 'icons/mob/inhands/items/drinks_righthand.dmi'
@@ -66,7 +66,7 @@
6666
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
6767
return TRUE
6868

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

98+
var/datum/reagent/main_reagent = reagents.get_master_reagent_id()
99+
var/condiment_overlay = initial(main_reagent.condiment_overlay)
100+
var/overlay_colored = initial(main_reagent.overlay_colored)
101+
if(condiment_overlay && istype (target, /obj/item/food))
102+
var/list/params_list = params2list(params)
103+
var/image/I = image('monkestation/code/modules/brewin_and_chewin/icons/condiment_overlays.dmi', target, condiment_overlay)
104+
I.pixel_x = clamp(text2num(params_list["icon-x"]) - world.icon_size/2 - pixel_x,-world.icon_size/2,world.icon_size/2)
105+
I.pixel_y = clamp(text2num(params_list["icon-y"]) - world.icon_size/2 - pixel_y,-world.icon_size/2,world.icon_size/2)
106+
if (overlay_colored)
107+
I.color = mix_color_from_reagents(reagents.reagent_list)
108+
target.overlays += I
109+
98110
/obj/item/reagent_containers/condiment/enzyme
99111
name = "universal enzyme"
100112
desc = "Used in cooking various dishes."
@@ -445,7 +457,7 @@
445457
/obj/item/reagent_containers/condiment/pack/attack(mob/M, mob/user, def_zone) //Can't feed these to people directly.
446458
return
447459

448-
/obj/item/reagent_containers/condiment/pack/afterattack(obj/target, mob/user , proximity)
460+
/obj/item/reagent_containers/condiment/pack/afterattack(obj/target, mob/user , proximity, params)
449461
if(!proximity)
450462
return
451463
. |= AFTERATTACK_PROCESSED_ITEM
@@ -461,6 +473,17 @@
461473
return
462474
else
463475
to_chat(user, span_notice("You tear open [src] above [target] and the condiments drip onto it."))
476+
var/datum/reagent/main_reagent = reagents.get_master_reagent_id()
477+
var/condiment_overlay = initial(main_reagent.condiment_overlay)
478+
var/overlay_colored = initial(main_reagent.overlay_colored)
479+
if(condiment_overlay && istype (target, /obj/item/food))
480+
var/list/params_list = params2list(params)
481+
var/image/I = image('monkestation/code/modules/brewin_and_chewin/icons/condiment_overlays.dmi', target, condiment_overlay)
482+
I.pixel_x = clamp(text2num(params_list["icon-x"]) - world.icon_size/2 - pixel_x,-world.icon_size/2,world.icon_size/2)
483+
I.pixel_y = clamp(text2num(params_list["icon-y"]) - world.icon_size/2 - pixel_y,-world.icon_size/2,world.icon_size/2)
484+
if (overlay_colored)
485+
I.color = mix_color_from_reagents(reagents.reagent_list)
486+
target.overlays += I
464487
src.reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
465488
qdel(src)
466489
return

icons/obj/food/containers.dmi

-209 Bytes
Binary file not shown.

icons/obj/food/piecake.dmi

-159 Bytes
Binary file not shown.

monkestation/code/datums/status_effects/food_buffs.dm

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
duration = 10 MINUTES
33
status_type = STATUS_EFFECT_REPLACE
44
show_duration = TRUE
5-
var/quality_modifier = 1
5+
6+
7+
/datum/status_effect/food/proc/apply_quality(quality)
8+
return
69

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

25+
/datum/status_effect/food/stamina_increase/apply_quality(quality)
26+
stam_increase = stam_increase * (1 + (quality / 50))
27+
2228
/atom/movable/screen/alert/status_effect/food/stamina_increase_t1
2329
name = "Tiny Stamina Increase"
2430
desc = "Increases your stamina by a tiny amount"
@@ -87,6 +93,9 @@
8793
var/range = RANGE
8894
var/duration_loss = DURATION_LOSS
8995

96+
/datum/status_effect/food/fire_burps/apply_quality(quality)
97+
range = range + round((quality / 40))
98+
9099
/atom/movable/screen/alert/status_effect/food/fire_burps
91100
name = "Firey Burps"
92101
desc = "Lets you burp out a line of fire"
@@ -191,6 +200,9 @@
191200
alert_type = /atom/movable/screen/alert/status_effect/food/health_increase_t1
192201
var/health_increase = 10
193202

203+
/datum/status_effect/food/health_increase/apply_quality(quality)
204+
health_increase = health_increase * (1 + (quality / 50))
205+
194206
/atom/movable/screen/alert/status_effect/food/health_increase_t1
195207
name = "Small Health Increase"
196208
desc = "You feel slightly heartier"
@@ -258,6 +270,9 @@
258270
alert_type = /atom/movable/screen/alert/status_effect/food/stam_regen_t1
259271
var/regen_increase = 0.5
260272

273+
/datum/status_effect/food/stam_regen/apply_quality(quality)
274+
regen_increase = regen_increase * (1 + (quality / 20))
275+
261276
/atom/movable/screen/alert/status_effect/food/stam_regen_t1
262277
name = "Small Stamina Regeneration Increase"
263278
desc = "You feel slightly more energetic"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
/datum/component/personal_crafting/proc/craft_until_cant(datum/crafting_recipe/recipe_to_use, mob/chef, turf/craft_location, craft_time)
3+
if(!craft_time)
4+
craft_time = recipe_to_use.time
5+
while(TRUE)
6+
// attempt_craft_loop sleeps, so this won't freeze the server while we craft
7+
if(!attempt_craft_loop(recipe_to_use, chef, craft_location, craft_time))
8+
break
9+
craft_time = max(5, craft_time * 0.75) // speed up the more you craft in a batch
10+
11+
/// Attempts a crafting loop. Returns true if it succeeds, false otherwise
12+
/datum/component/personal_crafting/proc/attempt_craft_loop(datum/crafting_recipe/recipe_to_use, mob/chef, turf/craft_location, craft_time)
13+
var/list/surroundings = get_surroundings(chef)
14+
if(!check_contents(chef, recipe_to_use, surroundings))
15+
chef.balloon_alert_to_viewers("failed to craft, missing ingredients!")
16+
return FALSE
17+
18+
var/atom/movable/result = construct_item(chef, recipe_to_use, craft_time)
19+
if(istext(result))
20+
chef.balloon_alert_to_viewers("failed to craft[result]")
21+
return FALSE
22+
//We made an item and didn't get a fail message
23+
result.forceMove(craft_location)
24+
result.pixel_x = rand(-10, 10)
25+
result.pixel_y = rand(-10, 10)
26+
if(isitem(result))
27+
var/obj/item/item_result = result
28+
item_result.do_drop_animation(chef)
29+
chef.investigate_log("[key_name(chef)] crafted [recipe_to_use]", INVESTIGATE_CRAFTING)
30+
recipe_to_use.on_craft_completion(chef, result)
31+
return TRUE
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/datum/component/edible/proc/check_menu(mob/user)
2+
if(!istype(user))
3+
return FALSE
4+
if(user.incapacitated() || !user.Adjacent(parent))
5+
return FALSE
6+
return TRUE
7+
8+
/datum/component/edible/proc/show_radial_recipes(atom/parent_atom, mob/user)
9+
SIGNAL_HANDLER
10+
if(!ishuman(user))
11+
return
12+
var/mob/living/carbon/human/chef = user
13+
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
14+
if(!crafting_menu)
15+
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")
16+
var/list/available_recipes = list()
17+
var/list/surroundings = crafting_menu.get_surroundings(chef)
18+
var/list/recipes_radial = list()
19+
var/list/recipes_craft = list()
20+
for(var/recipe in GLOB.cooking_recipes)
21+
var/datum/crafting_recipe/potential_recipe = recipe
22+
if(parent.type in potential_recipe.reqs) // dont show recipes that don't involve this item
23+
if(crafting_menu.check_contents(chef, potential_recipe, surroundings)) // don't show recipes we can't actually make
24+
available_recipes.Add(potential_recipe)
25+
for(var/available_recipe in available_recipes)
26+
var/datum/crafting_recipe/available_recipe_datum = available_recipe
27+
var/atom/craftable_atom = available_recipe_datum.result
28+
recipes_radial.Add(list(initial(craftable_atom.name) = image(icon = initial(craftable_atom.icon), icon_state = initial(craftable_atom.icon_state))))
29+
recipes_craft.Add(list(initial(craftable_atom.name) = available_recipe_datum))
30+
INVOKE_ASYNC(src, PROC_REF(hate_signals_holy_shit), recipes_radial, recipes_craft, chef, crafting_menu)
31+
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN
32+
33+
/datum/component/edible/proc/hate_signals_holy_shit(list/recipes_radial, list/recipes_craft, mob/chef, datum/component/personal_crafting/crafting_menu)
34+
var/recipe_chosen = show_radial_menu(chef, chef, recipes_radial, custom_check = CALLBACK(src, PROC_REF(check_menu), chef), require_near = TRUE, tooltips = TRUE)
35+
if(!recipe_chosen)
36+
return
37+
var/datum/crafting_recipe/chosen_recipe = recipes_craft[recipe_chosen]
38+
chef.balloon_alert_to_viewers("crafting [chosen_recipe.name]")
39+
crafting_menu.craft_until_cant(chosen_recipe, chef, get_turf(parent))

monkestation/code/modules/brewin_and_chewin/chewing/recipes/fried_rice.dm

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/datum/chewin_cooking/recipe/ti_hoeh_koe
2+
cooking_container = PAN
3+
food_category = CAT_STOVETOP
4+
product_type = /obj/item/food/epok_epok
5+
step_builder = list(
6+
list(CHEWIN_ADD_ITEM, /obj/item/food/doughslice, qmod=0.5),
7+
list(CHEWIN_ADD_ITEM, /obj/item/food/meat/cutlet/chicken, qmod=0.5),
8+
list(CHEWIN_USE_STOVE, J_MED, 10 SECONDS, finish_text="The chicken starts to cook."),
9+
list(CHEWIN_ADD_ITEM, /obj/item/food/grown/potato/wedges, qmod=0.5),
10+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledegg, qmod=0.5),
11+
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/curry_powder, 3, base=3),
12+
list(CHEWIN_USE_STOVE, J_LO, 10 SECONDS),
13+
)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/datum/chewin_cooking/recipe/hurricane_rice
2+
cooking_container = PAN
3+
food_category = CAT_STOVETOP
4+
product_type = /obj/item/food/salad/hurricane_rice
5+
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."
6+
step_builder = list(
7+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice, qmod=0.5),
8+
list(CHEWIN_ADD_ITEM, /obj/item/food/egg, qmod=0.5),
9+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/chili, qmod=0.5),
10+
11+
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/onion_slice, qmod=0.5),
12+
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/pineappleslice, qmod=0.5),
13+
14+
list(CHEWIN_USE_STOVE, J_HI, 15 SECONDS , finish_text = "You can smell almost finished fried rice, just needs some seasoning!"),
15+
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/soysauce, 3, base=3),
16+
list(CHEWIN_USE_STOVE, J_HI, 5 SECONDS , finish_text = "You can smell fried rice!"),
17+
)
18+
19+
/datum/chewin_cooking/recipe/ikareis
20+
cooking_container = PAN
21+
food_category = CAT_STOVETOP
22+
product_type = /obj/item/food/salad/ikareis
23+
recipe_guide = "Add boiled rice to pan, some squid ink, add vegetables and sausage, cook for 20 seconds on high."
24+
step_builder = list(
25+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice, qmod=0.5),
26+
list(CHEWIN_ADD_ITEM, /obj/item/food/canned/squid_ink, qmod=0.5),
27+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/bell_pepper, qmod=0.5),
28+
list(CHEWIN_ADD_ITEM, /obj/item/food/sausage, qmod=0.5),
29+
30+
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/onion_slice, qmod=0.5),
31+
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/pineappleslice, qmod=0.5, prod_desc = "Extra sweet!"),
32+
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/grown/chili, qmod=0.5, prod_desc = "Extra spicy!"),
33+
34+
list(CHEWIN_USE_STOVE, J_HI, 20 SECONDS , finish_text = "You can smell ikareis!"),
35+
)
36+
37+
/datum/chewin_cooking/recipe/ketchup_fried_rice
38+
name = "Ketchup Fried Rice"
39+
cooking_container = PAN
40+
food_category = CAT_STOVETOP
41+
product_type = /obj/item/food/salad/ketchup_fried_rice
42+
recipe_guide = "Cook ingredients in a pan."
43+
step_builder = list(
44+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
45+
list(CHEWIN_ADD_ITEM, /obj/item/food/onion_slice),
46+
list(CHEWIN_ADD_ITEM, /obj/item/food/sausage/american),
47+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/carrot),
48+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/peas),
49+
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/ketchup, 5),
50+
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/worcestershire, 2),
51+
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
52+
)
53+
54+
55+
/datum/chewin_cooking/recipe/mediterranean_fried_rice
56+
name = "Mediterranean Fried Rice"
57+
cooking_container = PAN
58+
food_category = CAT_STOVETOP
59+
product_type = /obj/item/food/salad/mediterranean_fried_rice
60+
recipe_guide = "Cook ingredients in a pan."
61+
step_builder = list(
62+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
63+
list(CHEWIN_ADD_ITEM, /obj/item/food/onion_slice),
64+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/herbs),
65+
list(CHEWIN_ADD_ITEM, /obj/item/food/cheese/firm_cheese_slice),
66+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/olive),
67+
list(CHEWIN_ADD_ITEM, /obj/item/food/meatball),
68+
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
69+
)
70+
71+
72+
/datum/chewin_cooking/recipe/egg_fried_rice
73+
name = "Egg Fried Rice"
74+
cooking_container = PAN
75+
food_category = CAT_STOVETOP
76+
product_type = /obj/item/food/salad/egg_fried_rice
77+
recipe_guide = "Cook ingredients in a pan."
78+
step_builder = list(
79+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
80+
list(CHEWIN_ADD_ITEM, /obj/item/food/egg),
81+
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/soysauce, 3),
82+
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
83+
)
84+
85+
86+
/datum/chewin_cooking/recipe/bibimbap
87+
name = "Bibimbap"
88+
cooking_container = PAN
89+
food_category = CAT_STOVETOP
90+
product_type = /obj/item/food/salad/bibimbap
91+
recipe_guide = "Cook ingredients in a pan."
92+
step_builder = list(
93+
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice),
94+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/cucumber),
95+
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/mushroom/chanterelle),
96+
list(CHEWIN_ADD_ITEM, /obj/item/food/meat/cutlet),
97+
list(CHEWIN_ADD_ITEM, /obj/item/food/kimchi),
98+
list(CHEWIN_ADD_ITEM, /obj/item/food/egg),
99+
list(CHEWIN_USE_STOVE, J_MED, 20 SECONDS) // Cook on medium for 20 seconds
100+
)

0 commit comments

Comments
 (0)