From f06fc04768736b8b7e4195fad6c5b122b4fcc8ea Mon Sep 17 00:00:00 2001 From: JJ <47927305+PHCodes@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:57:10 -0400 Subject: [PATCH] Deep Fryer And Its Powers (#163) * Deep Fryer And Its Powers The Deep Fryer has been implemented. It uses Corn Oil, Ghee, and Olive Oil to fry. Other features include: 1. Mixing Oil and Water at a certain temperature causes smoke. 2. When throwing an object at the Deep Fryer, a Chef will *always* land the shot, but anyone else has a chance of missing. 3. When an item is sliced, an event is triggered that other items can see. * Update meal_recipes.yml * Reworking the effects so they won't trigger on init. * Create DeepFryerTest.cs * Commenting out the UnsafeOilVolumeEffects part of the .yml. Something about the sound script inside of it breaks UnintializedSaveTest and it's not necessary for a smoke reaction to occur anyway. * Update DeepFryerSystem.cs --- .../Kitchen/Components/DeepFriedComponent.cs | 10 + .../Kitchen/Components/DeepFryerComponent.cs | 10 + .../Kitchen/UI/DeepFryerBoundUserInterface.cs | 64 + .../Kitchen/UI/DeepFryerWindow.xaml | 67 ++ .../Kitchen/UI/DeepFryerWindow.xaml.cs | 71 ++ .../Visualizers/DeepFriedVisualizer.cs | 73 ++ .../Visualizers/DeepFryerVisualizer.cs | 21 + .../Tests/Nyanotrasen/DeepFryerTest.cs | 58 + .../EntitySystems/SliceableFoodSystem.cs | 42 + .../Kitchen/Components/DeepFriedComponent.cs | 23 + .../Kitchen/Components/DeepFryerComponent.cs | 240 ++++ .../Components/ProfessionalChefComponent.cs | 5 + .../Kitchen/EntitySystems/DeepFryerSystem.cs | 1065 +++++++++++++++++ .../Kitchen/ClearSlagDoAfterEvent.cs | 29 + .../Components/SharedDeepFriedComponent.cs | 22 + .../Components/SharedDeepFryerComponent.cs | 12 + .../Kitchen/UI/DeepFryerMessages.cs | 67 ++ Content.Shared/Throwing/ThrowEvents.cs | 13 +- Content.Shared/Throwing/ThrownItemSystem.cs | 5 +- .../Nyanotrasen/Machines/attributions.yml | 9 + .../Machines/deepfryer_basket_add_item.ogg | Bin 0 -> 38471 bytes .../Machines/deepfryer_basket_remove_item.ogg | Bin 0 -> 9506 bytes .../kitchen/deep-fryer-component.ftl | 47 + .../Prototypes/Catalog/Fills/Crates/food.yml | 6 + .../Entities/Structures/Machines/lathe.yml | 2 +- .../Markers/Spawners/Random/devices.yml | 2 +- .../Objects/Consumable/Drinks/drinks_oil.yml | 56 + .../Devices/CircuitBoards/production.yml | 20 + .../Structures/Machines/deep_fryer.yml | 166 +++ .../Reagents/Consumable/Food/condiments.yml | 16 + .../Recipes/Lathes/electronics.yml | 9 + .../Nyanotrasen/Recipes/Reactions/food.yml | 13 +- .../Recipes/Reactions/pyrotechnic.yml | 39 + .../Reagents/Consumable/Food/ingredients.yml | 2 + .../Prototypes/Research/civilianservices.yml | 1 + .../Prototypes/Roles/Jobs/Civilian/chef.yml | 6 +- .../Consumable/Drinks/oil_jar.rsi/butter.png | Bin 0 -> 154 bytes .../Consumable/Drinks/oil_jar.rsi/corn.png | Bin 0 -> 157 bytes .../Consumable/Drinks/oil_jar.rsi/icon.png | Bin 0 -> 278 bytes .../Drinks/oil_jar.rsi/icon_open.png | Bin 0 -> 267 bytes .../Consumable/Drinks/oil_jar.rsi/meta.json | 26 + .../Consumable/Drinks/oil_jar.rsi/olives.png | Bin 0 -> 143 bytes .../Machines/deep_fryer.rsi/meta.json | 255 ++++ .../Machines/deep_fryer.rsi/off-0.png | Bin 0 -> 981 bytes .../Machines/deep_fryer.rsi/off-1.png | Bin 0 -> 152 bytes .../Machines/deep_fryer.rsi/off-2.png | Bin 0 -> 208 bytes .../Machines/deep_fryer.rsi/off-3.png | Bin 0 -> 217 bytes .../Machines/deep_fryer.rsi/off-4.png | Bin 0 -> 212 bytes .../Machines/deep_fryer.rsi/off-5.png | Bin 0 -> 236 bytes .../Machines/deep_fryer.rsi/off-6.png | Bin 0 -> 244 bytes .../Machines/deep_fryer.rsi/off-7.png | Bin 0 -> 240 bytes .../Machines/deep_fryer.rsi/off-8.png | Bin 0 -> 259 bytes .../Machines/deep_fryer.rsi/on-1.png | Bin 0 -> 322 bytes .../Machines/deep_fryer.rsi/on-2.png | Bin 0 -> 473 bytes .../Machines/deep_fryer.rsi/on-3.png | Bin 0 -> 539 bytes .../Machines/deep_fryer.rsi/on-4.png | Bin 0 -> 535 bytes .../Machines/deep_fryer.rsi/on-5.png | Bin 0 -> 566 bytes .../Machines/deep_fryer.rsi/on-6.png | Bin 0 -> 720 bytes .../Machines/deep_fryer.rsi/on-7.png | Bin 0 -> 729 bytes .../Machines/deep_fryer.rsi/on-8.png | Bin 0 -> 769 bytes 60 files changed, 2564 insertions(+), 8 deletions(-) create mode 100644 Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs create mode 100644 Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs create mode 100644 Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs create mode 100644 Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml create mode 100644 Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml.cs create mode 100644 Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFriedVisualizer.cs create mode 100644 Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFryerVisualizer.cs create mode 100644 Content.IntegrationTests/Tests/Nyanotrasen/DeepFryerTest.cs create mode 100644 Content.Server/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs create mode 100644 Content.Server/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs create mode 100644 Content.Server/Nyanotrasen/Kitchen/Components/ProfessionalChefComponent.cs create mode 100644 Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs create mode 100644 Content.Shared/Nyanotrasen/Kitchen/ClearSlagDoAfterEvent.cs create mode 100644 Content.Shared/Nyanotrasen/Kitchen/Components/SharedDeepFriedComponent.cs create mode 100644 Content.Shared/Nyanotrasen/Kitchen/Components/SharedDeepFryerComponent.cs create mode 100644 Content.Shared/Nyanotrasen/Kitchen/UI/DeepFryerMessages.cs create mode 100644 Resources/Audio/Nyanotrasen/Machines/deepfryer_basket_add_item.ogg create mode 100644 Resources/Audio/Nyanotrasen/Machines/deepfryer_basket_remove_item.ogg create mode 100644 Resources/Locale/en-US/nyanotrasen/kitchen/deep-fryer-component.ftl create mode 100644 Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Drinks/drinks_oil.yml create mode 100644 Resources/Prototypes/Nyanotrasen/Entities/Structures/Machines/deep_fryer.yml create mode 100644 Resources/Prototypes/Nyanotrasen/Recipes/Reactions/pyrotechnic.yml create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/butter.png create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/corn.png create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/icon.png create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/icon_open.png create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/meta.json create mode 100644 Resources/Textures/Nyanotrasen/Objects/Consumable/Drinks/oil_jar.rsi/olives.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/meta.json create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-0.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-1.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-2.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-3.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-4.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-5.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-6.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-7.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/off-8.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-1.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-2.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-3.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-4.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-5.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-6.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-7.png create mode 100644 Resources/Textures/Nyanotrasen/Structures/Machines/deep_fryer.rsi/on-8.png diff --git a/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs new file mode 100644 index 00000000000000..a1252cf43edbc0 --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs @@ -0,0 +1,10 @@ +using Content.Shared.Kitchen.Components; + +namespace Content.Client.Kitchen.Components +{ + [RegisterComponent] + //Unnecessary item: [ComponentReference(typeof(SharedDeepFriedComponent))] + public sealed partial class DeepFriedComponent : SharedDeepFriedComponent + { + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs new file mode 100644 index 00000000000000..4123eb341cae94 --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs @@ -0,0 +1,10 @@ +using Content.Shared.Kitchen.Components; + +namespace Content.Client.Kitchen.Components +{ + [RegisterComponent] + // Unnecessary line: [ComponentReference(typeof(SharedDeepFryerComponent))] + public sealed partial class DeepFryerComponent : SharedDeepFryerComponent + { + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs new file mode 100644 index 00000000000000..8db884328e45ab --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs @@ -0,0 +1,64 @@ +using Robust.Client.GameObjects; +using Content.Shared.Kitchen.UI; + +namespace Content.Client.Nyanotrasen.Kitchen.UI +{ + public sealed class DeepFryerBoundUserInterface : BoundUserInterface + { + private DeepFryerWindow? _window; + + private NetEntity[] _entities = default!; + + public DeepFryerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + base.Open(); + _window = new DeepFryerWindow(); + _window.OnClose += Close; + _window.ItemList.OnItemSelected += args => + { + SendMessage(new DeepFryerRemoveItemMessage(_entities[args.ItemIndex])); + }; + _window.InsertItem.OnPressed += _ => + { + SendMessage(new DeepFryerInsertItemMessage()); + }; + _window.ScoopVat.OnPressed += _ => + { + SendMessage(new DeepFryerScoopVatMessage()); + }; + _window.ClearSlag.OnPressed += args => + { + SendMessage(new DeepFryerClearSlagMessage()); + }; + _window.RemoveAllItems.OnPressed += _ => + { + SendMessage(new DeepFryerRemoveAllItemsMessage()); + }; + _window.OpenCentered(); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (_window == null) + return; + + if (state is not DeepFryerBoundUserInterfaceState cast) + return; + + _entities = cast.ContainedEntities; + _window.UpdateState(cast); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (!disposing) + return; + + _window?.Dispose(); + } + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml new file mode 100644 index 00000000000000..6ada0b95baf281 --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml @@ -0,0 +1,67 @@ + + + + + +