# SPDX-FileCopyrightText: 2020 Moses <StrawberryMoses@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 mirrorcult <notzombiedude@gmail.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# TODO: same as other wallmount cabinets they should use a base structure prototype
- type: entity
  parent: BaseItemCabinet
  id: DefibrillatorCabinet
  name: defibrillator cabinet
  description: A small wall mounted cabinet designed to hold a defibrillator.
  placement:
    mode: SnapgridCenter
  components:
  - type: WallMount
    arc: 175
  - type: Transform
    anchored: true
  - type: Clickable
  - type: InteractionOutline
  - 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
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - 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