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
{
/// <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))
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);
{
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);
}
key: walls
mode: NoSprite
- type: Occluder
+ - type: ContainerFill
+ containers:
+ battery-container: [ PowerCellMedium ]
+ - type: ContainerContainer
+ containers:
+ battery-container: !type:Container
- type: entity
id: BaseSecretDoorAssembly
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
+
doAfter: 0.25
- to: frame2
completed:
- - !type:EmptyAllContainers {}
+ - !type:EmptyAllContainers
+ pickup: true
+ emptyAtUser: true
conditions:
- !type:EntityAnchored
anchored: true
- !type:EntityAnchored {}
- !type:DoorWelded {}
completed:
- - !type:EmptyAllContainers {}
+ - !type:EmptyAllContainers
+ pickup: true
+ emptyAtUser: true
steps:
- tool: Prying
doAfter: 5
doAfter: 2.5
- to: assembly
completed:
- - !type:EmptyAllContainers {}
+ - !type:EmptyAllContainers
+ pickup: true
+ emptyAtUser: true
steps:
- tool: Prying
doAfter: 1
- !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
- !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
- !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
- !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
- !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
- !type:ContainerNotEmpty
container: board
completed:
- - !type:EmptyAllContainers {}
+ - !type:EmptyAllContainers
+ pickup: true
+ emptyAtUser: true
steps:
- tool: Prying
doAfter: 1