- 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.TapePlayerVisualLayers.Base"] # Sunrise-Edit
  - type: Transform
    anchored: true
  # Sunrise-Start
  - type: TapePlayer
    rolloffFactor: 1
    maxDistance: 30
    tapeSlot:
      insertSound: /Audio/_Sunrise/TapePlayer/insert_tape.ogg
      ejectSound: /Audio/_Sunrise/TapePlayer/eject_tape.ogg
      whitelist:
        components:
        - MusicTape
    onState: on
    offState: off
    buttonSound: /Audio/_Sunrise/TapePlayer/switch.ogg
    needPower: true
  - type: ItemSlots
  - type: ContainerContainer
    containers:
      tape: !type:ContainerSlot
      machine_board: !type:Container
      machine_parts: !type:Container
  # Sunrise-End
  - type: Machine
    board: JukeboxCircuitBoard
  - type: Appearance
  - type: ApcPowerReceiver
    powerLoad: 100
  - type: ExtensionCableReceiver
  - type: ActivatableUI # Sunrise-Edit
    key: enum.TapePlayerUiKey.Key # Sunrise-Edit
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
        enum.TapePlayerUiKey.Key: # Sunrise-Edit
          type: TapePlayerBoundUserInterface # Sunrise-Edit
        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
