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:
themias
2024-09-02 09:49:00 -04:00
committed by GitHub
parent ef1fadf275
commit 78201101d6
12 changed files with 115 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ using Content.Shared.Stacks;
using Content.Server.Construction.Components; using Content.Server.Construction.Components;
using Content.Shared.Chat; using Content.Shared.Chat;
using Content.Shared.Damage; using Content.Shared.Damage;
using Robust.Shared.Utility;
namespace Content.Server.Kitchen.EntitySystems namespace Content.Server.Kitchen.EntitySystems
{ {
@@ -100,6 +101,8 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove); SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
SubscribeLocalEvent<ActivelyMicrowavedComponent, OnConstructionTemperatureEvent>(OnConstructionTemp); SubscribeLocalEvent<ActivelyMicrowavedComponent, OnConstructionTemperatureEvent>(OnConstructionTemp);
SubscribeLocalEvent<FoodRecipeProviderComponent, GetSecretRecipesEvent>(OnGetSecretRecipes);
} }
private void OnCookStart(Entity<ActiveMicrowaveComponent> ent, ref ComponentStartup args) private void OnCookStart(Entity<ActiveMicrowaveComponent> ent, ref ComponentStartup args)
@@ -588,7 +591,12 @@ namespace Content.Server.Kitchen.EntitySystems
} }
// Check recipes // 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); CanSatisfyRecipe(component, r, solidsDict, reagentDict)).FirstOrDefault(r => r.Item2 > 0);
_audio.PlayPvs(component.StartCookingSound, uid); _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 #region ui
private void OnEjectMessage(Entity<MicrowaveComponent> ent, ref MicrowaveEjectMessage args) private void OnEjectMessage(Entity<MicrowaveComponent> ent, ref MicrowaveEjectMessage args)
{ {

View 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();
}

View 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();
}

View File

@@ -37,6 +37,12 @@ namespace Content.Shared.Kitchen
public IReadOnlyDictionary<string, FixedPoint2> IngredientsReagents => _ingsReagents; public IReadOnlyDictionary<string, FixedPoint2> IngredientsReagents => _ingsReagents;
public IReadOnlyDictionary<string, FixedPoint2> IngredientsSolids => _ingsSolids; public IReadOnlyDictionary<string, FixedPoint2> IngredientsSolids => _ingsSolids;
/// <summary>
/// Is this recipe unavailable in normal circumstances?
/// </summary>
[DataField]
public bool SecretRecipe = false;
/// <summary> /// <summary>
/// Count the number of ingredients in a recipe for sorting the recipe list. /// Count the number of ingredients in a recipe for sorting the recipe list.
/// This makes sure that where ingredient lists overlap, the more complex /// This makes sure that where ingredient lists overlap, the more complex

View File

@@ -14,6 +14,7 @@ namespace Content.Shared.Kitchen
Recipes = new List<FoodRecipePrototype>(); Recipes = new List<FoodRecipePrototype>();
foreach (var item in _prototypeManager.EnumeratePrototypes<FoodRecipePrototype>()) foreach (var item in _prototypeManager.EnumeratePrototypes<FoodRecipePrototype>())
{ {
if (!item.SecretRecipe)
Recipes.Add(item); Recipes.Add(item);
} }

View File

@@ -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. 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. 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. 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

View File

@@ -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-backpack-syndicate-desc = Lightweight explosion-proof a backpack for holding various traitor goods
uplink-combat-bakery-name = Combat Bakery Kit 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.

View File

@@ -83,3 +83,5 @@
- id: WeaponCroissant - id: WeaponCroissant
amount: 2 amount: 2
- id: WeaponBaguette - id: WeaponBaguette
- id: SyndicateMicrowaveMachineCircuitboard
- id: PaperWrittenCombatBakeryKit

View File

@@ -23,3 +23,12 @@
type: PaperBoundUserInterface type: PaperBoundUserInterface
- type: Paper - type: Paper
content: book-text-holoparasite-info 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

View File

@@ -1751,7 +1751,7 @@
icon: { sprite: Objects/Consumable/Food/Baked/bread.rsi, state: baguette} icon: { sprite: Objects/Consumable/Food/Baked/bread.rsi, state: baguette}
productEntity: CombatBakeryKit productEntity: CombatBakeryKit
cost: cost:
Telecrystal: 3 Telecrystal: 6
categories: categories:
- UplinkJob - UplinkJob
conditions: conditions:

View File

@@ -124,3 +124,7 @@
snapCardinals: true snapCardinals: true
- type: Machine - type: Machine
board: SyndicateMicrowaveMachineCircuitboard board: SyndicateMicrowaveMachineCircuitboard
- type: FoodRecipeProvider
providedRecipes:
- RecipeBaguetteSword
- RecipeThrowingCroissant

View File

@@ -458,6 +458,19 @@
solids: solids:
FoodDough: 1 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 - type: microwaveMealRecipe
id: RecipeButteredToast id: RecipeButteredToast
name: buttered toast recipe name: buttered toast recipe
@@ -1864,3 +1877,14 @@
solids: solids:
FoodCroissantRaw: 1 FoodCroissantRaw: 1
FoodButterSlice: 1 FoodButterSlice: 1
- type: microwaveMealRecipe
id: RecipeThrowingCroissant
name: throwing croissant recipe
result: WeaponCroissant
secretRecipe: true
time: 5
solids:
FoodCroissantRaw: 1
FoodButterSlice: 1
ShardGlass: 1