--- /dev/null
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Construction.Components;
+
+/// <summary>
+/// Used in construction graphs for building wall-mounted electronic devices.
+/// </summary>
+[RegisterComponent]
+public sealed partial class ElectronicsBoardComponent : Component
+{
+ /// <summary>
+ /// The device that is produced when the construction is completed.
+ /// </summary>
+ [DataField(required: true)]
+ public EntProtoId Prototype;
+}
[DataDefinition]
public sealed partial class BoardNodeEntity : IGraphNodeEntity
{
- [DataField("container")] public string Container { get; private set; } = string.Empty;
+ [DataField]
+ public string Container { get; private set; } = string.Empty;
public string? GetId(EntityUid? uid, EntityUid? userUid, GraphNodeEntityArgs args)
{
var board = container.ContainedEntities[0];
- // There should not be a case where both of these components exist on the same entity...
+ // There should not be a case where more than one of these components exist on the same entity
if (args.EntityManager.TryGetComponent(board, out MachineBoardComponent? machine))
return machine.Prototype;
if (args.EntityManager.TryGetComponent(board, out ComputerBoardComponent? computer))
return computer.Prototype;
+ if (args.EntityManager.TryGetComponent(board, out ElectronicsBoardComponent? electronics))
+ return electronics.Prototype;
+
return null;
}
}
construction-graph-tag-surveillance-camera-monitor-board = surveillance camera monitor board
construction-graph-tag-television-board = television board
construction-graph-tag-freezer-electronics = freezer electronics
+construction-graph-tag-turret-control-electronics = sentry turret control panel electronics
# crystals
construction-graph-tag-cyan-crystal-shard = cyan crystal shard
components:
- type: Sprite
sprite: Objects/Misc/module.rsi
- state: command
+ state: science
- type: MachineBoard
prototype: WeaponEnergyTurretAI
state: security
- type: MachineBoard
prototype: WeaponEnergyTurretSecurity
+
+- type: entity
+ parent: WeaponEnergyTurretStationMachineCircuitboardBase
+ id: WeaponEnergyTurretCommandMachineCircuitboard
+ suffix: Command
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/module.rsi
+ state: command
+ - type: MachineBoard
+ prototype: WeaponEnergyTurretCommand
--- /dev/null
+- type: entity
+ abstract: true
+ parent: BaseElectronics
+ id: WeaponEnergyTurretStationControlPanelElectronicsBase
+ name: sentry turret control panel electronics
+ description: An electronics board used in a sentry turret control panel.
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/module.rsi
+ state: security
+ - type: ElectronicsBoard
+ prototype: WeaponEnergyTurretSecurityControlPanel
+ - type: Tag
+ tags:
+ - TurretControlElectronics
+
+- type: entity
+ parent: WeaponEnergyTurretStationControlPanelElectronicsBase
+ id: WeaponEnergyTurretSecurityControlPanelElectronics
+ suffix: Security
+
+- type: entity
+ parent: WeaponEnergyTurretStationControlPanelElectronicsBase
+ id: WeaponEnergyTurretAIControlPanelElectronics
+ suffix: AI, Silicon
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/module.rsi
+ state: science
+ - type: ElectronicsBoard
+ prototype: WeaponEnergyTurretAIControlPanel
+
+- type: entity
+ parent: WeaponEnergyTurretStationControlPanelElectronicsBase
+ id: WeaponEnergyTurretCommandControlPanelElectronics
+ suffix: Command
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/module.rsi
+ state: command
+ - type: ElectronicsBoard
+ prototype: WeaponEnergyTurretCommandControlPanel
+
- Borg
- BasicSilicon
- type: Machine
- board: WeaponEnergyTurretSecurityMachineCircuitboard
+ board: WeaponEnergyTurretCommandMachineCircuitboard
- type: DeviceNetwork
receiveFrequencyId: TurretControl
transmitFrequencyId: Turret
collection: MetalGlassBreak
params:
volume: -4
- #- !type:ChangeConstructionNodeBehavior - To be added in a later PR
- # node: machineFrame
+ - !type:ChangeConstructionNodeBehavior
+ node: machineFrame
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Transform
- type: ContainerContainer
containers:
board: !type:Container
- #- type: Construction - To be added in a later PR
- # graph: WeaponEnergyTurretControlPanel
- # node: frame
+ - type: Construction
+ graph: WeaponEnergyTurretControlPanel
+ node: frame
+ containers:
+ - board
placement:
mode: SnapgridCenter
snap:
- type: Electrified
enabled: false
usesApcPower: true
- #- type: ContainerFill - Will be added in a later PR
- # containers:
- # board:
- # - WeaponEnergyTurretStationControlPanelElectronics
- #- type: Construction - Will be added in a later PR
- # graph: WeaponEnergyTurretControlPanel
- # node: finish
+ - type: ContainerFill
+ containers:
+ board:
+ - WeaponEnergyTurretStationControlPanelElectronics
+ - type: Construction
+ graph: WeaponEnergyTurretControlPanel
+ node: finish
- type: entity
parent: WeaponEnergyTurretStationControlPanelBase
components:
- type: AccessReader
access: [["StationAi"], ["ResearchDirector"]]
- #- type: ContainerFill - Will be added in a later PR
- # containers:
- # board:
- # - WeaponEnergyTurretAIControlPanelElectronics
+ - type: ContainerFill
+ containers:
+ board:
+ - WeaponEnergyTurretAIControlPanelElectronics
- type: DeviceNetwork
receiveFrequencyId: TurretAI
transmitFrequencyId: TurretControlAI
components:
- type: AccessReader
access: [["StationAi"], ["Security"]]
- #- type: ContainerFill - Will be added in a later PR
- # containers:
- # board:
- # - WeaponEnergyTurretSecurityControlPanelElectronics
+ - type: ContainerFill
+ containers:
+ board:
+ - WeaponEnergyTurretSecurityControlPanelElectronics
- type: TurretTargetSettings
exemptAccessLevels:
- Security
components:
- type: AccessReader
access: [["StationAi"], ["Command"]]
- #- type: ContainerFill - Will be added in a later PR
- # containers:
- # board:
- # - WeaponEnergyTurretCommandControlPanelElectronics
+ - type: ContainerFill
+ containers:
+ board:
+ - WeaponEnergyTurretCommandControlPanelElectronics
- type: TurretTargetSettings
exemptAccessLevels:
- Command
--- /dev/null
+- type: constructionGraph
+ id: WeaponEnergyTurretControlPanel
+ start: start
+ graph:
+ - node: start
+ edges:
+ - to: frame
+ steps:
+ - material: Steel
+ amount: 3
+ doAfter: 2
+
+ - node: frame
+ entity: WeaponEnergyTurretControlPanelFrame
+ edges:
+ - to: board
+ steps:
+ - tag: TurretControlElectronics
+ name: construction-graph-tag-turret-control-electronics
+ icon:
+ sprite: Objects/Misc/module.rsi
+ state: command
+ store: board
+
+ - to: start
+ completed:
+ - !type:GivePrototype
+ prototype: SheetSteel1
+ amount: 3
+ - !type:DeleteEntity {}
+ steps:
+ - tool: Screwing
+ doAfter: 4
+
+ - node: board
+ entity: WeaponEnergyTurretControlPanelFrame
+ edges:
+ - to: glass
+ steps:
+ - material: Glass
+ amount: 1
+ doAfter: 1
+
+ - to: frame
+ completed:
+ - !type:EmptyContainer
+ container: board
+ pickup: true
+ steps:
+ - tool: Prying
+ doAfter: 4
+
+ - node: glass
+ edges:
+ - to: finish
+ steps:
+ - tool: Screwing
+ doAfter: 2
+
+ - to: board
+ completed:
+ - !type:GivePrototype
+ prototype: SheetGlass1
+ amount: 1
+ steps:
+ - tool: Prying
+ doAfter: 2
+
+ - node: finish
+ entity: !type:BoardNodeEntity { container: board }
+ actions:
+ - !type:AddContainer
+ container: board
+ edges:
+ - to: board
+ conditions:
+ - !type:AllWiresCut {}
+ - !type:WirePanel {}
+ completed:
+ - !type:GivePrototype
+ prototype: SheetGlass1
+ amount: 1
+ steps:
+ - tool: Prying
+ doAfter: 4
canBuildInImpassable: true
conditions:
- !type:WallmountCondition
+
+# DEFENSES
+- type: construction
+ id: WeaponEnergyTurretControlPanel
+ graph: WeaponEnergyTurretControlPanel
+ startNode: start
+ targetNode: finish
+ category: construction-category-utilities
+ objectType: Structure
+ canRotate: true
+ placementMode: SnapgridCenter
+ canBuildInImpassable: true
+ conditions:
+ - !type:WallmountCondition