# 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 metalgearsloth <comedian_vs_clown@hotmail.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: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Avery Dobbins <avery.dobbins@gmail.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.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: this could probably use some kind of base structure prototype
# every wallmount cabinet copypastes placement and like 8 components
- type: entity
  parent: BaseItemCabinet
  id: ExtinguisherCabinet
  name: extinguisher cabinet
  description: A small wall mounted cabinet designed to hold a fire extinguisher.
  placement:
    mode: SnapgridCenter
  components:
    - type: WallMount
      arc: 360
    - type: Transform
      anchored: true
    - type: Clickable
    - type: InteractionOutline
    - type: Sprite
      sprite: Structures/Wallmounts/extinguisher_cabinet.rsi
      snapCardinals: true
      layers:
      - state: frame
      - state: extinguisher
        map: ["enum.ItemCabinetVisuals.Layer"]
        visible: true
      - state: closed
        map: ["enum.OpenableVisuals.Layer"]
    - type: ItemSlots
      slots:
        ItemCabinet:
          ejectOnInteract: true
          whitelist:
            components:
            - SpraySafety
    - 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
                params:
                  volume: -4

- type: entity
  parent: ExtinguisherCabinet
  id: ExtinguisherCabinetOpen
  suffix: Open
  components:
  - type: Openable
    opened: true

- type: entity
  parent: ExtinguisherCabinet
  id: ExtinguisherCabinetFilled
  suffix: Filled
  components:
  - type: ContainerFill
    containers:
      ItemCabinet:
      - FireExtinguisher

- type: entity
  parent: [ExtinguisherCabinetFilled, ExtinguisherCabinetOpen]
  id: ExtinguisherCabinetFilledOpen
  suffix: Filled, Open