diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index ab57abf2fb..9f43f76018 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -40,6 +40,7 @@ using Content.Shared.Stacks; using Content.Server.Construction.Components; using Content.Shared.Chat; using Content.Shared.Damage; +using Robust.Shared.Utility; namespace Content.Server.Kitchen.EntitySystems { @@ -100,6 +101,8 @@ namespace Content.Server.Kitchen.EntitySystems SubscribeLocalEvent(OnActiveMicrowaveRemove); SubscribeLocalEvent(OnConstructionTemp); + + SubscribeLocalEvent(OnGetSecretRecipes); } private void OnCookStart(Entity ent, ref ComponentStartup args) @@ -588,7 +591,12 @@ namespace Content.Server.Kitchen.EntitySystems } // Check recipes - var portionedRecipe = _recipeManager.Recipes.Select(r => + var getRecipesEv = new GetSecretRecipesEvent(); + RaiseLocalEvent(uid, ref getRecipesEv); + + List recipes = getRecipesEv.Recipes; + recipes.AddRange(_recipeManager.Recipes); + var portionedRecipe = recipes.Select(r => CanSatisfyRecipe(component, r, solidsDict, reagentDict)).FirstOrDefault(r => r.Item2 > 0); _audio.PlayPvs(component.StartCookingSound, uid); @@ -693,6 +701,21 @@ namespace Content.Server.Kitchen.EntitySystems } } + /// + /// This event tries to get secret recipes that the microwave might be capable of. + /// Currently, we only check the microwave itself, but in the future, the user might be able to learn recipes. + /// + private void OnGetSecretRecipes(Entity ent, ref GetSecretRecipesEvent args) + { + foreach (ProtoId recipeId in ent.Comp.ProvidedRecipes) + { + if (_prototype.TryIndex(recipeId, out var recipeProto)) + { + args.Recipes.Add(recipeProto); + } + } + } + #region ui private void OnEjectMessage(Entity ent, ref MicrowaveEjectMessage args) { diff --git a/Content.Shared/Kitchen/Components/RecipeProviderComponent.cs b/Content.Shared/Kitchen/Components/RecipeProviderComponent.cs new file mode 100644 index 0000000000..d677e42674 --- /dev/null +++ b/Content.Shared/Kitchen/Components/RecipeProviderComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.Prototypes; + +namespace Content.Shared.Kitchen.Components; + +[RegisterComponent] +public sealed partial class FoodRecipeProviderComponent : Component +{ + /// + /// These are additional recipes that the entity is capable of cooking. + /// + [DataField, ViewVariables] + public List> ProvidedRecipes = new(); +} diff --git a/Content.Shared/Kitchen/GetSecretRecipesEvent.cs b/Content.Shared/Kitchen/GetSecretRecipesEvent.cs new file mode 100644 index 0000000000..cf5416dfaa --- /dev/null +++ b/Content.Shared/Kitchen/GetSecretRecipesEvent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared.Kitchen; + +/// +/// This returns a list of recipes not found in the main list of available recipes. +/// +[ByRefEvent] +public struct GetSecretRecipesEvent() +{ + public List Recipes = new(); +} diff --git a/Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs b/Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs index b0991b5460..65a7b9ed04 100644 --- a/Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs +++ b/Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs @@ -37,6 +37,12 @@ namespace Content.Shared.Kitchen public IReadOnlyDictionary IngredientsReagents => _ingsReagents; public IReadOnlyDictionary IngredientsSolids => _ingsSolids; + /// + /// Is this recipe unavailable in normal circumstances? + /// + [DataField] + public bool SecretRecipe = false; + /// /// Count the number of ingredients in a recipe for sorting the recipe list. /// This makes sure that where ingredient lists overlap, the more complex diff --git a/Content.Shared/Kitchen/RecipeManager.cs b/Content.Shared/Kitchen/RecipeManager.cs index 0b120db26d..79c169b754 100644 --- a/Content.Shared/Kitchen/RecipeManager.cs +++ b/Content.Shared/Kitchen/RecipeManager.cs @@ -14,7 +14,8 @@ namespace Content.Shared.Kitchen Recipes = new List(); foreach (var item in _prototypeManager.EnumeratePrototypes()) { - Recipes.Add(item); + if (!item.SecretRecipe) + Recipes.Add(item); } Recipes.Sort(new RecipeComparer()); diff --git a/Resources/Locale/en-US/paper/paper-misc.ftl b/Resources/Locale/en-US/paper/paper-misc.ftl index 587701a927..c7c3a5e42e 100644 --- a/Resources/Locale/en-US/paper/paper-misc.ftl +++ b/Resources/Locale/en-US/paper/paper-misc.ftl @@ -26,3 +26,21 @@ book-text-ame-scribbles = I don't know if you're trained already, so I hope this The golden rule is 2 injection for every 1 core. You can go lower to save fuel. Higher will burn the engine out and eventually make it explode. Don't. Don't forget to refuel it, it tends to stop at the worst possible time. + +book-text-combat-bakery-kit = Thank you for choosing our combat bakery kit! + Enclosed are two (2) CyberSun patented Throwing Croissants, and one (1) patent-pending Baguette Sword. + The included Donk Co. microwave board can construct a microwave capable of baking more weapons. + Just like the baked weapons, be sure to eat this note after use. Good luck, agent. + + Baguette Sword Recipe: + Dough x 1 + Salt 5u + Pepper 5u + Metal Rod x 1 + Cook Time: 15 seconds + + Throwing Croissant Recipe: + Raw Croissant x 1 + Butter Slice x 1 + Glass Shard x 1 + Cook Time: 5 seconds \ No newline at end of file diff --git a/Resources/Locale/en-US/store/uplink-catalog.ftl b/Resources/Locale/en-US/store/uplink-catalog.ftl index b84202a291..65fee9d2cc 100644 --- a/Resources/Locale/en-US/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/store/uplink-catalog.ftl @@ -441,4 +441,4 @@ uplink-backpack-syndicate-name = Syndicate backpack uplink-backpack-syndicate-desc = Lightweight explosion-proof a backpack for holding various traitor goods uplink-combat-bakery-name = Combat Bakery Kit -uplink-combat-bakery-desc = A kit of clandestine baked weapons. Contains a baguette which a skilled mime could use as a sword and a pair of throwing croissants. Once the job is done, eat the evidence. +uplink-combat-bakery-desc = A kit of clandestine baked weapons. Contains a baguette sword, a pair of throwing croissants, and a syndicate microwave board for making more. Once the job is done, eat the evidence. diff --git a/Resources/Prototypes/Catalog/Fills/Boxes/syndicate.yml b/Resources/Prototypes/Catalog/Fills/Boxes/syndicate.yml index 27df984f25..0f99ae77d4 100644 --- a/Resources/Prototypes/Catalog/Fills/Boxes/syndicate.yml +++ b/Resources/Prototypes/Catalog/Fills/Boxes/syndicate.yml @@ -82,4 +82,6 @@ contents: - id: WeaponCroissant amount: 2 - - id: WeaponBaguette \ No newline at end of file + - id: WeaponBaguette + - id: SyndicateMicrowaveMachineCircuitboard + - id: PaperWrittenCombatBakeryKit \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/Fills/Paper/manuals.yml b/Resources/Prototypes/Catalog/Fills/Paper/manuals.yml index 4893fa2557..7f2268953b 100644 --- a/Resources/Prototypes/Catalog/Fills/Paper/manuals.yml +++ b/Resources/Prototypes/Catalog/Fills/Paper/manuals.yml @@ -23,3 +23,12 @@ type: PaperBoundUserInterface - type: Paper content: book-text-holoparasite-info + +- type: entity + id: PaperWrittenCombatBakeryKit + name: "combat bakery kit instructions" + description: "Eat note after reading." + parent: Paper + components: + - type: Paper + content: book-text-combat-bakery-kit \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 613b7bcded..8954325eb1 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -1751,7 +1751,7 @@ icon: { sprite: Objects/Consumable/Food/Baked/bread.rsi, state: baguette} productEntity: CombatBakeryKit cost: - Telecrystal: 3 + Telecrystal: 6 categories: - UplinkJob conditions: diff --git a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml index 1817445512..b415551ad2 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml @@ -124,3 +124,7 @@ snapCardinals: true - type: Machine board: SyndicateMicrowaveMachineCircuitboard + - type: FoodRecipeProvider + providedRecipes: + - RecipeBaguetteSword + - RecipeThrowingCroissant diff --git a/Resources/Prototypes/Recipes/Cooking/meal_recipes.yml b/Resources/Prototypes/Recipes/Cooking/meal_recipes.yml index 4c1080c135..bf39e1487b 100644 --- a/Resources/Prototypes/Recipes/Cooking/meal_recipes.yml +++ b/Resources/Prototypes/Recipes/Cooking/meal_recipes.yml @@ -458,6 +458,19 @@ solids: FoodDough: 1 +- type: microwaveMealRecipe + id: RecipeBaguetteSword + name: baguette sword recipe + result: WeaponBaguette + secretRecipe: true + time: 15 + reagents: + TableSalt: 5 + Blackpepper: 5 + solids: + FoodDough: 1 + PartRodMetal1: 1 + - type: microwaveMealRecipe id: RecipeButteredToast name: buttered toast recipe @@ -1864,3 +1877,14 @@ solids: FoodCroissantRaw: 1 FoodButterSlice: 1 + +- type: microwaveMealRecipe + id: RecipeThrowingCroissant + name: throwing croissant recipe + result: WeaponCroissant + secretRecipe: true + time: 5 + solids: + FoodCroissantRaw: 1 + FoodButterSlice: 1 + ShardGlass: 1 \ No newline at end of file