- type: entity
  parent: [ BaseMachinePowered, ConstructibleMachine ]
  id: TelecomServer
  name: telecommunication server
  description: When powered and filled with encryption keys it allows radio headset communication.
  components:
  - type: Sprite
    sprite: Structures/Machines/telecomms.rsi
    snapCardinals: true
    layers:
    - state: icon
    - state: unlit
      shader: unshaded
      map: ["enum.PowerDeviceVisualLayers.Powered"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: GenericVisualizer
    visuals:
      enum.PowerDeviceVisuals.Powered:
        enum.PowerDeviceVisualLayers.Powered:
          True: { visible: true }
          False: { visible: false }
  - type: Appearance
  - type: AmbientOnPowered
  - type: AmbientSound
    volume: -9
    range: 5
    sound:
      path: /Audio/Ambience/Objects/server_fans.ogg
  - type: WiresVisuals
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.4"
        density: 190
        mask:
        - MachineMask
        layer:
        - MachineLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Machine
    board: TelecomServerCircuitboard
  - type: WiresPanel
  - type: Transform
    anchored: true
  - type: Pullable
  - type: EncryptionKeyHolder
    keysExtractionMethod: Prying
    keySlots: 10
  - type: TelecomServer
  - type: ContainerContainer
    containers:
      key_slots: !type:Container
      machine_board: !type:Container
      machine_parts: !type:Container

- type: entity
  parent: TelecomServer
  id: TelecomServerFilled
  suffix: Filled All
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyCommon
      - EncryptionKeyCargo
      - EncryptionKeyEngineering
      - EncryptionKeyMedical
      - EncryptionKeyScience
      - EncryptionKeySecurity
      - EncryptionKeyService
      - EncryptionKeyCommand

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledCommon
  suffix: Common
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyCommon

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledCargo
  suffix: Cargo
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyCargo

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledEngineering
  suffix: Engineering
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyEngineering

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledMedical
  suffix: Medical
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyMedical

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledScience
  suffix: Science
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyScience

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledSecurity
  suffix: Security
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeySecurity

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledService
  suffix: Service
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyService

- type: entity
  parent: TelecomServer
  id: TelecomServerFilledCommand
  suffix: Command
  categories: [ HideSpawnMenu ] # Frontier
  components:
  - type: ContainerFill
    containers:
      key_slots:
      - EncryptionKeyCommand
