]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Puddle code hotfix 2 (#37046)
authorPrincess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Tue, 29 Apr 2025 20:10:00 +0000 (13:10 -0700)
committerGitHub <noreply@github.com>
Tue, 29 Apr 2025 20:10:00 +0000 (21:10 +0100)
Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs [new file with mode: 0644]
Content.Server/Chemistry/TileReactions/SpillTileReaction.cs [new file with mode: 0644]
Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml
Resources/Prototypes/Reagents/Consumable/Food/condiments.yml
Resources/Prototypes/Reagents/biological.yml
Resources/Prototypes/Reagents/cleaning.yml

diff --git a/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs b/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs
new file mode 100644 (file)
index 0000000..5acef8d
--- /dev/null
@@ -0,0 +1,30 @@
+using Content.Server.Fluids.EntitySystems;
+using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.Reaction;
+using Content.Shared.Chemistry.Reagent;
+using Content.Shared.FixedPoint;
+using JetBrains.Annotations;
+using Robust.Shared.Map;
+
+namespace Content.Server.Chemistry.TileReactions
+{
+    [UsedImplicitly]
+    [DataDefinition]
+    public sealed partial class SpillIfPuddlePresentTileReaction : ITileReaction
+    {
+        public FixedPoint2 TileReact(TileRef tile,
+            ReagentPrototype reagent,
+            FixedPoint2 reactVolume,
+            IEntityManager entityManager,
+            List<ReagentData>? data)
+        {
+            var spillSystem = entityManager.System<PuddleSystem>();
+            if (!spillSystem.TryGetPuddle(tile, out _))
+                return FixedPoint2.Zero;
+
+            return spillSystem.TrySpillAt(tile, new Solution(reagent.ID, reactVolume, data), out _, sound: false, tileReact: false)
+                ? reactVolume
+                : FixedPoint2.Zero;
+        }
+    }
+}
diff --git a/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs b/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs
new file mode 100644 (file)
index 0000000..c371410
--- /dev/null
@@ -0,0 +1,28 @@
+using Content.Server.Fluids.EntitySystems;
+using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.Reaction;
+using Content.Shared.Chemistry.Reagent;
+using Content.Shared.FixedPoint;
+using JetBrains.Annotations;
+using Robust.Shared.Map;
+
+namespace Content.Server.Chemistry.TileReactions
+{
+    [UsedImplicitly]
+    [DataDefinition]
+    public sealed partial class SpillTileReaction : ITileReaction
+    {
+        public FixedPoint2 TileReact(TileRef tile,
+            ReagentPrototype reagent,
+            FixedPoint2 reactVolume,
+            IEntityManager entityManager,
+            List<ReagentData>? data)
+        {
+            var spillSystem = entityManager.System<PuddleSystem>();
+
+            return spillSystem.TrySpillAt(tile, new Solution(reagent.ID, reactVolume, data), out _, sound: false, tileReact: false)
+                ? reactVolume
+                : FixedPoint2.Zero;
+        }
+    }
+}
index dac16dcb1c753dff4104a51ab159900679d87fbf..c5cbaea8d3084089f8c79918b2d19d091cdfe0a4 100644 (file)
@@ -19,6 +19,7 @@
     amount: 1
   tileReactions:
   - !type:ExtinguishTileReaction { }
+  - !type:SpillIfPuddlePresentTileReaction { }
 
 - type: reagent
   id: BaseSoda
index 1dde464128f1fd3786b037675428e82410fd6868..addc85096df8798b7ebb5406d919ecc7aad7ac13 100644 (file)
   recognizable: true
   physicalDesc: reagent-physical-desc-sticky
   viscosity: 0.55 #Start using syrup to attach your remote recievers to your microwaves!
+  tileReactions:
+    - !type:SpillTileReaction
   metabolisms:
     Food:
       # 12 diona blood for 1 unit of syrup, this stuff better be worthwhile.
index df5ed519452bdab23e6ef50797b201665052f124..7e7c544c12713f617756675f26b2fc4f2818297e 100644 (file)
@@ -66,6 +66,8 @@
   recognizable: true
   physicalDesc: reagent-physical-desc-viscous
   viscosity: 0.25
+  tileReactions:
+    - !type:SpillTileReaction
   metabolisms:
     Food:
       # Delicious!
@@ -87,6 +89,8 @@
   recognizable: true
   physicalDesc: reagent-physical-desc-sticky
   viscosity: 0.10
+  tileReactions:
+    - !type:SpillTileReaction
   metabolisms:
     Food:
       # Sweet!
index 1c0f220160c127f411c8945eb83147bec5caebb9..3f289d04865bb097e418e4f2ab8660ce0d92b0c9 100644 (file)
@@ -77,6 +77,8 @@
   recognizable: true
   boilingPoint: 290.0 # Glycerin
   meltingPoint: 18.2
+  tileReactions:
+  - !type:SpillTileReaction
   friction: 0.0
 
 - type: reagent
@@ -88,6 +90,8 @@
   color: "#ffffff"
   boilingPoint: 250.0
   meltingPoint: 380.0
+  tileReactions:
+  - !type:SpillTileReaction
   viscosity: 0.5
   reactiveEffects:
     Acidic: