# SPDX-FileCopyrightText: 2022 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 fishbait <gnesse@gmail.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
  abstract: true
  parent: [ BaseStructureDynamic, SmallConstructibleMachine ]
  id: SurveillanceWirelessCameraBase
  name: wireless camera
  description: A camera. It's watching you. Kinda.
  components:
    - type: InteractionOutline
    - type: Eye
    - type: WirelessNetworkConnection
      range: 200
    - type: Damageable
      damageContainer: StructuralInorganic
      damageModifierSet: Metallic
    - type: Rotatable
      rotateWhileAnchored: true
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeCircle
            radius: 0.45
          density: 80
          mask:
            - MachineMask
          layer:
            - BulletImpassable
    - type: SurveillanceCameraMicrophone
      blacklist:
        components:
          - SurveillanceCamera
          - SurveillanceCameraMonitor
          - RadioSpeaker
    - type: ActiveListener
      range: 10
    - type: UserInterface
      interfaces:
        enum.SurveillanceCameraSetupUiKey.Camera:
          type: SurveillanceCameraSetupBoundUi
    - type: StationAiVision # GOOB - AI can see entertainment
  placement:
    mode: SnapgridCenter

- type: entity
  abstract: true
  id: SurveillanceWirelessCameraAnchoredBase
  parent: SurveillanceWirelessCameraBase
  suffix: Anchored
  components:
    - type: Machine
      board: SurveillanceWirelessCameraAnchoredCircuitboard
    - type: Anchorable
    - type: Transform
      anchored: true
    - type: Physics
      bodyType: Static
    - type: Sprite
      noRot: true
      sprite: Structures/monitors.rsi
      layers:
        - map: [ "enum.SurveillanceCameraVisualsKey.Key" ]
          state: television

- type: entity
  abstract: true
  id: SurveillanceWirelessCameraMovableBase
  parent: SurveillanceWirelessCameraBase
  suffix: Movable
  components:
    - type: Machine
      board: SurveillanceWirelessCameraMovableCircuitboard
    - type: Transform
    - type: Sprite
      noRot: true
      sprite: Structures/monitors.rsi
      layers:
        - map: [ "enum.SurveillanceCameraVisualsKey.Key" ]
          state: mobilevision

- type: entity
  parent: SurveillanceWirelessCameraAnchoredBase
  suffix: Constructed, Anchored
  id: SurveillanceWirelessCameraAnchoredConstructed
  components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: SurveillanceCamera
      transmitFrequencyId: SurveillanceCamera
    - type: SurveillanceCamera
      setupAvailableNetworks:
        - SurveillanceCameraEntertainment
      mobile: True  # Goobstation - mobile cameras fix

- type: entity
  parent: SurveillanceWirelessCameraMovableBase
  suffix: Constructed, Movable
  id: SurveillanceWirelessCameraMovableConstructed
  components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: SurveillanceCameraEntertainment
      transmitFrequencyId: SurveillanceCamera
    - type: SurveillanceCamera
      setupAvailableNetworks:
        - SurveillanceCameraEntertainment
      mobile: True  # Goobstation - mobile cameras fix

- type: entity
  parent: SurveillanceWirelessCameraAnchoredBase
  suffix: Entertainment, Anchored
  id: SurveillanceWirelessCameraAnchoredEntertainment
  components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: SurveillanceCameraEntertainment
      transmitFrequencyId: SurveillanceCamera
    - type: SurveillanceCamera
      networkSet: true
      mobile: True # Goobstation - mobile cameras fix

- type: entity
  parent: SurveillanceWirelessCameraMovableBase
  suffix: Entertainment, Movable
  id: SurveillanceWirelessCameraMovableEntertainment
  components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: SurveillanceCameraEntertainment
      transmitFrequencyId: SurveillanceCamera
    - type: SurveillanceCamera
      networkSet: true
      mobile: True # Goobstation - mobile cameras fix
