# SPDX-FileCopyrightText: 2022 Chris <HoofedEar@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Deahaka <96499407+Deahaka@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Justin Trotter <trotter.justin@gmail.com>
# SPDX-FileCopyrightText: 2022 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Kit0vras <123590995+Kit0vras@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Futuristic-OK <141568243+Futuristic-OK@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Futuristic-OK <141568243+FuturisticRUS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 shamp <140359015+shampunj@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseCurtains
  parent: BaseStructure
  name: curtains
  description: Hides what others shouldn't see.
  abstract: true
  placement:
    mode: SnapgridCenter
  components:
  - type: Occluder
  - type: AnimationPlayer
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,-0.49,0.49,0.49"
        density: 100
        mask:
        - FullTileMask
        layer:
        - Opaque
  - type: Door
    canCrush: false
    performCollisionCheck: false
    bumpOpen: false
    clickOpen: true
    closeTimeOne: 0.5
    closeTimeTwo: 0.1
    openTimeOne: 0.5
    openTimeTwo: 0.1
    openSound:
      path: /Audio/Effects/curtain_openclose.ogg
    closeSound:
      path: /Audio/Effects/curtain_openclose.ogg
  - type: Appearance
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger: # Excess damage, don't spawn entities
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialCloth1:
            min: 1
            max: 1
  - type: WallMount
    arc: 360

- type: entity
  id: HospitalCurtains
  parent: BaseCurtains
  suffix: Hospital
  description: Contains less than 1% mercury.
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/hospital.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: Curtains

- type: entity
  id: HospitalCurtainsOpen
  parent: HospitalCurtains
  suffix: Open, Hospital
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsBlack
  parent: BaseCurtains
  suffix: Fancy black
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/black.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsBlack

- type: entity
  id: CurtainsBlackOpen
  parent: CurtainsBlack
  suffix: Open, Fancy black
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsBlackOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsBlue
  parent: BaseCurtains
  suffix: Fancy blue
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/blue.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsBlue

- type: entity
  id: CurtainsBlueOpen
  parent: CurtainsBlue
  suffix: Open, Fancy blue
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsBlueOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsCyan
  parent: BaseCurtains
  suffix: Fancy cyan
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/cyan.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsCyan

- type: entity
  id: CurtainsCyanOpen
  parent: CurtainsCyan
  suffix: Open, Fancy cyan
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsCyanOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsGreen
  parent: BaseCurtains
  suffix: Fancy green
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/green.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsGreen

- type: entity
  id: CurtainsGreenOpen
  parent: CurtainsGreen
  suffix: Open, Fancy green
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsGreenOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsOrange
  parent: BaseCurtains
  suffix: Fancy orange
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/orange.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsOrange

- type: entity
  id: CurtainsOrangeOpen
  parent: CurtainsOrange
  suffix: Open, Fancy orange
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsOrangeOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsPink
  parent: BaseCurtains
  suffix: Fancy pink
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/pink.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsPink

- type: entity
  id: CurtainsPinkOpen
  parent: CurtainsPink
  suffix: Open, Fancy pink
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsPinkOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsPurple
  parent: BaseCurtains
  suffix: Fancy purple
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/purple.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsPurple

- type: entity
  id: CurtainsPurpleOpen
  parent: CurtainsPurple
  suffix: Open, Fancy purple
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsPurpleOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsRed
  parent: BaseCurtains
  suffix: Fancy red
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/red.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsRed

- type: entity
  id: CurtainsRedOpen
  parent: CurtainsRed
  suffix: Open, Fancy red
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsRedOpen
  - type: Physics
    canCollide: false

- type: entity
  id: CurtainsWhite
  parent: BaseCurtains
  suffix: Fancy white
  components:
  - type: Sprite
    snapCardinals: true
    sprite: Structures/Decoration/Curtains/white.rsi
    layers:
    - state: closed
      map: ["enum.DoorVisualLayers.Base"]
  - type: Construction
    graph: Curtains
    node: CurtainsWhite

- type: entity
  id: CurtainsWhiteOpen
  parent: CurtainsWhite
  suffix: Open, Fancy white
  components:
  - type: Door
    state: Open
  - type: Occluder
    enabled: false
  - type: Construction
    graph: Curtains
    node: CurtainsWhiteOpen
  - type: Physics
    canCollide: false