From 2d1b3197ecb66f07694901be8e2a1a7521dd4811 Mon Sep 17 00:00:00 2001 From: Adrian16199 Date: Wed, 27 Sep 2023 16:39:43 +0200 Subject: [PATCH] Adjustments. --- .../EntitySystems/SliceableFoodSystem.cs | 74 +++++++++++++++++++ .../Kitchen/Components/DeepFryerComponent.cs | 2 +- .../reagents/meta/physical-desc.ftl | 1 - .../Objects/Consumable/Food/ingredients.yml | 9 +++ .../Objects/Consumable/Drinks/drinks_oil.yml | 2 +- .../Circuitboards/Machine/production.yml | 6 +- .../Structures/Machines/deep_fryer.yml | 2 +- .../Reagents/Consumable/Food/condiments.yml | 2 +- .../Recipes/Reactions/pyrotechnic.yml | 2 +- .../Prototypes/Roles/Jobs/Civilian/chef.yml | 4 + 10 files changed, 95 insertions(+), 9 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs index c4b248ff93e..45634b7d899 100644 --- a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs @@ -19,6 +19,7 @@ internal sealed class SliceableFoodSystem : EntitySystem [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; + [Dependency] private readonly SharedAudioSystem _audioSystem = default!; // this line belongs to deep fryer nyano. public override void Initialize() { @@ -57,6 +58,11 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem, return false; } + var attemptEvent = new SliceFoodAttemptEvent(user, usedItem, uid); //Start of Nyano deepfyer. + RaiseLocalEvent(uid, attemptEvent); + if (attemptEvent.Cancelled) + return false; //End of Nyano Deepfryer. + var sliceUid = Spawn(component.Slice, transform.Coordinates); var lostSolution = _solutionContainerSystem.SplitSolution(uid, solution, @@ -77,6 +83,8 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem, xform.LocalRotation = 0; } + _audioSystem.PlayPvs(component.Sound, uid, AudioParams.Default.WithVolume(-2f)); //Nyano deepfryer. + SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid), transform.Coordinates, AudioParams.Default.WithVolume(-2)); @@ -88,6 +96,9 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem, // } component.Count--; + + var sliceEvent = new SliceFoodEvent(user, usedItem, uid, sliceUid); //Start of Nyano deep fryer. + RaiseLocalEvent(uid, sliceEvent); //End of Nyano deep fryer // If someone makes food proto with 1 slice... if (component.Count < 1) @@ -116,6 +127,9 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem, xform.LocalRotation = 0; } + var sliceSplitEvent = new SliceFoodEvent(user, usedItem, uid, sliceUid); //Start of Nyano deep fryer. + RaiseLocalEvent(uid, sliceSplitEvent); //End of Nyano deep fryer + DeleteFood(uid, user); return true; } @@ -159,4 +173,64 @@ private void OnExamined(EntityUid uid, SliceableFoodComponent component, Examine args.PushMarkup(Loc.GetString("sliceable-food-component-on-examine-remaining-slices-text", ("remainingCount", component.Count))); } } + + public sealed class SliceFoodAttemptEvent : CancellableEntityEventArgs //Start of Nyano Deep fryer + { + /// + /// Who's doing the slicing? + /// + public EntityUid User; + + /// + /// What's doing the slicing? + /// + public EntityUid Tool; + + /// + /// What's being sliced? + /// + public EntityUid Food; + + public SliceFoodAttemptEvent(EntityUid user, EntityUid tool, EntityUid food) + { + User = user; + Tool = tool; + Food = food; + } + } + + public sealed class SliceFoodEvent : EntityEventArgs + { + /// + /// Who did the slicing? + /// + public EntityUid User; + + /// + /// What did the slicing? + /// + public EntityUid Tool; + + /// + /// What has been sliced? + /// + /// + /// This could soon be deleted if there was not enough food left to + /// continue slicing. + /// + public EntityUid Food; + + /// + /// What is the slice? + /// + public EntityUid Slice; + + public SliceFoodEvent(EntityUid user, EntityUid tool, EntityUid food, EntityUid slice) + { + User = user; + Tool = tool; + Food = food; + Slice = slice; + } + } //End of Nyano Deep fryer. } diff --git a/Content.Server/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs b/Content.Server/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs index fd7afb737b4..66c3e9b4ec3 100644 --- a/Content.Server/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs +++ b/Content.Server/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs @@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set; using Content.Server.Kitchen.EntitySystems; -using Content.Server.Nutrition; +using Content.Shared.Nutrition; // Changed from Server to Shared. using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; using Content.Shared.Construction.Prototypes; diff --git a/Resources/Locale/en-US/nyanotrasen/reagents/meta/physical-desc.ftl b/Resources/Locale/en-US/nyanotrasen/reagents/meta/physical-desc.ftl index 36e32615921..1783b386ac3 100644 --- a/Resources/Locale/en-US/nyanotrasen/reagents/meta/physical-desc.ftl +++ b/Resources/Locale/en-US/nyanotrasen/reagents/meta/physical-desc.ftl @@ -1,2 +1 @@ -reagent-physical-desc-enigmatic = enigmatic reagent-physical-desc-porous = porous diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml index 4d636e146fe..4164edc8a6a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml @@ -470,6 +470,15 @@ components: - type: Sprite state: butter + - type: SolutionContainerManager + solutions: + food: + maxVol: 15 + reagents: + - ReagentId: Butter + Quantity: 15 + - type: Extractable + grindableSolutionName: food - type: entity name: stick of cannabis butter diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Drinks/drinks_oil.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Drinks/drinks_oil.yml index 755b03ca1e5..45846d4da39 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Drinks/drinks_oil.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Consumable/Drinks/drinks_oil.yml @@ -33,7 +33,7 @@ drink: maxVol: 100 reagents: - - ReagentId: OilCorn + - ReagentId: Cornoil # Changed from OilCorn to fit wizden code. Quantity: 100 - type: entity diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Circuitboards/Machine/production.yml index 655682b3b39..599f2650530 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -14,6 +14,6 @@ Steel: 4 Glass: 2 Cable: 4 - - type: ReverseEngineering - recipes: - - DeepFryerMachineCircuitboard + # type: ReverseEngineering + # recipes: + # DeepFryerMachineCircuitboard \ No newline at end of file diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Machines/deep_fryer.yml b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Machines/deep_fryer.yml index 627c6998f21..5f1974f2bd4 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Machines/deep_fryer.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Machines/deep_fryer.yml @@ -102,7 +102,7 @@ - terrible solution: vat_oil fryingOils: - - OilCorn + - Cornoil # changed from OilCorn to Cornoil to fit wizden code. - OilGhee - OilOlive unsafeOilVolumeEffects: diff --git a/Resources/Prototypes/Nyanotrasen/Reagents/Consumable/Food/condiments.yml b/Resources/Prototypes/Nyanotrasen/Reagents/Consumable/Food/condiments.yml index a8bca216036..75563fa3c2a 100644 --- a/Resources/Prototypes/Nyanotrasen/Reagents/Consumable/Food/condiments.yml +++ b/Resources/Prototypes/Nyanotrasen/Reagents/Consumable/Food/condiments.yml @@ -94,4 +94,4 @@ effects: - !type:AdjustReagent reagent: Nutriment - amount: 0.75 \ No newline at end of file + amount: 0.75 diff --git a/Resources/Prototypes/Nyanotrasen/Recipes/Reactions/pyrotechnic.yml b/Resources/Prototypes/Nyanotrasen/Recipes/Reactions/pyrotechnic.yml index 78369bcde58..ca138a8983c 100644 --- a/Resources/Prototypes/Nyanotrasen/Recipes/Reactions/pyrotechnic.yml +++ b/Resources/Prototypes/Nyanotrasen/Recipes/Reactions/pyrotechnic.yml @@ -4,7 +4,7 @@ impact: Medium minTemp: 373.15 reactants: - OilCorn: + Cornoil: # Changed to Cornoil from OilCorn to fit wizden code. amount: 1 Water: amount: 1 diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml b/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml index ff9a0ab477e..b48bdced081 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml @@ -17,6 +17,10 @@ extendedAccess: - Hydroponics - Bar + special: # Start of Nyano Deep fryer + - !type:AddComponentSpecial + components: + - type: ProfessionalChef # End of Nyano Deep fryer - type: startingGear id: ChefGear