]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Microwaves no longer instantly gib living creatures Microwaves now heat in real-time
authordeathride58 <deathride58@users.noreply.github.com>
Sun, 7 Jan 2024 01:16:39 +0000 (20:16 -0500)
committerGitHub <noreply@github.com>
Sun, 7 Jan 2024 01:16:39 +0000 (17:16 -0800)
* Animal cruelty nerf - microwaves no longer instantly gib, and now heat in realtime

* While we're at it there's honestly no need for this shit to be hardcoded

Content.Server/Body/Systems/BodySystem.cs
Content.Server/Kitchen/Components/MicrowaveComponent.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs

index 351239c73a4fda7e0e8ee6d7a999f98118b4f460..1630d4cb10dbc070a99165763dc058d3719bdcd3 100644 (file)
@@ -37,7 +37,6 @@ public sealed class BodySystem : SharedBodySystem
 
         SubscribeLocalEvent<BodyComponent, MoveInputEvent>(OnRelayMoveInput);
         SubscribeLocalEvent<BodyComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
-        SubscribeLocalEvent<BodyComponent, BeingMicrowavedEvent>(OnBeingMicrowaved);
     }
 
     private void OnRelayMoveInput(EntityUid uid, BodyComponent component, ref MoveInputEvent args)
@@ -65,19 +64,6 @@ public sealed class BodySystem : SharedBodySystem
         }
     }
 
-    private void OnBeingMicrowaved(EntityUid uid, BodyComponent component, BeingMicrowavedEvent args)
-    {
-        if (args.Handled)
-            return;
-
-        // Don't microwave animals, kids
-        SharedTransform.AttachToGridOrMap(uid);
-        _appearance.SetData(args.Microwave, MicrowaveVisualState.Bloody, true);
-        GibBody(uid, false, component);
-
-        args.Handled = true;
-    }
-
     protected override void AddPart(
         EntityUid bodyUid,
         EntityUid partUid,
index 631ce6a45016f1ce7f85d0b6f10f1c928d6b4203..f0d0ffd95f58a229c87530ddc030b4215657a399 100644 (file)
@@ -16,6 +16,10 @@ namespace Content.Server.Kitchen.Components
         public string MachinePartCookTimeMultiplier = "Capacitor";
         [DataField("cookTimeScalingConstant")]
         public float CookTimeScalingConstant = 0.5f;
+        [DataField("baseHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]
+        public float BaseHeatMultiplier = 100;
+        [DataField("objectHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]
+        public float ObjectHeatMultiplier = 100;
 
         [DataField("failureResult", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
         public string BadRecipeEntityId = "FoodBadRecipe";
index fb9ea290421ea64b09ecb46a27c8e186afc6f052..38965a19d5534823e5afe993027d9ec0d06d1258 100644 (file)
@@ -105,11 +105,11 @@ namespace Content.Server.Kitchen.EntitySystems
         /// <param name="time">The time on the microwave, in seconds.</param>
         private void AddTemperature(MicrowaveComponent component, float time)
         {
-            var heatToAdd = time * 100;
+            var heatToAdd = time * component.BaseHeatMultiplier;
             foreach (var entity in component.Storage.ContainedEntities)
             {
                 if (TryComp<TemperatureComponent>(entity, out var tempComp))
-                    _temperature.ChangeHeat(entity, heatToAdd, false, tempComp);
+                    _temperature.ChangeHeat(entity, heatToAdd * component.ObjectHeatMultiplier, false, tempComp);
 
                 if (!TryComp<SolutionContainerManagerComponent>(entity, out var solutions))
                     continue;
@@ -482,10 +482,13 @@ namespace Content.Server.Kitchen.EntitySystems
                 //check if there's still cook time left
                 active.CookTimeRemaining -= frameTime;
                 if (active.CookTimeRemaining > 0)
+                {
+                    AddTemperature(microwave, frameTime);
                     continue;
+                }
 
                 //this means the microwave has finished cooking.
-                AddTemperature(microwave, active.TotalTime);
+                AddTemperature(microwave, Math.Max(frameTime + active.CookTimeRemaining, 0)); //Though there's still a little bit more heat to pump out
 
                 if (active.PortionedRecipe.Item1 != null)
                 {