Fix wallmount board dropping at random side of the wall (#21920)

* empty wallmount board at user

* change to DropNextTo

* add emptyAtUser to doors
This commit is contained in:
qwerltaz
2023-12-06 04:03:31 +01:00
committed by GitHub
parent 55c8ad04cd
commit daa70fc92c
13 changed files with 127 additions and 72 deletions

View 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);
}

View File

@@ -54,6 +54,12 @@
key: walls
mode: NoSprite
- type: Occluder
- type: ContainerFill
containers:
battery-container: [ PowerCellMedium ]
- type: ContainerContainer
containers:
battery-container: !type:Container
- type: entity
id: BaseSecretDoorAssembly

View File

@@ -81,7 +81,9 @@
conditions:
- !type:EntityAnchored {}
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 5
@@ -102,7 +104,9 @@
conditions:
- !type:EntityAnchored {}
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
- !type:SpawnPrototype
prototype: SheetRGlass1
amount: 1
@@ -134,7 +138,7 @@
steps:
- tool: Prying
doAfter: 2
- to: medSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -142,7 +146,7 @@
- material: Steel
amount: 2
doAfter: 2
- to: highSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -150,7 +154,7 @@
- material: Plasteel
amount: 2
doAfter: 2
## Standard airlock
- node: airlock
entity: Airlock
@@ -169,11 +173,13 @@
- !type:WirePanel {}
- !type:AllWiresCut
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 5
- to: medSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -181,7 +187,7 @@
- material: Steel
amount: 2
doAfter: 2
- to: highSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -196,7 +202,7 @@
- !type:SetWiresPanelSecurity
wiresAccessible: true
weldingAllowed: true
edges:
edges:
- to: medSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -204,7 +210,7 @@
- material: Steel
amount: 2
doAfter: 2
- to: highSecurityUnfinished
conditions:
- !type:WirePanel {}
@@ -221,7 +227,7 @@
wiresAccessible: false
weldingAllowed: false
edges:
- to: glassAirlock
- to: glassAirlock
completed:
- !type:GivePrototype
prototype: SheetSteel1
@@ -233,8 +239,8 @@
steps:
- tool: Prying
doAfter: 4
- to: airlock
- to: airlock
completed:
- !type:GivePrototype
prototype: SheetSteel1
@@ -246,8 +252,8 @@
steps:
- tool: Prying
doAfter: 4
- to: highSecDoor
- to: highSecDoor
completed:
- !type:GivePrototype
prototype: SheetSteel1
@@ -259,14 +265,14 @@
steps:
- tool: Prying
doAfter: 4
- to: medSecurity
conditions:
- to: medSecurity
conditions:
- !type:WirePanel {}
steps:
- tool: Welding
doAfter: 3
- node: medSecurity
actions:
- !type:SetWiresPanelSecurity
@@ -274,7 +280,7 @@
wiresAccessible: false
weldingAllowed: false
edges:
- to: medSecurityUnfinished
- to: medSecurityUnfinished
conditions:
- !type:WirePanel {}
steps:
@@ -289,7 +295,7 @@
wiresAccessible: false
weldingAllowed: false
edges:
- to: glassAirlock
- to: glassAirlock
completed:
- !type:GivePrototype
prototype: SheetPlasteel1
@@ -301,8 +307,8 @@
steps:
- tool: Prying
doAfter: 4
- to: airlock
- to: airlock
completed:
- !type:GivePrototype
prototype: SheetPlasteel1
@@ -314,8 +320,8 @@
steps:
- tool: Prying
doAfter: 4
- to: highSecDoor
- to: highSecDoor
completed:
- !type:GivePrototype
prototype: SheetPlasteel1
@@ -327,14 +333,14 @@
steps:
- tool: Prying
doAfter: 4
- to: highSecurity
conditions:
- to: highSecurity
conditions:
- !type:WirePanel {}
steps:
- tool: Welding
doAfter: 5
- node: highSecurity
actions:
- !type:SetWiresPanelSecurity
@@ -348,16 +354,16 @@
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
@@ -365,27 +371,27 @@
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
@@ -393,7 +399,7 @@
wiresAccessible: false
weldingAllowed: false
edges:
- to: maxSecurity
- to: maxSecurity
completed:
- !type:GivePrototype
prototype: SheetPlasteel1
@@ -403,25 +409,25 @@
steps:
- tool: Prying
doAfter: 4
- 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
weldingAllowed: false
edges:
- to: superMaxSecurityUnfinished
- to: superMaxSecurity
conditions:
- !type:WirePanel {}
steps:
- tool: Welding
doAfter: 15
doAfter: 5
- node: superMaxSecurity
actions:
- !type:SetWiresPanelSecurity
examine: wires-panel-component-on-examine-security-level7
wiresAccessible: false
weldingAllowed: false
edges:
- to: superMaxSecurityUnfinished
conditions:
- !type:WirePanel {}
steps:
- tool: Welding
doAfter: 15

View File

@@ -80,7 +80,9 @@
doAfter: 0.25
- to: frame2
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
conditions:
- !type:EntityAnchored
anchored: true

View File

@@ -80,7 +80,9 @@
- !type:EntityAnchored {}
- !type:DoorWelded {}
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 5

View File

@@ -54,7 +54,9 @@
doAfter: 2.5
- to: assembly
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1

View File

@@ -113,7 +113,9 @@
- !type:WirePanel {}
- !type:AllWiresCut
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Anchoring
doAfter: 1
@@ -213,7 +215,9 @@
container: board
- !type:AllWiresCut
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Anchoring
doAfter: 4

View File

@@ -70,7 +70,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1
@@ -147,7 +149,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1

View File

@@ -66,7 +66,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1

View File

@@ -70,7 +70,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1

View File

@@ -84,7 +84,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
- node: screenElectronics
edges:
@@ -101,7 +103,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
- node: brigElectronics
edges:
@@ -118,7 +122,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
- node: screenGlass
entity: TimerFrame

View File

@@ -84,7 +84,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1
@@ -98,7 +100,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1

View File

@@ -68,7 +68,9 @@
- !type:ContainerNotEmpty
container: board
completed:
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers
pickup: true
emptyAtUser: true
steps:
- tool: Prying
doAfter: 1