diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm
index 439583c859..378667cd82 100644
--- a/code/__DEFINES/is_helpers.dm
+++ b/code/__DEFINES/is_helpers.dm
@@ -246,6 +246,8 @@ GLOBAL_LIST_INIT(pointed_types, typecacheof(list(
#define isgun(A) (istype(A, /obj/item/gun))
+#define isfood(A) (istype(A, /obj/item/reagent_containers/food))
+
//Assemblies
#define isassembly(O) (istype(O, /obj/item/assembly))
diff --git a/code/datums/components/butchering.dm b/code/datums/components/butchering.dm
index 06169f64bf..e5625dee6a 100644
--- a/code/datums/components/butchering.dm
+++ b/code/datums/components/butchering.dm
@@ -69,9 +69,13 @@
H.apply_status_effect(/datum/status_effect/neck_slice)
/datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat)
+ var/meat_quality = 50 + (bonus_modifier/10) //increases through quality of butchering tool, and through if it was butchered in the kitchen or not
+ if(istype(get_area(butcher), /area/crew_quarters/kitchen))
+ meat_quality = meat_quality + 10
var/turf/T = meat.drop_location()
var/final_effectiveness = effectiveness - meat.butcher_difficulty
var/bonus_chance = max(0, (final_effectiveness - 100) + bonus_modifier) //so 125 total effectiveness = 25% extra chance
+ var/list/butchered_items = list()
for(var/V in meat.butcher_results)
var/obj/bones = V
var/amount = meat.butcher_results[bones]
@@ -83,16 +87,21 @@
if(butcher)
to_chat(butcher, "You harvest some extra [initial(bones.name)] from [meat]!")
for(var/i in 1 to 2)
- new bones (T)
+ butchered_items += new bones (T)
+
else
- new bones (T)
+ butchered_items += new bones (T)
meat.butcher_results.Remove(bones) //in case you want to, say, have it drop its results on gib
for(var/V in meat.guaranteed_butcher_results)
var/obj/sinew = V
var/amount = meat.guaranteed_butcher_results[sinew]
for(var/i in 1 to amount)
- new sinew (T)
+ butchered_items += new sinew (T)
meat.guaranteed_butcher_results.Remove(sinew)
+ for(var/butchered_item in butchered_items)
+ if(isfood(butchered_item))
+ var/obj/item/reagent_containers/food/butchered_meat = butchered_item
+ butchered_meat.food_quality = meat_quality
if(butcher)
meat.visible_message("[butcher] butchers [meat].")
ButcherEffects(meat)
diff --git a/code/datums/components/crafting/craft.dm b/code/datums/components/crafting/craft.dm
index e0bf084ac2..5d02cc4fec 100644
--- a/code/datums/components/crafting/craft.dm
+++ b/code/datums/components/crafting/craft.dm
@@ -205,6 +205,18 @@
var/atom/movable/I = new R.result (get_turf(user.loc))
I.CheckParts(parts, R)
if(isitem(I))
+ if(isfood(I))
+ var/obj/item/reagent_containers/food/food_result = I
+ var/total_quality = 0
+ var/total_items = 0
+ for(var/obj/item/ingredient in parts)
+ var/obj/item/reagent_containers/food/food_ingredient = ingredient
+ total_items += 1
+ total_quality += food_ingredient.food_quality
+ if(total_items == 0)
+ food_result.adjust_food_quality(50)
+ else
+ food_result.adjust_food_quality(total_quality / total_items)
user.put_in_hands(I)
if(send_feedback)
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
diff --git a/code/modules/food_and_drinks/food.dm b/code/modules/food_and_drinks/food.dm
index 2af24080cb..1342b1fcbf 100644
--- a/code/modules/food_and_drinks/food.dm
+++ b/code/modules/food_and_drinks/food.dm
@@ -16,6 +16,7 @@
resistance_flags = FLAMMABLE
var/foodtype = NONE
var/last_check_time
+ var/food_quality = 50
/obj/item/reagent_containers/food/Initialize(mapload)
. = ..()
@@ -23,6 +24,9 @@
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
+/obj/item/reagent_containers/food/proc/adjust_food_quality(new_quality)
+ food_quality = CLAMP(new_quality,0,100)
+
/obj/item/reagent_containers/food/proc/checkLiked(var/fraction, mob/M)
if(last_check_time + 50 < world.time)
if(ishuman(M))
@@ -32,13 +36,13 @@
to_chat(H,"What the hell was that thing?!")
H.adjust_disgust(25 + 30 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "toxic_food", /datum/mood_event/disgusting_food)
- else if(foodtype & H.dna.species.disliked_food)
+ else if((foodtype & H.dna.species.disliked_food) || food_quality <= 30)
to_chat(H,"That didn't taste very good...")
H.adjust_disgust(11 + 15 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "gross_food", /datum/mood_event/gross_food)
- else if(foodtype & H.dna.species.liked_food)
+ else if(((foodtype & H.dna.species.liked_food) && food_quality >= 50) || food_quality >= 70) //you like food of high quality, and food of regular quality you have a preference for
to_chat(H,"I love this taste!")
- H.adjust_disgust(-5 + -2.5 * fraction)
+ H.adjust_disgust(-5 + (-2.5 * food_quality/50) + -2.5 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "fav_food", /datum/mood_event/favorite_food)
else
if(foodtype & H.dna.species.toxic_food)
@@ -48,4 +52,4 @@
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "breakfast", /datum/mood_event/breakfast)
last_check_time = world.time
-#undef STOP_SERVING_BREAKFAST
\ No newline at end of file
+#undef STOP_SERVING_BREAKFAST
diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm
index bd20ad8d69..0e2bdc63c8 100644
--- a/code/modules/food_and_drinks/food/customizables.dm
+++ b/code/modules/food_and_drinks/food/customizables.dm
@@ -20,6 +20,7 @@
var/list/ingredients = list()
var/ingredients_placement = INGREDIENTS_FILL
var/customname = "custom"
+ var/total_quality = 0 //quality of all ingredients added together
/obj/item/reagent_containers/food/snacks/customizable/examine(mob/user)
. = ..()
@@ -56,6 +57,9 @@
S.reagents.trans_to(src,min(S.reagents.total_volume, 15)) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
foodtype |= S.foodtype
update_snack_overlays(S)
+ //quality of customised food is average of the ingredient's qualities
+ total_quality += S.food_quality
+ food_quality = total_quality / length(ingredients)
to_chat(user, "You add the [I.name] to the [name].")
update_name(S)
else
diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm
index 5aaa382ece..a485f0c864 100644
--- a/code/modules/food_and_drinks/food/snacks.dm
+++ b/code/modules/food_and_drinks/food/snacks.dm
@@ -153,6 +153,12 @@ All foods are distributed among various categories. Use common sense.
/obj/item/reagent_containers/food/snacks/examine(mob/user)
. = ..()
+ if(food_quality >= 70)
+ . += "It is of a high quality."
+ else
+ if(food_quality <= 30)
+ . += "It is of a low quality."
+
if(bitecount == 0)
return
else if(bitecount == 1)
@@ -296,6 +302,10 @@ All foods are distributed among various categories. Use common sense.
var/obj/item/result
if(cooked_type)
result = new cooked_type(T)
+ //if the result is food, set its food quality to the original food item's quality
+ if(isfood(result))
+ var/obj/item/reagent_containers/food/food_output = result
+ food_output.adjust_food_quality(food_quality + M.quality_increase)
if(istype(M))
initialize_cooked_food(result, M.efficiency)
else
diff --git a/code/modules/food_and_drinks/food/snacks_bread.dm b/code/modules/food_and_drinks/food/snacks_bread.dm
index 99fd2af9bb..f3d84f7169 100644
--- a/code/modules/food_and_drinks/food/snacks_bread.dm
+++ b/code/modules/food_and_drinks/food/snacks_bread.dm
@@ -197,6 +197,7 @@
icon = 'icons/obj/food/food.dmi'
icon_state = ""
bitesize = 2
+ var/fried_garbage = FALSE //did you really fry a fire extinguisher?
GLOBAL_VAR_INIT(frying_hardmode, TRUE)
GLOBAL_VAR_INIT(frying_bad_chem_add_volume, TRUE)
@@ -227,21 +228,13 @@ GLOBAL_LIST_INIT(frying_bad_chems, list(
item_flags = fried.item_flags
obj_flags = fried.obj_flags
- if(istype(fried, /obj/item/reagent_containers/food/snacks))
+ if(isfood(fried))
fried.reagents.trans_to(src, fried.reagents.total_volume)
qdel(fried)
else
fried.forceMove(src)
trash = fried
- if(!istype(fried, /obj/item/reagent_containers/food) && GLOB.frying_hardmode && GLOB.frying_bad_chems.len)
- var/R = rand(1, GLOB.frying_bad_chems.len)
- var/bad_chem = GLOB.frying_bad_chems[R]
- var/bad_chem_amount = GLOB.frying_bad_chems[bad_chem]
- if(GLOB.frying_bad_chem_add_volume)
- reagents.maximum_volume += bad_chem_amount + 2 //Added room for condensed cooking oil
- reagents.add_reagent(bad_chem, bad_chem_amount)
- //All fried inedible items also get condensed cooking oil added, which induces minor vomiting and heart damage
- reagents.add_reagent(/datum/reagent/toxin/condensed_cooking_oil, 2)
+ fried_garbage = TRUE
/obj/item/reagent_containers/food/snacks/deepfryholder/Destroy()
if(trash)
@@ -249,6 +242,13 @@ GLOBAL_LIST_INIT(frying_bad_chems, list(
. = ..()
/obj/item/reagent_containers/food/snacks/deepfryholder/On_Consume(mob/living/eater)
+ if(fried_garbage && GLOB.frying_hardmode && GLOB.frying_bad_chems.len)
+ var/R = rand(1, GLOB.frying_bad_chems.len)
+ var/bad_chem = GLOB.frying_bad_chems[R]
+ var/bad_chem_amount = GLOB.frying_bad_chems[bad_chem]
+ eater.reagents.add_reagent(bad_chem, bad_chem_amount)
+ //All fried inedible items also get condensed cooking oil added, which induces minor vomiting and heart damage
+ eater.reagents.add_reagent(/datum/reagent/toxin/condensed_cooking_oil, 2)
if(trash)
QDEL_NULL(trash)
..()
@@ -259,18 +259,22 @@ GLOBAL_LIST_INIT(frying_bad_chems, list(
add_atom_colour(rgb(166,103,54), FIXED_COLOUR_PRIORITY)
name = "lightly-fried [name]"
desc = "[desc] It's been lightly fried in a deep fryer."
+ adjust_food_quality(food_quality - 5)
if(16 to 49)
add_atom_colour(rgb(103,63,24), FIXED_COLOUR_PRIORITY)
name = "fried [name]"
desc = "[desc] It's been fried, increasing its tastiness value by [rand(1, 75)]%."
+ adjust_food_quality(food_quality - 10)
if(50 to 59)
add_atom_colour(rgb(63,23,4), FIXED_COLOUR_PRIORITY)
name = "deep-fried [name]"
desc = "[desc] Deep-fried to perfection."
+ adjust_food_quality(food_quality) //we shouldn't punish perfection in the fried arts
if(60 to INFINITY)
add_atom_colour(rgb(33,19,9), FIXED_COLOUR_PRIORITY)
name = "the physical manifestation of the very concept of fried foods"
desc = "A heavily-fried...something. Who can tell anymore?"
+ adjust_food_quality(0) //good job, you're truly the best cook.
filling_color = color
foodtype |= FRIED
diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
index 1215dd7ecb..0a3d172bb0 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
@@ -104,6 +104,12 @@ God bless America.
else if(!frying && user.transferItemToLoc(I, src))
to_chat(user, "You put [I] into [src].")
frying = new/obj/item/reagent_containers/food/snacks/deepfryholder(src, I)
+ //setup food quality for item depending on if it's edible or not
+ if(isfood(I))
+ var/obj/item/reagent_containers/food/original_food = I
+ frying.adjust_food_quality(original_food.food_quality) //food quality remains unchanged until degree of frying is calculated
+ else
+ frying.adjust_food_quality(10) //inedible fried item has low quality
icon_state = "fryer_on"
fry_loop.start()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index 5117439049..c94aba95b4 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
@@ -14,6 +14,7 @@
var/gibtime = 40 // Time from starting until meat appears
var/meat_produced = 0
var/ignore_clothing = FALSE
+ var/meat_quality = 35 //food_quality of meat produced
/obj/machinery/gibber/Initialize()
@@ -23,8 +24,10 @@
/obj/machinery/gibber/RefreshParts()
gibtime = 40
meat_produced = 0
+ meat_quality = 35 // unupgraded this means quality is 50, and max upgraded it is 95
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
meat_produced += B.rating
+ meat_quality += B.rating * 15
for(var/obj/item/stock_parts/manipulator/M in component_parts)
gibtime -= 5 * M.rating
if(M.rating >= 2)
@@ -181,6 +184,7 @@
for (var/i=1 to meat_produced)
var/obj/item/reagent_containers/food/snacks/meat/slab/newmeat = new typeofmeat
+ newmeat.adjust_food_quality(meat_quality)
newmeat.name = "[sourcename] [newmeat.name]"
if(istype(newmeat))
newmeat.subjectname = sourcename
diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index 3e0c9cb4b5..d9e3bc6165 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -19,6 +19,7 @@
var/broken = 0 // 0, 1 or 2 // How broken is it???
var/max_n_of_items = 10
var/efficiency = 0
+ var/quality_increase = 5 // how much do we increase the quality of microwaved items
var/productivity = 0
var/datum/looping_sound/microwave/soundloop
var/list/ingredients = list() // may only contain /atom/movables
@@ -51,7 +52,10 @@
efficiency += M.rating * 0.4
productivity += M.rating
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
- max_n_of_items += M.rating * 5
+
+ max_n_of_items = 10 * M.rating
+ quality_increase = M.rating * 5
+ break
/obj/machinery/microwave/examine(mob/user)
. = ..()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
index 3fa188fb94..9a3df0a92b 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
@@ -14,10 +14,13 @@
var/processing = FALSE
var/rating_speed = 1
var/rating_amount = 1
+ var/quality_increase = 5
/obj/machinery/processor/RefreshParts()
+ quality_increase = 0
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
rating_amount = B.rating
+ quality_increase += B.rating * 5
for(var/obj/item/stock_parts/manipulator/M in component_parts)
rating_speed = M.rating
@@ -28,8 +31,10 @@
/obj/machinery/processor/proc/process_food(datum/food_processor_process/recipe, atom/movable/what)
if (recipe.output && loc && !QDELETED(src))
+ var/obj/item/reagent_containers/food/food_input = what
for(var/i = 0, i < rating_amount, i++)
- new recipe.output(drop_location())
+ var/obj/item/reagent_containers/food/food_output = new recipe.output(drop_location())
+ food_output.adjust_food_quality(food_input.food_quality + quality_increase)
if (ismob(what))
var/mob/themob = what
themob.gib(TRUE,TRUE,TRUE)
diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm
index c15c1cd2f5..ec96a4537c 100644
--- a/code/modules/food_and_drinks/recipes/food_mixtures.dm
+++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm
@@ -8,7 +8,6 @@
parts |= reqs
//////////////////////////////////////////FOOD MIXTURES////////////////////////////////////
-
/datum/chemical_reaction/tofu
name = "Tofu"
id = "tofu"
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 39b687c64a..819af8513f 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -35,8 +35,6 @@
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_fantastic)
if (RACE_DRINK)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/race_drink)
- if (FOOD_AMAZING)
- SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_food", /datum/mood_event/amazingtaste)
return ..()
/datum/reagent/consumable/nutriment
@@ -819,11 +817,20 @@
nutriment_factor = 2 * REAGENTS_METABOLISM
color = "#792300"
taste_description = "indescribable"
- quality = FOOD_AMAZING
taste_mult = 100
can_synth = FALSE
pH = 6.1
+/datum/reagent/consumable/secretsauce/reaction_obj(obj/O, reac_volume)
+ //splashing any amount above or equal to 1u of secret sauce onto a piece of food turns its quality to 100
+ if(reac_volume >= 1 && isfood(O))
+ var/obj/item/reagent_containers/food/splashed_food = O
+ splashed_food.adjust_food_quality(100)
+ // if it's a customisable food, we need to edit its total quality too, to prevent its quality resetting from adding more ingredients!
+ if(istype(O, /obj/item/reagent_containers/food/snacks/customizable))
+ var/obj/item/reagent_containers/food/snacks/customizable/splashed_custom_food = O
+ splashed_custom_food.total_quality += 10000
+
/datum/reagent/consumable/char
name = "Char"
description = "Essence of the grill. Has strange properties when overdosed."
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index 305d12b3c5..bd79ed5fb8 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -506,7 +506,7 @@
taste_description = "awful cooking"
/datum/reagent/toxin/condensed_cooking_oil/on_mob_life(mob/living/carbon/M)
- if(prob(15))
+ if(prob(5))
M.vomit()
else
if(prob(40))