From 3ced7d03371c4b64b1a2e9a07e95efa34bbdc183 Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Thu, 28 Mar 2024 00:07:19 +0300 Subject: [PATCH 01/43] draft --- Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt diff --git a/Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt b/Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt new file mode 100644 index 00000000000..e69de29bb2d From a147065dd1f4bacda217d530ad09de59ee110dac Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 27 Mar 2024 23:23:19 +0200 Subject: [PATCH 02/43] Food System --- .../Body/Components/StomachComponent.cs | 14 +- .../Nutrition/Components/FoodComponent.cs | 35 ++++ .../Nutrition/EntitySystems/FoodSystem.cs | 156 ++++++++++++++++++ .../en-US/_NF/flavors/flavor-profiles.ftl | 1 + Resources/Locale/en-US/_NF/reagents/foods.ftl | 5 +- .../en-US/_NF/reagents/physical-desc.ftl | 1 + 6 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/flavors/flavor-profiles.ftl create mode 100644 Resources/Locale/en-US/_NF/reagents/physical-desc.ftl diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index fe93468f74e..821f4e7afaf 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -1,4 +1,4 @@ -using Content.Server.Body.Systems; +using Content.Server.Body.Systems; using Content.Server.Nutrition.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; @@ -64,5 +64,17 @@ public ReagentDelta(ReagentQuantity reagentQuantity) public void Increment(float delta) => Lifetime += delta; } + + /// + /// Frontier - Used by goblin for fliping the food quility effects + /// + [DataField] + public bool ReverseFoodQuality; + + /// + /// Frontier - Allow eating trash + /// + [DataField] + public bool TrashDigestion; } } diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 5ead67a12b2..25e4f3a0c95 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -7,6 +7,30 @@ namespace Content.Server.Nutrition.Components; +public enum Quality : byte // Frontier +{ + High, + Normal, + Junk, + Nasty, + Toxin, + Trash, + MailOpened, + MailClosed +} + +public enum FinalQuality : byte // Frontier +{ + High, + Normal, + Junk, + Nasty, + Toxin, + Trash, + MailOpened, + MailClosed +} + [RegisterComponent, Access(typeof(FoodSystem))] public sealed partial class FoodComponent : Component { @@ -74,4 +98,15 @@ public sealed partial class FoodComponent : Component /// [DataField, ViewVariables(VVAccess.ReadWrite)] public bool RequireDead = true; + + /// + /// Frontier - Nasty food, used for goblins to know if they can eat it or not + /// + [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier + public Quality Quality = Quality.Normal; + + /// + /// Frontier - Edited by the system to find the final quility results + /// + public FinalQuality FinalQuality = FinalQuality.Normal; } diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 2b627151339..ced6e5c0656 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -30,6 +30,12 @@ using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; using System.Linq; +using Content.Server.Medical; // Frontier +using Content.Shared.Speech.EntitySystems; // Frontier +using Robust.Shared.Random; // Frontier +using Content.Shared.Jittering; // Frontier +using Content.Server.Chat.Systems; // Frontier +using Content.Shared.Tag; // Frontier namespace Content.Server.Nutrition.EntitySystems; @@ -54,6 +60,12 @@ public sealed class FoodSystem : EntitySystem [Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly StomachSystem _stomach = default!; [Dependency] private readonly UtensilSystem _utensil = default!; + [Dependency] private readonly VomitSystem _vomit = default!; // Frontier + [Dependency] private readonly SharedStutteringSystem _stuttering = default!; // Frontier + [Dependency] protected readonly IRobustRandom RobustRandom = default!; // Frontier + [Dependency] private readonly SharedJitteringSystem _jittering = default!; // Frontier + [Dependency] private readonly ChatSystem _chat = default!; // Frontier + [Dependency] private readonly TagSystem _tag = default!; // Frontier public const float MaxFeedDistance = 1.0f; @@ -230,6 +242,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg // Get the stomach with the highest available solution volume var highestAvailable = FixedPoint2.Zero; StomachComponent? stomachToUse = null; + var reverseFoodQuality = false; // Frontier foreach (var (stomach, _) in stomachs) { var owner = stomach.Owner; @@ -244,6 +257,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg stomachToUse = stomach; highestAvailable = stomachSol.AvailableVolume; + reverseFoodQuality = stomachToUse.ReverseFoodQuality; // Frontier } // No stomach so just popup a message that they can't eat. @@ -257,6 +271,143 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _reaction.DoEntityReaction(args.Target.Value, solution, ReactionMethod.Ingestion); _stomach.TryTransferSolution(stomachToUse.Owner, split, stomachToUse); + /// Frontier - Goblin food system + if (entity.Comp.Quality == Quality.High) + entity.Comp.FinalQuality = FinalQuality.High; + else if (entity.Comp.Quality == Quality.Normal) + entity.Comp.FinalQuality = FinalQuality.Normal; + else if (entity.Comp.Quality == Quality.Junk) + entity.Comp.FinalQuality = FinalQuality.Junk; + else if (entity.Comp.Quality == Quality.Nasty) + entity.Comp.FinalQuality = FinalQuality.Nasty; + else if (entity.Comp.Quality == Quality.Toxin) + entity.Comp.FinalQuality = FinalQuality.Toxin; + else if (entity.Comp.Quality == Quality.Trash) + entity.Comp.FinalQuality = FinalQuality.Trash; + + if (reverseFoodQuality) + { + if (entity.Comp.Quality == Quality.High) + entity.Comp.FinalQuality = FinalQuality.Toxin; + else if (entity.Comp.Quality == Quality.Normal) + entity.Comp.FinalQuality = FinalQuality.Nasty; + else if (entity.Comp.Quality == Quality.Nasty) + entity.Comp.FinalQuality = FinalQuality.Normal; + else if (entity.Comp.Quality == Quality.Toxin) + entity.Comp.FinalQuality = FinalQuality.High; + } + + // TODO: Add detection for fried food on nasty to update it to toxin for goblins. + // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. + + string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid" }; + var speedRegent = "Stimulants"; + var damagingRegent = "Toxin"; + var emoteId = "Laugh"; + + TryComp(args.Target.Value, out var bloodStream); + + switch (entity.Comp.FinalQuality) + { + case FinalQuality.High: + if (reverseFoodQuality) + { + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood + } + else + { + + } + break; + case FinalQuality.Normal: + if (reverseFoodQuality) + { + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood + } + else + { + + } + break; + case FinalQuality.Junk: + if (reverseFoodQuality) + { + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 7), out _); // Add to blood + } + else + { + + } + break; + case FinalQuality.Nasty: + if (reverseFoodQuality) + { + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, damagingRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood + _stuttering.DoStutter(args.Target.Value, TimeSpan.FromSeconds(5), false); // Gives stuttering + _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 40f, 4f, true, null); + } + else + { + + } + break; + case FinalQuality.Toxin: + if (reverseFoodQuality) + { + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, damagingRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood + _stuttering.DoStutter(args.Target.Value, TimeSpan.FromSeconds(5), false); // Gives stuttering + _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 80f, 8f, true, null); + _chat.TryEmoteWithoutChat(args.Target.Value, emoteId); + + if (RobustRandom.Prob(.05f)) // 5% to puke + _vomit.Vomit(args.Target.Value); + } + else + { + + } + break; + case FinalQuality.Trash: + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood + break; + default: + throw new ArgumentOutOfRangeException($"No implemented mask radio behavior for {entity.Comp.Quality}!"); + } /// Frontier + var flavors = args.FlavorMessage; if (forceFeed) @@ -402,6 +553,11 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma // Run through the mobs' stomachs foreach (var (comp, _) in stomachs) { + // Frontier - Allow trash eating + if (!comp.TrashDigestion && component.Quality == Quality.Trash) + return false; + // Frontier - Allow trash eating + // Find a stomach with a SpecialDigestible if (comp.SpecialDigestible == null) continue; diff --git a/Resources/Locale/en-US/_NF/flavors/flavor-profiles.ftl b/Resources/Locale/en-US/_NF/flavors/flavor-profiles.ftl new file mode 100644 index 00000000000..24494b508e3 --- /dev/null +++ b/Resources/Locale/en-US/_NF/flavors/flavor-profiles.ftl @@ -0,0 +1 @@ +flavor-base-trashjuice = trashy diff --git a/Resources/Locale/en-US/_NF/reagents/foods.ftl b/Resources/Locale/en-US/_NF/reagents/foods.ftl index c4e85782ce8..bd9ed7bcfc9 100644 --- a/Resources/Locale/en-US/_NF/reagents/foods.ftl +++ b/Resources/Locale/en-US/_NF/reagents/foods.ftl @@ -1 +1,4 @@ -reagent-name-flaverol = Flaverol \ No newline at end of file +reagent-name-flaverol = Flaverol + +reagent-name-trashjuice = trash juices +reagent-desc-trashjuice = Do you really want to know what it is? diff --git a/Resources/Locale/en-US/_NF/reagents/physical-desc.ftl b/Resources/Locale/en-US/_NF/reagents/physical-desc.ftl new file mode 100644 index 00000000000..24bb74a5ea4 --- /dev/null +++ b/Resources/Locale/en-US/_NF/reagents/physical-desc.ftl @@ -0,0 +1 @@ +reagent-physical-desc-trashjuice = ... Wait.. Did it just move? From 199e72bf8e47b7f8e10582c5bcaa9dd1f319d904 Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 27 Mar 2024 23:25:18 +0200 Subject: [PATCH 03/43] Create fun.yml --- Resources/Prototypes/_NF/Reagents/fun.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Resources/Prototypes/_NF/Reagents/fun.yml diff --git a/Resources/Prototypes/_NF/Reagents/fun.yml b/Resources/Prototypes/_NF/Reagents/fun.yml new file mode 100644 index 00000000000..2aa9b87f761 --- /dev/null +++ b/Resources/Prototypes/_NF/Reagents/fun.yml @@ -0,0 +1,15 @@ +- type: reagent + id: TrashJuice + name: reagent-name-trashjuice + desc: reagent-desc-trashjuice + physicalDesc: reagent-physical-desc-trashjuice + flavor: sharp + color: "#767C00" +# metabolisms: +# Food: +# effects: +# - !type:SatiateHunger +# factor: 0 +# conditions: +# - !type:OrganType +# type: Goblin From d9862dbc1235adab9e884f29d2ff50ec79f3f117 Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Thu, 28 Mar 2024 00:31:15 +0300 Subject: [PATCH 04/43] food stuffs --- .../Objects/Consumable/Food/Baked/bread.yml | 5 +++- .../Objects/Consumable/Food/Baked/donut.yml | 2 ++ .../Objects/Consumable/Food/Baked/pie.yml | 6 +++++ .../Objects/Consumable/Food/Baked/pizza.yml | 2 ++ .../Objects/Consumable/Food/burger.yml | 27 +++++++++++++++++++ .../Objects/Consumable/Food/ingredients.yml | 2 ++ .../Objects/Consumable/Food/meals.yml | 5 ++++ .../Entities/Objects/Consumable/Food/meat.yml | 12 +++++++++ .../Objects/Consumable/Food/produce.yml | 2 ++ .../Objects/Consumable/Food/skewer.yml | 4 +++ .../Objects/Consumable/Food/snacks.yml | 14 ++++++++++ .../Entities/Objects/Consumable/Food/soup.yml | 2 ++ Resources/Prototypes/Reagents/toxins.yml | 9 +++++++ 13 files changed, 91 insertions(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml index 452f66c316a..9ba21939ab0 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml @@ -453,6 +453,7 @@ - cobwebs - bread - type: Food + quality: Toxin # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat @@ -475,7 +476,6 @@ tags: - Meat - Bread -# Tastes like bread, cobwebs. - type: entity name: spider meat bread slice @@ -488,6 +488,7 @@ - cobwebs - bread - type: Food + quality: Toxin # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat-slice @@ -800,6 +801,8 @@ Quantity: 4 - ReagentId: Mold Quantity: 7 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like decaying fungus. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml index e174f397347..de87dddf76a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml @@ -467,3 +467,5 @@ reagents: - ReagentId: Amatoxin Quantity: 10 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml index be96ee357bc..e7b814aa120 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml @@ -31,6 +31,8 @@ - type: Tag tags: - Pie + - type: Food # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: entity parent: FoodInjectableBase # Not sliceable @@ -56,6 +58,8 @@ Quantity: 1 - ReagentId: Flavorol Quantity: 1.5 + - type: Food # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System # Pie @@ -434,6 +438,8 @@ Quantity: 4 - ReagentId: Flavorol Quantity: 6 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like pie, mushrooms. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml index 2d5ae0e2823..e225debe943 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml @@ -11,6 +11,7 @@ - oily - bread - type: Food + quality: High # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/pizza.rsi - type: SolutionContainerManager @@ -43,6 +44,7 @@ - oily - bread - type: Food + quality: Toxin # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/pizza.rsi - type: SolutionContainerManager diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml index 9d87fce4352..d17d1d7215d 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml @@ -32,6 +32,7 @@ - bun - meaty - type: Food + quality: High # Frontier, New Food Quality System transferAmount: 5 - type: Sprite sprite: Objects/Consumable/Food/burger.rsi @@ -96,6 +97,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like bun, grass. - type: entity @@ -124,6 +127,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System # Tastes like bun, bacon. - type: entity @@ -154,6 +159,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System - type: entity name: bearger @@ -183,6 +190,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System - type: entity name: big bite burger @@ -300,6 +309,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System # TODO: Make this work. # - type: Sprite # state: plate @@ -370,6 +381,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: corger #not curger @@ -455,6 +468,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: duck sandwich # Burger for you sick bastards @@ -526,6 +541,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System # Tastes like bun, fish. - type: entity @@ -614,6 +631,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: McGuffin @@ -705,6 +724,8 @@ Quantity: 1 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like . - type: entity @@ -735,6 +756,8 @@ - type: Tag tags: - Meat + - type: Food + quality: Normal # Frontier, New Food Quality System - type: entity name: rat burger @@ -764,6 +787,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like bun, HEAT. - type: entity @@ -936,6 +961,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like bun, acid. # Note: I would put a bunch of colored burgers here as listed in the tg .dm but diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml index 1df6615a9fb..aa38b2d81f7 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml @@ -619,6 +619,8 @@ - type: Tag tags: - Trash + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: cocoa beans diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml index 1ec52c28893..58e48364afb 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml @@ -13,6 +13,7 @@ - type: Item storedRotation: -90 - type: Food + quality: High # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/meals.rsi - type: SolutionContainerManager @@ -252,6 +253,8 @@ tags: - CubanCarp - Meat + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like fish, batter, hot peppers. - type: entity @@ -547,6 +550,8 @@ - type: Tag tags: - Meat + - type: Food # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # tastes exotic - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml index 167a0288e3f..a7f091a0c72 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml @@ -67,6 +67,8 @@ entity: FoodMeatRotten # once it would say bloated, turn into the rotten prototype stage: 1 + - type: Food + quality: Nasty # Frontier, New Food Quality System # bruh - type: Tag @@ -154,6 +156,8 @@ reagents: - ReagentId: CarpoToxin Quantity: 5 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw bacon @@ -455,6 +459,8 @@ Quantity: 4 - ReagentId: Fat Quantity: 4 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw spider meat @@ -554,6 +560,8 @@ - type: SliceableFood count: 3 slice: FoodMeatXenoCutlet + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw rouny meat @@ -1247,6 +1255,8 @@ reagents: - ReagentId: SulfuricAcid Quantity: 20 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw killer tomato cutlet @@ -1469,3 +1479,5 @@ Quantity: 1 - ReagentId: Protein Quantity: 1 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index bf9717bd56c..0349ff08f92 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -1392,6 +1392,8 @@ - type: Extractable grindableSolutionName: food - type: BadFood + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: gatfruit diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml index 29f865e6362..2e6dd248cf6 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml @@ -128,6 +128,8 @@ Quantity: 2 - ReagentId: Flavorol Quantity: 5 + - type: Food + quality: Nasty # Frontier, New Food Quality System - type: entity name: double rat kebab @@ -150,6 +152,8 @@ Quantity: 6 - ReagentId: Flavorol Quantity: 10 + - type: Food + quality: Nasty # Frontier, New Food Quality System - type: entity name: fiesta kebab diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index 20c3003f2df..b119a611298 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -7,6 +7,7 @@ abstract: true components: - type: Food + quality: Junk # Frontier, New Food Quality System - type: Tag tags: - FoodSnack @@ -478,6 +479,19 @@ - type: SpaceGarbage - type: StaticPrice price: 1 + - type: FlavorProfile # Frontier, Goblins + flavors: # Frontier, Goblins + - funny # Frontier, Goblins + - type: Food # Frontier, Goblins + quality: Trash # Frontier, New Food Quality System +# requiresSpecialDigestion: true # Frontier, Goblins + - type: SolutionContainerManager # Frontier + solutions: # Frontier + food: # Frontier + maxVol: 1 # Frontier + reagents: # Frontier + - ReagentId: TrashJuice # Frontier + Quantity: 1 # Frontier - type: entity noSpawn: true diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml index 8ad8343f5cc..564580efbd5 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml @@ -603,6 +603,8 @@ Quantity: 6 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Soup - type: entity diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml index 18d47932740..f7d312cd098 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -111,6 +111,9 @@ Poison: effects: - !type:HealthChange + conditions: + - !type:OrganType + type: Human damage: types: Poison: 1 @@ -502,6 +505,12 @@ shouldHave: false reagent: Protein amount: 0.5 + - !type:AdjustReagent # Frontier: Goblin + conditions: # Frontier: Goblin + - !type:OrganType # Frontier: Goblin + type: Goblin # Frontier: Goblin + reagent: Protein # Frontier: Goblin + amount: 0.5 # Frontier: Goblin - type: reagent id: Allicin From 2fca6436deda2b1abb51e3a9f299aee4dff1416b Mon Sep 17 00:00:00 2001 From: ErhardSteinhauer <65374927+ErhardSteinhauer@users.noreply.github.com> Date: Thu, 28 Mar 2024 00:32:26 +0300 Subject: [PATCH 05/43] there_do_be_goblins.txt --- Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt diff --git a/Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt b/Resources/Prototypes/_NF/Entities/Mobs/there_do_be_goblins.txt deleted file mode 100644 index e69de29bb2d..00000000000 From 142b1a3106b573398dfbf125a60c9439c81f727d Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Thu, 28 Mar 2024 00:34:37 +0300 Subject: [PATCH 06/43] revert changes to toxins.yml --- Resources/Prototypes/Reagents/toxins.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml index f7d312cd098..18d47932740 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -111,9 +111,6 @@ Poison: effects: - !type:HealthChange - conditions: - - !type:OrganType - type: Human damage: types: Poison: 1 @@ -505,12 +502,6 @@ shouldHave: false reagent: Protein amount: 0.5 - - !type:AdjustReagent # Frontier: Goblin - conditions: # Frontier: Goblin - - !type:OrganType # Frontier: Goblin - type: Goblin # Frontier: Goblin - reagent: Protein # Frontier: Goblin - amount: 0.5 # Frontier: Goblin - type: reagent id: Allicin From 03ce1a69dae48949ac824b10d3c85f6fbae44d57 Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 27 Mar 2024 23:50:23 +0200 Subject: [PATCH 07/43] Update pie.yml --- .../Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml index e7b814aa120..8f00a5645ac 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml @@ -25,14 +25,13 @@ - ReagentId: Flavorol Quantity: 11 - type: Food #All pies here made with a pie tin; unless you're some kind of savage, you're probably not destroying this when you eat or slice the pie! + quality: High # Frontier, New Food Quality System trash: FoodPlateTin - type: SliceableFood count: 4 - type: Tag tags: - Pie - - type: Food # Frontier, New Food Quality System - quality: High # Frontier, New Food Quality System - type: entity parent: FoodInjectableBase # Not sliceable From 0c821134849f5fcdb41a3e29333d4e18351d0278 Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Thu, 28 Mar 2024 00:56:46 +0300 Subject: [PATCH 08/43] mail things --- .../Entities/Objects/Specific/Mail/base_mail.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index 73a75cae24d..fd52b33e07d 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -94,14 +94,14 @@ types: Blunt: 10 - type: CargoSellBlacklist - - type: Food # Frontier - Moth food - requiresSpecialDigestion: true + - type: Food # Frontier + quality: Trash # Frontier, New Food Quality System - type: SolutionContainerManager solutions: food: maxVol: 1 reagents: - - ReagentId: Nothing + - ReagentId: TrashJuice Quantity: 1 # This empty parcel is allowed to exist and evade the tests for the admin From 06c29ad9df94991c8bf08c443286e0e41b6c3946 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:36:38 +0300 Subject: [PATCH 09/43] Update StomachComponent.cs --- Content.Server/Body/Components/StomachComponent.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 821f4e7afaf..e414fba5693 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -76,5 +76,11 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// [DataField] public bool TrashDigestion; + + /// + /// Frontier - Allow eating fiber like food (Moth food) + /// + [DataField] + public bool FiberDigestion; } } From 85538a277ee41bb32d82eb373aca2ced635b3b2e Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:37:05 +0300 Subject: [PATCH 10/43] Update FoodComponent.cs --- Content.Server/Nutrition/Components/FoodComponent.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 25e4f3a0c95..6e596c7f200 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -15,8 +15,7 @@ public enum Quality : byte // Frontier Nasty, Toxin, Trash, - MailOpened, - MailClosed + Fiber } public enum FinalQuality : byte // Frontier @@ -27,8 +26,7 @@ public enum FinalQuality : byte // Frontier Nasty, Toxin, Trash, - MailOpened, - MailClosed + Fiber } [RegisterComponent, Access(typeof(FoodSystem))] From c4e7c52d91292e1d73ef9a667c3e4a39460d5aaa Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:37:59 +0300 Subject: [PATCH 11/43] Update StomachComponent.cs --- Content.Server/Body/Components/StomachComponent.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index e414fba5693..ffe24461288 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -82,5 +82,11 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// [DataField] public bool FiberDigestion; + + /// + /// Frontier - Allow eating mail TODO: Move this to a switch before fully added. + /// + [DataField] + public bool MailDigestion; } } From a41995adc6d7a6fc075ff998a44d5f2841d7df04 Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 3 May 2024 15:45:27 +0300 Subject: [PATCH 12/43] Food System Multi types support --- .../Nutrition/Components/FoodComponent.cs | 31 +--- .../Nutrition/EntitySystems/FoodSystem.cs | 142 +++++++++--------- 2 files changed, 73 insertions(+), 100 deletions(-) diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 6e596c7f200..e6a44116b11 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -5,29 +5,9 @@ using Robust.Shared.Audio; using Robust.Shared.Prototypes; -namespace Content.Server.Nutrition.Components; - -public enum Quality : byte // Frontier -{ - High, - Normal, - Junk, - Nasty, - Toxin, - Trash, - Fiber -} +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; -public enum FinalQuality : byte // Frontier -{ - High, - Normal, - Junk, - Nasty, - Toxin, - Trash, - Fiber -} +namespace Content.Server.Nutrition.Components; [RegisterComponent, Access(typeof(FoodSystem))] public sealed partial class FoodComponent : Component @@ -100,11 +80,12 @@ public sealed partial class FoodComponent : Component /// /// Frontier - Nasty food, used for goblins to know if they can eat it or not /// - [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier - public Quality Quality = Quality.Normal; + [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier + public string[] Quality = { "Normal" }; /// /// Frontier - Edited by the system to find the final quility results /// - public FinalQuality FinalQuality = FinalQuality.Normal; + [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier + public string FinalQuality = "Normal"; } diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 5fe1b57b11c..f1395aacbfa 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -271,45 +271,51 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _reaction.DoEntityReaction(args.Target.Value, solution, ReactionMethod.Ingestion); _stomach.TryTransferSolution(stomachToUse.Owner, split, stomachToUse); - /// Frontier - Goblin food system - if (entity.Comp.Quality == Quality.High) - entity.Comp.FinalQuality = FinalQuality.High; - else if (entity.Comp.Quality == Quality.Normal) - entity.Comp.FinalQuality = FinalQuality.Normal; - else if (entity.Comp.Quality == Quality.Junk) - entity.Comp.FinalQuality = FinalQuality.Junk; - else if (entity.Comp.Quality == Quality.Nasty) - entity.Comp.FinalQuality = FinalQuality.Nasty; - else if (entity.Comp.Quality == Quality.Toxin) - entity.Comp.FinalQuality = FinalQuality.Toxin; - else if (entity.Comp.Quality == Quality.Trash) - entity.Comp.FinalQuality = FinalQuality.Trash; - - if (reverseFoodQuality) + /// Frontier - Food quality system + var foodQuality = entity.Comp.Quality; + var foodFinalQuality = entity.Comp.FinalQuality; + + foreach (var quality in foodQuality) { - if (entity.Comp.Quality == Quality.High) - entity.Comp.FinalQuality = FinalQuality.Toxin; - else if (entity.Comp.Quality == Quality.Normal) - entity.Comp.FinalQuality = FinalQuality.Nasty; - else if (entity.Comp.Quality == Quality.Nasty) - entity.Comp.FinalQuality = FinalQuality.Normal; - else if (entity.Comp.Quality == Quality.Toxin) - entity.Comp.FinalQuality = FinalQuality.High; - } + if (quality == null) + continue; + else if (quality == "High") + foodFinalQuality = "High"; + else if (quality == "Normal") + foodFinalQuality = "Normal"; + else if (quality == "Junk") + foodFinalQuality = "Junk"; + else if (quality == "Nasty") + foodFinalQuality = "Nasty"; + else if (quality == "Toxin") + foodFinalQuality = "Toxin"; + else if (quality == "Trash") + foodFinalQuality = "Trash"; + + if (reverseFoodQuality) + { + if (quality == "High") + foodFinalQuality = "Toxin"; + else if (quality == "Normal") + foodFinalQuality = "Nasty"; + else if (quality == "Nasty") + foodFinalQuality = "Normal"; + else if (quality == "Toxin") + foodFinalQuality = "High"; + } - // TODO: Add detection for fried food on nasty to update it to toxin for goblins. - // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. + // TODO: Add detection for fried food on nasty to update it to toxin for goblins. + // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. - string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid" }; - var speedRegent = "Stimulants"; - var damagingRegent = "Toxin"; - var emoteId = "Laugh"; + string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid" }; + var speedRegent = "Stimulants"; + var damagingRegent = "Toxin"; + var emoteId = "Laugh"; - TryComp(args.Target.Value, out var bloodStream); + TryComp(args.Target.Value, out var bloodStream); - switch (entity.Comp.FinalQuality) - { - case FinalQuality.High: + if (foodFinalQuality == "High") + { if (reverseFoodQuality) { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) @@ -321,12 +327,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood } - else - { - - } - break; - case FinalQuality.Normal: + } + else if (foodFinalQuality == "Normal") + { if (reverseFoodQuality) { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) @@ -338,12 +341,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood } - else - { - - } - break; - case FinalQuality.Junk: + } + else if (foodFinalQuality == "Junk") + { if (reverseFoodQuality) { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) @@ -355,12 +355,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 7), out _); // Add to blood } - else - { - - } - break; - case FinalQuality.Nasty: + } + else if (foodFinalQuality == "Nasty") + { if (reverseFoodQuality) { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) @@ -370,12 +367,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _stuttering.DoStutter(args.Target.Value, TimeSpan.FromSeconds(5), false); // Gives stuttering _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 40f, 4f, true, null); } - else - { - - } - break; - case FinalQuality.Toxin: + } + else if (foodFinalQuality == "Toxin") + { if (reverseFoodQuality) { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) @@ -389,24 +383,22 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg if (RobustRandom.Prob(.05f)) // 5% to puke _vomit.Vomit(args.Target.Value); } - else - { - - } - break; - case FinalQuality.Trash: - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + } + else if (foodFinalQuality == "Trash") + { + if (reverseFoodQuality) { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood - break; - default: - throw new ArgumentOutOfRangeException($"No implemented mask radio behavior for {entity.Comp.Quality}!"); - } /// Frontier + } + } var flavors = args.FlavorMessage; @@ -554,7 +546,7 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma foreach (var (comp, _) in stomachs) { // Frontier - Allow trash eating - if (!comp.TrashDigestion && component.Quality == Quality.Trash) + if (!comp.TrashDigestion && component.Quality.Contains("Trash")) return false; // Frontier - Allow trash eating From 9693762adf2109353716bb5c83ed8333912b8a8a Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Fri, 3 May 2024 15:46:04 +0300 Subject: [PATCH 13/43] trash eating gob stomach --- Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml index b514153338b..03efefb646a 100644 --- a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml +++ b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml @@ -134,6 +134,8 @@ - ReagentId: UncookedAnimalProteins Quantity: 5 - type: Stomach + reverseFoodQuality: true + trashDigestion: true - type: Metabolizer maxReagents: 3 metabolizerTypes: [ Animal ] # [ Goblin ] From fe792f79d1e8223c2264f168b27772a56fb38fa0 Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 3 May 2024 15:49:24 +0300 Subject: [PATCH 14/43] Update FoodSystem.cs --- .../Nutrition/EntitySystems/FoodSystem.cs | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index f1395aacbfa..90a5cf2daf6 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -273,35 +273,34 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg /// Frontier - Food quality system var foodQuality = entity.Comp.Quality; - var foodFinalQuality = entity.Comp.FinalQuality; foreach (var quality in foodQuality) { if (quality == null) continue; else if (quality == "High") - foodFinalQuality = "High"; + entity.Comp.FinalQuality = "High"; else if (quality == "Normal") - foodFinalQuality = "Normal"; + entity.Comp.FinalQuality = "Normal"; else if (quality == "Junk") - foodFinalQuality = "Junk"; + entity.Comp.FinalQuality = "Junk"; else if (quality == "Nasty") - foodFinalQuality = "Nasty"; + entity.Comp.FinalQuality = "Nasty"; else if (quality == "Toxin") - foodFinalQuality = "Toxin"; + entity.Comp.FinalQuality = "Toxin"; else if (quality == "Trash") - foodFinalQuality = "Trash"; + entity.Comp.FinalQuality = "Trash"; if (reverseFoodQuality) { if (quality == "High") - foodFinalQuality = "Toxin"; + entity.Comp.FinalQuality = "Toxin"; else if (quality == "Normal") - foodFinalQuality = "Nasty"; + entity.Comp.FinalQuality = "Nasty"; else if (quality == "Nasty") - foodFinalQuality = "Normal"; + entity.Comp.FinalQuality = "Normal"; else if (quality == "Toxin") - foodFinalQuality = "High"; + entity.Comp.FinalQuality = "High"; } // TODO: Add detection for fried food on nasty to update it to toxin for goblins. @@ -314,7 +313,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg TryComp(args.Target.Value, out var bloodStream); - if (foodFinalQuality == "High") + if (entity.Comp.FinalQuality == "High") { if (reverseFoodQuality) { @@ -328,7 +327,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood } } - else if (foodFinalQuality == "Normal") + else if (entity.Comp.FinalQuality == "Normal") { if (reverseFoodQuality) { @@ -342,7 +341,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood } } - else if (foodFinalQuality == "Junk") + else if (entity.Comp.FinalQuality == "Junk") { if (reverseFoodQuality) { @@ -356,7 +355,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 7), out _); // Add to blood } } - else if (foodFinalQuality == "Nasty") + else if (entity.Comp.FinalQuality == "Nasty") { if (reverseFoodQuality) { @@ -368,7 +367,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 40f, 4f, true, null); } } - else if (foodFinalQuality == "Toxin") + else if (entity.Comp.FinalQuality == "Toxin") { if (reverseFoodQuality) { @@ -384,7 +383,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _vomit.Vomit(args.Target.Value); } } - else if (foodFinalQuality == "Trash") + else if (entity.Comp.FinalQuality == "Trash") { if (reverseFoodQuality) { From bd8426884912c5780136094f53434df7318a9b4f Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 3 May 2024 16:11:24 +0300 Subject: [PATCH 15/43] Update FoodSystem.cs --- .../Nutrition/EntitySystems/FoodSystem.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 90a5cf2daf6..2bbe0085298 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -385,17 +385,14 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg } else if (entity.Comp.FinalQuality == "Trash") { - if (reverseFoodQuality) + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) { - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood } + if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood } } From a3cf9599775061de5c1b32420f8aaf57227fa56a Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Fri, 3 May 2024 16:37:48 +0300 Subject: [PATCH 16/43] more trash food --- .../Objects/Consumable/Food/frozen.yml | 4 ++-- .../Objects/Consumable/Food/produce.yml | 4 ++-- .../Objects/Consumable/Food/snacks.yml | 15 +-------------- .../Prototypes/Entities/Objects/Misc/box.yml | 2 +- .../Entities/Objects/Misc/candles.yml | 2 +- .../Entities/Objects/Misc/spaceshroom.yml | 6 ++++++ .../Objects/Consumable/Food/spoiled.yml | 4 ++++ .../Entities/Objects/Consumable/Food/trash.yml | 18 ++++++++++++++++++ .../Objects/Consumable/Food/meat_goblin.yml | 4 ++-- 9 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml index c760e5e3ebb..96365536aef 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml @@ -251,7 +251,7 @@ - type: entity name: paper cone - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: FoodFrozenSnowconeTrash description: A crumpled paper cone used for an icy treat. Worthless. components: @@ -264,7 +264,7 @@ - type: entity name: popsicle stick - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: FoodFrozenPopsicleTrash description: Once held a delicious treat. Now, 'tis barren. components: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index ad4f49a0aa9..d862e265e09 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -301,7 +301,7 @@ - type: entity name: banana peel - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: TrashBananaPeel components: - type: Sprite @@ -946,7 +946,7 @@ - type: entity name: corn cob - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: FoodCornTrash description: Not a dang kernel left. components: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index 8aae72935bb..dffa508e8d8 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -460,7 +460,7 @@ - type: entity noSpawn: true - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: FoodPacketTrash description: This is rubbish. abstract: true @@ -480,19 +480,6 @@ - type: SpaceGarbage - type: StaticPrice price: 1 - - type: FlavorProfile # Frontier, Goblins - flavors: # Frontier, Goblins - - funny # Frontier, Goblins - - type: Food # Frontier, Goblins - quality: Trash # Frontier, New Food Quality System -# requiresSpecialDigestion: true # Frontier, Goblins - - type: SolutionContainerManager # Frontier - solutions: # Frontier - food: # Frontier - maxVol: 1 # Frontier - reagents: # Frontier - - ReagentId: TrashJuice # Frontier - Quantity: 1 # Frontier - type: entity noSpawn: true diff --git a/Resources/Prototypes/Entities/Objects/Misc/box.yml b/Resources/Prototypes/Entities/Objects/Misc/box.yml index edb1a812391..c46b0760b0b 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/box.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/box.yml @@ -1,6 +1,6 @@ - type: entity id: BoxBase - parent: BaseStorageItem + parent: [ BaseStorageItem, TrashSolutionInjector ] # Frontier abstract: true components: - type: Sprite diff --git a/Resources/Prototypes/Entities/Objects/Misc/candles.yml b/Resources/Prototypes/Entities/Objects/Misc/candles.yml index bef37e5fd08..f9c127461a9 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/candles.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/candles.yml @@ -1,6 +1,6 @@ - type: entity name: candle - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: Candle description: A thin wick threaded through fat. components: diff --git a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml index 9ec6ce0ed11..a55b535fa6c 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml @@ -5,6 +5,8 @@ suffix: Structure description: A cluster of wild mushrooms that likes to grow in dark, moist environments. components: + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Sprite sprite: Objects/Misc/spaceshroom.rsi state: structure @@ -45,6 +47,8 @@ id: FoodSpaceshroom description: A wild mushroom. There's no telling what effect it could have... components: + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Produce - type: Sprite sprite: Objects/Misc/spaceshroom.rsi @@ -103,6 +107,8 @@ id: FoodSpaceshroomCooked description: A wild mushroom that has been cooked through. It seems the heat has removed its chemical effects. components: + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: FlavorProfile flavors: - spaceshroomcooked diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml index 766fd9cfddc..f13159a28c5 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml @@ -6,6 +6,8 @@ description: "It's probably still edible, just need to scrape this thing off. And this one too. And this one." noSpawn: true components: + - type: Food + quality: Toxin - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi @@ -36,6 +38,8 @@ description: "It's probably still edible, just need to scrape this thing off. And this one too. And this one." noSpawn: true components: + - type: Food + quality: Toxin - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml new file mode 100644 index 00000000000..b0fdf72b1a7 --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml @@ -0,0 +1,18 @@ +- type: entity + noSpawn: true + id: TrashSolutionInjector + abstract: true + components: + - type: FlavorProfile + flavors: + - funny + - type: Food + quality: Trash +# requiresSpecialDigestion: true # Frontier, Goblins + - type: SolutionContainerManager + solutions: + food: + maxVol: 1 + reagents: + - ReagentId: TrashJuice + Quantity: 1 diff --git a/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml b/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml index af27157d276..5b586db46f0 100644 --- a/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml +++ b/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml @@ -7,5 +7,5 @@ - type: Sprite state: rotten color: lime -# - type: Food # Frontier, New Food Quality System -# quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System From 24c27e8237865e6c8063dd2ba3816bf67ca143c9 Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 3 May 2024 17:10:11 +0300 Subject: [PATCH 17/43] Food --- .../Nutrition/EntitySystems/FoodSystem.cs | 16 ++++++++++++++-- .../_NF/nutrition/components/food-component.ftl | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 2bbe0085298..8c99bf28465 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -273,6 +273,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg /// Frontier - Food quality system var foodQuality = entity.Comp.Quality; + //var showFlavors = true; // Frontier foreach (var quality in foodQuality) { @@ -311,6 +312,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg var damagingRegent = "Toxin"; var emoteId = "Laugh"; + //var msgNasty = Loc.GetString("food-system-nasty", ("used", args.Used), ("target", args.Target)); + //var msgToxin = Loc.GetString("food-system-toxin", ("used", args.Used), ("target", args.Target)); + TryComp(args.Target.Value, out var bloodStream); if (entity.Comp.FinalQuality == "High") @@ -359,6 +363,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { if (reverseFoodQuality) { + //showFlavors = false; // Frontier + //_popup.PopupEntity(msgNasty, args.Target.Value, args.User); + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) @@ -371,6 +378,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { if (reverseFoodQuality) { + //showFlavors = false; // Frontier + //_popup.PopupEntity(msgToxin, args.Target.Value, args.User); + if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) @@ -402,7 +412,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { var targetName = Identity.Entity(args.Target.Value, EntityManager); var userName = Identity.Entity(args.User, EntityManager); - _popup.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), entity.Owner, entity.Owner); + //if (showFlavors) // Frontier + _popup.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), entity.Owner, entity.Owner); _popup.PopupEntity(Loc.GetString("food-system-force-feed-success-user", ("target", targetName)), args.User, args.User); @@ -411,7 +422,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg } else { - _popup.PopupEntity(Loc.GetString(entity.Comp.EatMessage, ("food", entity.Owner), ("flavors", flavors)), args.User, args.User); + //if (showFlavors) // Frontier + _popup.PopupEntity(Loc.GetString(entity.Comp.EatMessage, ("food", entity.Owner), ("flavors", flavors)), args.User, args.User); // log successful voluntary eating _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(entity.Owner):food}"); diff --git a/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl b/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl new file mode 100644 index 00000000000..b01fc76648b --- /dev/null +++ b/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl @@ -0,0 +1,2 @@ +food-system-nasty = This food gross. +food-system-toxin = This food bad. From f890786734511d559ca0d9a0a9ba05a81a182526 Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 02:12:07 +0300 Subject: [PATCH 18/43] Allow goblin to eat open mail only --- .../Body/Components/StomachComponent.cs | 12 +++--- .../Nutrition/Components/FoodComponent.cs | 3 +- .../Nutrition/EntitySystems/FoodSystem.cs | 40 +++++++++++++------ Content.Server/Nyanotrasen/Mail/MailSystem.cs | 3 ++ .../Objects/Specific/Mail/base_mail.yml | 2 +- 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 2c3e4a14cea..01aa15ee070 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -74,24 +74,24 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// Frontier - Used by goblin for fliping the food quility effects /// [DataField] - public bool ReverseFoodQuality; + public bool ReverseFoodQuality = false; /// - /// Frontier - Allow eating trash + /// Frontier - Allow eating mail TODO: Move this to a switch before fully added. /// [DataField] - public bool TrashDigestion; + public bool MailDigestion = false; /// /// Frontier - Allow eating fiber like food (Moth food) /// [DataField] - public bool FiberDigestion; + public bool FiberDigestion = false; /// - /// Frontier - Allow eating mail TODO: Move this to a switch before fully added. + /// Frontier - Allow eating trash /// [DataField] - public bool MailDigestion; + public bool TrashDigestion = false; } } diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index e6a44116b11..479dfc8beae 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -4,12 +4,13 @@ using Content.Shared.FixedPoint; using Robust.Shared.Audio; using Robust.Shared.Prototypes; +using Content.Server.Mail; // Frontier using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; namespace Content.Server.Nutrition.Components; -[RegisterComponent, Access(typeof(FoodSystem))] +[RegisterComponent, Access(typeof(FoodSystem), typeof(MailSystem))] // Frontier public sealed partial class FoodComponent : Component { [DataField] diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 8c99bf28465..427bf5567fe 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -273,7 +273,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg /// Frontier - Food quality system var foodQuality = entity.Comp.Quality; - //var showFlavors = true; // Frontier + var showFlavors = true; foreach (var quality in foodQuality) { @@ -289,7 +289,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg entity.Comp.FinalQuality = "Nasty"; else if (quality == "Toxin") entity.Comp.FinalQuality = "Toxin"; - else if (quality == "Trash") + else if ((quality == "Trash") || (quality == "Mail") || (quality == "Fiber")) entity.Comp.FinalQuality = "Trash"; if (reverseFoodQuality) @@ -312,8 +312,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg var damagingRegent = "Toxin"; var emoteId = "Laugh"; - //var msgNasty = Loc.GetString("food-system-nasty", ("used", args.Used), ("target", args.Target)); - //var msgToxin = Loc.GetString("food-system-toxin", ("used", args.Used), ("target", args.Target)); + var msgNasty = Loc.GetString("food-system-nasty", ("used", args.Used), ("target", args.Target)); + var msgToxin = Loc.GetString("food-system-toxin", ("used", args.Used), ("target", args.Target)); TryComp(args.Target.Value, out var bloodStream); @@ -363,8 +363,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { if (reverseFoodQuality) { - //showFlavors = false; // Frontier - //_popup.PopupEntity(msgNasty, args.Target.Value, args.User); + showFlavors = false; + _popup.PopupEntity(msgNasty, args.Target.Value, args.User); if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood @@ -378,8 +378,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { if (reverseFoodQuality) { - //showFlavors = false; // Frontier - //_popup.PopupEntity(msgToxin, args.Target.Value, args.User); + showFlavors = false; + _popup.PopupEntity(msgToxin, args.Target.Value, args.User); if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood @@ -405,6 +405,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood } } + /// Frontier - Food quality system end var flavors = args.FlavorMessage; @@ -412,7 +413,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { var targetName = Identity.Entity(args.Target.Value, EntityManager); var userName = Identity.Entity(args.User, EntityManager); - //if (showFlavors) // Frontier + if (showFlavors) // Frontier _popup.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), entity.Owner, entity.Owner); _popup.PopupEntity(Loc.GetString("food-system-force-feed-success-user", ("target", targetName)), args.User, args.User); @@ -422,7 +423,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg } else { - //if (showFlavors) // Frontier + if (showFlavors) // Frontier _popup.PopupEntity(Loc.GetString(entity.Comp.EatMessage, ("food", entity.Owner), ("flavors", flavors)), args.User, args.User); // log successful voluntary eating @@ -553,10 +554,23 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma // Run through the mobs' stomachs foreach (var (comp, _) in stomachs) { - // Frontier - Allow trash eating - if (!comp.TrashDigestion && component.Quality.Contains("Trash")) + // Frontier - Food system hack job + var foodQuality = component.Quality; + var allowEating = true; + foreach (var quality in foodQuality) + { + if (!comp.MailDigestion && quality == "Mail") + allowEating = true; + else if (!comp.FiberDigestion && quality == "Fiber") + allowEating = true; + else if (!comp.TrashDigestion && quality == "Trash") + allowEating = true; + else + allowEating = false; + } + if (allowEating) return false; - // Frontier - Allow trash eating + // Frontier - Food system hack job // Find a stomach with a SpecialDigestible if (comp.SpecialDigestible == null) diff --git a/Content.Server/Nyanotrasen/Mail/MailSystem.cs b/Content.Server/Nyanotrasen/Mail/MailSystem.cs index ffb173acdf4..baff5801405 100644 --- a/Content.Server/Nyanotrasen/Mail/MailSystem.cs +++ b/Content.Server/Nyanotrasen/Mail/MailSystem.cs @@ -735,6 +735,9 @@ public void OpenMail(EntityUid uid, MailComponent? component = null, EntityUid? _handsSystem.PickupOrDrop(user, entity); } + if (TryComp(uid, out var food)) // Frontier + food.Quality = new string[] { "Mail", "Fiber", "Trash" }; + _tagSystem.AddTag(uid, "Trash"); _tagSystem.AddTag(uid, "Recyclable"); component.IsEnabled = false; diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index fd52b33e07d..a384ac9caad 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -95,7 +95,7 @@ Blunt: 10 - type: CargoSellBlacklist - type: Food # Frontier - quality: Trash # Frontier, New Food Quality System + quality: Mail # Frontier, New Food Quality System - type: SolutionContainerManager solutions: food: From 94294be53c25a6a363980115d6db5448ee1430ec Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Sat, 4 May 2024 03:53:47 +0300 Subject: [PATCH 19/43] yml fixes --- .../Prototypes/Body/Organs/Animal/animal.yml | 4 +- Resources/Prototypes/Body/Organs/human.yml | 4 +- Resources/Prototypes/Body/Parts/base.yml | 2 + .../Objects/Consumable/Food/Baked/bread.yml | 18 ++-- .../Objects/Consumable/Food/Baked/cake.yml | 3 + .../Objects/Consumable/Food/Baked/donut.yml | 4 +- .../Objects/Consumable/Food/Baked/pie.yml | 12 ++- .../Objects/Consumable/Food/Baked/pizza.yml | 5 +- .../Objects/Consumable/Food/burger.yml | 99 ++++++++++++++----- .../Entities/Objects/Consumable/Food/egg.yml | 3 +- .../Objects/Consumable/Food/frozen.yml | 1 + .../Objects/Consumable/Food/meals.yml | 6 +- .../Entities/Objects/Consumable/Food/meat.yml | 68 ++++++++++--- .../Objects/Consumable/Food/noodles.yml | 4 + .../Objects/Consumable/Food/produce.yml | 4 +- .../Objects/Consumable/Food/skewer.yml | 9 +- .../Objects/Consumable/Food/snacks.yml | 2 +- .../Entities/Objects/Consumable/Food/soup.yml | 7 +- .../_NF/Body/Organs/goblin_organs.yml | 31 +++--- .../Objects/Consumable/Food/Baked/misc.yml | 2 + .../Objects/Consumable/Food/burger.yml | 2 + .../Entities/Objects/Consumable/Food/meat.yml | 14 +++ .../Objects/Consumable/Food/produce.yml | 2 + .../Objects/Consumable/Food/spoiled.yml | 4 +- .../Objects/Consumable/Food/trash.yml | 3 +- .../Objects/Consumable/Food/meat_goblin.yml | 11 --- 26 files changed, 228 insertions(+), 96 deletions(-) delete mode 100644 Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml diff --git a/Resources/Prototypes/Body/Organs/Animal/animal.yml b/Resources/Prototypes/Body/Organs/Animal/animal.yml index 89acef82927..dd35b71709c 100644 --- a/Resources/Prototypes/Body/Organs/Animal/animal.yml +++ b/Resources/Prototypes/Body/Organs/Animal/animal.yml @@ -4,8 +4,8 @@ abstract: true components: - type: Organ - - type: Food -# quality: Nasty # Frontier + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier - type: Sprite sprite: Mobs/Species/Human/organs.rsi - type: StaticPrice diff --git a/Resources/Prototypes/Body/Organs/human.yml b/Resources/Prototypes/Body/Organs/human.yml index 6cd4996926a..b0bb6bbd357 100644 --- a/Resources/Prototypes/Body/Organs/human.yml +++ b/Resources/Prototypes/Body/Organs/human.yml @@ -6,8 +6,8 @@ - type: Sprite sprite: Mobs/Species/Human/organs.rsi - type: Organ - - type: Food -# quality: Nasty # Frontier + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier - type: Extractable grindableSolutionName: organ - type: SolutionContainerManager diff --git a/Resources/Prototypes/Body/Parts/base.yml b/Resources/Prototypes/Body/Parts/base.yml index 836d0f140af..e011d2ad2e3 100644 --- a/Resources/Prototypes/Body/Parts/base.yml +++ b/Resources/Prototypes/Body/Parts/base.yml @@ -6,6 +6,8 @@ name: "body part" abstract: true components: + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier - type: Damageable damageContainer: Biological - type: BodyPart diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml index 9ba21939ab0..0d29be7c156 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml @@ -10,6 +10,7 @@ flavors: - bread - type: Food + quality: [ "Normal" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/bread.rsi - type: Tag @@ -452,8 +453,8 @@ flavors: - cobwebs - bread - - type: Food - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat @@ -487,8 +488,8 @@ flavors: - cobwebs - bread - - type: Food - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat-slice @@ -574,7 +575,8 @@ flavors: - acid - bread - - type: Food + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: Sprite layers: - state: xenomeat @@ -737,6 +739,8 @@ id: FoodBreadGarlicSlice description: Alas, it is limited. components: + - type: Food # Frontier + quality: [ "High" ] # Frontier, New Food Quality System - type: FlavorProfile flavors: - bread @@ -801,8 +805,8 @@ Quantity: 4 - ReagentId: Mold Quantity: 7 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System # Tastes like decaying fungus. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml index 9cdf49c27eb..9234be5d719 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml @@ -10,6 +10,7 @@ flavors: - sweet - type: Food + quality: [ "High" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/cake.rsi - type: SolutionContainerManager @@ -165,6 +166,8 @@ state: brain - type: SliceableFood slice: FoodCakeBrainSlice + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml index de87dddf76a..9cea116a100 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml @@ -467,5 +467,5 @@ reagents: - ReagentId: Amatoxin Quantity: 10 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml index 019346c8b19..9af112171f3 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml @@ -25,7 +25,7 @@ - ReagentId: Flavorol Quantity: 11 - type: Food #All pies here made with a pie tin; unless you're some kind of savage, you're probably not destroying this when you eat or slice the pie! - quality: High # Frontier, New Food Quality System + quality: [ "High" ] # Frontier, New Food Quality System trash: FoodPlateTin - type: SliceableFood count: 4 @@ -57,8 +57,8 @@ Quantity: 1 - ReagentId: Flavorol Quantity: 1.5 - - type: Food # Frontier, New Food Quality System - quality: High # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "High" ] # Frontier, New Food Quality System # Pie @@ -330,6 +330,8 @@ tags: - Meat - Pie + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: slice of xeno pie @@ -349,6 +351,8 @@ tags: - Meat - Pie + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System # Tastes like pie, meat, acid. - type: entity @@ -440,7 +444,7 @@ - ReagentId: Flavorol Quantity: 6 - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + quality: [ "Toxin" ] # Frontier, New Food Quality System # Tastes like pie, mushrooms. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml index 9785e6d5113..6b7cf99ff20 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml @@ -11,7 +11,7 @@ - oily - bread - type: Food - quality: High # Frontier, New Food Quality System + quality: [ "High" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/pizza.rsi - type: SolutionContainerManager @@ -44,7 +44,6 @@ - oily - bread - type: Food - quality: Toxin # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/pizza.rsi - type: SolutionContainerManager @@ -555,4 +554,6 @@ Quantity: 2 - ReagentId: Vitamin Quantity: 1 + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System # Tastes like stale crust, rancid cheese, mushroom. diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml index d17d1d7215d..25897d49bec 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml @@ -31,8 +31,8 @@ flavors: - bun - meaty - - type: Food - quality: High # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "High" ] # Frontier, New Food Quality System transferAmount: 5 - type: Sprite sprite: Objects/Consumable/Food/burger.rsi @@ -97,8 +97,9 @@ - type: Tag tags: - Meat - - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, grass. - type: entity @@ -127,8 +128,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, bacon. - type: entity @@ -159,8 +161,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: bearger @@ -190,8 +193,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: big bite burger @@ -250,6 +254,9 @@ - type: Tag tags: - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, brains. - type: entity @@ -279,6 +286,9 @@ - type: Tag tags: - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: cheese burger @@ -309,8 +319,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # TODO: Make this work. # - type: Sprite # state: plate @@ -382,7 +393,7 @@ tags: - Meat - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + quality: [ "Nasty" ] # Frontier, New Food Quality System - type: entity name: corger #not curger @@ -437,6 +448,9 @@ - type: Tag tags: - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: crazy hamburger # Burger for you euro-cucks @@ -468,8 +482,9 @@ - type: Tag tags: - Meat - - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: duck sandwich # Burger for you sick bastards @@ -524,6 +539,9 @@ Quantity: 5 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, pure electricity. - type: entity @@ -541,8 +559,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, fish. - type: entity @@ -572,6 +591,9 @@ Quantity: 1 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, HEAT. - type: entity @@ -601,6 +623,9 @@ tags: - ClothMade - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, ectoplasm. - type: entity @@ -631,8 +656,9 @@ - type: Tag tags: - Meat - - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: McGuffin @@ -724,8 +750,9 @@ Quantity: 1 - ReagentId: Flavorol Quantity: 5 - - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like . - type: entity @@ -756,8 +783,9 @@ - type: Tag tags: - Meat - - type: Food - quality: Normal # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier - type: entity name: rat burger @@ -787,8 +815,9 @@ - type: Tag tags: - Meat - - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, HEAT. - type: entity @@ -816,6 +845,9 @@ - type: Tag tags: - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, lettuce, sludge. - type: entity @@ -843,6 +875,9 @@ Quantity: 4 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, redditors. - type: entity @@ -870,6 +905,9 @@ Quantity: 10 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, silver. - type: entity @@ -930,6 +968,9 @@ Quantity: 3 - ReagentId: Flavorol Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, tofu. - type: entity @@ -961,8 +1002,9 @@ - type: Tag tags: - Meat - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier # Tastes like bun, acid. # Note: I would put a bunch of colored burgers here as listed in the tg .dm but @@ -995,4 +1037,7 @@ - type: Tag tags: - Meat + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System + transferAmount: 5 # Frontier \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml index 8cd2fa70ee5..7cf33c3b317 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml @@ -11,6 +11,7 @@ - Egg - Meat - type: Food + quality: [ "Normal" ] # Frontier, New Food Quality System trash: Eggshells - type: Sprite sprite: Objects/Consumable/Food/egg.rsi @@ -71,7 +72,7 @@ # Splat - type: entity name: eggshells - parent: BaseItem + parent: [ BaseItem, TrashSolutionInjector ] # Frontier id: Eggshells description: You're walkin' on 'em bud. components: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml index 96365536aef..595763fbef8 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml @@ -7,6 +7,7 @@ abstract: true components: - type: Food + quality: [ "Normal" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/frozen.rsi - type: SolutionContainerManager diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml index 58e48364afb..7c3cd5b1742 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml @@ -13,7 +13,7 @@ - type: Item storedRotation: -90 - type: Food - quality: High # Frontier, New Food Quality System + quality: [ "High" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/meals.rsi - type: SolutionContainerManager @@ -254,7 +254,7 @@ - CubanCarp - Meat - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + quality: [ "Toxin" ] # Frontier, New Food Quality System # Tastes like fish, batter, hot peppers. - type: entity @@ -551,7 +551,7 @@ tags: - Meat - type: Food # Frontier, New Food Quality System - quality: Nasty # Frontier, New Food Quality System + quality: [ "Nasty" ] # Frontier, New Food Quality System # tastes exotic - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml index 2131668d529..b6e6cb5bc8a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml @@ -67,8 +67,8 @@ entity: FoodMeatRotten # once it would say bloated, turn into the rotten prototype stage: 1 - - type: Food - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System # bruh - type: Tag @@ -157,7 +157,7 @@ - ReagentId: CarpoToxin Quantity: 5 - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: raw bacon @@ -462,8 +462,8 @@ Quantity: 4 - ReagentId: Fat Quantity: 4 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: raw spider meat @@ -484,6 +484,8 @@ - type: SliceableFood count: 3 slice: FoodMeatSpiderCutlet + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: raw spider leg @@ -501,6 +503,8 @@ Quantity: 10 - ReagentId: Fat Quantity: 3 + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: meatwheat clump @@ -563,8 +567,8 @@ - type: SliceableFood count: 3 slice: FoodMeatXenoCutlet - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: raw rouny meat @@ -594,6 +598,8 @@ graph: RounySteak node: start defaultTarget: rouny steak + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: killer tomato meat @@ -632,6 +638,8 @@ damage: types: Blunt: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: meat clown @@ -743,6 +751,8 @@ - type: Construction graph: MeatSteak node: meat steak + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: bacon @@ -774,6 +784,8 @@ - type: Construction graph: Bacon node: bacon + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: cooked bear @@ -803,6 +815,8 @@ - type: Construction graph: BearSteak node: filet migrawr + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: penguin filet @@ -831,6 +845,8 @@ - type: Construction graph: PenguinSteak node: cooked penguin + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: cooked chicken @@ -859,6 +875,8 @@ - type: Construction graph: ChickenSteak node: cooked chicken + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: fried chicken @@ -887,6 +905,8 @@ Quantity: 5 - ReagentId: Protein Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: cooked duck @@ -915,6 +935,8 @@ - type: Construction graph: DuckSteak node: cooked duck + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: cooked crab @@ -943,6 +965,8 @@ - type: Construction graph: CrabSteak node: cooked crab + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: goliath steak @@ -969,6 +993,8 @@ - type: Construction graph: GoliathSteak node: goliath steak + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: rouny steak @@ -1028,6 +1054,8 @@ - type: Construction graph: LizardSteak node: lizard steak + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: boiled spider leg @@ -1071,6 +1099,8 @@ Quantity: 5 - ReagentId: Protein Quantity: 5 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System # Cutlets @@ -1263,8 +1293,8 @@ reagents: - ReagentId: SulfuricAcid Quantity: 20 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: raw killer tomato cutlet @@ -1301,6 +1331,8 @@ Quantity: 1 - ReagentId: Protein Quantity: 1 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System # Cooked @@ -1325,6 +1357,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: bear cutlet @@ -1350,6 +1384,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: penguin cutlet @@ -1373,6 +1409,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: chicken cutlet @@ -1396,6 +1434,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: duck cutlet @@ -1419,6 +1459,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: lizard cutlet @@ -1443,6 +1485,8 @@ Quantity: 2 - ReagentId: Protein Quantity: 2 + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: entity name: spider cutlet @@ -1465,6 +1509,8 @@ Quantity: 1 - ReagentId: Protein Quantity: 1 + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: xeno cutlet @@ -1487,5 +1533,5 @@ Quantity: 1 - ReagentId: Protein Quantity: 1 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml index 47a64a1fc7c..e13098745ab 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml @@ -7,6 +7,8 @@ abstract: true description: Now that's a nice pasta! components: + - type: Food # Frontier + quality: [ "High" ] # Frontier, New Food Quality System - type: Item storedRotation: -90 - type: Sprite @@ -28,6 +30,8 @@ id: FoodNoodlesBoiled description: A plain dish of noodles, this needs more ingredients. components: + - type: Food # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System - type: FlavorProfile flavors: - pasta diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index d862e265e09..45303d27c84 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -1429,8 +1429,8 @@ - type: Extractable grindableSolutionName: food - type: BadFood - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: gatfruit diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml index fac5904d29f..19ce2d38517 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml @@ -7,6 +7,7 @@ abstract: true components: - type: Food + quality: [ "Normal" ] # Frontier, New Food Quality System trash: FoodKebabSkewer - type: Sprite sprite: Objects/Consumable/Food/skewer.rsi @@ -128,8 +129,8 @@ Quantity: 2 - ReagentId: Flavorol Quantity: 5 - - type: Food - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System - type: entity name: double rat kebab @@ -152,8 +153,8 @@ Quantity: 6 - ReagentId: Flavorol Quantity: 10 - - type: Food - quality: Nasty # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System - type: entity name: fiesta kebab diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index dffa508e8d8..b1b347ae642 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -7,7 +7,7 @@ abstract: true components: - type: Food - quality: Junk # Frontier, New Food Quality System + quality: [ "Low" ] # Frontier, New Food Quality System - type: Tag tags: - FoodSnack diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml index 11e3b858f5e..50da376601c 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml @@ -8,6 +8,7 @@ - type: Item storedRotation: -90 - type: Food + quality: [ "High" ] # Frontier, New Food Quality System trash: FoodBowlBig utensil: Spoon - type: SolutionContainerManager @@ -603,8 +604,8 @@ Quantity: 6 - ReagentId: Flavorol Quantity: 5 - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System # Soup - type: entity @@ -1018,6 +1019,8 @@ tags: - Meat - Soup + - type: Food # Frontier + quality: [ "Nasty" ] # Frontier, New Food Quality System - type: entity name: miso soup diff --git a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml index 03efefb646a..20ae09bdf65 100644 --- a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml +++ b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml @@ -1,5 +1,14 @@ - type: entity - parent: OrganHumanBrain + id: BaseGoblinOrgan + parent: BaseHumanOrganUnGibbable + abstract: true + components: + - type: Gibbable + - type: Food + quality: [ "Toxin" ] + +- type: entity + parent: [ OrganHumanBrain, BaseGoblinOrgan ] id: OrganGoblinBrain name: brain suffix: Goblin @@ -21,7 +30,7 @@ - Meat - type: entity - parent: OrganHumanEyes + parent: [ OrganHumanEyes, BaseGoblinOrgan ] id: OrganGoblinEyes name: eyes suffix: Goblin @@ -33,7 +42,7 @@ - state: eyeball-r - type: entity - parent: OrganHumanTongue + parent: [ OrganHumanTongue, BaseGoblinOrgan ] id: OrganGoblinTongue name: tongue suffix: Goblin @@ -43,7 +52,7 @@ state: tongue - type: entity - parent: OrganHumanAppendix + parent: [ OrganHumanAppendix, BaseGoblinOrgan ] id: OrganGoblinAppendix name: appendix suffix: Goblin @@ -56,7 +65,7 @@ visible: false - type: entity - parent: OrganHumanEars + parent: [ OrganHumanEars, BaseGoblinOrgan ] id: OrganGoblinEars name: ears suffix: Goblin @@ -66,7 +75,7 @@ state: ears - type: entity - parent: BaseHumanOrgan + parent: BaseGoblinOrgan id: OrganGoblinLungs name: lungs suffix: Goblin @@ -102,7 +111,7 @@ Quantity: 5 - type: entity - parent: OrganHumanHeart + parent: [ OrganHumanHeart, BaseGoblinOrgan ] id: OrganGoblinHeart name: heart suffix: Goblin @@ -114,7 +123,7 @@ metabolizerTypes: [ Goblin ] - type: entity - parent: [ OrganHumanStomach, OrganAnimalStomach ] + parent: [ OrganHumanStomach, BaseGoblinOrgan, OrganAnimalStomach ] id: OrganGoblinStomach name: stomach suffix: Goblin @@ -149,7 +158,7 @@ - id: Alcohol - type: entity - parent: OrganHumanLiver + parent: [ OrganHumanLiver, BaseGoblinOrgan ] id: OrganGoblinLiver name: liver suffix: Goblin @@ -159,13 +168,13 @@ state: liver - type: Metabolizer # The liver metabolizes certain chemicals only, like alcohol. maxReagents: 1 - metabolizerTypes: [ Goblin ] + metabolizerTypes: [ Animal ] # [ Goblin ] groups: - id: Alcohol rateModifier: 0.1 # removes alcohol very slowly along with the stomach removing it as a drink - type: entity - parent: OrganHumanKidneys + parent: [ OrganHumanKidneys, BaseGoblinOrgan ] id: OrganGoblinKidneys name: kidneys suffix: Goblin diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml index 9bd9ea2ac28..6d2696b81d5 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml @@ -5,6 +5,8 @@ description: This cookie looks incredibly delicious. Whoever made it must really appreciate you. suffix: DO NOT MAP components: + - type: Food + quality: [ "High" ] - type: Sprite state: cookie-sugar - type: FlavorProfile diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml index 6d5cf330679..d97ad959354 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml @@ -29,3 +29,5 @@ - type: Tag tags: - Meat + - type: Food + quality: [ "High" ] diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml index bda82a7ca92..ee36312f469 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml @@ -24,3 +24,17 @@ price: 750 # - type: StealTarget # stealGroup: FoodMeatCat + - type: Food + quality: [ "Nasty" ] + +- type: entity + parent: FoodMeatRotten + id: FoodMeatGoblin + name: raw goblin meat + description: Just look at that marbling! Oh, wait, is that plastic? + components: + - type: Sprite + state: rotten + color: lime + - type: Food + quality: [ "Toxin" ] diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml index 9ab84a26dc1..83977dcbb48 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml @@ -23,3 +23,5 @@ - type: Tag tags: - Fruit + - type: Food + quality: [ "Normal" ] diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml index f13159a28c5..2be4584aaf0 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml @@ -7,7 +7,7 @@ noSpawn: true components: - type: Food - quality: Toxin + quality: [ "Toxin" ] - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi @@ -39,7 +39,7 @@ noSpawn: true components: - type: Food - quality: Toxin + quality: [ "Toxin" ] - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml index b0fdf72b1a7..ccf7b15a168 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml @@ -7,8 +7,7 @@ flavors: - funny - type: Food - quality: Trash -# requiresSpecialDigestion: true # Frontier, Goblins + quality: [ "Trash" ] - type: SolutionContainerManager solutions: food: diff --git a/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml b/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml deleted file mode 100644 index 5b586db46f0..00000000000 --- a/Resources/Prototypes/_NF/Objects/Consumable/Food/meat_goblin.yml +++ /dev/null @@ -1,11 +0,0 @@ -- type: entity - parent: FoodMeatRotten - id: FoodMeatGoblin - name: raw goblin meat - description: Just look at that marbling! Wait, is that microplastic? - components: - - type: Sprite - state: rotten - color: lime - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System From e9a96a64deaa6fab18429b1cdcca88b5e0babb1e Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Sat, 4 May 2024 04:04:23 +0300 Subject: [PATCH 20/43] more yml fixes --- .../Entities/Objects/Consumable/Food/ingredients.yml | 4 ++-- .../Prototypes/Entities/Objects/Misc/spaceshroom.yml | 12 ++++++------ .../Entities/Objects/Specific/Mail/base_mail.yml | 11 ++--------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml index aa38b2d81f7..26bd33300e7 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml @@ -619,8 +619,8 @@ - type: Tag tags: - Trash - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: entity name: cocoa beans diff --git a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml index a55b535fa6c..c9b32cfe995 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml @@ -5,8 +5,8 @@ suffix: Structure description: A cluster of wild mushrooms that likes to grow in dark, moist environments. components: - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: Sprite sprite: Objects/Misc/spaceshroom.rsi state: structure @@ -47,8 +47,8 @@ id: FoodSpaceshroom description: A wild mushroom. There's no telling what effect it could have... components: - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: Produce - type: Sprite sprite: Objects/Misc/spaceshroom.rsi @@ -107,8 +107,8 @@ id: FoodSpaceshroomCooked description: A wild mushroom that has been cooked through. It seems the heat has removed its chemical effects. components: - - type: Food # Frontier, New Food Quality System - quality: Toxin # Frontier, New Food Quality System + - type: Food # Frontier + quality: [ "Toxin" ] # Frontier, New Food Quality System - type: FlavorProfile flavors: - spaceshroomcooked diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index a384ac9caad..86ed92d3bf4 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -8,6 +8,8 @@ size: Normal - type: Mail - type: AccessReader + - type: Food # Frontier + quality: [ "Trash", "Mail" ] # Frontier, New Food Quality System - type: Sprite scale: 0.7, 0.7 # Frontier sprite: Nyanotrasen/Objects/Specific/Mail/mail.rsi @@ -94,15 +96,6 @@ types: Blunt: 10 - type: CargoSellBlacklist - - type: Food # Frontier - quality: Mail # Frontier, New Food Quality System - - type: SolutionContainerManager - solutions: - food: - maxVol: 1 - reagents: - - ReagentId: TrashJuice - Quantity: 1 # This empty parcel is allowed to exist and evade the tests for the admin # mailto command. From 0b59814d18e27396da7d4b05cc8dc473340828a5 Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 15:12:33 +0300 Subject: [PATCH 21/43] No More refill --- Content.Server/Nutrition/EntitySystems/FoodSystem.cs | 2 ++ Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 427bf5567fe..591ee86d9ac 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -440,6 +440,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg args.Repeat = !forceFeed; + _solutionContainer.SetCapacity(soln.Value, soln.Value.Comp.Solution.MaxVolume - transferAmount); // Frontier - You cannot eat a cake and leave it whole + if (TryComp(entity, out var stack)) { //Not deleting whole stack piece will make troubles with grinding object diff --git a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs index 3ea42811b66..e6bddec16d4 100644 --- a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs @@ -58,6 +58,8 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem, return false; } + _solutionContainerSystem.SetCapacity(soln.Value, soln.Value.Comp.Solution.MaxVolume - (solution.Volume / FixedPoint2.New(component.Count))); // Frontier - You cannot eat a cake and leave it whole + var sliceUid = Slice(uid, user, component, transform); var lostSolution = _solutionContainerSystem.SplitSolution(soln.Value, solution.Volume / FixedPoint2.New(component.Count)); From 39aefbd02308e2107d40b2f41dfb31789f7a466d Mon Sep 17 00:00:00 2001 From: ErhardSteinhauer <65374927+ErhardSteinhauer@users.noreply.github.com> Date: Sat, 4 May 2024 15:34:36 +0300 Subject: [PATCH 22/43] less corn in cob --- .../Prototypes/Entities/Objects/Consumable/Food/produce.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index 45303d27c84..e7e8b49b5e5 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -964,7 +964,7 @@ maxVol: 20 reagents: - ReagentId: Cornmeal - Quantity: 10 + Quantity: 3 # Frontier, from 10 to 3 - type: entity name: onion From 0d099eed927bfb5d71f2d4e838075cd30229d251 Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 18:28:36 +0300 Subject: [PATCH 23/43] Pain --- .../Nutrition/EntitySystems/FoodSystem.cs | 46 ++++++++++++------- .../Objects/Specific/Mail/base_mail.yml | 4 +- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 591ee86d9ac..697eab513ea 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -558,34 +558,46 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma { // Frontier - Food system hack job var foodQuality = component.Quality; - var allowEating = true; + var block = false; foreach (var quality in foodQuality) { - if (!comp.MailDigestion && quality == "Mail") - allowEating = true; - else if (!comp.FiberDigestion && quality == "Fiber") - allowEating = true; - else if (!comp.TrashDigestion && quality == "Trash") - allowEating = true; - else - allowEating = false; + if (quality == "Mail" || quality == "Fiber" || quality == "Trash") + { + if (comp.MailDigestion && quality == "Mail") + { + block = false; + break; + } + else if (comp.TrashDigestion && quality == "Trash") + { + block = false; + break; + } + else if (comp.TrashDigestion && quality == "Trash") + { + block = false; + break; + } + else + block = true; + } } - if (allowEating) + if (block) return false; // Frontier - Food system hack job // Find a stomach with a SpecialDigestible - if (comp.SpecialDigestible == null) - continue; + //if (comp.SpecialDigestible == null) + // continue; // Check if the food is in the whitelist - if (comp.SpecialDigestible.IsValid(food, EntityManager)) - return true; + //if (comp.SpecialDigestible.IsValid(food, EntityManager)) + // return true; // They can only eat whitelist food and the food isn't in the whitelist. It's not edible. - return false; + //return false; } - if (component.RequiresSpecialDigestion) - return false; + //if (component.RequiresSpecialDigestion) + // return false; return digestible; } diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index 86ed92d3bf4..6675fba2ff5 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -1,5 +1,5 @@ - type: entity - parent: BaseItem + parent: [ BaseItem , TrashSolutionInjector ] # Frontier abstract: true id: BaseMail name: mail-item-name-unaddressed @@ -8,8 +8,6 @@ size: Normal - type: Mail - type: AccessReader - - type: Food # Frontier - quality: [ "Trash", "Mail" ] # Frontier, New Food Quality System - type: Sprite scale: 0.7, 0.7 # Frontier sprite: Nyanotrasen/Objects/Specific/Mail/mail.rsi From 0d15fce8eb2ed35d9725dc90b9f10d79baeb9bae Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 18:39:50 +0300 Subject: [PATCH 24/43] Fixing --- .../Nutrition/EntitySystems/FoodSystem.cs | 28 +++++++++---------- .../Objects/Specific/Mail/base_mail.yml | 4 ++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 697eab513ea..4401e15e41e 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -558,46 +558,46 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma { // Frontier - Food system hack job var foodQuality = component.Quality; - var block = false; + var foodQualityblock = false; foreach (var quality in foodQuality) { if (quality == "Mail" || quality == "Fiber" || quality == "Trash") { if (comp.MailDigestion && quality == "Mail") { - block = false; + foodQualityblock = false; break; } - else if (comp.TrashDigestion && quality == "Trash") + else if (comp.FiberDigestion && quality == "Fiber") { - block = false; + foodQualityblock = false; break; } else if (comp.TrashDigestion && quality == "Trash") { - block = false; + foodQualityblock = false; break; } else - block = true; + foodQualityblock = true; } } - if (block) + if (foodQualityblock) return false; // Frontier - Food system hack job // Find a stomach with a SpecialDigestible - //if (comp.SpecialDigestible == null) - // continue; + if (comp.SpecialDigestible == null) + continue; // Check if the food is in the whitelist - //if (comp.SpecialDigestible.IsValid(food, EntityManager)) - // return true; + if (comp.SpecialDigestible.IsValid(food, EntityManager)) + return true; // They can only eat whitelist food and the food isn't in the whitelist. It's not edible. - //return false; + return false; } - //if (component.RequiresSpecialDigestion) - // return false; + if (component.RequiresSpecialDigestion) + return false; return digestible; } diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index 6675fba2ff5..8d4b00433a9 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -93,7 +93,9 @@ damage: types: Blunt: 10 - - type: CargoSellBlacklist + - type: CargoSellBlacklist # Frontier + - type: Food # Frontier + quality: [ "Mail" ] # Frontier, New Food Quality System # This empty parcel is allowed to exist and evade the tests for the admin # mailto command. From 052d6199e4b3ed522d78b96ceda361d2ad2c1775 Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 18:57:40 +0300 Subject: [PATCH 25/43] Moff --- Resources/Prototypes/Body/Organs/moth.yml | 1 + .../Objects/Consumable/Food/produce.yml | 3 ++- .../Prototypes/Entities/Objects/Misc/paper.yml | 5 +++-- .../Entities/Objects/Consumable/Food/moth.yml | 18 ++++++++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Resources/Prototypes/Body/Organs/moth.yml b/Resources/Prototypes/Body/Organs/moth.yml index 4d44dbad42f..e3584a3cbd8 100644 --- a/Resources/Prototypes/Body/Organs/moth.yml +++ b/Resources/Prototypes/Body/Organs/moth.yml @@ -10,6 +10,7 @@ # - Fruit # - Pill # - Crayon + fiberDigestion: true - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index e7e8b49b5e5..2903f394455 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -1856,7 +1856,8 @@ flavors: - cotton - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System - type: SolutionContainerManager solutions: food: diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index ee6ed9a70b9..e68cd266aa7 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -63,6 +63,7 @@ solution: food delay: 7 forceFeedDelay: 7 + quality: [ "Fiber" ] # Frontier, New Food Quality System - type: BadFood - type: SolutionContainerManager solutions: @@ -71,8 +72,8 @@ reagents: - ReagentId: Fiber Quantity: 1 - - type: StaticPrice - price: 0 # Stop fax copy abuse. + - type: StaticPrice # Frontier - Stop fax copy abuse. + price: 0 # Frontier - type: entity name: paper scrap diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml index c365459480c..53f99edccc5 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml @@ -542,7 +542,8 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System #Tastes like cotton and broth - type: entity @@ -1117,7 +1118,8 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System - type: entity name: slice of cotton pizza @@ -1137,7 +1139,8 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System # Tastes like crust, cotton, cheese # Sweets @@ -1199,7 +1202,8 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System #Tastes like vanilla and clouds. - type: entity @@ -1229,7 +1233,8 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System #Tastes like vanilla and clouds. - type: entity @@ -1270,6 +1275,7 @@ tags: - MothFood - type: Food - requiresSpecialDigestion: true +# requiresSpecialDigestion: true # Frontier + quality: [ "Normal" ] # Frontier, New Food Quality System #Tastes like muffin, dust and lint From 118699e13af814590b4741b66cb9f2ea32915aba Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 4 May 2024 19:25:49 +0300 Subject: [PATCH 26/43] Update paper.yml --- Resources/Prototypes/Entities/Objects/Misc/paper.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index e68cd266aa7..3e150a0df56 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -63,7 +63,7 @@ solution: food delay: 7 forceFeedDelay: 7 - quality: [ "Fiber" ] # Frontier, New Food Quality System + quality: [ "Trash", "Fiber" ] # Frontier, New Food Quality System - type: BadFood - type: SolutionContainerManager solutions: From eaee2bffec8b53379e1f1f9dbb8122eedde1d14f Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 30 May 2024 23:41:18 +0300 Subject: [PATCH 27/43] Fixup --- .../Nutrition/Components/FoodComponent.cs | 4 +- .../Nutrition/EntitySystems/FoodSystem.cs | 38 ++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 479dfc8beae..294e5287b6f 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -81,12 +81,12 @@ public sealed partial class FoodComponent : Component /// /// Frontier - Nasty food, used for goblins to know if they can eat it or not /// - [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier + [DataField, ViewVariables] // Frontier public string[] Quality = { "Normal" }; /// /// Frontier - Edited by the system to find the final quility results /// - [ViewVariables(VVAccess.ReadWrite), DataField] // Frontier + [DataField, ViewVariables] // Frontier public string FinalQuality = "Normal"; } diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 4401e15e41e..2abdc84ab7a 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -556,35 +556,39 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma // Run through the mobs' stomachs foreach (var (comp, _) in stomachs) { - // Frontier - Food system hack job + // Frontier - Food System var foodQuality = component.Quality; - var foodQualityblock = false; + bool foodQualityBlock = false; + + // Map each quality to the corresponding component property for digestion capability + var digestionMap = new Dictionary + { + {"Mail", comp.MailDigestion}, + {"Fiber", comp.FiberDigestion}, + {"Trash", comp.TrashDigestion} + }; + foreach (var quality in foodQuality) { - if (quality == "Mail" || quality == "Fiber" || quality == "Trash") + if (digestionMap.ContainsKey(quality)) { - if (comp.MailDigestion && quality == "Mail") + // Set foodQualityBlock based on whether the specific digestion capability is true + // If the component can digest this type of quality, set to false and break out of the loop + if (digestionMap[quality]) { - foodQualityblock = false; + foodQualityBlock = false; break; } - else if (comp.FiberDigestion && quality == "Fiber") - { - foodQualityblock = false; - break; - } - else if (comp.TrashDigestion && quality == "Trash") + else { - foodQualityblock = false; - break; + // If the component cannot digest this quality, set to true + foodQualityBlock = true; } - else - foodQualityblock = true; } } - if (foodQualityblock) + if (foodQualityBlock) return false; - // Frontier - Food system hack job + // Frontier - Food System // Find a stomach with a SpecialDigestible if (comp.SpecialDigestible == null) From 7298cf624870bd23e71e50c8a511f90dd68f035c Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 30 May 2024 23:45:25 +0300 Subject: [PATCH 28/43] Update burger.yml --- .../Objects/Consumable/Food/burger.yml | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml index 25897d49bec..1b736d44336 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml @@ -99,7 +99,6 @@ - Meat - type: Food # Frontier quality: [ "Nasty" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, grass. - type: entity @@ -130,7 +129,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, bacon. - type: entity @@ -163,7 +161,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: bearger @@ -195,7 +192,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: big bite burger @@ -256,7 +252,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, brains. - type: entity @@ -288,7 +283,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: cheese burger @@ -321,7 +315,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # TODO: Make this work. # - type: Sprite # state: plate @@ -450,7 +443,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: crazy hamburger # Burger for you euro-cucks @@ -484,7 +476,6 @@ - Meat - type: Food # Frontier quality: [ "Nasty" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: duck sandwich # Burger for you sick bastards @@ -541,7 +532,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, pure electricity. - type: entity @@ -561,7 +551,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, fish. - type: entity @@ -593,7 +582,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, HEAT. - type: entity @@ -625,7 +613,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, ectoplasm. - type: entity @@ -658,7 +645,6 @@ - Meat - type: Food # Frontier quality: [ "Nasty" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: McGuffin @@ -752,7 +738,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Nasty" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like . - type: entity @@ -785,7 +770,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - type: entity name: rat burger @@ -817,7 +801,6 @@ - Meat - type: Food # Frontier quality: [ "Nasty" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, HEAT. - type: entity @@ -847,7 +830,6 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, lettuce, sludge. - type: entity @@ -877,7 +859,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, redditors. - type: entity @@ -907,7 +888,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, silver. - type: entity @@ -970,7 +950,6 @@ Quantity: 5 - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, tofu. - type: entity @@ -1004,7 +983,6 @@ - Meat - type: Food # Frontier quality: [ "Toxin" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier # Tastes like bun, acid. # Note: I would put a bunch of colored burgers here as listed in the tg .dm but @@ -1039,5 +1017,3 @@ - Meat - type: Food # Frontier quality: [ "Normal" ] # Frontier, New Food Quality System - transferAmount: 5 # Frontier - \ No newline at end of file From 7a6338ed9d34b9a195c0d85eb2432b722abcb5dc Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 30 May 2024 23:48:46 +0300 Subject: [PATCH 29/43] Update FoodSystem.cs --- .../Nutrition/EntitySystems/FoodSystem.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 2abdc84ab7a..e508a545108 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -279,18 +279,8 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { if (quality == null) continue; - else if (quality == "High") - entity.Comp.FinalQuality = "High"; - else if (quality == "Normal") - entity.Comp.FinalQuality = "Normal"; - else if (quality == "Junk") - entity.Comp.FinalQuality = "Junk"; - else if (quality == "Nasty") - entity.Comp.FinalQuality = "Nasty"; - else if (quality == "Toxin") - entity.Comp.FinalQuality = "Toxin"; - else if ((quality == "Trash") || (quality == "Mail") || (quality == "Fiber")) - entity.Comp.FinalQuality = "Trash"; + else + entity.Comp.FinalQuality = quality; if (reverseFoodQuality) { From 6c7010f390f521fb10936d17035b7560631064d4 Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 30 May 2024 23:49:28 +0300 Subject: [PATCH 30/43] Update FoodSystem.cs --- Content.Server/Nutrition/EntitySystems/FoodSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index e508a545108..f00c76c9319 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -383,7 +383,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _vomit.Vomit(args.Target.Value); } } - else if (entity.Comp.FinalQuality == "Trash") + else if (entity.Comp.FinalQuality == "Trash" || entity.Comp.FinalQuality == "Mail" || entity.Comp.FinalQuality == "Fiber") { if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) { From 483d04845c70413e8a3fb34f56ddc90c59c050c8 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Thu, 30 May 2024 23:51:03 +0300 Subject: [PATCH 31/43] Update Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl Co-authored-by: whatston3 <166147148+whatston3@users.noreply.github.com> --- .../Locale/en-US/_NF/nutrition/components/food-component.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl b/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl index b01fc76648b..4eb8b5f8ee6 100644 --- a/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl +++ b/Resources/Locale/en-US/_NF/nutrition/components/food-component.ftl @@ -1,2 +1,2 @@ -food-system-nasty = This food gross. -food-system-toxin = This food bad. +food-system-nasty = That food was gross. +food-system-toxin = That food was bad. From 311260b529999de3bb0728b61e805dcef1ea49ed Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 31 May 2024 00:05:11 +0300 Subject: [PATCH 32/43] Update FoodSystem.cs --- Content.Server/Nutrition/EntitySystems/FoodSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index f00c76c9319..4306d3666d3 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -206,6 +206,18 @@ private void OnFeedFood(Entity entity, ref AfterInteractEvent arg return (true, true); } + public enum Quality // Frontier + { + Toxin, + Nasty, + Normal, + High, + Junk, + Mail, + Fiber, + Trash + } + private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent args) { if (args.Cancelled || args.Handled || entity.Comp.Deleted || args.Target == null) From 92dd46bfd0a1aaf32fe23cbfd6b6e19547232b5b Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Fri, 31 May 2024 18:45:24 +0300 Subject: [PATCH 33/43] Update Resources/Locale/en-US/_NF/reagents/foods.ftl Co-authored-by: whatston3 <166147148+whatston3@users.noreply.github.com> --- Resources/Locale/en-US/_NF/reagents/foods.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/en-US/_NF/reagents/foods.ftl b/Resources/Locale/en-US/_NF/reagents/foods.ftl index bd9ed7bcfc9..87f00449b55 100644 --- a/Resources/Locale/en-US/_NF/reagents/foods.ftl +++ b/Resources/Locale/en-US/_NF/reagents/foods.ftl @@ -1,4 +1,4 @@ reagent-name-flaverol = Flaverol -reagent-name-trashjuice = trash juices +reagent-name-trashjuice = trash juice reagent-desc-trashjuice = Do you really want to know what it is? From 38f6b4edc9187a5a05a91a3ba3e70dec5bbd6858 Mon Sep 17 00:00:00 2001 From: "steinhauer.erhard" Date: Fri, 14 Jun 2024 14:40:07 +0300 Subject: [PATCH 34/43] mail --- .../Objects/Specific/Mail/base_mail.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index 4f4592c3723..667ca0885a3 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -5,7 +5,8 @@ name: mail-item-name-unaddressed components: - type: Item - size: Normal +# size: Normal # Frontier + storedRotation: -90 - type: Mail - type: AccessReader - type: Sprite @@ -19,8 +20,8 @@ map: ["enum.MailVisualLayers.FragileStamp"] visible: false - map: ["enum.MailVisualLayers.JobStamp"] - scale: 0.5, 0.5 - offset: 0.275, 0.2 + scale: 0.8, 0.8 # Frontier 0.5<0.8 + offset: 0.225, 0.165 # Frontier (0.275, 0.2)<(0.225, 0.165) - state: locked map: ["enum.MailVisualLayers.Lock"] - state: priority @@ -93,8 +94,15 @@ types: Blunt: 10 - type: CargoSellBlacklist # Frontier - - type: Food # Frontier - quality: [ "Mail" ] # Frontier, New Food Quality System + - type: Food # Frontier - Moth food + requiresSpecialDigestion: true + - type: SolutionContainerManager + solutions: + food: + maxVol: 1 + reagents: + - ReagentId: Nothing + Quantity: 1 # This empty parcel is allowed to exist and evade the tests for the admin # mailto command. From 1dda7a06058f6b0c8b64e678318f4d1b503e46e3 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 10 Jul 2024 07:12:32 -0400 Subject: [PATCH 35/43] Stomach: Digestion types & function enums --- .../Body/Components/StomachComponent.cs | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 01aa15ee070..3f3bf432246 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -73,25 +73,30 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// /// Frontier - Used by goblin for fliping the food quility effects /// - [DataField] - public bool ReverseFoodQuality = false; + [DataField(customTypeSerializer: typeof(FlagSerializer))] + public DigestionTypes Digestion = DigestionTypes.None; /// - /// Frontier - Allow eating mail TODO: Move this to a switch before fully added. + /// Frontier - Used by goblin for fliping the food quility effects /// - [DataField] - public bool MailDigestion = false; + [DataField("digestionFunction")] + public DigestionFunction DigestionFunc = DigestionFunction.Normal; + } - /// - /// Frontier - Allow eating fiber like food (Moth food) - /// - [DataField] - public bool FiberDigestion = false; + // Special types of food that this stomach can digest. + [Flags] + public enum DigestionTypes : byte + { + None = 0, + Mail = 1 << 0, + Fiber = 1 << 1, + Trash = 1 << 2, + } - /// - /// Frontier - Allow eating trash - /// - [DataField] - public bool TrashDigestion = false; + // Digestion functions. Expand this enum if adding species-specific digestion functions. + public enum DigestionFunction : byte + { + Normal, + Goblin } } From af995230c8f93ab2f6bff487635ae71ed91db16d Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 10 Jul 2024 15:11:44 -0400 Subject: [PATCH 36/43] FoodSystem: digestion rework --- .../Nutrition/Components/FoodComponent.cs | 25 ++- .../Nutrition/EntitySystems/FoodSystem.cs | 198 +----------------- .../EntitySystems/FoodSystem.Digestion.cs | 133 ++++++++++++ 3 files changed, 159 insertions(+), 197 deletions(-) create mode 100644 Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 294e5287b6f..1fb52b09cc5 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -78,15 +78,24 @@ public sealed partial class FoodComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public bool RequireDead = true; + // New Frontiers - Digestion Rework - Add quality to add species-specific digestion + // This code is licensed under AGPLv3. See AGPLv3.txt /// - /// Frontier - Nasty food, used for goblins to know if they can eat it or not + /// The quality of this food, for species-specific digestion. /// - [DataField, ViewVariables] // Frontier - public string[] Quality = { "Normal" }; + [DataField, ViewVariables] + public FoodQuality Quality = FoodQuality.Normal; +} - /// - /// Frontier - Edited by the system to find the final quility results - /// - [DataField, ViewVariables] // Frontier - public string FinalQuality = "Normal"; +/// +/// An enumeration of the quality of given pieces of food. +/// +public enum FoodQuality : byte +{ + Toxin, + Nasty, + Junk, + Normal, + High, } +// End of modified code diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index cf42a9379f0..2eeb855a15f 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -33,19 +33,12 @@ using System.Linq; using Robust.Server.GameObjects; using Content.Shared.Whitelist; -using Content.Server.Medical; // Frontier -using Content.Shared.Speech.EntitySystems; // Frontier -using Robust.Shared.Random; // Frontier -using Content.Shared.Jittering; // Frontier -using Content.Server.Chat.Systems; // Frontier -using Content.Shared.Tag; // Frontier - namespace Content.Server.Nutrition.EntitySystems; /// /// Handles feeding attempts both on yourself and on the target. /// -public sealed class FoodSystem : EntitySystem +public partial class FoodSystem : EntitySystem // Frontier: sealed entity, ref AfterInteractEvent arg return (true, true); } - public enum Quality // Frontier - { - Toxin, - Nasty, - Normal, - High, - Junk, - Mail, - Fiber, - Trash - } - private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent args) { if (args.Cancelled || args.Handled || entity.Comp.Deleted || args.Target == null) @@ -258,10 +233,12 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg // Get the stomach with the highest available solution volume var highestAvailable = FixedPoint2.Zero; StomachComponent? stomachToUse = null; - var reverseFoodQuality = false; // Frontier foreach (var (stomach, _) in stomachs) { var owner = stomach.Owner; + // Frontier: check specific-stomach digestion + if (!_stomach.CanStomachDigestFood(stomach, )) + if (!_stomach.CanTransferSolution(owner, split, stomach)) continue; @@ -273,7 +250,6 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg stomachToUse = stomach; highestAvailable = stomachSol.AvailableVolume; - reverseFoodQuality = stomachToUse.ReverseFoodQuality; // Frontier } // No stomach so just popup a message that they can't eat. @@ -287,131 +263,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _reaction.DoEntityReaction(args.Target.Value, solution, ReactionMethod.Ingestion); _stomach.TryTransferSolution(stomachToUse.Owner, split, stomachToUse); - /// Frontier - Food quality system - var foodQuality = entity.Comp.Quality; - var showFlavors = true; - - foreach (var quality in foodQuality) - { - if (quality == null) - continue; - else - entity.Comp.FinalQuality = quality; - - if (reverseFoodQuality) - { - if (quality == "High") - entity.Comp.FinalQuality = "Toxin"; - else if (quality == "Normal") - entity.Comp.FinalQuality = "Nasty"; - else if (quality == "Nasty") - entity.Comp.FinalQuality = "Normal"; - else if (quality == "Toxin") - entity.Comp.FinalQuality = "High"; - } - - // TODO: Add detection for fried food on nasty to update it to toxin for goblins. - // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. - - string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid" }; - var speedRegent = "Stimulants"; - var damagingRegent = "Toxin"; - var emoteId = "Laugh"; - - var msgNasty = Loc.GetString("food-system-nasty", ("used", args.Used), ("target", args.Target)); - var msgToxin = Loc.GetString("food-system-toxin", ("used", args.Used), ("target", args.Target)); - - TryComp(args.Target.Value, out var bloodStream); - - if (entity.Comp.FinalQuality == "High") - { - if (reverseFoodQuality) - { - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood - } - } - else if (entity.Comp.FinalQuality == "Normal") - { - if (reverseFoodQuality) - { - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood - } - } - else if (entity.Comp.FinalQuality == "Junk") - { - if (reverseFoodQuality) - { - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount / 7), out _); // Add to blood - } - } - else if (entity.Comp.FinalQuality == "Nasty") - { - if (reverseFoodQuality) - { - showFlavors = false; - _popup.PopupEntity(msgNasty, args.Target.Value, args.User); - - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, damagingRegent, FixedPoint2.New((int) transferAmount / 5), out _); // Add to blood - _stuttering.DoStutter(args.Target.Value, TimeSpan.FromSeconds(5), false); // Gives stuttering - _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 40f, 4f, true, null); - } - } - else if (entity.Comp.FinalQuality == "Toxin") - { - if (reverseFoodQuality) - { - showFlavors = false; - _popup.PopupEntity(msgToxin, args.Target.Value, args.User); - - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - _solutionContainer.RemoveReagent(stomachToUse.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, damagingRegent, FixedPoint2.New((int) transferAmount / 3), out _); // Add to blood - _stuttering.DoStutter(args.Target.Value, TimeSpan.FromSeconds(5), false); // Gives stuttering - _jittering.DoJitter(args.Target.Value, TimeSpan.FromSeconds(5), true, 80f, 8f, true, null); - _chat.TryEmoteWithoutChat(args.Target.Value, emoteId); - - if (RobustRandom.Prob(.05f)) // 5% to puke - _vomit.Vomit(args.Target.Value); - } - } - else if (entity.Comp.FinalQuality == "Trash" || entity.Comp.FinalQuality == "Mail" || entity.Comp.FinalQuality == "Fiber") - { - if (_solutionContainer.ResolveSolution(stomachToUse.Owner, stomachToUse.BodySolutionName, ref stomachToUse.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, reagent, FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomachToUse!.Solution.Value, "Flavorol", FixedPoint2.New((int) transferAmount)); // Remove from body before it goes to blood - } - if (_solutionContainer.ResolveSolution(args.Target.Value, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, speedRegent, FixedPoint2.New((int) transferAmount), out _); // Add to blood - } - } - /// Frontier - Food quality system end + // New Frontiers - Digestion Rework - Allows species-specific digestion. + // This code is licensed under AGPLv3. See AGPLv3.txt + var digestion = DigestFood(entity, stomachToUse, transferAmount, args); var flavors = args.FlavorMessage; @@ -419,7 +273,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg { var targetName = Identity.Entity(args.Target.Value, EntityManager); var userName = Identity.Entity(args.User, EntityManager); - if (showFlavors) // Frontier + if (digestion.ShowFlavors) // Frontier _popup.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), entity.Owner, entity.Owner); _popup.PopupEntity(Loc.GetString("food-system-force-feed-success-user", ("target", targetName)), args.User, args.User); @@ -429,7 +283,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg } else { - if (showFlavors) // Frontier + if (digestion.ShowFlavors) // Frontier _popup.PopupEntity(Loc.GetString(entity.Comp.EatMessage, ("food", entity.Owner), ("flavors", flavors)), args.User, args.User); // log successful voluntary eating @@ -562,40 +416,6 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(Stoma // Run through the mobs' stomachs foreach (var (comp, _) in stomachs) { - // Frontier - Food System - var foodQuality = component.Quality; - bool foodQualityBlock = false; - - // Map each quality to the corresponding component property for digestion capability - var digestionMap = new Dictionary - { - {"Mail", comp.MailDigestion}, - {"Fiber", comp.FiberDigestion}, - {"Trash", comp.TrashDigestion} - }; - - foreach (var quality in foodQuality) - { - if (digestionMap.ContainsKey(quality)) - { - // Set foodQualityBlock based on whether the specific digestion capability is true - // If the component can digest this type of quality, set to false and break out of the loop - if (digestionMap[quality]) - { - foodQualityBlock = false; - break; - } - else - { - // If the component cannot digest this quality, set to true - foodQualityBlock = true; - } - } - } - if (foodQualityBlock) - return false; - // Frontier - Food System - // Find a stomach with a SpecialDigestible if (comp.SpecialDigestible == null) continue; diff --git a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs new file mode 100644 index 00000000000..4997d5bb6e8 --- /dev/null +++ b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs @@ -0,0 +1,133 @@ +// New Frontiers - This file is licensed under AGPLv3 +// Copyright (c) 2024 New Frontiers Contributors +// See AGPLv3.txt for details. +using Content.Server.Medical; +using Content.Server.Nutrition.Components; +using Content.Shared.Speech.EntitySystems; +using Robust.Shared.Random; +using Content.Shared.Jittering; +using Content.Server.Chat.Systems; +using Content.Shared.Tag; +using Content.Shared.Nutrition; +using Content.Server.Body.Components; +using Content.Shared.FixedPoint; + +namespace Content.Server.Nutrition.EntitySystems; + +// Frontier: extending food system to handle species-specific digestion quirks. +public partial class FoodSystem : EntitySystem // Frontier: sealed entity, StomachComponent stomach, FixedPoint2 foodAmount, ref ConsumeDoAfterEvent args) + { + /// Frontier - Food quality system + switch (stomach.DigestionFunc) + { + case DigestionFunction.Normal: + default: + break; + case DigestionFunction.Goblin: + return GoblinDigestion(entity, stomach, foodAmount, ref args); + } + return new DigestionResult + { + ShowFlavors = true + }; + } + + DigestionResult GoblinDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, ref ConsumeDoAfterEvent args) + { + DigestionResult result; + result.ShowFlavors = true; + var foodQuality = entity.Comp.Quality; + // TODO: Add detection for fried food on nasty to update it to toxin for goblins. + // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. + + string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid", "Bungotoxin" }; + + EntityUid eater = args?.Target ?? EntityUid.Invalid; + TryComp(eater, out var bloodStream); + + string? print = null; + float jitterStrength = 0.0f; + bool stutter = false; + bool emote = false; + bool vomit = false; + int speedDivisor = 0; + int damageDivisor = 0; + + // Assign parameters based on food quality + if (_tag.HasAnyTag(entity, "Mail", "Trash", "Fiber")) + { + speedDivisor = 1; + } + else + switch (foodQuality) + { + case FoodQuality.High: + result.ShowFlavors = false; + print = Loc.GetString("food-system-toxin"); + stutter = true; + jitterStrength = 8.0f; + vomit = true; + damageDivisor = 3; + emote = true; + break; + case FoodQuality.Normal: + result.ShowFlavors = false; + print = Loc.GetString("food-system-nasty"); + stutter = true; + jitterStrength = 4.0f; + damageDivisor = 5; + break; + case FoodQuality.Junk: + speedDivisor = 7; + break; + case FoodQuality.Nasty: + speedDivisor = 5; + break; + case FoodQuality.Toxin: + speedDivisor = 3; + break; + } + + // Run goblin food behaviour + if (_solutionContainer.ResolveSolution(eater, stomach.BodySolutionName, ref stomach.Solution)) + { + foreach (var reagent in toxinsRegent) + _solutionContainer.RemoveReagent(stomach.Solution.Value, reagent, FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood + _solutionContainer.RemoveReagent(stomach.Solution.Value, "Flavorol", FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood + } + if ((speedDivisor > 0 || damageDivisor > 0) && + _solutionContainer.ResolveSolution(eater, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + { + if (speedDivisor > 0) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Stimulants", FixedPoint2.New((int) foodAmount / speedDivisor), out _); // Add to blood + if (damageDivisor > 0) + _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Toxin", FixedPoint2.New((int) foodAmount / damageDivisor), out _); // Add to blood + } + if (stutter) + _stuttering.DoStutter(eater, TimeSpan.FromSeconds(5), false); // Gives stuttering + if (jitterStrength > 0.0f) + _jittering.DoJitter(eater, TimeSpan.FromSeconds(5), true, jitterStrength * 10f, jitterStrength, true, null); + if (emote) + _chat.TryEmoteWithoutChat(eater, "Laugh"); + + if (vomit && RobustRandom.Prob(.05f)) // 5% to puke + _vomit.Vomit(eater); + + return result; + } + +} \ No newline at end of file From 20d78a5c30366324f0b13677968db9ac210f4892 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 10 Jul 2024 21:08:56 -0400 Subject: [PATCH 37/43] digestion check proof of concept --- .../Nutrition/EntitySystems/FoodSystem.cs | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 2eeb855a15f..d36ca53e593 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -229,16 +229,21 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg var split = _solutionContainer.SplitSolution(soln.Value, transferAmount); + if (!CheckDigestablePrereqs(entity, entity.Comp, stomachs)) { + return; + } + //TODO: Get the stomach UID somehow without nabbing owner // Get the stomach with the highest available solution volume var highestAvailable = FixedPoint2.Zero; StomachComponent? stomachToUse = null; - foreach (var (stomach, _) in stomachs) + foreach ((var stomach, var _) in stomachs) { - var owner = stomach.Owner; // Frontier: check specific-stomach digestion - if (!_stomach.CanStomachDigestFood(stomach, )) + if (!IsFoodDigestibleByStomach(entity, entity.Comp, stomach)) // Frontier: make sure food is processed by a stomach that can digest it + continue; + var owner = stomach.Owner; if (!_stomach.CanTransferSolution(owner, split, stomach)) continue; @@ -265,7 +270,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg // New Frontiers - Digestion Rework - Allows species-specific digestion. // This code is licensed under AGPLv3. See AGPLv3.txt - var digestion = DigestFood(entity, stomachToUse, transferAmount, args); + var digestion = DigestFood(entity, stomachToUse, transferAmount, ref args); var flavors = args.FlavorMessage; @@ -300,8 +305,6 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg args.Repeat = !forceFeed; - _solutionContainer.SetCapacity(soln.Value, soln.Value.Comp.Solution.MaxVolume - transferAmount); // Frontier - You cannot eat a cake and leave it whole - if (TryComp(entity, out var stack)) { //Not deleting whole stack piece will make troubles with grinding object @@ -407,29 +410,43 @@ public bool IsDigestibleBy(EntityUid uid, EntityUid food, FoodComponent? foodCom /// private bool IsDigestibleBy(EntityUid food, FoodComponent component, List<(StomachComponent, OrganComponent)> stomachs) { - var digestible = true; + return GetDigestableStomach(food, component, stomachs) is not null; // Frontier: removed + } + + private bool CheckDigestablePrereqs(EntityUid food, FoodComponent component, List<(StomachComponent, OrganComponent)> stomachs) + { + return stomachs.Count >= component.RequiredStomachs; + } - // Does the mob have enough stomachs? - if (stomachs.Count < component.RequiredStomachs) + private bool IsFoodDigestibleByStomach(EntityUid food, FoodComponent component, StomachComponent stomach) + { + if (!component.RequiresSpecialDigestion) + return true; + + // Find a stomach with a SpecialDigestible + if (stomach.SpecialDigestible == null) + return false; + // Check if the food is in the whitelist + if (_whitelistSystem.IsWhitelistPass(stomach.SpecialDigestible, food)) + return true; + else return false; + } + private StomachComponent? GetDigestableStomach(EntityUid food, FoodComponent component, List<(StomachComponent, OrganComponent)> stomachs) + { + if (!CheckDigestablePrereqs(food, component, stomachs)) { + return null; + } // Run through the mobs' stomachs foreach (var (comp, _) in stomachs) { - // Find a stomach with a SpecialDigestible - if (comp.SpecialDigestible == null) - continue; - // Check if the food is in the whitelist - if (_whitelistSystem.IsWhitelistPass(comp.SpecialDigestible, food)) - return true; - // They can only eat whitelist food and the food isn't in the whitelist. It's not edible. - return false; + if (IsFoodDigestibleByStomach(food, component, comp)) { + return comp; + } } - if (component.RequiresSpecialDigestion) - return false; - - return digestible; + return null; } private bool TryGetRequiredUtensils(EntityUid user, FoodComponent component, From c7065b464e768f888b96243a49fd5d4553624ab5 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 11 Jul 2024 08:31:18 -0400 Subject: [PATCH 38/43] Quality to enum, restore special digestion for now --- .../Body/Components/StomachComponent.cs | 26 ++------- .../Nutrition/EntitySystems/FoodSystem.cs | 6 +- Content.Server/Nyanotrasen/Mail/MailSystem.cs | 3 - .../EntitySystems/FoodSystem.Digestion.cs | 54 ++++++++++++----- .../Prototypes/Body/Organs/Animal/animal.yml | 2 +- Resources/Prototypes/Body/Organs/human.yml | 2 +- Resources/Prototypes/Body/Parts/base.yml | 2 +- .../Objects/Consumable/Food/Baked/bread.yml | 12 ++-- .../Objects/Consumable/Food/Baked/cake.yml | 4 +- .../Objects/Consumable/Food/burger.yml | 50 ++++++++-------- .../Entities/Objects/Consumable/Food/egg.yml | 2 +- .../Objects/Consumable/Food/frozen.yml | 2 +- .../Objects/Consumable/Food/ingredients.yml | 2 +- .../Objects/Consumable/Food/meals.yml | 6 +- .../Entities/Objects/Consumable/Food/meat.yml | 58 +++++++++---------- .../Objects/Consumable/Food/noodles.yml | 4 +- .../Objects/Consumable/Food/produce.yml | 6 +- .../Objects/Consumable/Food/skewer.yml | 6 +- .../Objects/Consumable/Food/snacks.yml | 2 +- .../Entities/Objects/Consumable/Food/soup.yml | 6 +- .../Entities/Objects/Misc/paper.yml | 1 - .../Entities/Objects/Consumable/Food/moth.yml | 18 +++--- .../_NF/Body/Organs/goblin_organs.yml | 13 ++++- .../Objects/Consumable/Food/Baked/misc.yml | 2 +- .../Objects/Consumable/Food/burger.yml | 2 +- .../Entities/Objects/Consumable/Food/meat.yml | 4 +- .../Objects/Consumable/Food/produce.yml | 2 +- .../Objects/Consumable/Food/spoiled.yml | 4 +- .../Objects/Consumable/Food/trash.yml | 5 +- 29 files changed, 158 insertions(+), 148 deletions(-) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 3f3bf432246..087864c7ae1 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -73,30 +73,14 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// /// Frontier - Used by goblin for fliping the food quility effects /// - [DataField(customTypeSerializer: typeof(FlagSerializer))] - public DigestionTypes Digestion = DigestionTypes.None; - - /// - /// Frontier - Used by goblin for fliping the food quility effects - /// - [DataField("digestionFunction")] - public DigestionFunction DigestionFunc = DigestionFunction.Normal; - } - - // Special types of food that this stomach can digest. - [Flags] - public enum DigestionTypes : byte - { - None = 0, - Mail = 1 << 0, - Fiber = 1 << 1, - Trash = 1 << 2, + [DataField] + public DigestionType Digestion = DigestionType.Normal; } - // Digestion functions. Expand this enum if adding species-specific digestion functions. - public enum DigestionFunction : byte + public enum DigestionType : byte { Normal, - Goblin + Goblin, + Felinid, } } diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index d36ca53e593..139deee68b2 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -270,13 +270,13 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg // New Frontiers - Digestion Rework - Allows species-specific digestion. // This code is licensed under AGPLv3. See AGPLv3.txt - var digestion = DigestFood(entity, stomachToUse, transferAmount, ref args); + var digestion = DigestFood(entity, stomachToUse, transferAmount, args.Target ?? EntityUid.Invalid, args.User); var flavors = args.FlavorMessage; if (forceFeed) { - var targetName = Identity.Entity(args.Target.Value, EntityManager); + var targetName = Identity.Entity(args.Target!.Value, EntityManager); var userName = Identity.Entity(args.User, EntityManager); if (digestion.ShowFlavors) // Frontier _popup.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), entity.Owner, entity.Owner); @@ -295,7 +295,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(entity.Owner):food}"); } - _audio.PlayPvs(entity.Comp.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-1f)); + _audio.PlayPvs(entity.Comp.UseSound, args.Target!.Value, AudioParams.Default.WithVolume(-1f)); // Try to break all used utensils foreach (var utensil in utensils) diff --git a/Content.Server/Nyanotrasen/Mail/MailSystem.cs b/Content.Server/Nyanotrasen/Mail/MailSystem.cs index 1f22e3a27c1..7e76648a09b 100644 --- a/Content.Server/Nyanotrasen/Mail/MailSystem.cs +++ b/Content.Server/Nyanotrasen/Mail/MailSystem.cs @@ -745,9 +745,6 @@ public void OpenMail(EntityUid uid, MailComponent? component = null, EntityUid? _handsSystem.PickupOrDrop(user, entity); } - if (TryComp(uid, out var food)) // Frontier - food.Quality = new string[] { "Mail", "Fiber", "Trash" }; - _tagSystem.AddTag(uid, "Trash"); _tagSystem.AddTag(uid, "Recyclable"); component.IsEnabled = false; diff --git a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs index 4997d5bb6e8..5672546ab09 100644 --- a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs +++ b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs @@ -7,8 +7,8 @@ using Robust.Shared.Random; using Content.Shared.Jittering; using Content.Server.Chat.Systems; +using Content.Shared.Chemistry.Components; using Content.Shared.Tag; -using Content.Shared.Nutrition; using Content.Server.Body.Components; using Content.Shared.FixedPoint; @@ -29,16 +29,18 @@ protected struct DigestionResult public bool ShowFlavors; } - DigestionResult DigestFood(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, ref ConsumeDoAfterEvent args) + DigestionResult DigestFood(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) { /// Frontier - Food quality system - switch (stomach.DigestionFunc) + switch (stomach.Digestion) { - case DigestionFunction.Normal: + case DigestionType.Normal: default: break; - case DigestionFunction.Goblin: - return GoblinDigestion(entity, stomach, foodAmount, ref args); + case DigestionType.Goblin: + return GoblinDigestion(entity, stomach, foodAmount, target, user); + case DigestionType.Felinid: + return FelinidDigestion(entity, stomach, foodAmount, target, user); } return new DigestionResult { @@ -46,7 +48,7 @@ DigestionResult DigestFood(Entity entity, StomachComponent stomac }; } - DigestionResult GoblinDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, ref ConsumeDoAfterEvent args) + DigestionResult GoblinDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) { DigestionResult result; result.ShowFlavors = true; @@ -56,8 +58,7 @@ DigestionResult GoblinDigestion(Entity entity, StomachComponent s string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid", "Bungotoxin" }; - EntityUid eater = args?.Target ?? EntityUid.Invalid; - TryComp(eater, out var bloodStream); + TryComp(target, out var bloodStream); string? print = null; float jitterStrength = 0.0f; @@ -68,7 +69,7 @@ DigestionResult GoblinDigestion(Entity entity, StomachComponent s int damageDivisor = 0; // Assign parameters based on food quality - if (_tag.HasAnyTag(entity, "Mail", "Trash", "Fiber")) + if (_tag.HasAnyTag(entity, "Trash")) { speedDivisor = 1; } @@ -103,31 +104,52 @@ DigestionResult GoblinDigestion(Entity entity, StomachComponent s } // Run goblin food behaviour - if (_solutionContainer.ResolveSolution(eater, stomach.BodySolutionName, ref stomach.Solution)) + if (_solutionContainer.ResolveSolution(target, stomach.BodySolutionName, ref stomach.Solution)) { foreach (var reagent in toxinsRegent) _solutionContainer.RemoveReagent(stomach.Solution.Value, reagent, FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood _solutionContainer.RemoveReagent(stomach.Solution.Value, "Flavorol", FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood } if ((speedDivisor > 0 || damageDivisor > 0) && - _solutionContainer.ResolveSolution(eater, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) + _solutionContainer.ResolveSolution(target, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) { if (speedDivisor > 0) _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Stimulants", FixedPoint2.New((int) foodAmount / speedDivisor), out _); // Add to blood if (damageDivisor > 0) _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Toxin", FixedPoint2.New((int) foodAmount / damageDivisor), out _); // Add to blood } + if (print is not null) + _popup.PopupEntity(print, target, user); if (stutter) - _stuttering.DoStutter(eater, TimeSpan.FromSeconds(5), false); // Gives stuttering + _stuttering.DoStutter(target, TimeSpan.FromSeconds(5), false); // Gives stuttering if (jitterStrength > 0.0f) - _jittering.DoJitter(eater, TimeSpan.FromSeconds(5), true, jitterStrength * 10f, jitterStrength, true, null); + _jittering.DoJitter(target, TimeSpan.FromSeconds(5), true, jitterStrength * 10f, jitterStrength, true, null); if (emote) - _chat.TryEmoteWithoutChat(eater, "Laugh"); + _chat.TryEmoteWithoutChat(target, "Laugh"); if (vomit && RobustRandom.Prob(.05f)) // 5% to puke - _vomit.Vomit(eater); + _vomit.Vomit(target); return result; } + DigestionResult FelinidDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) + { + TryComp(target, out var bloodStream); + + // Run goblin food behaviour + if (_solutionContainer.ResolveSolution(target, stomach.BodySolutionName, ref stomach.Solution) && + TryComp(stomach.Solution, out var solutionComp)) + { + var carpotoxinAmount = solutionComp.Solution.GetTotalPrototypeQuantity("CarpoToxin"); + solutionComp.Solution.RemoveReagent("CarpoToxin", carpotoxinAmount); + solutionComp.Solution.AddReagent("Nutriment", 0.4f * carpotoxinAmount); + solutionComp.Solution.AddReagent("Protein", 0.2f * carpotoxinAmount); + solutionComp.Solution.AddReagent("Vitamin", 0.2f * carpotoxinAmount); + solutionComp.Solution.AddReagent("Water", 0.2f * carpotoxinAmount); + } + + return new DigestionResult { ShowFlavors = true }; + } + } \ No newline at end of file diff --git a/Resources/Prototypes/Body/Organs/Animal/animal.yml b/Resources/Prototypes/Body/Organs/Animal/animal.yml index 384bd30b71e..e459c6ecd03 100644 --- a/Resources/Prototypes/Body/Organs/Animal/animal.yml +++ b/Resources/Prototypes/Body/Organs/Animal/animal.yml @@ -5,7 +5,7 @@ components: - type: Organ - type: Food # Frontier - quality: [ "Nasty" ] # Frontier + quality: Nasty # Frontier - type: Sprite sprite: Mobs/Species/Human/organs.rsi - type: StaticPrice diff --git a/Resources/Prototypes/Body/Organs/human.yml b/Resources/Prototypes/Body/Organs/human.yml index ffcd20eff4b..40c1d02a91b 100644 --- a/Resources/Prototypes/Body/Organs/human.yml +++ b/Resources/Prototypes/Body/Organs/human.yml @@ -7,7 +7,7 @@ sprite: Mobs/Species/Human/organs.rsi - type: Organ - type: Food # Frontier - quality: [ "Nasty" ] # Frontier + quality: Nasty # Frontier - type: Extractable grindableSolutionName: organ - type: SolutionContainerManager diff --git a/Resources/Prototypes/Body/Parts/base.yml b/Resources/Prototypes/Body/Parts/base.yml index e011d2ad2e3..c2861364d90 100644 --- a/Resources/Prototypes/Body/Parts/base.yml +++ b/Resources/Prototypes/Body/Parts/base.yml @@ -7,7 +7,7 @@ abstract: true components: - type: Food # Frontier - quality: [ "Nasty" ] # Frontier + quality: Nasty # Frontier - type: Damageable damageContainer: Biological - type: BodyPart diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml index 013c77d02df..ba49850e19c 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml @@ -10,7 +10,7 @@ flavors: - bread - type: Food - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/bread.rsi - type: Tag @@ -462,7 +462,7 @@ - cobwebs - bread - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat @@ -497,7 +497,7 @@ - cobwebs - bread - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Sprite layers: - state: spidermeat-slice @@ -586,7 +586,7 @@ - acid - bread - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Sprite layers: - state: xenomeat @@ -749,7 +749,7 @@ description: Alas, it is limited. components: - type: Food # Frontier - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: FlavorProfile flavors: - bread @@ -815,7 +815,7 @@ - ReagentId: Mold Quantity: 7 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like decaying fungus. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml index 20a145a3e39..12189c35c47 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml @@ -10,7 +10,7 @@ flavors: - sweet - type: Food - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/cake.rsi - type: SolutionContainerManager @@ -177,7 +177,7 @@ - type: SliceableFood slice: FoodCakeBrainSlice - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml index 1b736d44336..cf690db1e03 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/burger.yml @@ -32,7 +32,7 @@ - bun - meaty - type: Food # Frontier - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System transferAmount: 5 - type: Sprite sprite: Objects/Consumable/Food/burger.rsi @@ -98,7 +98,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like bun, grass. - type: entity @@ -128,7 +128,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, bacon. - type: entity @@ -160,7 +160,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: bearger @@ -191,7 +191,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: big bite burger @@ -251,7 +251,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, brains. - type: entity @@ -282,7 +282,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: cheese burger @@ -314,7 +314,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # TODO: Make this work. # - type: Sprite # state: plate @@ -386,7 +386,7 @@ tags: - Meat - type: Food # Frontier, New Food Quality System - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: corger #not curger @@ -442,7 +442,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: crazy hamburger # Burger for you euro-cucks @@ -475,7 +475,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: duck sandwich # Burger for you sick bastards @@ -531,7 +531,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, pure electricity. - type: entity @@ -550,7 +550,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, fish. - type: entity @@ -581,7 +581,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, HEAT. - type: entity @@ -612,7 +612,7 @@ - ClothMade - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, ectoplasm. - type: entity @@ -644,7 +644,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: McGuffin @@ -737,7 +737,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like . - type: entity @@ -769,7 +769,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: rat burger @@ -800,7 +800,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # Tastes like bun, HEAT. - type: entity @@ -829,7 +829,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, lettuce, sludge. - type: entity @@ -858,7 +858,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, redditors. - type: entity @@ -887,7 +887,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, silver. - type: entity @@ -949,7 +949,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Tastes like bun, tofu. - type: entity @@ -982,7 +982,7 @@ tags: - Meat - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like bun, acid. # Note: I would put a bunch of colored burgers here as listed in the tg .dm but @@ -1016,4 +1016,4 @@ tags: - Meat - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml index 7cf33c3b317..1f87b7f80b2 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/egg.yml @@ -11,7 +11,7 @@ - Egg - Meat - type: Food - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System trash: Eggshells - type: Sprite sprite: Objects/Consumable/Food/egg.rsi diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml index 595763fbef8..e4cd3e060b6 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/frozen.yml @@ -7,7 +7,7 @@ abstract: true components: - type: Food - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/frozen.rsi - type: SolutionContainerManager diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml index f423138fca9..62358470a3a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml @@ -638,7 +638,7 @@ tags: - Trash - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: cocoa beans diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml index 7c3cd5b1742..58e48364afb 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meals.yml @@ -13,7 +13,7 @@ - type: Item storedRotation: -90 - type: Food - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/meals.rsi - type: SolutionContainerManager @@ -254,7 +254,7 @@ - CubanCarp - Meat - type: Food # Frontier, New Food Quality System - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like fish, batter, hot peppers. - type: entity @@ -551,7 +551,7 @@ tags: - Meat - type: Food # Frontier, New Food Quality System - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # tastes exotic - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml index 663a3289d36..4f13576ae67 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml @@ -68,7 +68,7 @@ # once it would say bloated, turn into the rotten prototype stage: 1 - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System # bruh - type: Tag @@ -157,7 +157,7 @@ - ReagentId: CarpoToxin Quantity: 5 - type: Food # Frontier, New Food Quality System - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw bacon @@ -463,7 +463,7 @@ - ReagentId: Fat Quantity: 4 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw spider meat @@ -485,7 +485,7 @@ count: 3 slice: FoodMeatSpiderCutlet - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw spider leg @@ -504,7 +504,7 @@ - ReagentId: Fat Quantity: 3 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: meatwheat clump @@ -568,7 +568,7 @@ count: 3 slice: FoodMeatXenoCutlet - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw rouny meat @@ -599,7 +599,7 @@ node: start defaultTarget: rouny steak - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: killer tomato meat @@ -641,7 +641,7 @@ types: Blunt: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: meat clown @@ -754,7 +754,7 @@ graph: MeatSteak node: meat steak - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: bacon @@ -787,7 +787,7 @@ graph: Bacon node: bacon - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: cooked bear @@ -818,7 +818,7 @@ graph: BearSteak node: filet migrawr - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: penguin filet @@ -848,7 +848,7 @@ graph: PenguinSteak node: cooked penguin - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: cooked chicken @@ -878,7 +878,7 @@ graph: ChickenSteak node: cooked chicken - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: fried chicken @@ -908,7 +908,7 @@ - ReagentId: Protein Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: cooked duck @@ -938,7 +938,7 @@ graph: DuckSteak node: cooked duck - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: cooked crab @@ -968,7 +968,7 @@ graph: CrabSteak node: cooked crab - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: goliath steak @@ -996,7 +996,7 @@ graph: GoliathSteak node: goliath steak - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: rouny steak @@ -1057,7 +1057,7 @@ graph: LizardSteak node: lizard steak - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: boiled spider leg @@ -1102,7 +1102,7 @@ - ReagentId: Protein Quantity: 5 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Cutlets @@ -1296,7 +1296,7 @@ - ReagentId: SulfuricAcid Quantity: 20 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: raw killer tomato cutlet @@ -1336,7 +1336,7 @@ - ReagentId: Protein Quantity: 1 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System # Cooked @@ -1362,7 +1362,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: bear cutlet @@ -1389,7 +1389,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: penguin cutlet @@ -1414,7 +1414,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: chicken cutlet @@ -1439,7 +1439,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: duck cutlet @@ -1464,7 +1464,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: lizard cutlet @@ -1490,7 +1490,7 @@ - ReagentId: Protein Quantity: 2 - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: entity name: spider cutlet @@ -1514,7 +1514,7 @@ - ReagentId: Protein Quantity: 1 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: xeno cutlet @@ -1538,4 +1538,4 @@ - ReagentId: Protein Quantity: 1 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml index e13098745ab..01b37121b18 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/noodles.yml @@ -8,7 +8,7 @@ description: Now that's a nice pasta! components: - type: Food # Frontier - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: Item storedRotation: -90 - type: Sprite @@ -31,7 +31,7 @@ description: A plain dish of noodles, this needs more ingredients. components: - type: Food # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System - type: FlavorProfile flavors: - pasta diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index c02ee67b77e..b921566e31c 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -1448,7 +1448,7 @@ grindableSolutionName: food - type: BadFood - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: gatfruit @@ -1878,8 +1878,8 @@ flavors: - cotton - type: Food -# requiresSpecialDigestion: true # Frontier - quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System + requiresSpecialDigestion: true + quality: Normal # Frontier, New Food Quality System - type: SolutionContainerManager solutions: food: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml index 19ce2d38517..9ecd5326d31 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/skewer.yml @@ -7,7 +7,7 @@ abstract: true components: - type: Food - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System trash: FoodKebabSkewer - type: Sprite sprite: Objects/Consumable/Food/skewer.rsi @@ -130,7 +130,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: double rat kebab @@ -154,7 +154,7 @@ - ReagentId: Flavorol Quantity: 10 - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: fiesta kebab diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index b1b347ae642..dffa508e8d8 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -7,7 +7,7 @@ abstract: true components: - type: Food - quality: [ "Low" ] # Frontier, New Food Quality System + quality: Junk # Frontier, New Food Quality System - type: Tag tags: - FoodSnack diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml index 50da376601c..4bdd5bb0675 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml @@ -8,7 +8,7 @@ - type: Item storedRotation: -90 - type: Food - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System trash: FoodBowlBig utensil: Spoon - type: SolutionContainerManager @@ -605,7 +605,7 @@ - ReagentId: Flavorol Quantity: 5 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Soup - type: entity @@ -1020,7 +1020,7 @@ - Meat - Soup - type: Food # Frontier - quality: [ "Nasty" ] # Frontier, New Food Quality System + quality: Nasty # Frontier, New Food Quality System - type: entity name: miso soup diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index 0113933532b..91478287d14 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -63,7 +63,6 @@ solution: food delay: 7 forceFeedDelay: 7 - quality: [ "Trash", "Fiber" ] # Frontier, New Food Quality System - type: BadFood - type: SolutionContainerManager solutions: diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml index 0e31073f321..299e4617350 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/moth.yml @@ -540,8 +540,8 @@ tags: - MothFood - type: Food -# requiresSpecialDigestion: true # Frontier - quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System + requiresSpecialDigestion: true + quality: Normal #Tastes like cotton and broth - type: entity @@ -1116,8 +1116,8 @@ tags: - MothFood - type: Food -# requiresSpecialDigestion: true # Frontier - quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System + requiresSpecialDigestion: true + quality: Normal - type: entity name: slice of cotton pizza @@ -1137,8 +1137,8 @@ tags: - MothFood - type: Food -# requiresSpecialDigestion: true # Frontier - quality: [ "Normal", "Fiber" ] # Frontier, New Food Quality System + requiresSpecialDigestion: true + quality: Normal # Tastes like crust, cotton, cheese # Sweets @@ -1201,7 +1201,7 @@ - MothFood - type: Food # requiresSpecialDigestion: true # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System #Tastes like vanilla and clouds. - type: entity @@ -1232,7 +1232,7 @@ - MothFood - type: Food # requiresSpecialDigestion: true # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System #Tastes like vanilla and clouds. - type: entity @@ -1274,6 +1274,6 @@ - MothFood - type: Food # requiresSpecialDigestion: true # Frontier - quality: [ "Normal" ] # Frontier, New Food Quality System + quality: Normal # Frontier, New Food Quality System #Tastes like muffin, dust and lint diff --git a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml index 6a6c50dca54..28270796ab8 100644 --- a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml +++ b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml @@ -5,7 +5,7 @@ components: - type: Gibbable - type: Food - quality: [ "Toxin" ] + quality: Toxin - type: entity parent: [ OrganHumanBrain, BaseGoblinOrgan ] @@ -143,8 +143,15 @@ - ReagentId: UncookedAnimalProteins Quantity: 5 - type: Stomach - reverseFoodQuality: true - trashDigestion: true + digestion: Goblin + specialDigestible: + component: + - Food + tags: + - Pill + - Crayon + - Trash + - Paper - type: Metabolizer maxReagents: 3 metabolizerTypes: [ Animal ] # [ Goblin ] diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml index 6d2696b81d5..a7b0d34fbf3 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/Baked/misc.yml @@ -6,7 +6,7 @@ suffix: DO NOT MAP components: - type: Food - quality: [ "High" ] + quality: High - type: Sprite state: cookie-sugar - type: FlavorProfile diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml index d97ad959354..cdc042de26f 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/burger.yml @@ -30,4 +30,4 @@ tags: - Meat - type: Food - quality: [ "High" ] + quality: High diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml index ee36312f469..47af3eddb4e 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/meat.yml @@ -25,7 +25,7 @@ # - type: StealTarget # stealGroup: FoodMeatCat - type: Food - quality: [ "Nasty" ] + quality: Nasty - type: entity parent: FoodMeatRotten @@ -37,4 +37,4 @@ state: rotten color: lime - type: Food - quality: [ "Toxin" ] + quality: Toxin diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml index 83977dcbb48..b934709caee 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml @@ -24,4 +24,4 @@ tags: - Fruit - type: Food - quality: [ "Normal" ] + quality: Normal diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml index 2be4584aaf0..f13159a28c5 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml @@ -7,7 +7,7 @@ noSpawn: true components: - type: Food - quality: [ "Toxin" ] + quality: Toxin - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi @@ -39,7 +39,7 @@ noSpawn: true components: - type: Food - quality: [ "Toxin" ] + quality: Toxin - type: Sprite layers: - sprite: Objects/Consumable/Food/meat.rsi diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml index ccf7b15a168..680ffb6b699 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml @@ -6,8 +6,9 @@ - type: FlavorProfile flavors: - funny - - type: Food - quality: [ "Trash" ] + - type: Tag + tags: + - Trash - type: SolutionContainerManager solutions: food: From e354ede71bfb0b88cb55e62415a86a62655b9aa1 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 11 Jul 2024 09:08:38 -0400 Subject: [PATCH 39/43] Missing food qualities, restore special digestion --- Resources/Prototypes/Body/Organs/arachnid.yml | 14 ++++++------- Resources/Prototypes/Body/Organs/moth.yml | 14 ++++++------- .../Prototypes/Body/Organs/reptilian.yml | 16 +++++++-------- .../DeltaV/Body/Organs/vulpkanin.yml | 16 +++++++-------- .../Objects/Consumable/Food/Baked/donut.yml | 2 +- .../Objects/Consumable/Food/Baked/pie.yml | 10 +++++----- .../Objects/Consumable/Food/Baked/pizza.yml | 4 ++-- .../Entities/Objects/Misc/spaceshroom.yml | 6 +++--- .../Nyanotrasen/Body/Prototypes/felinid.yml | 13 ++++++++++-- .../Objects/Consumable/Food/Baked/misc.yml | 1 + .../Objects/Consumable/Food/spoiled.yml | 20 +++++++++---------- 11 files changed, 63 insertions(+), 53 deletions(-) diff --git a/Resources/Prototypes/Body/Organs/arachnid.yml b/Resources/Prototypes/Body/Organs/arachnid.yml index 411b8de4e83..5740efb4f72 100644 --- a/Resources/Prototypes/Body/Organs/arachnid.yml +++ b/Resources/Prototypes/Body/Organs/arachnid.yml @@ -35,13 +35,13 @@ sprite: Mobs/Species/Arachnid/organs.rsi state: stomach - type: Stomach - # specialDigestible: - # tags: - # - Fruit - # - Pill - # - BloodFood - # - Crayon - # - Soup + specialDigestible: + tags: + - Fruit + - Pill + - BloodFood + - Crayon + - Soup updateInterval: 1.5 - type: SolutionContainerManager solutions: diff --git a/Resources/Prototypes/Body/Organs/moth.yml b/Resources/Prototypes/Body/Organs/moth.yml index 7445f7fccca..583a0b05231 100644 --- a/Resources/Prototypes/Body/Organs/moth.yml +++ b/Resources/Prototypes/Body/Organs/moth.yml @@ -4,13 +4,13 @@ noSpawn: true components: - type: Stomach - # specialDigestible: - # tags: - # - MothFood - # - Fruit - # - Pill - # - Crayon - fiberDigestion: true + specialDigestible: + tags: + - MothFood + - Fruit + - Pill + - Crayon + - Fiber - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/Body/Organs/reptilian.yml b/Resources/Prototypes/Body/Organs/reptilian.yml index 9c350e23f32..78b21aa6301 100644 --- a/Resources/Prototypes/Body/Organs/reptilian.yml +++ b/Resources/Prototypes/Body/Organs/reptilian.yml @@ -4,14 +4,14 @@ noSpawn: true components: - type: Stomach - # specialDigestible: - # tags: - # - Fruit - # - ReptilianFood - # - Meat - # - Pill - # - Crayon - # - Paper + specialDigestible: + tags: + - Fruit + - ReptilianFood + - Meat + - Pill + - Crayon + - Paper - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml b/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml index 01c60da6522..f4ae0c94558 100644 --- a/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml +++ b/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml @@ -4,14 +4,14 @@ noSpawn: true components: - type: Stomach - # specialDigestible: - # tags: - # - Fruit - # - Meat - # - Pill - # - Egg - # - Crayon - # - Bread + specialDigestible: + tags: + - Fruit + - Meat + - Pill + - Egg + - Crayon + - Bread - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml index 9cea116a100..7b6bc7bfe2c 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/donut.yml @@ -468,4 +468,4 @@ - ReagentId: Amatoxin Quantity: 10 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml index 06647431598..1d0011db56e 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml @@ -25,7 +25,7 @@ - ReagentId: Flavorol Quantity: 11 - type: Food #All pies here made with a pie tin; unless you're some kind of savage, you're probably not destroying this when you eat or slice the pie! - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System trash: FoodPlateTin - type: SliceableFood count: 4 @@ -62,7 +62,7 @@ - Pie - Slice - type: Food # Frontier - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System # Pie @@ -340,7 +340,7 @@ - Meat - Pie - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: entity name: slice of xeno pie @@ -362,7 +362,7 @@ - Pie - Slice - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like pie, meat, acid. - type: entity @@ -454,7 +454,7 @@ - ReagentId: Flavorol Quantity: 6 - type: Food # Frontier, New Food Quality System - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like pie, mushrooms. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml index e31d86b5b39..959cc7b01f9 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml @@ -11,7 +11,7 @@ - oily - bread - type: Food - quality: [ "High" ] # Frontier, New Food Quality System + quality: High # Frontier, New Food Quality System - type: Sprite sprite: Objects/Consumable/Food/Baked/pizza.rsi - type: SolutionContainerManager @@ -565,5 +565,5 @@ - ReagentId: Vitamin Quantity: 1 - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System # Tastes like stale crust, rancid cheese, mushroom. diff --git a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml index c9c6d43103b..9e76332baff 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/spaceshroom.yml @@ -6,7 +6,7 @@ description: A cluster of wild mushrooms that likes to grow in dark, moist environments. components: - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Sprite sprite: Objects/Misc/spaceshroom.rsi state: structure @@ -53,7 +53,7 @@ description: A wild mushroom. There's no telling what effect it could have... components: - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: Produce - type: Sprite sprite: Objects/Misc/spaceshroom.rsi @@ -113,7 +113,7 @@ description: A wild mushroom that has been cooked through. It seems the heat has removed its chemical effects. components: - type: Food # Frontier - quality: [ "Toxin" ] # Frontier, New Food Quality System + quality: Toxin # Frontier, New Food Quality System - type: FlavorProfile flavors: - spaceshroomcooked diff --git a/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml b/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml index 5bea9ac360f..2e34e98cd86 100644 --- a/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml +++ b/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml @@ -20,7 +20,7 @@ organs: heart: OrganAnimalHeart lungs: OrganHumanLungs - stomach: OrganAnimalStomach # Frontier + stomach: OrganFelinidStomach # Frontier liver: OrganAnimalLiver kidneys: OrganHumanKidneys right arm: @@ -46,4 +46,13 @@ right foot: part: RightFootHuman left foot: - part: LeftFootHuman \ No newline at end of file + part: LeftFootHuman + +# Frontier: move this hack out of here +- type: entity + id: OrganFelinidStomach + parent: OrganAnimalStomach + noSpawn: true + components: + - type: Stomach + digestion: Felinid diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/Baked/misc.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/Baked/misc.yml index b92dcbd1853..4399da47f9c 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/Baked/misc.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Food/Baked/misc.yml @@ -5,6 +5,7 @@ description: It's still good enough to eat, just eat around the moldy bits. components: - type: Food + quality: Toxin # Frontier - type: Sprite layers: - state: moldy diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml index f13159a28c5..e2f1a613c2e 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/spoiled.yml @@ -66,8 +66,8 @@ - type: entity name: rotten burger parent: - - FoodBurgerBase - FoodSpoiledRotten + - FoodBurgerBase id: FoodBurgerBaconRotten components: - type: Sprite @@ -92,8 +92,8 @@ - type: entity name: rotten burger parent: - - FoodBurgerBase - FoodSpoiledRotten + - FoodBurgerBase id: FoodBurgerBigBiteRotten components: - type: Sprite @@ -118,8 +118,8 @@ - type: entity name: rotten burger parent: - - FoodBurgerBase - FoodSpoiledRotten + - FoodBurgerBase id: FoodBurgerCheeseRotten components: - type: Sprite @@ -144,8 +144,8 @@ - type: entity name: rotten burger parent: - - FoodBurgerBase - FoodSpoiledRotten + - FoodBurgerBase id: FoodBurgerEmpoweredRotten components: - type: Sprite @@ -170,8 +170,8 @@ - type: entity name: rotten burger parent: - - FoodBurgerBase - FoodSpoiledRotten + - FoodBurgerBase id: FoodBurgerPlainRotten components: - type: Sprite @@ -197,8 +197,8 @@ - type: entity name: moldy food parent: - - FoodRiceEgg - FoodSpoiledMoldy + - FoodRiceEgg id: FoodRiceEggMoldy components: - type: Sprite @@ -229,8 +229,8 @@ - type: entity name: moldy food parent: - - FoodSoupMeatball - FoodSpoiledMoldy + - FoodSoupMeatball id: FoodSoupMeatballMoldy components: - type: Sprite @@ -261,8 +261,8 @@ - type: entity name: moldy food parent: - - FoodNoodles - FoodSpoiledMoldy + - FoodNoodles id: FoodNoodlesMoldy components: - type: Sprite @@ -293,8 +293,8 @@ - type: entity name: moldy food parent: - - FoodNoodlesMeatball - FoodSpoiledMoldy + - FoodNoodlesMeatball id: FoodNoodlesMeatballMoldy components: - type: Sprite @@ -325,8 +325,8 @@ - type: entity name: moldy food parent: - - FoodSaladCaesar - FoodSpoiledMoldy + - FoodSaladCaesar id: FoodSaladCaesarMoldy components: - type: Sprite From 08cd56e51406802739586cf365054c580b86ed44 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 18 Sep 2024 12:50:11 -0400 Subject: [PATCH 40/43] Species-specific digestion progress with prototype --- .../Body/Components/StomachComponent.cs | 14 +- .../Nutrition/EntitySystems/FoodSystem.cs | 36 ++-- .../EntitySystems/FoodSystem.Digestion.cs | 171 +++++------------- .../Prototypes/DigestionPrototype.cs | 56 ++++++ Resources/Prototypes/Body/Organs/arachnid.yml | 17 +- Resources/Prototypes/Body/Organs/moth.yml | 4 +- .../Prototypes/Body/Organs/reptilian.yml | 19 +- .../DeltaV/Body/Organs/vulpkanin.yml | 19 +- .../Nyanotrasen/Body/Organs/felinid.yml | 9 + .../Nyanotrasen/Body/Prototypes/felinid.yml | 9 - .../_NF/Body/Prototypes/digestion.yml | 142 +++++++++++++++ 11 files changed, 301 insertions(+), 195 deletions(-) create mode 100644 Content.Server/_NF/Nutrition/Prototypes/DigestionPrototype.cs create mode 100644 Resources/Prototypes/Nyanotrasen/Body/Organs/felinid.yml create mode 100644 Resources/Prototypes/_NF/Body/Prototypes/digestion.yml diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 087864c7ae1..3dbcd6b2bcf 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -3,6 +3,7 @@ using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; using Content.Shared.Whitelist; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Body.Components @@ -71,16 +72,9 @@ public ReagentDelta(ReagentQuantity reagentQuantity) } /// - /// Frontier - Used by goblin for fliping the food quility effects + /// Frontier: digestion prototype (used for species-specific reagent replacement/effects) /// - [DataField] - public DigestionType Digestion = DigestionType.Normal; - } - // Digestion functions. Expand this enum if adding species-specific digestion functions. - public enum DigestionType : byte - { - Normal, - Goblin, - Felinid, + [DataField(required: true)] + public ProtoId? Digestion = "Default"; } } diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 990641ca318..77e2a19419c 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -256,7 +256,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg var owner = ent.Owner; // Frontier: check specific-stomach digestion - if (!IsFoodDigestibleByStomach(owner, entity.Comp, stomach)) // Frontier: make sure food is processed by a stomach that can digest it + if (!IsFoodDigestibleByStomach(owner, entity.Comp, ent.Comp1)) // Frontier: make sure food is processed by a stomach that can digest it continue; if (!_stomach.CanTransferSolution(owner, split, ent.Comp1)) @@ -280,13 +280,11 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg return; } + var digestion = DigestFood(entity, stomachToUse.Value, split, args.Target.Value, args.User); // Frontier: species-specific digestion + _reaction.DoEntityReaction(args.Target.Value, solution, ReactionMethod.Ingestion); _stomach.TryTransferSolution(stomachToUse!.Value.Owner, split, stomachToUse); - // New Frontiers - Digestion Rework - Allows species-specific digestion. - // This code is licensed under AGPLv3. See AGPLv3.txt - var digestion = DigestFood(entity, stomachToUse, transferAmount, args.Target ?? EntityUid.Invalid, args.User); - var flavors = args.FlavorMessage; if (forceFeed) @@ -436,7 +434,7 @@ private bool IsDigestibleBy(EntityUid food, FoodComponent component, List stomachs) + private bool CheckDigestablePrereqs(EntityUid food, FoodComponent component, List> stomachs) { return stomachs.Count >= component.RequiredStomachs; } @@ -456,7 +454,7 @@ private bool IsFoodDigestibleByStomach(EntityUid food, FoodComponent component, return false; } - private StomachComponent? GetDigestableStomach(EntityUid food, FoodComponent component, List<(StomachComponent, OrganComponent)> stomachs) + private StomachComponent? GetDigestableStomach(EntityUid food, FoodComponent component, List> stomachs) { if (!CheckDigestablePrereqs(food, component, stomachs)) { return null; @@ -464,20 +462,18 @@ private bool IsFoodDigestibleByStomach(EntityUid food, FoodComponent component, // Run through the mobs' stomachs foreach (var ent in stomachs) { -<<<<<<< HEAD - if (IsFoodDigestibleByStomach(food, component, comp)) { - return comp; + if (IsFoodDigestibleByStomach(food, component, ent.Comp1)) { + return ent.Comp1; } -======= - // Find a stomach with a SpecialDigestible - if (ent.Comp1.SpecialDigestible == null) - continue; - // Check if the food is in the whitelist - if (_whitelistSystem.IsWhitelistPass(ent.Comp1.SpecialDigestible, food)) - return true; - // They can only eat whitelist food and the food isn't in the whitelist. It's not edible. - return false; ->>>>>>> a05437f57579764fe3f2f2b87a081d73ed2ebaa7 + + // // Find a stomach with a SpecialDigestible + // if (ent.Comp1.SpecialDigestible == null) + // continue; + // // Check if the food is in the whitelist + // if (_whitelistSystem.IsWhitelistPass(ent.Comp1.SpecialDigestible, food)) + // return true; + // // They can only eat whitelist food and the food isn't in the whitelist. It's not edible. + // return false; } return null; diff --git a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs index 5672546ab09..c07c9a371d9 100644 --- a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs +++ b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs @@ -1,155 +1,76 @@ // New Frontiers - This file is licensed under AGPLv3 // Copyright (c) 2024 New Frontiers Contributors // See AGPLv3.txt for details. -using Content.Server.Medical; using Content.Server.Nutrition.Components; -using Content.Shared.Speech.EntitySystems; -using Robust.Shared.Random; -using Content.Shared.Jittering; -using Content.Server.Chat.Systems; +using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Components; -using Content.Shared.Tag; using Content.Server.Body.Components; -using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; +using Content.Shared.EntityEffects; +using Robust.Shared.Random; +using Content.Shared.Chemistry; namespace Content.Server.Nutrition.EntitySystems; // Frontier: extending food system to handle species-specific digestion quirks. -public partial class FoodSystem : EntitySystem // Frontier: sealed entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) + DigestionResult DigestFood(Entity food, Entity stomach, Solution eatenSolution, EntityUid target, EntityUid _) { - /// Frontier - Food quality system - switch (stomach.Digestion) - { - case DigestionType.Normal: - default: - break; - case DigestionType.Goblin: - return GoblinDigestion(entity, stomach, foodAmount, target, user); - case DigestionType.Felinid: - return FelinidDigestion(entity, stomach, foodAmount, target, user); - } - return new DigestionResult + var result = new DigestionResult { ShowFlavors = true }; - } - - DigestionResult GoblinDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) - { - DigestionResult result; - result.ShowFlavors = true; - var foodQuality = entity.Comp.Quality; - // TODO: Add detection for fried food on nasty to update it to toxin for goblins. - // TODO: Add inspect food but only for goblin eyes to see, goblins can tell food quality. - string[] toxinsRegent = { "Toxin", "CarpoToxin", "Mold", "Amatoxin", "SulfuricAcid", "Bungotoxin" }; - - TryComp(target, out var bloodStream); - - string? print = null; - float jitterStrength = 0.0f; - bool stutter = false; - bool emote = false; - bool vomit = false; - int speedDivisor = 0; - int damageDivisor = 0; - - // Assign parameters based on food quality - if (_tag.HasAnyTag(entity, "Trash")) + // Frontier - Food quality system + if (!_prototype.TryIndex(stomach.Comp.Digestion, out var digestion)) { - speedDivisor = 1; + return result; } - else - switch (foodQuality) + + var eatenVolume = eatenSolution.Volume; + while (digestion != null) + { + // Iterate through effects + foreach (var effect in digestion.Effects) { - case FoodQuality.High: - result.ShowFlavors = false; - print = Loc.GetString("food-system-toxin"); - stutter = true; - jitterStrength = 8.0f; - vomit = true; - damageDivisor = 3; - emote = true; - break; - case FoodQuality.Normal: - result.ShowFlavors = false; - print = Loc.GetString("food-system-nasty"); - stutter = true; - jitterStrength = 4.0f; - damageDivisor = 5; - break; - case FoodQuality.Junk: - speedDivisor = 7; - break; - case FoodQuality.Nasty: - speedDivisor = 5; - break; - case FoodQuality.Toxin: - speedDivisor = 3; - break; + if (_whitelistSystem.IsWhitelistFail(effect.Whitelist, food.Owner)) + continue; + + // Run reagent conversions + foreach (var (beforeReagent, afterDict) in effect.Conversions) + { + var removedAmount = eatenSolution.RemoveReagent(new ReagentQuantity(beforeReagent, eatenVolume)); + foreach (var (afterReagent, afterRatio) in afterDict) + { + eatenSolution.AddReagent(new ReagentQuantity(afterReagent, removedAmount * afterRatio)); + } + } + + var args = new EntityEffectReagentArgs(target, EntityManager, stomach.Owner, eatenSolution, eatenSolution.Volume, null, ReactionMethod.Ingestion, 1.0f); + foreach (var entEffect in effect.Effects) + { + if (!EntityEffectExt.ShouldApply(entEffect, args, _random)) + continue; + entEffect.Effect(args); + } } - // Run goblin food behaviour - if (_solutionContainer.ResolveSolution(target, stomach.BodySolutionName, ref stomach.Solution)) - { - foreach (var reagent in toxinsRegent) - _solutionContainer.RemoveReagent(stomach.Solution.Value, reagent, FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood - _solutionContainer.RemoveReagent(stomach.Solution.Value, "Flavorol", FixedPoint2.New((int) foodAmount)); // Remove from body before it goes to blood - } - if ((speedDivisor > 0 || damageDivisor > 0) && - _solutionContainer.ResolveSolution(target, bloodStream!.ChemicalSolutionName, ref bloodStream.ChemicalSolution)) - { - if (speedDivisor > 0) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Stimulants", FixedPoint2.New((int) foodAmount / speedDivisor), out _); // Add to blood - if (damageDivisor > 0) - _solutionContainer.TryAddReagent(bloodStream.ChemicalSolution.Value, "Toxin", FixedPoint2.New((int) foodAmount / damageDivisor), out _); // Add to blood + // Get next digestion to run + if (!_prototype.TryIndex(stomach.Comp.Digestion, out digestion)) + { + digestion = null; + } } - if (print is not null) - _popup.PopupEntity(print, target, user); - if (stutter) - _stuttering.DoStutter(target, TimeSpan.FromSeconds(5), false); // Gives stuttering - if (jitterStrength > 0.0f) - _jittering.DoJitter(target, TimeSpan.FromSeconds(5), true, jitterStrength * 10f, jitterStrength, true, null); - if (emote) - _chat.TryEmoteWithoutChat(target, "Laugh"); - - if (vomit && RobustRandom.Prob(.05f)) // 5% to puke - _vomit.Vomit(target); return result; } - - DigestionResult FelinidDigestion(Entity entity, StomachComponent stomach, FixedPoint2 foodAmount, EntityUid target, EntityUid user) - { - TryComp(target, out var bloodStream); - - // Run goblin food behaviour - if (_solutionContainer.ResolveSolution(target, stomach.BodySolutionName, ref stomach.Solution) && - TryComp(stomach.Solution, out var solutionComp)) - { - var carpotoxinAmount = solutionComp.Solution.GetTotalPrototypeQuantity("CarpoToxin"); - solutionComp.Solution.RemoveReagent("CarpoToxin", carpotoxinAmount); - solutionComp.Solution.AddReagent("Nutriment", 0.4f * carpotoxinAmount); - solutionComp.Solution.AddReagent("Protein", 0.2f * carpotoxinAmount); - solutionComp.Solution.AddReagent("Vitamin", 0.2f * carpotoxinAmount); - solutionComp.Solution.AddReagent("Water", 0.2f * carpotoxinAmount); - } - - return new DigestionResult { ShowFlavors = true }; - } - -} \ No newline at end of file +} diff --git a/Content.Server/_NF/Nutrition/Prototypes/DigestionPrototype.cs b/Content.Server/_NF/Nutrition/Prototypes/DigestionPrototype.cs new file mode 100644 index 00000000000..bf82f4844c3 --- /dev/null +++ b/Content.Server/_NF/Nutrition/Prototypes/DigestionPrototype.cs @@ -0,0 +1,56 @@ +using Content.Server.Nutrition.Components; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Content.Shared.Whitelist; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Chemistry.Reagent; + +[Prototype("digestion")] +[DataDefinition] +public sealed partial class DigestionPrototype : IPrototype +{ + [ViewVariables] + [IdDataField] + public string ID { get; private set; } = default!; + + /// + /// The list of digestive effects that occur in this organ. + /// + [DataField] + public List Effects { get; private set; } = new(); + + /// + /// The list of digestive effects that occur in this organ. + /// + [DataField] + public ProtoId? PostDigest { get; private set; } = null; +} + +[DataDefinition] +public sealed partial class DigestionEffect +{ + /// + /// The quality of food this effect occurs on. + /// + [DataField] + public FoodQuality? Quality { get; private set; } = null; + + /// + /// A whitelist on the food item this bite was taken from. + /// + [DataField] + public EntityWhitelist? Whitelist { get; private set; } = null; + + /// + /// A list of reagent effects that happen on the stomach solution + /// + [DataField] + public List Effects { get; private set; } = new(); + + /// + /// A list of conversions. All values should be ratios of the input reagent, and the sum of their values should be <= 1. + /// + [DataField] + public Dictionary, Dictionary, FixedPoint2>> Conversions { get; private set; } = new(); +} diff --git a/Resources/Prototypes/Body/Organs/arachnid.yml b/Resources/Prototypes/Body/Organs/arachnid.yml index dfadc0076cb..101a08d9b44 100644 --- a/Resources/Prototypes/Body/Organs/arachnid.yml +++ b/Resources/Prototypes/Body/Organs/arachnid.yml @@ -35,15 +35,14 @@ sprite: Mobs/Species/Arachnid/organs.rsi state: stomach - type: Stomach - # Frontier: TODO: figure out species digestion - specialDigestible: - tags: - - Fruit - - Pill - - BloodFood - - Crayon - - Soup - # End Frontier: TODO: figure out species digestion + digestion: Arachnid # Frontier + # specialDigestible: + # tags: + # - Fruit + # - Pill + # - BloodFood + # - Crayon + # - Soup updateInterval: 1.5 - type: SolutionContainerManager solutions: diff --git a/Resources/Prototypes/Body/Organs/moth.yml b/Resources/Prototypes/Body/Organs/moth.yml index a81446bc07e..e3bd664c2e4 100644 --- a/Resources/Prototypes/Body/Organs/moth.yml +++ b/Resources/Prototypes/Body/Organs/moth.yml @@ -4,7 +4,6 @@ categories: [ HideSpawnMenu ] components: - type: Stomach - # Frontier - TODO: figure out species digestion specialDigestible: tags: - MothFood @@ -12,7 +11,8 @@ - Pill - Crayon - Fiber - # End Frontier - TODO: figure out species digestion + - Food # Frontier + digestion: Moth # Frontier - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/Body/Organs/reptilian.yml b/Resources/Prototypes/Body/Organs/reptilian.yml index 4197fb52aac..1aac050ab57 100644 --- a/Resources/Prototypes/Body/Organs/reptilian.yml +++ b/Resources/Prototypes/Body/Organs/reptilian.yml @@ -4,16 +4,15 @@ categories: [ HideSpawnMenu ] components: - type: Stomach - # Frontier - TODO: figure out species digestion - specialDigestible: - tags: - - Fruit - - ReptilianFood - - Meat - - Pill - - Crayon - - Paper - # End Frontier - TODO: figure out species digestion + digestion: Carnivore # Frontier + # specialDigestible: + # tags: + # - Fruit + # - ReptilianFood + # - Meat + # - Pill + # - Crayon + # - Paper - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml b/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml index 5dbb0977476..b913f3b39ea 100644 --- a/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml +++ b/Resources/Prototypes/DeltaV/Body/Organs/vulpkanin.yml @@ -4,16 +4,15 @@ categories: [ HideSpawnMenu ] components: - type: Stomach - # Frontier - TODO: figure out species digestion (note, removed on Delta V) - specialDigestible: - tags: - - Fruit - - Meat - - Pill - - Egg - - Crayon - - Bread - # End Frontier - TODO: figure out species digestion + digestion: Carnivore # Frontier + # specialDigestible: + # tags: + # - Fruit + # - Meat + # - Pill + # - Egg + # - Crayon + # - Bread - type: SolutionContainerManager solutions: stomach: diff --git a/Resources/Prototypes/Nyanotrasen/Body/Organs/felinid.yml b/Resources/Prototypes/Nyanotrasen/Body/Organs/felinid.yml new file mode 100644 index 00000000000..d9bffb5b974 --- /dev/null +++ b/Resources/Prototypes/Nyanotrasen/Body/Organs/felinid.yml @@ -0,0 +1,9 @@ +# Frontier: species-specific digestion +- type: entity + id: OrganFelinidStomach + parent: OrganAnimalStomach + noSpawn: true + components: + - type: Stomach + digestion: Felinid +# End Frontier \ No newline at end of file diff --git a/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml b/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml index 2e34e98cd86..c726e922850 100644 --- a/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml +++ b/Resources/Prototypes/Nyanotrasen/Body/Prototypes/felinid.yml @@ -47,12 +47,3 @@ part: RightFootHuman left foot: part: LeftFootHuman - -# Frontier: move this hack out of here -- type: entity - id: OrganFelinidStomach - parent: OrganAnimalStomach - noSpawn: true - components: - - type: Stomach - digestion: Felinid diff --git a/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml new file mode 100644 index 00000000000..6e2190d39a4 --- /dev/null +++ b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml @@ -0,0 +1,142 @@ +- type: digestion + id: Default + effects: + - quality: High + conversions: + Vitamin: + Flavorol: 0.4 + Nutriment: + Flavorol: 0.4 + Protein: + Flavorol: 0.4 + - quality: Normal + conversions: + Vitamin: + Flavorol: 0.2 + Nutriment: + Flavorol: 0.2 + Protein: + Flavorol: 0.2 + - quality: Junk + conversions: + Vitamin: + Bloatamine: 0.2 + Nutriment: + Bloatamine: 0.2 + Protein: + Bloatamine: 0.2 + +- type: digestion + id: Felinid + effects: + - conversions: + Carpotoxin: + Nutriment: 0.5 + Vitamin: 0.25 + Protein: 0.25 + postDigest: Default + +- type: digestion + id: Moth + effects: + - quality: Normal + conversions: + Fiber: + Nutriment: 0.2 + - quality: High + conversions: + Fiber: + Nutriment: 0.4 + postDigest: Default + +- type: digestion + id: Arachnid + effects: + - quality: Normal + conversions: + SulfuricAcid: + Nutriment: 0.2 + - quality: High + conversions: + SulfuricAcid: + Flavorol: 0.3 + Nutriment: 0.1 + postDigest: Default + +- type: digestion + id: Goblin + effects: + # Eat trash, run fast, touch grass + - whitelist: + tag: + - Trash + effects: + !type:AdjustReagent + reagent: Stimulants + amount: 0.5 + # High gobbo cuisine (moth equivalent without tags) + - conversions: + TrashJuice: + Nutriment: 0.5 + Vitamin: 0.25 + Protein: 0.25 + # Overwriting default flavorol generation. + - quality: Nasty + conversions: + Vitamin: + Flavorol: 0.2 + Nutriment: + Flavorol: 0.2 + Protein: + Flavorol: 0.2 + - quality: Junk + conversions: + Vitamin: + Bloatamine: 0.2 + Nutriment: + Bloatamine: 0.2 + Protein: + Bloatamine: 0.2 + +- type: digestion + id: Carnivore + effects: + - whitelist: + tags: + - Meat + conversions: + Vitamin: + Flavorol: 0.1 + Nutriment: + Flavorol: 0.1 + Protein: + Flavorol: 0.1 + postDigest: Default + +# type: digestion +# id: SimpleDiet +# effects: +# - quality: Normal +# conversions: +# Vitamin: +# Flavorol: 0.3 +# Nutriment: +# Flavorol: 0.3 +# Protein: +# Flavorol: 0.3 +# - quality: High +# conversions: +# Vitamin: +# Bloatamine: 0.2 +# Nutriment: +# Bloatamine: 0.2 +# Protein: +# Bloatamine: 0.2 +# - quality: Junk +# conversions: +# Vitamin: +# Bloatamine: 0.2 +# Nutriment: +# Bloatamine: 0.2 +# Protein: +# Bloatamine: 0.2 \ No newline at end of file From 02d08060eaadcf1028a1af797abc0d61ece35fa5 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 18 Sep 2024 12:53:16 -0400 Subject: [PATCH 41/43] Compilation fix (bad merge) --- Content.Server/Nutrition/Components/FoodComponent.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 66186b6126a..bb8dab3b579 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -6,11 +6,9 @@ using Robust.Shared.Prototypes; using Content.Server.Mail; // Frontier -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; - namespace Content.Server.Nutrition.Components; -[RegisterComponent, Access(typeof(FoodSystem), typeof(FoodSequenceSystem)), typeof(MailSystem))] // Frontier +[RegisterComponent, Access(typeof(FoodSystem), typeof(FoodSequenceSystem), typeof(MailSystem))] // Frontier public sealed partial class FoodComponent : Component { [DataField] From f719d0a8a1fe5b1d8dbe9324290437138bc94794 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Wed, 18 Sep 2024 13:19:47 -0400 Subject: [PATCH 42/43] Bugfixes, initial bloatamine pass --- .../Body/Components/StomachComponent.cs | 2 +- .../reagents/meta/consumable/food/food.ftl | 3 +++ .../Objects/Consumable/Food/snacks.yml | 4 +-- .../_NF/Body/Prototypes/digestion.yml | 6 ++--- .../Objects/Consumable/Food/produce.yml | 1 - .../Objects/Consumable/Food/trash.yml | 4 +-- .../_NF/Reagents/Consumables/food.yml | 26 +++++++++++++++++++ 7 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index 3dbcd6b2bcf..22a3157155b 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -74,7 +74,7 @@ public ReagentDelta(ReagentQuantity reagentQuantity) /// /// Frontier: digestion prototype (used for species-specific reagent replacement/effects) /// - [DataField(required: true)] + [DataField] public ProtoId? Digestion = "Default"; } } diff --git a/Resources/Locale/en-US/_NF/reagents/meta/consumable/food/food.ftl b/Resources/Locale/en-US/_NF/reagents/meta/consumable/food/food.ftl index 044c74eea27..2832bac1c17 100644 --- a/Resources/Locale/en-US/_NF/reagents/meta/consumable/food/food.ftl +++ b/Resources/Locale/en-US/_NF/reagents/meta/consumable/food/food.ftl @@ -1,5 +1,8 @@ reagent-name-flavorol = flavorol reagent-desc-flavorol = All the vitamins, minerals, and carbohydrates the body needs in pure form. +reagent-name-bloatamine = bloatamine +reagent-desc-bloatamine = A metabolized version of the preservatives put in junk food. Carcinogenic in large quantities. + reagent-name-raisins = raisins reagent-desc-raisins = Are they the best or worst part of the cookie? They're a bunch of desiccated grapes is what they are. diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index 6d60e4f98b2..6f47bbf8052 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -513,8 +513,8 @@ # Trash - type: entity - categories: [ HideSpawnMenu, TrashSolutionInjector ] # Frontier: added TrashSolutionInjector - parent: BaseItem + categories: [ HideSpawnMenu ] + parent: [ BaseItem, TrashSolutionInjector ] # Frontier: added TrashSolutionInjector id: FoodPacketTrash description: This is rubbish. abstract: true diff --git a/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml index 6e2190d39a4..8facc4ea2e2 100644 --- a/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml +++ b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml @@ -71,9 +71,9 @@ tag: - Trash effects: - !type:AdjustReagent - reagent: Stimulants - amount: 0.5 + - !type:AdjustReagent + reagent: Stimulants + amount: 0.5 # High gobbo cuisine (moth equivalent without tags) - conversions: TrashJuice: diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml index a2d842f190c..142d45cd21d 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/produce.yml @@ -44,7 +44,6 @@ - type: FlavorProfile flavors: - bitter - - type: Food - type: SolutionContainerManager solutions: food: diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml index 680ffb6b699..cc8cbeb79fa 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml @@ -1,6 +1,6 @@ - type: entity - noSpawn: true id: TrashSolutionInjector + categories: [ HideSpawnMenu ] abstract: true components: - type: FlavorProfile @@ -14,5 +14,5 @@ food: maxVol: 1 reagents: - - ReagentId: TrashJuice + - ReagentId: Fiber Quantity: 1 diff --git a/Resources/Prototypes/_NF/Reagents/Consumables/food.yml b/Resources/Prototypes/_NF/Reagents/Consumables/food.yml index b3111159d8d..00bbce95ce5 100644 --- a/Resources/Prototypes/_NF/Reagents/Consumables/food.yml +++ b/Resources/Prototypes/_NF/Reagents/Consumables/food.yml @@ -32,6 +32,32 @@ amount: 0.5 pricePerUnit: 10 +- type: reagent + id: Bloatamine + name: reagent-name-bloatamine + group: Foods + desc: reagent-desc-bloatamine + physicalDesc: reagent-physical-desc-putrid + flavor: horrible + color: "#302522" + metabolisms: + Food: + metabolismRate: 0.05 + effects: + - !type:MovespeedModifier + walkSpeedModifier: 0.85 + sprintSpeedModifier: 0.85 # SLOW + conditions: + - !type:ReagentThreshold + min: 3 + - !type:HealthChange + conditions: + - !type:ReagentThreshold + min: 10 + damage: + groups: + Genetic: 0.05 + - type: reagent id: Raisins name: reagent-name-raisins From e9727380c2fd8aa6d81161af55d3304c00f113e7 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 19 Sep 2024 17:00:20 -0400 Subject: [PATCH 43/43] more stuff --- .../Nutrition/EntitySystems/FoodSystem.cs | 5 +- .../EntitySystems/FoodSystem.Digestion.cs | 6 +- Resources/Prototypes/Body/Organs/moth.yml | 9 +- .../_NF/Body/Organs/goblin_organs.yml | 2 - .../_NF/Body/Prototypes/digestion.yml | 253 ++++++++++-------- .../Objects/Consumable/Food/trash.yml | 3 + 6 files changed, 156 insertions(+), 122 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 77e2a19419c..7380277efea 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -256,7 +256,7 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent arg var owner = ent.Owner; // Frontier: check specific-stomach digestion - if (!IsFoodDigestibleByStomach(owner, entity.Comp, ent.Comp1)) // Frontier: make sure food is processed by a stomach that can digest it + if (!IsFoodDigestibleByStomach(args.Used.Value, entity.Comp, ent.Comp1)) // Frontier: make sure food is processed by a stomach that can digest it continue; if (!_stomach.CanTransferSolution(owner, split, ent.Comp1)) @@ -444,9 +444,6 @@ private bool IsFoodDigestibleByStomach(EntityUid food, FoodComponent component, if (!component.RequiresSpecialDigestion) return true; - // Find a stomach with a SpecialDigestible - if (stomach.SpecialDigestible == null) - return false; // Check if the food is in the whitelist if (_whitelistSystem.IsWhitelistPass(stomach.SpecialDigestible, food)) return true; diff --git a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs index c07c9a371d9..8128c8133d7 100644 --- a/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs +++ b/Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs @@ -42,6 +42,10 @@ DigestionResult DigestFood(Entity food, Entity // Iterate through effects foreach (var effect in digestion.Effects) { + // Precondition: match food quality and/or whitelist. + if (effect.Quality != null && effect.Quality != food.Comp.Quality) + continue; + if (_whitelistSystem.IsWhitelistFail(effect.Whitelist, food.Owner)) continue; @@ -65,7 +69,7 @@ DigestionResult DigestFood(Entity food, Entity } // Get next digestion to run - if (!_prototype.TryIndex(stomach.Comp.Digestion, out digestion)) + if (!_prototype.TryIndex(digestion.PostDigest, out digestion)) { digestion = null; } diff --git a/Resources/Prototypes/Body/Organs/moth.yml b/Resources/Prototypes/Body/Organs/moth.yml index e3bd664c2e4..6b506c00a84 100644 --- a/Resources/Prototypes/Body/Organs/moth.yml +++ b/Resources/Prototypes/Body/Organs/moth.yml @@ -7,10 +7,11 @@ specialDigestible: tags: - MothFood - - Fruit - - Pill - - Crayon - - Fiber + #- Fruit + #- Pill + #- Crayon + #- Fiber + component: - Food # Frontier digestion: Moth # Frontier - type: SolutionContainerManager diff --git a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml index ef5b52b7499..4c1de2591cc 100644 --- a/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml +++ b/Resources/Prototypes/_NF/Body/Organs/goblin_organs.yml @@ -148,8 +148,6 @@ component: - Food tags: - - Pill - - Crayon - Trash - Paper - type: Metabolizer diff --git a/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml index 8facc4ea2e2..c8b726eca9b 100644 --- a/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml +++ b/Resources/Prototypes/_NF/Body/Prototypes/digestion.yml @@ -1,142 +1,173 @@ - type: digestion id: Default effects: - - quality: High - conversions: - Vitamin: - Flavorol: 0.4 - Nutriment: - Flavorol: 0.4 - Protein: - Flavorol: 0.4 - - quality: Normal - conversions: - Vitamin: - Flavorol: 0.2 - Nutriment: - Flavorol: 0.2 - Protein: - Flavorol: 0.2 - - quality: Junk - conversions: - Vitamin: - Bloatamine: 0.2 - Nutriment: - Bloatamine: 0.2 - Protein: - Bloatamine: 0.2 + - quality: High + conversions: + Vitamin: + Flavorol: 0.4 + Vitamin: 0.6 + Nutriment: + Flavorol: 0.4 + Nutriment: 0.6 + Protein: + Flavorol: 0.4 + Protein: 0.6 + - quality: Normal + conversions: + Vitamin: + Flavorol: 0.2 + Vitamin: 0.8 + Nutriment: + Flavorol: 0.2 + Nutriment: 0.8 + Protein: + Flavorol: 0.2 + Protein: 0.8 + - quality: Junk + conversions: + Vitamin: + Bloatamine: 0.2 + Vitamin: 0.8 + Nutriment: + Bloatamine: 0.2 + Nutriment: 0.8 + Protein: + Bloatamine: 0.2 + Protein: 0.8 - type: digestion id: Felinid effects: - - conversions: - Carpotoxin: - Nutriment: 0.5 - Vitamin: 0.25 - Protein: 0.25 + - conversions: + Carpotoxin: + Nutriment: 0.5 + Vitamin: 0.25 + Protein: 0.25 postDigest: Default - type: digestion id: Moth effects: - - quality: Normal - conversions: - Fiber: - Nutriment: 0.2 - - quality: High - conversions: - Fiber: - Nutriment: 0.4 + - quality: Normal + conversions: + Fiber: + Nutriment: 0.2 + Fiber: 0.8 + - quality: High + conversions: + Fiber: + Nutriment: 0.4 + Fiber: 0.6 postDigest: Default - type: digestion id: Arachnid effects: - - quality: Normal - conversions: - SulfuricAcid: - Nutriment: 0.2 - - quality: High - conversions: - SulfuricAcid: - Flavorol: 0.3 - Nutriment: 0.1 + - quality: Normal + conversions: + SulfuricAcid: + Nutriment: 0.2 + Water: 0.8 + - quality: High + conversions: + SulfuricAcid: + Flavorol: 0.3 + Nutriment: 0.1 + Water: 0.6 postDigest: Default - type: digestion id: Goblin effects: - # Eat trash, run fast, touch grass - - whitelist: - tag: - - Trash - effects: - - !type:AdjustReagent - reagent: Stimulants - amount: 0.5 - # High gobbo cuisine (moth equivalent without tags) - - conversions: - TrashJuice: - Nutriment: 0.5 - Vitamin: 0.25 - Protein: 0.25 - # Overwriting default flavorol generation. - - quality: Nasty - conversions: - Vitamin: - Flavorol: 0.2 - Nutriment: - Flavorol: 0.2 - Protein: - Flavorol: 0.2 - - quality: Junk - conversions: - Vitamin: - Bloatamine: 0.2 - Nutriment: - Bloatamine: 0.2 - Protein: - Bloatamine: 0.2 + # Eat trash, run fast, touch grass + - whitelist: + tags: + - Trash + effects: + - !type:AdjustReagent + reagent: Stimulants + amount: 0.5 + # High gobbo cuisine (moth equivalent without tags) + - conversions: + TrashJuice: + Nutriment: 0.5 + Vitamin: 0.25 + Protein: 0.25 + # Overwriting default flavorol generation. + - quality: Nasty + conversions: + Vitamin: + Flavorol: 0.2 + Vitamin: 0.8 + Nutriment: + Flavorol: 0.2 + Nutriment: 0.8 + Protein: + Flavorol: 0.2 + Protein: 0.8 + - quality: Junk + conversions: + Vitamin: + Bloatamine: 0.2 + Vitamin: 0.8 + Nutriment: + Bloatamine: 0.2 + Nutriment: 0.8 + Protein: + Bloatamine: 0.2 + Protein: 0.8 - type: digestion id: Carnivore effects: - - whitelist: - tags: - - Meat - conversions: - Vitamin: - Flavorol: 0.1 - Nutriment: - Flavorol: 0.1 - Protein: - Flavorol: 0.1 + - whitelist: + tags: + - Meat + conversions: + Vitamin: + Flavorol: 0.1 + Vitamin: 0.9 + Nutriment: + Flavorol: 0.1 + Nutriment: 0.9 + Protein: + Flavorol: 0.1 + Protein: 0.9 postDigest: Default # type: digestion # id: SimpleDiet # effects: -# - quality: Normal -# conversions: -# Vitamin: -# Flavorol: 0.3 -# Nutriment: -# Flavorol: 0.3 -# Protein: -# Flavorol: 0.3 -# - quality: High -# conversions: -# Vitamin: -# Bloatamine: 0.2 -# Nutriment: -# Bloatamine: 0.2 -# Protein: -# Bloatamine: 0.2 -# - quality: Junk -# conversions: -# Vitamin: -# Bloatamine: 0.2 -# Nutriment: -# Bloatamine: 0.2 -# Protein: -# Bloatamine: 0.2 \ No newline at end of file +# - quality: Normal +# conversions: +# Vitamin: +# Flavorol: 0.3 +# Vitamin: 0.7 +# Nutriment: +# Flavorol: 0.3 +# Nutriment: 0.7 +# Protein: +# Flavorol: 0.3 +# Protein: 0.7 +# - quality: High +# conversions: +# Vitamin: +# Bloatamine: 0.2 +# Vitamin: 0.8 +# Nutriment: +# Bloatamine: 0.2 +# Nutriment: 0.8 +# Protein: +# Bloatamine: 0.2 +# Protein: 0.8 +# - quality: Junk +# conversions: +# Vitamin: +# Bloatamine: 0.2 +# Vitamin: 0.8 +# Nutriment: +# Bloatamine: 0.2 +# Nutriment: 0.8 +# Protein: +# Bloatamine: 0.2 +# Protein: 0.8 \ No newline at end of file diff --git a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml index cc8cbeb79fa..e318eb79a83 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Consumable/Food/trash.yml @@ -16,3 +16,6 @@ reagents: - ReagentId: Fiber Quantity: 1 + - type: Food + requiresSpecialDigestion: true + quality: Nasty \ No newline at end of file