Add Donk Co. microwave board to Combat Bakery Kit (#31239)
* Add special microwave board to Combat Bakery Kit * use event instead of trycomp * make the board sus * add instructions note * embarrassing typo * Add functionality to Donk Co. microwave instead * update note
This commit is contained in:
@@ -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<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
|
||||
|
||||
SubscribeLocalEvent<ActivelyMicrowavedComponent, OnConstructionTemperatureEvent>(OnConstructionTemp);
|
||||
|
||||
SubscribeLocalEvent<FoodRecipeProviderComponent, GetSecretRecipesEvent>(OnGetSecretRecipes);
|
||||
}
|
||||
|
||||
private void OnCookStart(Entity<ActiveMicrowaveComponent> 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<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);
|
||||
@@ -693,6 +701,21 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
|
||||
13
Content.Shared/Kitchen/Components/RecipeProviderComponent.cs
Normal file
13
Content.Shared/Kitchen/Components/RecipeProviderComponent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
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();
|
||||
}
|
||||
10
Content.Shared/Kitchen/GetSecretRecipesEvent.cs
Normal file
10
Content.Shared/Kitchen/GetSecretRecipesEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
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();
|
||||
}
|
||||
@@ -37,6 +37,12 @@ namespace Content.Shared.Kitchen
|
||||
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
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace Content.Shared.Kitchen
|
||||
Recipes = new List<FoodRecipePrototype>();
|
||||
foreach (var item in _prototypeManager.EnumeratePrototypes<FoodRecipePrototype>())
|
||||
{
|
||||
Recipes.Add(item);
|
||||
if (!item.SecretRecipe)
|
||||
Recipes.Add(item);
|
||||
}
|
||||
|
||||
Recipes.Sort(new RecipeComparer());
|
||||
|
||||
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -83,3 +83,5 @@
|
||||
- id: WeaponCroissant
|
||||
amount: 2
|
||||
- id: WeaponBaguette
|
||||
- id: SyndicateMicrowaveMachineCircuitboard
|
||||
- id: PaperWrittenCombatBakeryKit
|
||||
@@ -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
|
||||
@@ -1751,7 +1751,7 @@
|
||||
icon: { sprite: Objects/Consumable/Food/Baked/bread.rsi, state: baguette}
|
||||
productEntity: CombatBakeryKit
|
||||
cost:
|
||||
Telecrystal: 3
|
||||
Telecrystal: 6
|
||||
categories:
|
||||
- UplinkJob
|
||||
conditions:
|
||||
|
||||
@@ -124,3 +124,7 @@
|
||||
snapCardinals: true
|
||||
- type: Machine
|
||||
board: SyndicateMicrowaveMachineCircuitboard
|
||||
- type: FoodRecipeProvider
|
||||
providedRecipes:
|
||||
- RecipeBaguetteSword
|
||||
- RecipeThrowingCroissant
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user