]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
You can bless more containers with a bible (#26526)
authorVerm <32827189+Vermidia@users.noreply.github.com>
Sat, 20 Apr 2024 06:16:55 +0000 (01:16 -0500)
committerGitHub <noreply@github.com>
Sat, 20 Apr 2024 06:16:55 +0000 (16:16 +1000)
* Made more things blessable

* Removed junk

* Remove whatever that was

* Make bowls blessable

* New mixablesolution component, converted everything to work with it

* Fix minor mishaps

* Fix extra spaces in bottle yml

* Fix last extra space, fix bottle havign the wrong solution name

* Remvoe unneeded event(I think), fix alcohol bottles not being mixable

* I missed cans

24 files changed:
Content.Server/Chemistry/EntitySystems/ReactionMixerSystem.cs
Content.Shared/Chemistry/Components/MixableSolutionComponent.cs [new file with mode: 0644]
Content.Shared/Chemistry/Components/Solution.cs
Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.Capabilities.cs
Content.Shared/Chemistry/Reaction/ReactionMixerComponent.cs
Resources/Maps/Test/dev_map.yml
Resources/Maps/atlas.yml
Resources/Maps/cluster.yml
Resources/Maps/core.yml
Resources/Maps/fland.yml
Resources/Maps/saltern.yml
Resources/Prototypes/Entities/Effects/puddle.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml
Resources/Prototypes/Entities/Objects/Specific/chemical-containers.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
Resources/Prototypes/Entities/Objects/Tools/bucket.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml

index 032374d4a5516d87de10556a2cf22ccf166d9af8..d5f7655f884cb1f337ad29307d16830318b3502b 100644 (file)
@@ -30,7 +30,7 @@ public sealed partial class ReactionMixerSystem : EntitySystem
             return;
         }
 
-        if (!_solutionContainers.TryGetMixableSolution(args.Target.Value, out var solution))
+        if (!_solutionContainers.TryGetMixableSolution(args.Target.Value, out var solution, out _))
             return;
 
         _popup.PopupEntity(Loc.GetString(entity.Comp.MixMessage, ("mixed", Identity.Entity(args.Target.Value, EntityManager)), ("mixer", Identity.Entity(entity.Owner, EntityManager))), args.User, args.User);
diff --git a/Content.Shared/Chemistry/Components/MixableSolutionComponent.cs b/Content.Shared/Chemistry/Components/MixableSolutionComponent.cs
new file mode 100644 (file)
index 0000000..2b1c140
--- /dev/null
@@ -0,0 +1,13 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Chemistry.Components;
+
+[RegisterComponent, NetworkedComponent]
+public sealed partial class MixableSolutionComponent : Component
+{
+    /// <summary>
+    /// Solution name which can be mixed with methods such as blessing
+    /// </summary>
+    [DataField, ViewVariables(VVAccess.ReadWrite)]
+    public string Solution = "default";
+}
index 1c24c860dd004de3efcd04c2233c8fa23e708852..4de3c369f7cce5e09ba51941dc97dc06372849fc 100644 (file)
@@ -48,13 +48,6 @@ namespace Content.Shared.Chemistry.Components
         [DataField("canReact")]
         public bool CanReact { get; set; } = true;
 
-        /// <summary>
-        ///     If reactions can occur via mixing.
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite)]
-        [DataField("canMix")]
-        public bool CanMix { get; set; } = false;
-
         /// <summary>
         ///     Volume needed to fill this container.
         /// </summary>
index 0d4912a504b14ea76670e0d94d9eb126f4119bb3..ce0cfab0021a3755ffa3f22918a7b8e29976d4c9 100644 (file)
@@ -78,31 +78,15 @@ public abstract partial class SharedSolutionContainerSystem
         return TryGetSolution((entity.Owner, entity.Comp2), entity.Comp1.Solution, out soln, out solution);
     }
 
-    public bool TryGetMixableSolution(Entity<SolutionContainerManagerComponent?> container, [NotNullWhen(true)] out Entity<SolutionComponent>? solution)
+    public bool TryGetMixableSolution(Entity<MixableSolutionComponent?, SolutionContainerManagerComponent?> entity, [NotNullWhen(true)] out Entity<SolutionComponent>? soln, [NotNullWhen(true)] out Solution? solution)
     {
-        var getMixableSolutionAttempt = new GetMixableSolutionAttemptEvent(container);
-        RaiseLocalEvent(container, ref getMixableSolutionAttempt);
-        if (getMixableSolutionAttempt.MixedSolution != null)
-        {
-            solution = getMixableSolutionAttempt.MixedSolution;
-            return true;
-        }
-
-        if (!Resolve(container, ref container.Comp, false))
+        if (!Resolve(entity, ref entity.Comp1, logMissing: false))
         {
-            solution = default!;
+            (soln, solution) = (default!, null);
             return false;
         }
 
-        var tryGetSolution = EnumerateSolutions(container).FirstOrNull(x => x.Solution.Comp.Solution.CanMix);
-        if (tryGetSolution.HasValue)
-        {
-            solution = tryGetSolution.Value.Solution;
-            return true;
-        }
-
-        solution = default!;
-        return false;
+        return TryGetSolution((entity.Owner, entity.Comp2), entity.Comp1.Solution, out soln, out solution);
     }
 
     #endregion Solution Accessors
index ede73c496906d4350cc9e4f2b99ba1387232041f..118f224061094bb66cd84b7ee920623b3b4f7a67 100644 (file)
@@ -25,6 +25,3 @@ public sealed partial class ReactionMixerComponent : Component
 public record struct MixingAttemptEvent(EntityUid Mixed, bool Cancelled = false);
 
 public readonly record struct AfterMixingEvent(EntityUid Mixed, EntityUid Mixer);
-
-[ByRefEvent]
-public record struct GetMixableSolutionAttemptEvent(EntityUid Mixed, Entity<SolutionComponent>? MixedSolution = null);
index 85f35719fb0a77fc5e5583706d3191adfbbe5a6f..48b2eddf621bc740ab07fd8ea63a42c0fe627e98 100644 (file)
@@ -4351,7 +4351,6 @@ entities:
       solutions:
         absorbed:
           temperature: 293.15
-          canMix: False
           canReact: True
           maxVol: 50
           name: null
index 7035f5ee24538f505ccc2d6eef720a0c2a1ee01c..eaf00d830aba8594239b312b49a6bb4210f9f667 100644 (file)
@@ -4542,7 +4542,6 @@ entities:
       solutions:
         beaker:
           temperature: 293.15
-          canMix: True
           canReact: True
           maxVol: 50
           name: null
@@ -4550,6 +4549,8 @@ entities:
           - data: null
             ReagentId: Leporazine
             Quantity: 50
+    - type: MixableSolution
+      solution: beaker
 - proto: Bed
   entities:
   - uid: 247
@@ -22184,7 +22185,6 @@ entities:
       solutions:
         drink:
           temperature: 293.15
-          canMix: False
           canReact: True
           maxVol: 30
           name: null
index cc12d77259ff8bd81354231eb540b2e3b836412f..607d8fb4f3fa6b0c144ba539d5b5b87959ed6744 100644 (file)
@@ -32761,7 +32761,6 @@ entities:
       solutions:
         drink:
           temperature: 293.15
-          canMix: False
           canReact: True
           maxVol: 30
           name: null
index 9e977b9b3598eb8a3018794f7ed7ad00da23e145..fa04376cbfa67e934bd0a74175bc9cd1e03d6d83 100644 (file)
@@ -64838,7 +64838,6 @@ entities:
       solutions:
         drink:
           temperature: 293.15
-          canMix: False
           canReact: True
           maxVol: 50
           name: null
index 451294470f91614ea4706054e7ab7de0fb2d3119..1476ef5c2d723d01d3e19633eae54486c4a9df56 100644 (file)
@@ -172898,7 +172898,6 @@ entities:
       solutions:
         puddle:
           temperature: 293.15
-          canMix: False
           canReact: True
           maxVol: 1000
           name: null
index 84e3587945d80eeb47c48ec79ff31a289f5b96c1..22b08b60b6f35c19393e8007df3d29c41c9a0742 100644 (file)
@@ -6112,7 +6112,6 @@ entities:
       solutions:
         beaker:
           temperature: 293.15
-          canMix: True
           canReact: True
           maxVol: 50
           name: null
@@ -6120,6 +6119,8 @@ entities:
           - data: null
             ReagentId: Leporazine
             Quantity: 40
+    - type: MixableSolution
+      solution: beaker
   - uid: 10800
     components:
     - type: Transform
index 2c845e1d0f05ee7bf645ad6dc0aa4f118a315522..fecf9f19a4785d017b0d4093a645fd578619c8a2 100644 (file)
     mode: CardinalFlags
   - type: SolutionContainerManager
     solutions:
-      puddle: { maxVol: 1000 }
+      puddle:
+        maxVol: 1000
   - type: Puddle
+  - type: MixableSolution
+    solution: puddle
   - type: Appearance
   - type: ActiveEdgeSpreader
   - type: EdgeSpreader
index aac2803dd2bca1fdd3563f25ee989694dd38df08..e8ae78763620fb49919d4b6f54cfa56a1768edbf 100644 (file)
@@ -10,6 +10,8 @@
     solutions:
       drink:
         maxVol: 30
+  - type: MixableSolution
+    solution: drink
   - type: SolutionTransfer
     canChangeTransferAmount: true
   - type: Drink
index 7dcd3fa6039eb0614ada69b625b3531e7d42e3bb..ca67e51792e8dd7227b4d8b5beba67640a2f7232 100644 (file)
@@ -14,6 +14,8 @@
         - ReagentId: Cola
           Quantity: 30
         maxVol: 30
+  - type: MixableSolution
+    solution: drink
   - type: SolutionTransfer
     canChangeTransferAmount: true
     maxTransferAmount: 15
index 8242496e20618c88cc235ed1d5d1f2c84faf5f96..763c4210ae2d5de3aad860adbad26aada054daa0 100644 (file)
@@ -10,7 +10,8 @@
     solutions:
       drink:
         maxVol: 20
-        canMix: true
+  - type: MixableSolution
+    solution: drink
   - type: FitsInDispenser
     solution: drink
   - type: DrawableSolution
index a7f1bdbec6bc2621b60678cf3a19a9c494cfaabe..829d68279d4c6147f3c79b67e4d5a6e9375c1aab 100644 (file)
@@ -8,6 +8,8 @@
     solutions:
       drink:
         maxVol: 100
+  - type: MixableSolution
+    solution: drink
   - type: Drink
   - type: Shakeable # Doesn't do anything, but I mean...
   - type: FitsInDispenser
index a3f5bf1903f5405d003e8d0eb5e22c5db53d1378..67154963d1fdabfc87b5ff85988f8350b48f1fc2 100644 (file)
@@ -25,6 +25,8 @@
     damage:
       types:
         Blunt: 0
+  - type: MixableSolution
+    solution: drink
   - type: Spillable
     solution: drink
   - type: FitsInDispenser
     solutions:
       drink:
         maxVol: 50
+  - type: MixableSolution
+    solution: drink
   - type: SolutionTransfer
     canChangeTransferAmount: true
     maxTransferAmount: 5
index 45953296351272334d17a83b98fcdc759c6ef0ec..70303cfdff4315b199c13dfd34d5477ccc637d31 100644 (file)
@@ -19,6 +19,8 @@
     - map: ["enum.SolutionContainerLayers.Fill"]
       state: fill-1
       visible: false
+  - type: MixableSolution
+    solution: food
   - type: DamageOnLand
     damage:
       types:
index 027ff206f8d9b2e0a74302001afdbdf433937673..01efcfa95024ef4e91ed29a6671ac7ec86db13ac 100644 (file)
@@ -8,7 +8,6 @@
       solutions:
         beaker:
           maxVol: 200
-          canMix: true
     - type: Sprite
       sprite: Objects/Specific/Chemistry/jug.rsi
       layers:
@@ -19,6 +18,8 @@
     - type: Item
       size: Normal
       sprite: Objects/Specific/Chemistry/jug.rsi
+    - type: MixableSolution
+      solution: beaker
     - type: RefillableSolution
       solution: beaker
     - type: DrainableSolution
index acfb65aa54fab54d63f78bb243d10513c24b7190..6c81fa946650024e0cd419f435f0ed0459e0b27c 100644 (file)
@@ -29,7 +29,8 @@
     solutions:
       drink: # This solution name and target volume is hard-coded in ChemMasterComponent
         maxVol: 30
-        canMix: true
+  - type: MixableSolution
+    solution: drink
   - type: RefillableSolution
     solution: drink
   - type: DrainableSolution
index c5de88d690d133b6987b38453b15f4e1af6e9a75..65f5fbb5d0624cb5fe19f1d1f668bc37b353721d 100644 (file)
@@ -35,7 +35,8 @@
     solutions:
       beaker:
         maxVol: 30
-        canMix: true
+  - type: MixableSolution
+    solution: beaker
   - type: RefillableSolution
     solution: beaker
   - type: DrainableSolution
index 9e68879fb491ee7428b5451b39e178acff971920..9ac699db5a48fbdb2fc9270b8ff7a30e824a5366 100644 (file)
@@ -25,7 +25,8 @@
     solutions:
       beaker:
         maxVol: 50
-        canMix: true
+  - type: MixableSolution
+    solution: beaker
   - type: FitsInDispenser
     solution: beaker
   - type: RefillableSolution
     solutions:
       beaker:
         maxVol: 50
-        canMix: true
+  - type: MixableSolution
+    solution: beaker
   - type: FitsInDispenser
     solution: beaker
   - type: RefillableSolution
     solutions:
       beaker:
         maxVol: 100
-        canMix: true
   - type: Appearance
   - type: SolutionContainerVisuals
     maxFillLevels: 6
     solutions:
       beaker:
         maxVol: 1000
-        canMix: true
 
 - type: entity
   name: dropper
index 496fd231b82a2f855ffbb6bfcd61706c326dfadf..d0a3bb37022ee8618bdbb0ee792d0648d0ffd5d4 100644 (file)
@@ -26,6 +26,8 @@
     solutions:
       bucket:
         maxVol: 250
+  - type: MixableSolution
+    solution: bucket
   - type: SolutionTransfer
     transferAmount: 100
     maxTransferAmount: 100
index 6e4e339ae61305e6d737f246b1cee1994394dfc0..e046fb831a008fc0fafd3a4cf1b3efca3ae0bf23 100644 (file)
     solutions:
       tank:
         maxVol: 400
-        canMix: true
+  - type: MixableSolution
+    solution: tank
   - type: DrainableSolution
     solution: tank
   - type: ExaminableSolution