wall mounted lockers (#11382)

This commit is contained in:
Nemanja
2022-09-17 16:05:39 -04:00
committed by GitHub
parent 9e8d0a51ad
commit 4fe4ba1575
33 changed files with 383 additions and 71 deletions

View File

@@ -12,9 +12,9 @@ using Content.Shared.Interaction;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Placeable; using Content.Shared.Placeable;
using Content.Shared.Storage; using Content.Shared.Storage;
using Content.Shared.Wall;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;
using Robust.Server.Containers; using Robust.Server.Containers;
using Robust.Shared.Audio;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics; using Robust.Shared.Physics;
@@ -24,6 +24,8 @@ namespace Content.Server.Storage.EntitySystems;
public sealed class EntityStorageSystem : EntitySystem public sealed class EntityStorageSystem : EntitySystem
{ {
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly ConstructionSystem _construction = default!; [Dependency] private readonly ConstructionSystem _construction = default!;
[Dependency] private readonly ContainerSystem _container = default!; [Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!;
@@ -148,7 +150,7 @@ public sealed class EntityStorageSystem : EntitySystem
component.Open = true; component.Open = true;
EmptyContents(uid, component); EmptyContents(uid, component);
ModifyComponents(uid, component); ModifyComponents(uid, component);
SoundSystem.Play(component.OpenSound.GetSound(), Filter.Pvs(component.Owner), component.Owner); _audio.PlayPvs(component.OpenSound, component.Owner);
ReleaseGas(uid, component); ReleaseGas(uid, component);
RaiseLocalEvent(uid, new StorageAfterOpenEvent()); RaiseLocalEvent(uid, new StorageAfterOpenEvent());
} }
@@ -187,7 +189,7 @@ public sealed class EntityStorageSystem : EntitySystem
TakeGas(uid, component); TakeGas(uid, component);
ModifyComponents(uid, component); ModifyComponents(uid, component);
SoundSystem.Play(component.CloseSound.GetSound(), Filter.Pvs(uid), uid); _audio.PlayPvs(component.CloseSound, component.Owner);
component.LastInternalOpenAttempt = default; component.LastInternalOpenAttempt = default;
RaiseLocalEvent(uid, new StorageAfterCloseEvent()); RaiseLocalEvent(uid, new StorageAfterCloseEvent());
} }
@@ -265,15 +267,14 @@ public sealed class EntityStorageSystem : EntitySystem
} }
//Checks to see if the opening position, if offset, is inside of a wall. //Checks to see if the opening position, if offset, is inside of a wall.
if (component.EnteringOffset != (0, 0)) //if the entering position is offset if (component.EnteringOffset != (0, 0) && !HasComp<WallMountComponent>(target)) //if the entering position is offset
{ {
var targetXform = Transform(target); var targetXform = Transform(target);
var newCoords = new EntityCoordinates(target, component.EnteringOffset); var newCoords = new EntityCoordinates(target, component.EnteringOffset);
if (!_interactionSystem.InRangeUnobstructed(target, newCoords, collisionMask: component.EnteringOffsetCollisionFlags)) if (!_interactionSystem.InRangeUnobstructed(target, newCoords, 0, collisionMask: component.EnteringOffsetCollisionFlags))
{ {
if (!silent) if (!silent)
_popupSystem.PopupEntity(Loc.GetString("entity-storage-component-cannot-open-no-space"), target, Filter.Pvs(target)); _popupSystem.PopupEntity(Loc.GetString("entity-storage-component-cannot-open-no-space"), target, Filter.Pvs(target));
return false; return false;
} }
} }
@@ -301,8 +302,10 @@ public sealed class EntityStorageSystem : EntitySystem
return false; return false;
if (TryComp<IPhysBody>(toAdd, out var phys)) if (TryComp<IPhysBody>(toAdd, out var phys))
{
if (component.MaxSize < phys.GetWorldAABB().Size.X || component.MaxSize < phys.GetWorldAABB().Size.Y) if (component.MaxSize < phys.GetWorldAABB().Size.X || component.MaxSize < phys.GetWorldAABB().Size.Y)
return false; return false;
}
return Insert(toAdd, container, component); return Insert(toAdd, container, component);
} }
@@ -326,10 +329,7 @@ public sealed class EntityStorageSystem : EntitySystem
var targetIsMob = HasComp<SharedBodyComponent>(toInsert); var targetIsMob = HasComp<SharedBodyComponent>(toInsert);
var storageIsItem = HasComp<ItemComponent>(container); var storageIsItem = HasComp<ItemComponent>(container);
var allowedToEat = whitelist?.IsValid(toInsert) ?? HasComp<ItemComponent>(toInsert);
var allowedToEat = whitelist == null
? HasComp<ItemComponent>(toInsert)
: whitelist.IsValid(toInsert);
// BEFORE REPLACING THIS WITH, I.E. A PROPERTY: // BEFORE REPLACING THIS WITH, I.E. A PROPERTY:
// Make absolutely 100% sure you have worked out how to stop people ending up in backpacks. // Make absolutely 100% sure you have worked out how to stop people ending up in backpacks.
@@ -379,11 +379,8 @@ public sealed class EntityStorageSystem : EntitySystem
if (TryComp<PlaceableSurfaceComponent>(uid, out var surface)) if (TryComp<PlaceableSurfaceComponent>(uid, out var surface))
_placeableSurface.SetPlaceable(uid, component.Open, surface); _placeableSurface.SetPlaceable(uid, component.Open, surface);
if (TryComp<AppearanceComponent>(uid, out var appearance)) _appearance.SetData(uid, StorageVisuals.Open, component.Open);
{ _appearance.SetData(uid, StorageVisuals.HasContents, component.Contents.ContainedEntities.Count > 0);
appearance.SetData(StorageVisuals.Open, component.Open);
appearance.SetData(StorageVisuals.HasContents, component.Contents.ContainedEntities.Any());
}
} }
private void TakeGas(EntityUid uid, EntityStorageComponent component) private void TakeGas(EntityUid uid, EntityStorageComponent component)

View File

@@ -16,6 +16,25 @@
- id: Ointment - id: Ointment
amount: 2 amount: 2
- type: entity
id: LockerWallMedicalFilled
suffix: Filled
parent: LockerWallMedical
components:
- type: StorageFill
contents:
- id: BoxPillCanister
amount: 1
- id: BoxSyringe
amount: 1
- id: EpinephrineChemistryBottle
amount: 3
- id: Brutepack
amount: 2
- id: Ointment
amount: 2
- type: entity - type: entity
id: LockerMedicalFilled id: LockerMedicalFilled
suffix: Filled suffix: Filled

View File

@@ -38,6 +38,32 @@
- id: BoxMRE - id: BoxMRE
prob: 0.1 prob: 0.1
- type: entity
id: ClosetWallEmergencyFilledRandom
parent: ClosetWallEmergency
suffix: Filled, Random
components:
- type: StorageFill
contents:
- id: ToolboxEmergencyFilled
prob: 0.4
- id: ClothingMaskBreath
prob: 0.4
- id: ClothingMaskBreath
prob: 0.25
- id: EmergencyOxygenTankFilled
prob: 0.4
- id: OxygenTankFilled
prob: 0.2
- id: MedkitOxygenFilled
prob: 0.2
- id: WeaponFlareGun
prob: 0.05
- id: ClothingOuterSuitEmergency
prob: 0.5
- id: BoxMRE
prob: 0.1
- type: entity - type: entity
id: ClosetFireFilled id: ClosetFireFilled
parent: ClosetFire parent: ClosetFire
@@ -54,6 +80,22 @@
- id: ClothingHeadHelmetFire - id: ClothingHeadHelmetFire
prob: 0.75 prob: 0.75
- type: entity
id: ClosetWallFireFilledRandom
parent: ClosetWallFire
suffix: Filled
components:
- type: StorageFill
contents:
- id: YellowOxygenTankFilled
prob: 0.6
- id: ClothingOuterSuitFire
prob: 0.75
- id: ClothingMaskGas
prob: 0.75
- id: ClothingHeadHelmetFire
prob: 0.75
- type: entity - type: entity
id: ClosetMaintenanceFilledRandom id: ClosetMaintenanceFilledRandom
suffix: Filled, Random suffix: Filled, Random
@@ -93,3 +135,29 @@
prob: 0.1 prob: 0.1
- id: ClothingHandsGlovesColorYellowBudget - id: ClothingHandsGlovesColorYellowBudget
prob: 0.33 prob: 0.33
- type: entity
id: ClosetWallMaintenanceFilledRandom
parent: ClosetWall
suffix: Filled, Random
components:
- type: StorageFill
contents:
- id: ToolboxEmergencyFilled
prob: 0.4
- id: ClothingMaskBreath
prob: 0.4
- id: ClothingMaskBreath
prob: 0.25
- id: EmergencyOxygenTankFilled
prob: 0.4
- id: OxygenTankFilled
prob: 0.2
- id: MedkitOxygenFilled
prob: 0.2
- id: WeaponFlareGun
prob: 0.05
- id: ClothingOuterSuitEmergency
prob: 0.5
- id: BoxMRE
prob: 0.1

View File

@@ -70,3 +70,85 @@
state: generic state: generic
state_open: generic_open state_open: generic_open
state_closed: generic_door state_closed: generic_door
#Wall Closet
- type: entity
id: BaseWallCloset
placement:
mode: SnapgridCenter
abstract: true
name: wall closet
description: A standard-issue Nanotrasen storage unit, now on walls.
components:
- type: InteractionOutline
- type: Clickable
- type: ResistLocker
- type: Weldable
- type: WallMount
arc: 180
- type: Transform
noRot: false
- type: Sprite
drawdepth: WallMountedItems
netsync: false
noRot: false
sprite: Structures/Storage/wall_locker.rsi
layers:
- state: generic
- state: generic_door
map: ["enum.StorageVisualLayers.Door"]
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- type: EntityStorage
isCollidableWhenOpen: true
enteringOffset: 0, -0.8
closeSound:
path: /Audio/Items/deconstruct.ogg
openSound:
path: /Audio/Items/deconstruct.ogg
- type: ContainerContainer
containers:
entity_storage: !type:Container
ents: []
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 150
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 1
#Wall locker
- type: entity
id: BaseWallLocker
parent: BaseWallCloset
abstract: true
components:
- type: AccessReader
- type: Lock
- type: Sprite
netsync: false
sprite: Structures/Storage/wall_locker.rsi
layers:
- state: generic
- state: generic_door
map: ["enum.StorageVisualLayers.Door"]
- state: locked
map: ["enum.StorageVisualLayers.Lock"]
shader: unshaded
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]

View File

@@ -1,48 +1,180 @@
- type: entity - type: entity
id: BaseWallLocker id: ClosetWall
placement: parent: BaseWallCloset
mode: SnapgridCenter name: maintenance wall closet
abstract: true description: It's a storage unit.
components: components:
- type: Clickable - type: Appearance
- type: InteractionOutline visuals:
- type: WallMount - type: StorageVisualizer
arc: 180 state: generic
- type: Sprite state_open: generic_open
drawdepth: WallMountedItems state_closed: generic_door
netsync: false
sprite: Structures/Storage/wall_locker.rsi
layers:
- state: door
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 2
- type: Storage
capacity: 100
- type: UserInterface
interfaces:
- key: enum.StorageUiKey.Key
type: StorageBoundUserInterface
- type: ContainerContainer
containers:
storagebase: !type:Container
ents: []
- type: entity - type: entity
id: WallLocker id: ClosetWallEmergency
name: emergency wall closet
parent: BaseWallCloset
description: It's a storage unit for emergency breath masks and O2 tanks.
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: emergency
state_open: emergency_open
state_closed: emergency_door
- type: entity
id: ClosetWallFire
name: fire-safety wall closet
parent: BaseWallCloset
description: It's a storage unit for fire-fighting supplies.
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: fire
state_open: fire_open
state_closed: fire_door
- type: entity
id: ClosetWallBlue
parent: BaseWallCloset
name: blue wall closet
description: "A wardrobe packed with stylish blue clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: blue_door
- type: entity
id: ClosetWallPink
parent: BaseWallCloset
name: pink wall closet
description: "A wardrobe packed with fabulous pink clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: pink_door
- type: entity
id: ClosetWallBlack
parent: BaseWallCloset
name: black wall closet
description: "A wardrobe packed with stylish black clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: black_door
- type: entity
id: ClosetWallGreen
parent: BaseWallCloset
name: green wall closet
description: "A wardrobe packed with stylish green clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: green_door
- type: entity
id: ClosetWallOrange
parent: BaseWallCloset
name: prison wall closet
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: orange_door
- type: entity
id: ClosetWallYellow
parent: BaseWallCloset
name: yellow wall closet
description: "A wardrobe packed with stylish yellow clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: yellow_door
- type: entity
id: ClosetWallWhite
parent: BaseWallCloset
name: white wall closet
description: "A wardrobe packed with stylish white clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: white_door
- type: entity
id: ClosetWallGrey
parent: BaseWallCloset
name: grey wall closet
description: "A wardrobe packed with a tide of grey clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: gray_door
- type: entity
id: ClosetWallMixed
parent: BaseWallCloset
name: mixed wall closet
description: "A wardrobe packed with a mix of colorful clothing."
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: mixed_door
- type: entity
id: ClosetWallAtmospherics
parent: BaseWallCloset
name: atmospherics wall closet
components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: generic
state_open: generic_open
state_closed: atmos_door
- type: entity
id: LockerWallMedical
parent: BaseWallLocker parent: BaseWallLocker
name: wall locker name: medical doctor's wall locker
description: A locker built into the wall. components:
- type: Appearance
visuals:
- type: StorageVisualizer
state: med
state_open: med_open
state_closed: med_door
- type: AccessReader
access: [["Medical"]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

View File

@@ -1,23 +1,37 @@
{ {
"version": 1, "version": 1,
"license": "CC-BY-SA-3.0", "license": "CC-BY-SA-3.0",
"copyright": "https://github.com/space-wizards/space-station-14/pull/10673, modified from TGstation commit 4a274a6e4b195dfcaffd20d7348631131418ecb5", "copyright": "Taken from shiptest at commmit https://github.com/shiptest-ss13/Shiptest/commit/440a15fb476a20d77ba28c1fe315c1b659032ce8",
"size": { "size": {
"x": 32, "x": 32,
"y": 32 "y": 32
}, },
"states": [ "states": [
{ { "name": "atmos_door" },
"name": "door" { "name": "black_door" },
}, { "name": "blue_door" },
{ { "name": "emergency" },
"name": "locked" { "name": "emergency_door" },
}, { "name": "emergency_open" },
{ { "name": "fire" },
"name": "unlocked" { "name": "fire_door" },
}, { "name": "fire_open" },
{ { "name": "generic" },
"name": "welded" { "name": "generic_door" },
} { "name": "generic_open" },
{ "name": "gray_door" },
{ "name": "green_door" },
{ "name": "locked" },
{ "name": "med" },
{ "name": "med_door" },
{ "name": "med_open" },
{ "name": "mixed_door" },
{ "name": "orange_door" },
{ "name": "pink_door" },
{ "name": "red_door" },
{ "name": "unlocked" },
{ "name": "welded" },
{ "name": "white_door" },
{ "name": "yellow_door" }
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B