]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix wallmount board dropping at random side of the wall (#21920)
authorqwerltaz <69696513+qwerltaz@users.noreply.github.com>
Wed, 6 Dec 2023 03:03:31 +0000 (04:03 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2023 03:03:31 +0000 (22:03 -0500)
* empty wallmount board at user

* change to DropNextTo

* add emptyAtUser to doors

13 files changed:
Content.Server/Construction/Completions/EmptyAllContainers.cs
Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/firelock.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/secretdoor.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/shuttle.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/air_alarms.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/intercom.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/timer.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_generator.yml
Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_substation.yml

index 5b086efb4a94707e06d8883d7b68af5000683ca1..79de939387d92b13f828b70c48cecb129ef011e9 100644 (file)
@@ -3,7 +3,10 @@ using Content.Shared.Construction;
 using Content.Shared.Hands.Components;
 using JetBrains.Annotations;
 using Robust.Server.Containers;
+using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
+using Robust.Shared.GameObjects;
+using Robust.Shared.Map;
 
 namespace Content.Server.Construction.Completions
 {
@@ -14,9 +17,15 @@ namespace Content.Server.Construction.Completions
         /// <summary>
         ///     Whether or not the user should attempt to pick up the removed entities.
         /// </summary>
-        [DataField("pickup")]
+        [DataField]
         public bool Pickup = false;
 
+        /// <summary>
+        ///    Whether or not to empty the container at the user's location.
+        /// </summary>
+        [DataField]
+        public bool EmptyAtUser = false;
+
         public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
         {
             if (!entityManager.TryGetComponent(uid, out ContainerManagerComponent? containerManager))
@@ -24,6 +33,7 @@ namespace Content.Server.Construction.Completions
 
             var containerSys = entityManager.EntitySysManager.GetEntitySystem<ContainerSystem>();
             var handSys = entityManager.EntitySysManager.GetEntitySystem<HandsSystem>();
+            var transformSys = entityManager.EntitySysManager.GetEntitySystem<TransformSystem>();
 
             HandsComponent? hands = null;
             var pickup = Pickup && entityManager.TryGetComponent(userUid, out hands);
@@ -32,6 +42,9 @@ namespace Content.Server.Construction.Completions
             {
                 foreach (var ent in containerSys.EmptyContainer(container, true, reparent: !pickup))
                 {
+                    if (EmptyAtUser && userUid is not null)
+                        transformSys.DropNextTo(ent, (EntityUid) userUid);
+
                     if (pickup)
                         handSys.PickupOrDrop(userUid, ent, handsComp: hands);
                 }
index 9605b7edec96ddc1afef182ee1944a7c2363a8c0..cafaea3a2269a355f92fd9468f8f4a8f04f29a01 100644 (file)
     key: walls
     mode: NoSprite
   - type: Occluder
+  - type: ContainerFill
+    containers:
+      battery-container: [ PowerCellMedium ]
+  - type: ContainerContainer
+    containers:
+      battery-container: !type:Container
 
 - type: entity
   id: BaseSecretDoorAssembly
index 4ddeb3851960d0fb15f2e49bb6858664317718e8..3cd22bbfc72ba4375e996d43cce4a2e7f8b07a31 100644 (file)
@@ -81,7 +81,9 @@
       conditions:
       - !type:EntityAnchored {}
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 5
       conditions:
       - !type:EntityAnchored {}
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       - !type:SpawnPrototype
         prototype: SheetRGlass1
         amount: 1
       steps:
       - tool: Prying
         doAfter: 2
-        
+
     - to: medSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       - material: Steel
         amount: 2
         doAfter: 2
-    
+
     - to: highSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       - material: Plasteel
         amount: 2
         doAfter: 2
-        
+
 ## Standard airlock
   - node: airlock
     entity: Airlock
       - !type:WirePanel {}
       - !type:AllWiresCut
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 5
-        
+
     - to: medSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       - material: Steel
         amount: 2
         doAfter: 2
-    
+
     - to: highSecurityUnfinished
       conditions:
       - !type:WirePanel {}
     - !type:SetWiresPanelSecurity
       wiresAccessible: true
       weldingAllowed: true
-    edges:   
+    edges:
     - to: medSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       - material: Steel
         amount: 2
         doAfter: 2
-    
+
     - to: highSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       wiresAccessible: false
       weldingAllowed: false
     edges:
-    - to: glassAirlock 
+    - to: glassAirlock
       completed:
       - !type:GivePrototype
         prototype: SheetSteel1
       steps:
       - tool: Prying
         doAfter: 4
-        
-    - to: airlock 
+
+    - to: airlock
       completed:
       - !type:GivePrototype
         prototype: SheetSteel1
       steps:
       - tool: Prying
         doAfter: 4
-        
-    - to: highSecDoor 
+
+    - to: highSecDoor
       completed:
       - !type:GivePrototype
         prototype: SheetSteel1
       steps:
       - tool: Prying
         doAfter: 4
-    
-    - to: medSecurity 
-      conditions:  
+
+    - to: medSecurity
+      conditions:
       - !type:WirePanel {}
       steps:
       - tool: Welding
         doAfter: 3
-      
+
   - node: medSecurity
     actions:
     - !type:SetWiresPanelSecurity
       wiresAccessible: false
       weldingAllowed: false
     edges:
-    - to: medSecurityUnfinished 
+    - to: medSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       steps:
       wiresAccessible: false
       weldingAllowed: false
     edges:
-    - to: glassAirlock 
+    - to: glassAirlock
       completed:
       - !type:GivePrototype
         prototype: SheetPlasteel1
       steps:
       - tool: Prying
         doAfter: 4
-        
-    - to: airlock 
+
+    - to: airlock
       completed:
       - !type:GivePrototype
         prototype: SheetPlasteel1
       steps:
       - tool: Prying
         doAfter: 4
-        
-    - to: highSecDoor 
+
+    - to: highSecDoor
       completed:
       - !type:GivePrototype
         prototype: SheetPlasteel1
       steps:
       - tool: Prying
         doAfter: 4
-    
-    - to: highSecurity 
-      conditions:  
+
+    - to: highSecurity
+      conditions:
       - !type:WirePanel {}
       steps:
       - tool: Welding
         doAfter: 5
-      
+
   - node: highSecurity
     actions:
     - !type:SetWiresPanelSecurity
       steps:
       - tool: Welding
         doAfter: 15
-    
+
     - to: maxSecurity
       conditions:
       - !type:WirePanel {}
-      steps:     
+      steps:
       - material: MetalRod
         amount: 2
         doAfter: 1
 
-## Max security level door: an electric grill is added        
+## Max security level door: an electric grill is added
   - node: maxSecurity
     actions:
     - !type:SetWiresPanelSecurity
       wiresAccessible: false
       weldingAllowed: true
     edges:
-    - to: highSecurity 
+    - to: highSecurity
       completed:
       - !type:AttemptElectrocute
       - !type:GivePrototype
         prototype: PartRodMetal1
         amount: 2
-      conditions:  
+      conditions:
       - !type:WirePanel {}
       steps:
       - tool: Cutting
-        doAfter: 0.5 
+        doAfter: 0.5
 
     - to: superMaxSecurityUnfinished
       conditions:
       - !type:WirePanel {}
-      steps:     
+      steps:
       - material: Plasteel
         amount: 2
         doAfter: 2
 
-## Super max security level door: an additional layer of plasteel is added     
+## Super max security level door: an additional layer of plasteel is added
   - node: superMaxSecurityUnfinished
     actions:
     - !type:SetWiresPanelSecurity
       wiresAccessible: false
       weldingAllowed: false
     edges:
-    - to: maxSecurity 
+    - to: maxSecurity
       completed:
       - !type:GivePrototype
         prototype: SheetPlasteel1
       steps:
       - tool: Prying
         doAfter: 4
-    
-    - to: superMaxSecurity 
-      conditions:  
+
+    - to: superMaxSecurity
+      conditions:
       - !type:WirePanel {}
       steps:
       - tool: Welding
         doAfter: 5
-      
+
   - node: superMaxSecurity
     actions:
     - !type:SetWiresPanelSecurity
       examine: wires-panel-component-on-examine-security-level7
-      wiresAccessible: false  
+      wiresAccessible: false
       weldingAllowed: false
     edges:
-    - to: superMaxSecurityUnfinished 
+    - to: superMaxSecurityUnfinished
       conditions:
       - !type:WirePanel {}
       steps:
       - tool: Welding
-        doAfter: 15        
+        doAfter: 15
+
index 9d5b2945a65f7ab4713985e9ba26ebdec04d894d..0dbf26794d9338a3b43941d85a1c1a960ae826bd 100644 (file)
@@ -80,7 +80,9 @@
               doAfter: 0.25
         - to: frame2
           completed:
-            - !type:EmptyAllContainers {}
+            - !type:EmptyAllContainers
+              pickup: true
+              emptyAtUser: true
           conditions:
             - !type:EntityAnchored
               anchored: true
index 8acaa5f50559c83a0135a09852c2694a58eff05f..336933a36b369ea56dcb108071279e01f398f5e7 100644 (file)
@@ -80,7 +80,9 @@
       - !type:EntityAnchored {}
       - !type:DoorWelded {}
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 5
index dc05edd8fbae6485401ffb7c5a58271a0c603b4b..457fbfede562f6a10a64b49b474cafe1ec30e087 100644 (file)
@@ -54,7 +54,9 @@
         doAfter: 2.5
     - to: assembly
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 1
index a991884acb02858e811705906b2be8f97b66cabe..9e19196c6cb8d2a6d534ff1385765f8d35445787 100644 (file)
       - !type:WirePanel {}
       - !type:AllWiresCut
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Anchoring
         doAfter: 1
         container: board
       - !type:AllWiresCut
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Anchoring
         doAfter: 4
index ca5cb5f10817ba5298249e7a2d130c1508cf96b2..5aee750b9a4df1967dc29bda027857df63df9ca6 100644 (file)
@@ -70,7 +70,9 @@
       - !type:ContainerNotEmpty
         container: board
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 1
       - !type:ContainerNotEmpty
         container: board
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 1
index 8da7a2a03244fcd12fd7b3b43b997020de957161..2247860f892f521b44f8aae14a1463b1082f5e04 100644 (file)
@@ -66,7 +66,9 @@
       - !type:ContainerNotEmpty
         container: board
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 1
index 43a111ec7f3651c653edb6c7c564ab4fe40b9412..eb826a0f98be7180450241552b00b3f7f1044a20 100644 (file)
@@ -70,7 +70,9 @@
       - !type:ContainerNotEmpty
         container: board
       completed:
-      - !type:EmptyAllContainers {}
+      - !type:EmptyAllContainers
+        pickup: true
+        emptyAtUser: true
       steps:
       - tool: Prying
         doAfter: 1
index 6c5def7c4ce02a88b1db91b81b8ec2d67b111c2d..0d400a848d98a5627b07006df3606b63cfc0c401 100644 (file)
@@ -84,7 +84,9 @@
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
 
     - node: screenElectronics
       edges:
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
 
     - node: brigElectronics
       edges:
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
 
     - node: screenGlass
       entity: TimerFrame
index 3df8d9c81880816429f857fc35d11194a11c2513..24d928cc4023408748e00a3e606fff8260aa6011 100644 (file)
@@ -84,7 +84,9 @@
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
         steps:
         - tool: Prying
           doAfter: 1
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
         steps:
         - tool: Prying
           doAfter: 1
index 78a1a34c6a2dd7d332066cbe78121f95290408be..381871f94af17599e85bd8f769f1cdc0514f4de6 100644 (file)
@@ -68,7 +68,9 @@
         - !type:ContainerNotEmpty
           container: board
         completed:
-        - !type:EmptyAllContainers {}
+        - !type:EmptyAllContainers
+          pickup: true
+          emptyAtUser: true
         steps:
         - tool: Prying
           doAfter: 1