diff --git a/code/__DEFINES/food.dm b/code/__DEFINES/food.dm index 3787aeb4df7b9..c9b7cb43cf0d9 100644 --- a/code/__DEFINES/food.dm +++ b/code/__DEFINES/food.dm @@ -139,7 +139,7 @@ GLOBAL_LIST_INIT(food_quality_events, list( FOOD_QUALITY_TOP = /datum/mood_event/food/top, )) -/// Crafted food buffs grouped by crafting_complexity +/// Weighted lists of crafted food buffs randomly given according to crafting_complexity unless the food has a specific buff GLOBAL_LIST_INIT(food_buffs, list( FOOD_COMPLEXITY_1 = list( /datum/status_effect/food/haste = 1, @@ -152,11 +152,9 @@ GLOBAL_LIST_INIT(food_buffs, list( ), FOOD_COMPLEXITY_4 = list( /datum/status_effect/food/haste = 1, - /datum/status_effect/food/trait/shockimmune = 1, ), FOOD_COMPLEXITY_5 = list( /datum/status_effect/food/haste = 1, - /datum/status_effect/food/trait/shockimmune = 2, ), )) diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 8f436faa9c6c4..d383c6f639e7a 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -611,6 +611,9 @@ data["name"] = "[data["name"]] [recipe.result_amount]x" data["desc"] = recipe.desc || initial(atom.desc) + if(ispath(recipe.result, /obj/item/food)) + var/obj/item/food/food = recipe.result + data["has_food_effect"] = !!food.crafted_food_buff // Crafting if(recipe.non_craftable) diff --git a/code/datums/components/speechmod.dm b/code/datums/components/speechmod.dm index 2506a0b914077..8ffa3e8624e49 100644 --- a/code/datums/components/speechmod.dm +++ b/code/datums/components/speechmod.dm @@ -34,6 +34,12 @@ var/atom/owner = parent + if (istype(parent, /datum/status_effect)) + var/datum/status_effect/effect = parent + targeted = effect.owner + RegisterSignal(targeted, COMSIG_MOB_SAY, PROC_REF(handle_speech)) + return + if (ismob(parent)) targeted = parent RegisterSignal(targeted, COMSIG_MOB_SAY, PROC_REF(handle_speech)) diff --git a/code/datums/status_effects/food_effects.dm b/code/datums/status_effects/buffs/food/_food_effect.dm similarity index 64% rename from code/datums/status_effects/food_effects.dm rename to code/datums/status_effects/buffs/food/_food_effect.dm index f36f1e2034d9c..fe63df29e3a8a 100644 --- a/code/datums/status_effects/food_effects.dm +++ b/code/datums/status_effects/buffs/food/_food_effect.dm @@ -1,19 +1,18 @@ /// Buffs given by eating hand-crafted food. The duration scales with consumable reagents purity. /datum/status_effect/food - id = "food_buff" + id = "food_effect" duration = 5 MINUTES // Same as food mood buffs status_type = STATUS_EFFECT_REPLACE // Only one food buff allowed alert_type = /atom/movable/screen/alert/status_effect/food show_duration = TRUE - /// Buff power + /// Buff power equal to food complexity (1 to 5) var/strength /datum/status_effect/food/on_creation(mob/living/new_owner, timeout_mod = 1, strength = 1) + . = ..() src.strength = strength - //Generate alert when not specified if(isnum(timeout_mod)) duration *= timeout_mod - . = ..() if(istype(linked_alert, /atom/movable/screen/alert/status_effect/food)) linked_alert.icon_state = "[linked_alert.base_icon_state]_[strength]" @@ -22,19 +21,3 @@ desc = "Eating it made me feel better." icon_state = "food_buff_1" base_icon_state = "food_buff" - -/// Makes you gain a trait -/datum/status_effect/food/trait - var/trait = TRAIT_DUMB // You need to override this - -/datum/status_effect/food/trait/on_apply() - ADD_TRAIT(owner, trait, type) - return ..() - -/datum/status_effect/food/trait/be_replaced() - REMOVE_TRAIT(owner, trait, type) - return ..() - -/datum/status_effect/food/trait/on_remove() - REMOVE_TRAIT(owner, trait, type) - return ..() diff --git a/code/datums/status_effects/buffs/food/food_traits.dm b/code/datums/status_effects/buffs/food/food_traits.dm deleted file mode 100644 index dfd0b888aa096..0000000000000 --- a/code/datums/status_effects/buffs/food/food_traits.dm +++ /dev/null @@ -1,7 +0,0 @@ -/datum/status_effect/food/trait/shockimmune - alert_type = /atom/movable/screen/alert/status_effect/food/trait_shockimmune - trait = TRAIT_SHOCKIMMUNE - -/atom/movable/screen/alert/status_effect/food/trait_shockimmune - name = "Grounded" - desc = "That meal made me feel like a superconductor..." diff --git a/code/datums/status_effects/buffs/food/grant_trait.dm b/code/datums/status_effects/buffs/food/grant_trait.dm new file mode 100644 index 0000000000000..f25be3b0b3bfd --- /dev/null +++ b/code/datums/status_effects/buffs/food/grant_trait.dm @@ -0,0 +1,56 @@ +/// Makes you gain a trait +/datum/status_effect/food/trait + var/trait = TRAIT_DUMB // You need to override this + +/datum/status_effect/food/trait/on_apply() + if(!HAS_TRAIT_FROM(owner, trait, type)) // Check if trait was already applied + ADD_TRAIT(owner, trait, type) + return ..() + +/datum/status_effect/food/trait/be_replaced() + REMOVE_TRAIT(owner, trait, type) + return ..() + +/datum/status_effect/food/trait/on_remove() + REMOVE_TRAIT(owner, trait, type) + return ..() + +/datum/status_effect/food/trait/shockimmune + alert_type = /atom/movable/screen/alert/status_effect/shockimmune + trait = TRAIT_SHOCKIMMUNE + +/atom/movable/screen/alert/status_effect/shockimmune + name = "Grounded" + desc = "That meal made me feel like a superconductor..." + icon_state = "shock_immune" + +/datum/status_effect/food/trait/mute + alert_type = /atom/movable/screen/alert/status_effect/mute + trait = TRAIT_MUTE + +/atom/movable/screen/alert/status_effect/mute + name = "..." + desc = "..." + icon_state = "mute" + +/datum/status_effect/food/trait/ashstorm_immune + alert_type = /atom/movable/screen/alert/status_effect/ashstorm_immune + trait = TRAIT_ASHSTORM_IMMUNE + +/atom/movable/screen/alert/status_effect/ashstorm_immune + name = "Ashstorm-proof" + desc = "That meal makes me feel born on Lavaland." + icon_state = "ashstorm_immune" + +/datum/status_effect/food/trait/waddle + alert_type = /atom/movable/screen/alert/status_effect/waddle + trait = TRAIT_WADDLING + +/datum/status_effect/food/trait/waddle/on_apply() + owner.AddElementTrait(trait, type, /datum/element/waddling) + return ..() + +/atom/movable/screen/alert/status_effect/waddle + name = "Waddling" + desc = "That meal makes me want to joke around." + icon_state = "waddle" diff --git a/code/datums/status_effects/buffs/food/speech.dm b/code/datums/status_effects/buffs/food/speech.dm new file mode 100644 index 0000000000000..634fd739709b3 --- /dev/null +++ b/code/datums/status_effects/buffs/food/speech.dm @@ -0,0 +1,45 @@ +///Temporary modifies the speech using the /datum/component/speechmod +/datum/status_effect/food/speech + +/datum/status_effect/food/speech/italian + alert_type = /atom/movable/screen/alert/status_effect/italian_speech + +/datum/status_effect/food/speech/italian/on_apply() + AddComponent( \ + /datum/component/speechmod, \ + replacements = strings("italian_replacement.json", "italian"), \ + end_string = list( + " Ravioli, ravioli, give me the formuoli!", + " Mamma-mia!", + " Mamma-mia! That's a spicy meat-ball!", + " La la la la la funiculi funicula!" + ), \ + end_string_chance = 3 \ + ) + return ..() + +/atom/movable/screen/alert/status_effect/italian_speech + name = "Linguini Embrace" + desc = "You feel a sudden urge to gesticulate wildly." + icon_state = "food_italian" + +/datum/status_effect/food/speech/french + alert_type = /atom/movable/screen/alert/status_effect/french_speech + +/datum/status_effect/food/speech/french/on_apply() + AddComponent( \ + /datum/component/speechmod, \ + replacements = strings("french_replacement.json", "french"), \ + end_string = list( + " Honh honh honh!", + " Honh!", + " Zut Alors!" + ), \ + end_string_chance = 3, \ + ) + return ..() + +/atom/movable/screen/alert/status_effect/french_speech + name = "Café Chic" + desc = "Suddenly, everything seems worthy of a passionate debate." + icon_state = "food_french" diff --git a/code/game/objects/items/food/cake.dm b/code/game/objects/items/food/cake.dm index 0b443554bb3b6..3bcb35376ab88 100644 --- a/code/game/objects/items/food/cake.dm +++ b/code/game/objects/items/food/cake.dm @@ -521,6 +521,7 @@ foodtypes = GRAIN | SUGAR | DAIRY slice_type = /obj/item/food/cakeslice/clown_slice crafting_complexity = FOOD_COMPLEXITY_5 + crafted_food_buff = /datum/status_effect/food/trait/waddle /obj/item/food/cakeslice/clown_slice name = "clown cake slice" @@ -534,6 +535,7 @@ tastes = list("cake" = 1, "sugar" = 1, "joy" = 10) foodtypes = GRAIN | SUGAR | DAIRY crafting_complexity = FOOD_COMPLEXITY_5 + crafted_food_buff = /datum/status_effect/food/trait/waddle /obj/item/food/cake/trumpet name = "spaceman's cake" diff --git a/code/game/objects/items/food/egg.dm b/code/game/objects/items/food/egg.dm index b669e16b103cd..bcc61e721e211 100644 --- a/code/game/objects/items/food/egg.dm +++ b/code/game/objects/items/food/egg.dm @@ -277,6 +277,7 @@ GLOBAL_VAR_INIT(chicks_from_eggs, 0) foodtypes = MEAT | BREAKFAST | DAIRY venue_value = FOOD_PRICE_CHEAP crafting_complexity = FOOD_COMPLEXITY_2 + crafted_food_buff = /datum/status_effect/food/speech/french /obj/item/food/omelette/attackby(obj/item/item, mob/user, params) if(istype(item, /obj/item/kitchen/fork)) diff --git a/code/game/objects/items/food/mexican.dm b/code/game/objects/items/food/mexican.dm index 396e351ff4bde..c4349ca38c673 100644 --- a/code/game/objects/items/food/mexican.dm +++ b/code/game/objects/items/food/mexican.dm @@ -196,6 +196,7 @@ w_class = WEIGHT_CLASS_SMALL venue_value = FOOD_PRICE_LEGENDARY crafting_complexity = FOOD_COMPLEXITY_5 + crafted_food_buff = /datum/status_effect/food/trait/ashstorm_immune /obj/item/food/chipsandsalsa name = "chips and salsa" diff --git a/code/game/objects/items/food/pastries.dm b/code/game/objects/items/food/pastries.dm index 1024e44c625f3..83f30ab0b06bd 100644 --- a/code/game/objects/items/food/pastries.dm +++ b/code/game/objects/items/food/pastries.dm @@ -327,6 +327,20 @@ tastes = list("cake" = 3, "blue cherry" = 1) crafting_complexity = FOOD_COMPLEXITY_3 +/obj/item/food/jupitercupcake + name = "jupiter-cup-cake" + desc = "A static dessert." + icon_state = "jupitercupcake" + food_reagents = list( + /datum/reagent/consumable/nutriment = 6, + /datum/reagent/consumable/nutriment/vitamin = 2, + /datum/reagent/consumable/caramel = 3, + /datum/reagent/consumable/liquidelectricity/enriched = 3, + ) + tastes = list("cake" = 3, "caramel" = 2, "zap" = 1) + crafting_complexity = FOOD_COMPLEXITY_3 + crafted_food_buff = /datum/status_effect/food/trait/shockimmune + /obj/item/food/honeybun name = "honey bun" desc = "A sticky pastry bun glazed with honey." diff --git a/code/game/objects/items/food/pie.dm b/code/game/objects/items/food/pie.dm index e57759915208d..8872903294d10 100644 --- a/code/game/objects/items/food/pie.dm +++ b/code/game/objects/items/food/pie.dm @@ -316,6 +316,7 @@ ) tastes = list("nothing" = 3) foodtypes = GRAIN + crafted_food_buff = /datum/status_effect/food/trait/mute /obj/item/food/pie/berrytart name = "berry tart" diff --git a/code/game/objects/items/food/spaghetti.dm b/code/game/objects/items/food/spaghetti.dm index cab4a62a29f3b..bf1fca9332a08 100644 --- a/code/game/objects/items/food/spaghetti.dm +++ b/code/game/objects/items/food/spaghetti.dm @@ -249,3 +249,17 @@ tastes = list("noodles" = 5, "fried tofu" = 4, "lime" = 2, "peanut" = 3, "onion" = 2) foodtypes = GRAIN | VEGETABLES | NUTS | FRUIT crafting_complexity = FOOD_COMPLEXITY_4 + +/obj/item/food/spaghetti/carbonara + name = "spaghetti carbonara" + desc = "Silky eggs, crispy pork, cheesy bliss. Mamma mia!" + icon_state = "carbonara" + food_reagents = list( + /datum/reagent/consumable/nutriment = 10, + /datum/reagent/consumable/nutriment/protein = 6, + /datum/reagent/consumable/nutriment/vitamin = 4, + ) + tastes = list("spaghetti" = 1, "parmigiano reggiano" = 1, "guanciale" = 1) + foodtypes = GRAIN | MEAT | DAIRY + crafting_complexity = FOOD_COMPLEXITY_4 + crafted_food_buff = /datum/status_effect/food/speech/italian diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm index ec8eda8d3cfff..7b8c071b3a539 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm @@ -13,7 +13,7 @@ category = CAT_EGG /datum/crafting_recipe/food/omelette - name = "Omelette" + name = "Omelette du fromage" reqs = list( /obj/item/food/egg = 2, /obj/item/food/cheese/wedge = 2 diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm index 376c1d4f84509..c965526bcb1c6 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm @@ -604,6 +604,16 @@ result = /obj/item/food/cherrycupcake/blue category = CAT_PASTRY +/datum/crafting_recipe/food/jupitercupcake + name = "Jupiter-cup-cake" + reqs = list( + /obj/item/food/pastrybase = 1, + /obj/item/food/grown/mushroom/jupitercup = 1, + /datum/reagent/consumable/caramel = 3, + ) + result = /obj/item/food/jupitercupcake + category = CAT_PASTRY + /datum/crafting_recipe/food/honeybun name = "Honey bun" reqs = list( diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_spaghetti.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_spaghetti.dm index 589235eacb70c..1af5651624d71 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_spaghetti.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_spaghetti.dm @@ -157,3 +157,15 @@ ) result = /obj/item/food/spaghetti/pad_thai category = CAT_SPAGHETTI + +/datum/crafting_recipe/food/carbonara + name = "Spaghetti Carbonara" + reqs = list( + /obj/item/food/spaghetti/boiledspaghetti = 1, + /obj/item/food/cheese/firm_cheese_slice = 1, + /obj/item/food/meat/bacon = 1, + /obj/item/food/egg = 1, + /datum/reagent/consumable/blackpepper = 2, + ) + result = /obj/item/food/spaghetti/carbonara + category = CAT_SPAGHETTI diff --git a/icons/hud/screen_alert.dmi b/icons/hud/screen_alert.dmi index dda7d6cc635af..10d0b741f0b7c 100644 Binary files a/icons/hud/screen_alert.dmi and b/icons/hud/screen_alert.dmi differ diff --git a/icons/obj/food/food.dmi b/icons/obj/food/food.dmi index 9ad8d3235e1f0..683260704f503 100644 Binary files a/icons/obj/food/food.dmi and b/icons/obj/food/food.dmi differ diff --git a/icons/obj/food/spaghetti.dmi b/icons/obj/food/spaghetti.dmi index 1c97a45e7b788..0d5e473e9b4b6 100644 Binary files a/icons/obj/food/spaghetti.dmi and b/icons/obj/food/spaghetti.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 71734a11472a6..bcc589c45eeb4 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1853,7 +1853,6 @@ #include "code\datums\status_effects\agent_pinpointer.dm" #include "code\datums\status_effects\buffs.dm" #include "code\datums\status_effects\drug_effects.dm" -#include "code\datums\status_effects\food_effects.dm" #include "code\datums\status_effects\gas.dm" #include "code\datums\status_effects\grouped_effect.dm" #include "code\datums\status_effects\limited_effect.dm" @@ -1868,9 +1867,11 @@ #include "code\datums\status_effects\buffs\bioware\cortex.dm" #include "code\datums\status_effects\buffs\bioware\ligaments.dm" #include "code\datums\status_effects\buffs\bioware\nerves.dm" +#include "code\datums\status_effects\buffs\food\_food_effect.dm" #include "code\datums\status_effects\buffs\food\chilling.dm" -#include "code\datums\status_effects\buffs\food\food_traits.dm" +#include "code\datums\status_effects\buffs\food\grant_trait.dm" #include "code\datums\status_effects\buffs\food\haste.dm" +#include "code\datums\status_effects\buffs\food\speech.dm" #include "code\datums\status_effects\debuffs\blindness.dm" #include "code\datums\status_effects\debuffs\choke.dm" #include "code\datums\status_effects\debuffs\confusion.dm" diff --git a/tgui/packages/tgui/interfaces/PersonalCrafting.tsx b/tgui/packages/tgui/interfaces/PersonalCrafting.tsx index c8c80c173e645..f4c4cd8bf0ed9 100644 --- a/tgui/packages/tgui/interfaces/PersonalCrafting.tsx +++ b/tgui/packages/tgui/interfaces/PersonalCrafting.tsx @@ -137,6 +137,7 @@ type Recipe = { structures: string[]; steps: string[]; foodtypes: string[]; + has_food_effect: BooleanLike; }; type Diet = { @@ -792,10 +793,16 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => { - + {item.name} {item.desc && {item.desc}} + {!!item.has_food_effect && ( + + + Special effect on consumption. + + )} {item.reqs && (