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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user