# SPDX-FileCopyrightText: 2022 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 ChilbroBaggins <107660393+ChilbroBaggins@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: ComputerSurveillanceWirelessCameraMonitor
  id: ComputerTelevision
  name: wooden television
  description: Finally, some decent reception around here...
  components:
  - type: Sprite
    noRot: true
    drawdepth: SmallObjects
    layers:
    - map: ["computerLayerBody"]
      state: television
    - map: ["computerLayerScreen"]
      state: detective_television
  - type: Computer
    board: ComputerTelevisionCircuitboard
  - type: PointLight
    radius: 1.5
    energy: 1.6
    color: "#b89f25"
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.25,-0.25,0.25,0.25"
        density: 200
        mask:
          - TabletopMachineMask
        layer:
          - TabletopMachineLayer

- type: entity
  parent: BaseComputer
  id: WallmountTelescreenFrame
  name: telescreen frame
  description: Finally, some decent reception around here...
  components:
  - type: Construction
    graph: WallmountTelescreen
    node: TelescreenFrame
  - type: Sprite
    drawdepth: WallMountedItems
    sprite: Structures/Machines/computers.rsi
    layers:
      - map: ["computerLayerBody"]
        state: telescreen_frame
      - map: ["computerLayerScreen"]
        state: telescreen
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.20,-0.10,0.25,0.35"
        density: 250
        mask:
          - FullTileMask
        layer:
          - WallLayer
  - type: WallMount
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors: #excess damage, don't spawn entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Transform
    anchored: true

- type: entity
  parent: WallmountTelescreenFrame
  id: WallmountTelescreen
  suffix: camera monitor
  name: telescreen
  description: Finally, some decent reception around here...
  components:
  - type: Construction
    graph: WallmountTelescreen
    node: Telescreen
  - type: PointLight
    radius: 1.5
    energy: 1.6
    color: "#b89f25"
  - type: DeviceNetwork
    deviceNetId: Wired
    receiveFrequencyId: SurveillanceCamera
    transmitFrequencyId: SurveillanceCamera
  - type: WiredNetworkConnection
  - type: DeviceNetworkRequiresPower
  - type: SurveillanceCameraMonitor
  - type: ActivatableUI
    key: enum.SurveillanceCameraMonitorUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: ActivatableUIRequiresVision
  - type: UserInterface
    interfaces:
        enum.SurveillanceCameraMonitorUiKey.Key:
          type: SurveillanceCameraMonitorBoundUserInterface

# Wall Televisions

- type: entity
  parent: WallmountTelescreenFrame
  id: WallmountTelevisionFrame
  name: television frame
  description: Finally, some decent reception around here...
  components:
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.75,-0.10,0.75,0.35"
        density: 75
        mask:
          - FullTileMask
        layer:
          - WallLayer
  - type: Construction
    graph: WallmountTelevision
    node: TelevisionFrame
  - type: Sprite
    drawdepth: WallMountedItems
    sprite: Structures/Wallmounts/flatscreentv.rsi
    layers:
      - map: ["computerLayerBody"]
        state: television_wall
      - map: ["computerLayerScreen"]
        state: television_wallscreen

- type: entity
  parent: WallmountTelevisionFrame
  id: WallmountTelevision
  suffix: entertainment
  name: television
  description: Finally, some decent reception around here...
  components:
  - type: Construction
    graph: WallmountTelevision
    node: Television
  - type: DeviceNetwork
    deviceNetId: Wireless
    receiveFrequencyId: SurveillanceCamera
    transmitFrequencyId: SurveillanceCamera
  - type: WirelessNetworkConnection
    range: 200
  - type: DeviceNetworkRequiresPower
  - type: Speech
  - type: SurveillanceCameraSpeaker
  - type: SurveillanceCameraMonitor
  - type: ActivatableUI
    key: enum.SurveillanceCameraMonitorUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: ActivatableUIRequiresVision
  - type: UserInterface
    interfaces:
        enum.SurveillanceCameraMonitorUiKey.Key:
          type: SurveillanceCameraMonitorBoundUserInterface
  - type: PointLight
    radius: 1.5
    energy: 1.6
    color: "#b89f25"