Skip to content

Commit

Permalink
reinforce sec intercoms
Browse files Browse the repository at this point in the history
  • Loading branch information
EmoGarbage404 committed Jun 29, 2024
1 parent ab0e719 commit b349014
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public sealed partial class EncryptionKeySystem : EntitySystem
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedWiresSystem _wires = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -150,7 +151,7 @@ private void TryRemoveKey(EntityUid uid, EncryptionKeyHolderComponent component,
return;
}

if (TryComp<WiresPanelComponent>(uid, out var panel) && !panel.Open)
if (!_wires.IsPanelOpen(uid))
{
_popup.PopupClient(Loc.GetString("encryption-keys-panel-locked"), uid, args.User);
return;
Expand Down
41 changes: 36 additions & 5 deletions Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- type: entity
id: Intercom
id: BaseIntercom
name: intercom
description: An intercom. For when the station just needs to know something.
abstract: true
Expand Down Expand Up @@ -28,6 +28,7 @@
- type: InteractionOutline
- type: Appearance
- type: WiresVisuals
- type: WiresPanelSecurity
- type: ContainerFill
containers:
board: [ IntercomElectronics ]
Expand Down Expand Up @@ -121,7 +122,7 @@
- Wallmount

- type: entity
id: IntercomAssesmbly
id: IntercomAssembly
name: intercom assembly
description: An intercom. It doesn't seem very helpful right now.
components:
Expand Down Expand Up @@ -153,9 +154,10 @@
snap:
- Wallmount

# this weird inheritance BS exists for construction shitcode
- type: entity
id: IntercomConstructed
parent: Intercom
parent: BaseIntercom
suffix: Empty, Panel Open
components:
- type: Sprite
Expand All @@ -178,6 +180,30 @@
- type: WiresPanel
open: true

- type: entity
id: Intercom
parent: IntercomConstructed
suffix: ""
components:
- type: Sprite
layers:
- state: base
- state: unshaded
map: ["enum.PowerDeviceVisualLayers.Powered"]
shader: unshaded
- state: broadcasting
map: ["enum.RadioDeviceVisualLayers.Broadcasting"]
shader: unshaded
visible: false
- state: speaker
map: ["enum.RadioDeviceVisualLayers.Speaker"]
shader: unshaded
visible: false
- state: panel
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: WiresPanel
open: false

- type: entity
id: IntercomCommon
parent: Intercom
Expand Down Expand Up @@ -248,8 +274,13 @@
suffix: Security
description: An intercom. It's been reinforced with metal from security helmets, making it a bitch-and-a-half to open.
components:
- type: WiresPanel #this should use a security panel but the code is horrendous
openDelay: 10
- type: WiresPanel
openDelay: 5
- type: WiresPanelSecurity
examine: wires-panel-component-on-examine-security-level2
wiresAccessible: false
- type: Construction
node: intercomReinforced
- type: ContainerFill
containers:
board:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
doAfter: 2.0

- node: assembly
entity: IntercomAssesmbly
entity: IntercomAssembly
edges:
- to: wired
steps:
Expand All @@ -33,7 +33,7 @@
doAfter: 2

- node: wired
entity: IntercomAssesmbly
entity: IntercomAssembly
edges:
- to: electronics
steps:
Expand Down Expand Up @@ -65,6 +65,10 @@

- node: intercom
entity: IntercomConstructed
doNotReplaceInheritingEntities: true
actions:
- !type:SetWiresPanelSecurity
wiresAccessible: true
edges:
- to: wired
conditions:
Expand All @@ -79,3 +83,27 @@
steps:
- tool: Prying
doAfter: 1
- to: intercomReinforced
conditions:
- !type:WirePanel
steps:
- material: Steel
amount: 1
- tool: Welding
doAfter: 1

- node: intercomReinforced
actions:
- !type:SetWiresPanelSecurity
examine: wires-panel-component-on-examine-security-level2
wiresAccessible: false
edges:
- to: intercom
conditions:
- !type:WirePanel
completed:
- !type:GivePrototype
prototype: SheetSteel1
steps:
- tool: Welding
doAfter: 5
2 changes: 1 addition & 1 deletion Resources/Prototypes/Recipes/Construction/utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
# INTERCOM
- type: construction
name: intercom
id: IntercomAssesmbly
id: IntercomAssembly
graph: Intercom
startNode: start
targetNode: intercom
Expand Down
3 changes: 3 additions & 0 deletions Resources/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,6 @@ FloorTileItemReinforced: PartRodMetal1

#2024-06-25
BookChefGaming: BookHowToCookForFortySpaceman

#2024-06-29
IntercomAssesmbly: IntercomAssembly

0 comments on commit b349014

Please sign in to comment.