# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Ygg01 <daniel.fath7@gmail.com>
# SPDX-FileCopyrightText: 2020 moonheart08 <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2021 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SlamBamActionman <slambamactionman@gmail.com>
# SPDX-FileCopyrightText: 2025 Southbridge <7013162+southbridge-fur@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 qwerltaz <msmarcinpl@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# TODO move all of this to tiles once tile smoothing is supported
- type: entity
  id: CarpetBase
  parent: BaseStructure
  name: carpet
  description: "Fancy walking surface."
  abstract: true
  components:
  - type: Sprite
    drawdepth: FloorTiles
  - type: Icon
    state: full
  - type: IconSmooth
    key: full
    base: carpet_
  - type: Tag
    tags:
    - Carpet
    - ForceFixRotations
  - type: Physics
    canCollide: false
  - type: Fixtures
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
        behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Butcherable
    butcheringType: Knife
    butcherDelay: 2
    spawned:
    - id: MaterialCloth1
      amount: 1
  - type: TrayScanReveal

- type: entity
  id: Carpet
  parent: CarpetBase
  suffix: Red
  components:
  - type: Sprite
    sprite: Structures/Furniture/Carpets/red_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/red_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemRed:
                min: 1
                max: 1

- type: entity
  id: CarpetBlack
  parent: CarpetBase
  suffix: Black
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/black_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/black_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemBlack:
                min: 1
                max: 1

- type: entity
  id: CarpetPink
  parent: CarpetBase
  suffix: Pink
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/pink_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/pink_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemPink:
                min: 1
                max: 1

- type: entity
  id: CarpetBlue
  parent: CarpetBase
  suffix: Blue
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/blue_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/blue_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemBlue:
                min: 1
                max: 1

- type: entity
  id: CarpetGreen
  parent: CarpetBase
  suffix: Green
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/green_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/green_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemGreen:
                min: 1
                max: 1

- type: entity
  id: CarpetOrange
  parent: CarpetBase
  suffix: Orange
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/orange_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/orange_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemOrange:
                min: 1
                max: 1

- type: entity
  id: CarpetSBlue
  parent: CarpetBase
  suffix: Sky Blue
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/skyblue_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/skyblue_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemSkyBlue:
                min: 1
                max: 1

- type: entity
  id: CarpetPurple
  parent: CarpetBase
  suffix: Purple
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/purple_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/purple_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemPurple:
                min: 1
                max: 1

- type: entity
  id: CarpetCyan
  parent: CarpetBase
  suffix: Cyan
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/cyan_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/cyan_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemCyan:
                min: 1
                max: 1

- type: entity
  id: CarpetWhite
  parent: CarpetBase
  suffix: White
  components:
  - type: Clickable
  - type: Sprite
    sprite: Structures/Furniture/Carpets/white_carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Carpets/white_carpet.rsi
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 100
        behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:SpawnEntitiesBehavior
            spawn:
              FloorCarpetItemWhite:
                min: 1
                max: 1

# TODO nuke this once tiles support rotating sprites
- type: entity
  id: CarpetChapel
  parent: BaseStructure
  name: "chapel's carpet"
  components:
  - type: Sprite
    sprite: Structures/Furniture/Carpets/chapel_carpet.rsi
    state: chapel
    drawdepth: FloorTiles
  - type: Icon
    sprite: Structures/Furniture/Carpets/chapel_carpet.rsi
    state: chapel
  - type: Tag
    tags: [ Carpet ]
  - type: Physics
    canCollide: false
  - type: Fixtures
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 10
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
  - type: TrayScanReveal