using Content.Server.Construction.Components;
using Content.Shared.Chat;
using Content.Shared.Damage;
+using Robust.Shared.Utility;
namespace Content.Server.Kitchen.EntitySystems
{
SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
SubscribeLocalEvent<ActivelyMicrowavedComponent, OnConstructionTemperatureEvent>(OnConstructionTemp);
+
+ SubscribeLocalEvent<FoodRecipeProviderComponent, GetSecretRecipesEvent>(OnGetSecretRecipes);
}
private void OnCookStart(Entity<ActiveMicrowaveComponent> ent, ref ComponentStartup args)
}
// Check recipes
- var portionedRecipe = _recipeManager.Recipes.Select(r =>
+ var getRecipesEv = new GetSecretRecipesEvent();
+ RaiseLocalEvent(uid, ref getRecipesEv);
+
+ List<FoodRecipePrototype> 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);
}
}
+ /// <summary>
+ /// 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.
+ /// </summary>
+ private void OnGetSecretRecipes(Entity<FoodRecipeProviderComponent> ent, ref GetSecretRecipesEvent args)
+ {
+ foreach (ProtoId<FoodRecipePrototype> recipeId in ent.Comp.ProvidedRecipes)
+ {
+ if (_prototype.TryIndex(recipeId, out var recipeProto))
+ {
+ args.Recipes.Add(recipeProto);
+ }
+ }
+ }
+
#region ui
private void OnEjectMessage(Entity<MicrowaveComponent> ent, ref MicrowaveEjectMessage args)
{
--- /dev/null
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Kitchen.Components;
+
+[RegisterComponent]
+public sealed partial class FoodRecipeProviderComponent : Component
+{
+ /// <summary>
+ /// These are additional recipes that the entity is capable of cooking.
+ /// </summary>
+ [DataField, ViewVariables]
+ public List<ProtoId<FoodRecipePrototype>> ProvidedRecipes = new();
+}
--- /dev/null
+namespace Content.Shared.Kitchen;
+
+/// <summary>
+/// This returns a list of recipes not found in the main list of available recipes.
+/// </summary>
+[ByRefEvent]
+public struct GetSecretRecipesEvent()
+{
+ public List<FoodRecipePrototype> Recipes = new();
+}
public IReadOnlyDictionary<string, FixedPoint2> IngredientsReagents => _ingsReagents;
public IReadOnlyDictionary<string, FixedPoint2> IngredientsSolids => _ingsSolids;
+ /// <summary>
+ /// Is this recipe unavailable in normal circumstances?
+ /// </summary>
+ [DataField]
+ public bool SecretRecipe = false;
+
/// <summary>
/// Count the number of ingredients in a recipe for sorting the recipe list.
/// This makes sure that where ingredient lists overlap, the more complex
Recipes = new List<FoodRecipePrototype>();
foreach (var item in _prototypeManager.EnumeratePrototypes<FoodRecipePrototype>())
{
- Recipes.Add(item);
+ if (!item.SecretRecipe)
+ Recipes.Add(item);
}
Recipes.Sort(new RecipeComparer());
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
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.
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
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
icon: { sprite: Objects/Consumable/Food/Baked/bread.rsi, state: baguette}
productEntity: CombatBakeryKit
cost:
- Telecrystal: 3
+ Telecrystal: 6
categories:
- UplinkJob
conditions:
snapCardinals: true
- type: Machine
board: SyndicateMicrowaveMachineCircuitboard
+ - type: FoodRecipeProvider
+ providedRecipes:
+ - RecipeBaguetteSword
+ - RecipeThrowingCroissant
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
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