# SPDX-FileCopyrightText: 2021 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2023 Slava0135 <40753025+Slava0135@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 Velcroboy <107660393+ChilbroBaggins@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nim <128169402+Nimfar11@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Zealith-Gamer <61980908+Zealith-Gamer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 BombasterDS <deniskaporoshok@gmail.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 War Pigeon <54217755+minus1over12@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BlastDoor
  parent: BaseShutter
  name: blast door
  description: This one says 'BLAST DONGER'.
  components:
  - type: AccessReader
    containerAccessProvider: board
  - type: Sprite
    sprite: Structures/Doors/Shutters/blastdoor.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Door
    closeTimeOne: 0.4
    closeTimeTwo: 0.4
    openTimeOne: 0.4
    openTimeTwo: 0.4
    openingAnimationTime: 1.0
    closingAnimationTime: 1.0
    canPry: false
    crushDamage:
      types:
        Blunt: 25 # yowch
    openSound:
      path: /Audio/Machines/blastdoor.ogg
    closeSound:
      path: /Audio/Machines/blastdoor.ogg
  - type: Occluder
  - type: Appearance
  - type: RadiationBlocker
    resistance: 8
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: StrongMetallic
  - type: ContainerFill
    containers:
      board: [ DoorElectronics ]
  - type: Construction
    graph: BlastDoor
    node: blastdoor
    containers:
    - board
  - type: StaticPrice
    price: 500
  - type: InteractionPopup
    interactSuccessString: comp-window-knock
    messagePerceivedByOthers: comp-window-knock
    interactSuccessSound:
      path: /Audio/Effects/glass_knock.ogg
  - type: Penetratable # Goobstation - Better snipers
    penetrateDamage: 200
    damagePenalty: 0.4
  - type: WeldingSparksAnimation # Goobstation
    startingOffset: 0, 0.5

- type: entity
  id: BlastDoorOpen
  parent: BlastDoor
  suffix: Open
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Physics
    canCollide: false
  - type: Airtight
    airBlocked: false
  - type: RadiationBlocker
    enabled: false

- type: entity
  id: BlastDoorFrame
  parent: BaseStructureDynamic
  name: blast door frame
  description: This one says 'BLAST DONGER'.
  components:
  - type: Sprite
    sprite: Structures/Doors/Shutters/blastdoor.rsi
    state: assembly
  - type: InteractionOutline
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: StructuralMetallicStrong
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 300
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 55
        mask:
        - Impassable
        - HighImpassable
        layer:
        - HighImpassable
  - type: Transform
    noRot: true
  - type: Construction
    graph: BlastDoor
    node: frame1
  placement:
    mode: SnapgridCenter
