# TODO: same as other wallmount cabinets they should use a base structure prototype
- type: entity
  parent: BaseWallmountCabinet
  id: DefibrillatorCabinet
  name: defibrillator cabinet
  description: A small wall mounted cabinet designed to hold a defibrillator.
  placement:
    mode: SnapgridCenter
  components:
  - type: Sprite
    sprite: Structures/Wallmounts/defib_cabinet.rsi
    noRot: false
    layers:
    - state: frame
    - state: fill
      map: ["enum.ItemCabinetVisuals.Layer"]
      visible: true
    - state: closed
      map: ["enum.OpenableVisuals.Layer"]
  - type: ItemSlots
    slots:
      ItemCabinet:
        ejectOnInteract: true
        whitelist:
          components:
          - Defibrillator
  # Begin DeltaV additions
  - type: Charger
    slotId: ItemCabinet
  - type: ApcPowerReceiver
    powerLoad: 1000
  - type: ExtensionCableReceiver
  - type: LightningTarget
    priority: 1
  # End DeltaV additions
  - type: Destructible
    thresholds:
    - trigger: !type:DamageTrigger
        damage: 80
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger: !type:DamageTrigger
        damage: 40
      behaviors:
      - !type:EmptyAllContainersBehaviour
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:PlaySoundBehavior
        sound:
          collection: MetalGlassBreak

- type: entity
  parent: DefibrillatorCabinet
  id: DefibrillatorCabinetOpen
  suffix: Open
  components:
  - type: Openable
    opened: true

- type: entity
  parent: DefibrillatorCabinet
  id: DefibrillatorCabinetFilled
  suffix: Filled
  components:
  - type: ContainerFill
    containers:
      ItemCabinet:
      - Defibrillator

- type: entity
  parent: [DefibrillatorCabinetFilled, DefibrillatorCabinetOpen]
  id: DefibrillatorCabinetFilledOpen
  suffix: Filled, Open
