# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 iNVERTED <alextjorgensen@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
  id: Jukebox
  name: jukebox
  parent: [ BaseMachinePowered, ConstructibleMachine ]
  description: A machine capable of playing a wide variety of tunes. Enjoyment not guaranteed.
  components:
  - type: StationAiWhitelist
  - type: Sprite
    sprite: Structures/Machines/jukebox.rsi
    layers:
    - state: "off"
      map: ["enum.JukeboxVisualLayers.Base"]
  - type: Transform
    anchored: true
  - type: Jukebox
    onState: on
    offState: off
    selectState: select
  - type: Machine
    board: JukeboxCircuitBoard
  - type: Appearance
  - type: ApcPowerReceiver
    powerLoad: 100
  - type: ExtensionCableReceiver
  - type: ActivatableUI
    key: enum.JukeboxUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
        enum.JukeboxUiKey.Key:
          type: JukeboxBoundUserInterface
        enum.WiresUiKey.Key:
          type: WiresBoundUserInterface
  - type: WiresPanel
  - type: Wires
    boardName: wires-board-name-jukebox
    layoutId: Jukebox
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 75
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 2
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.25,-0.45,0.25,0.45"
        mask:
        - MachineMask
        layer:
        - MachineLayer
        density: 200