diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Update.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Update.cs index aab1bb63fa..c76c19d847 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Update.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Update.cs @@ -14,107 +14,109 @@ namespace Content.Server.Nyanotrasen.Kitchen.EntitySystems; public sealed partial class DeepFryerSystem { public override void Update(float frameTime) + { + base.Update(frameTime); + + foreach (var component in EntityManager.EntityQuery()) { - base.Update(frameTime); + var uid = component.Owner; - foreach (var component in EntityManager.EntityQuery()) + if (_gameTimingSystem.CurTime < component.NextFryTime || + !_powerReceiverSystem.IsPowered(uid)) { - var uid = component.Owner; + continue; + } - if (_gameTimingSystem.CurTime < component.NextFryTime || - !_powerReceiverSystem.IsPowered(uid)) + UpdateNextFryTime(uid, component); + + if (!_solutionContainerSystem.TryGetSolution(uid, component.Solution.Name, out var solution)) + continue; + + // Heat the vat solution and contained entities. + _solutionContainerSystem.SetTemperature(solution.Value, component.PoweredTemperature); + + foreach (var item in component.Storage.ContainedEntities) + CookItem(uid, component, item); + + // Do something bad if there's enough heat but not enough oil. + var oilVolume = GetOilVolume(uid, component); + + if (oilVolume < component.SafeOilVolume) + { + foreach (var item in component.Storage.ContainedEntities.ToArray()) + BurnItem(uid, component, item); + + if (oilVolume > FixedPoint2.Zero) { - continue; - } - - UpdateNextFryTime(uid, component); - - if (!_solutionContainerSystem.TryGetSolution(uid, component.Solution.Name, out var solution)) - continue; - - // Heat the vat solution and contained entities. - _solutionContainerSystem.SetTemperature(solution.Value, component.PoweredTemperature); - - foreach (var item in component.Storage.ContainedEntities) - CookItem(uid, component, item); - - // Do something bad if there's enough heat but not enough oil. - var oilVolume = GetOilVolume(uid, component); - - if (oilVolume < component.SafeOilVolume) - { - foreach (var item in component.Storage.ContainedEntities.ToArray()) - BurnItem(uid, component, item); - - if (oilVolume > FixedPoint2.Zero) + //JJ Comment - this code block makes the Linter fail, and doesn't seem to be necessary with the changes I made. + foreach (var reagent in component.Solution.Contents.ToArray()) { - //JJ Comment - this code block makes the Linter fail, and doesn't seem to be necessary with the changes I made. - foreach (var reagent in component.Solution.Contents.ToArray()) + _prototypeManager.TryIndex(reagent.Reagent.ToString(), out var proto); + + foreach (var effect in component.UnsafeOilVolumeEffects) { - _prototypeManager.TryIndex(reagent.Reagent.ToString(), out var proto); - - foreach (var effect in component.UnsafeOilVolumeEffects) - { - effect.Effect(new EntityEffectReagentArgs(uid, - EntityManager, - null, - component.Solution, - reagent.Quantity, - proto!, - null, - 1f)); - } - + // TODO: October - Fix this + /*effect.Effect(new EntityEffectReagentArgs(uid, + EntityManager, + null, + component.Solution, + reagent.Quantity, + proto!, + null, + 1f)); + */ } - component.Solution.RemoveAllSolution(); - - _popupSystem.PopupEntity( - Loc.GetString("deep-fryer-oil-volume-low", - ("deepFryer", uid)), - uid, - PopupType.SmallCaution); - - continue; } - } - // We only alert the chef that there's a problem with oil purity - // if there's anything to cook beyond this point. - if (!component.Storage.ContainedEntities.Any()) - { - continue; - } + component.Solution.RemoveAllSolution(); - if (GetOilPurity(uid, component) < component.FryingOilThreshold) - { _popupSystem.PopupEntity( - Loc.GetString("deep-fryer-oil-purity-low", + Loc.GetString("deep-fryer-oil-volume-low", ("deepFryer", uid)), uid, - Filter.Pvs(uid, PvsWarningRange), - true); + PopupType.SmallCaution); + continue; } - - foreach (var item in component.Storage.ContainedEntities.ToArray()) - DeepFry(uid, component, item); - - // After the round of frying, replace the spent oil with a - // waste product. - if (component.WasteToAdd > FixedPoint2.Zero) - { - foreach (var reagent in component.WasteReagents) - component.Solution.AddReagent(reagent.Reagent.ToString(), reagent.Quantity * component.WasteToAdd); - - component.WasteToAdd = FixedPoint2.Zero; - - _solutionContainerSystem.UpdateChemicals(solution.Value, true); - } - - UpdateUserInterface(uid, component); } + + // We only alert the chef that there's a problem with oil purity + // if there's anything to cook beyond this point. + if (!component.Storage.ContainedEntities.Any()) + { + continue; + } + + if (GetOilPurity(uid, component) < component.FryingOilThreshold) + { + _popupSystem.PopupEntity( + Loc.GetString("deep-fryer-oil-purity-low", + ("deepFryer", uid)), + uid, + Filter.Pvs(uid, PvsWarningRange), + true); + continue; + } + + foreach (var item in component.Storage.ContainedEntities.ToArray()) + DeepFry(uid, component, item); + + // After the round of frying, replace the spent oil with a + // waste product. + if (component.WasteToAdd > FixedPoint2.Zero) + { + foreach (var reagent in component.WasteReagents) + component.Solution.AddReagent(reagent.Reagent.ToString(), reagent.Quantity * component.WasteToAdd); + + component.WasteToAdd = FixedPoint2.Zero; + + _solutionContainerSystem.UpdateChemicals(solution.Value, true); + } + + UpdateUserInterface(uid, component); } + } private void UpdateAmbientSound(EntityUid uid, DeepFryerComponent component) { diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs index eccbb50fb7..660f7eb58c 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs @@ -16,7 +16,7 @@ using Content.Server.Popups; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Server.Storage.EntitySystems; -using Content.Server.Temperature.Components; + using Content.Server.Temperature.Systems; using Content.Server.UserInterface; using Content.Shared.Cargo; @@ -47,6 +47,7 @@ using Content.Shared.Nyanotrasen.Kitchen.Components; using Content.Shared.Nyanotrasen.Kitchen.UI; using Content.Shared.Popups; using Content.Shared.Power; +using Content.Shared.Temperature.Components; using Content.Shared.Throwing; using Content.Shared.UserInterface; using Content.Shared.Whitelist; @@ -384,7 +385,8 @@ public sealed partial class DeepFryerSystem : SharedDeepfryerSystem //JJ Comment - not sure this works. Need to check if Reagent.ToString is correct. _prototypeManager.TryIndex(reagent.Reagent.ToString(), out var proto); - var effectsArgs = new EntityEffectReagentArgs(uid, + // TODO: October - Fix this + /*var effectsArgs = new EntityEffectReagentArgs(uid, EntityManager, null, component.Solution, @@ -392,12 +394,13 @@ public sealed partial class DeepFryerSystem : SharedDeepfryerSystem proto!, null, 1f); + foreach (var effect in component.UnsafeOilVolumeEffects) { if (!effect.ShouldApply(effectsArgs, _random)) continue; effect.Effect(effectsArgs); - } + }*/ } } diff --git a/Resources/Migrations/migration.yml b/Resources/Migrations/migration.yml index dbde7fbaaf..4da877e178 100644 --- a/Resources/Migrations/migration.yml +++ b/Resources/Migrations/migration.yml @@ -702,3 +702,6 @@ DresserHeadOfSecurityFilled: DresserHeadOfSecurityFilledDV DresserQuarterMasterFilled: DresserQuarterMasterFilledDV DresserResearchDirectorFilled: DresserResearchDirectorFilledDV DresserWardenFilled: DresserWardenFilledDV + +# 2025-12-23 - DeltaV +KitchenDeepFryer: null \ No newline at end of file