# SPDX-FileCopyrightText: 2020 Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Peter Wedder <burneddi@gmail.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Ygg01 <daniel.fath7@gmail.com>
# SPDX-FileCopyrightText: 2021 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <gradientvera@outlook.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2022 Fishfish458 <47410468+Fishfish458@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2022 fishfish458 <fishfish458>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 wrexbe <81056464+wrexbe@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Ilya Chvilyov <90278813+Telyonok@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 PixelTK <85175107+PixelTheKermit@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 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 MACMAN2003 <macman2003c@gmail.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ps3Moira <113228053+ps3moira@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: TableFrame
  # BaseStructure and not BaseTable, since these shouldn't be climbable/placeable.
  parent: BaseStructure
  name: table frame
  description: Pieces of metal that make the frame of a table.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/frame.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/frame.rsi
    state: full
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.40,-0.30,0.40,0.45"
        density: 80
        mask:
        - TableMask
        layer:
        - TableLayer
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: IconSmooth
    key: state
    base: state_
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: Table
    node: TableFrame

- type: entity
  id: CounterWoodFrame
  parent: BaseStructure
  name: wooden counter frame
  description: Pieces of wood that make the frame of a table.
  components:
  - type: SpriteFade
  - type: Sprite
    sprite: Structures/Furniture/Tables/frame.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/frame.rsi
    state: full
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 55
        mask:
        - TableMask
        layer:
        - TableLayer
        - BulletImpassable #Goobstation
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Wood
  - type: IconSmooth
    key: state
    base: state_
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: Table
    node: CounterWoodFrame
  - type: RequireProjectileTarget # Goobstation - Crawling
    ignoreThrow: true

- type: entity
  id: CounterMetalFrame
  parent: CounterWoodFrame
  name: metal counter frame
  description: Pieces of metal that make the frame of a table.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/frame.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/frame.rsi
    state: full
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: IconSmooth
    key: state
    base: state_
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 125
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: Table
    node: CounterMetalFrame

- type: entity
  id: Table
  parent: TableBase
  name: table
  description: A square piece of metal standing on four metal legs.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/generic.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/generic.rsi
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 125
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: metaltable
    base: state_
  - type: Construction
    graph: Table
    node: Table
  - type: Tag # goob edit
    tags:
    - Table

- type: entity
  id: TableReinforced
  parent: TableBase
  name: reinforced table
  description: A square piece of metal standing on four metal legs. Extra robust.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/reinforced.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/reinforced.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 150
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 75
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: metalreinforcedtable
  - type: Construction
    graph: Table
    node: TableReinforced
  - type: Climbable
    # Reinforced tables are extra tough
  - type: Bonkable
    bonkDamage:
      types:
        Blunt: 8
    bonkTime: 3
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableGlass
  parent: TableBase
  name: glass table
  description: A square piece of glass, standing on four metal legs.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/glass.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/glass.rsi
  - type: GlassTable
    climberDamage:
      types:
        Slash: 15
    tableDamage:
      types:
        Blunt: 25
    tableMassLimit: 60
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
        - !type:PlaySoundBehavior
          sound:
            collection: GlassBreak
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
      - !type:ChangeConstructionNodeBehavior
        node: TableFrame
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: glasstable
  - type: Construction
    graph: Table
    node: TableGlass
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepTile
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableCard
  parent: TableBase
  name: cardboard table
  description: Cardboard sheets wrapped around a metal table frame.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/card.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/card.rsi
  - type: GlassTable #they named it that cause 'it would never be used elsewhere' or something, smh
    climberDamage:
      types:
        Blunt: 6
    tableDamage:
      types:
        Blunt: 15
    tableMassLimit: 40
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Card
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 45 #excess damage (nuke?). avoid computational cost of spawning entities.
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
        - !type:PlaySoundBehavior
          sound: /Audio//Weapons/pierce.ogg
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio//Weapons/pierce.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialCardboard:
            min: 1
            max: 2
      - !type:ChangeConstructionNodeBehavior
        node: TableFrame
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: cardtable
  - type: Construction
    graph: Table
    node: TableCard
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepTile

- type: entity
  id: TableReinforcedGlass
  parent: TableBase
  name: reinforced glass table
  description: A square piece of glass, standing on four metal legs. Extra robust.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/r_glass.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/r_glass.rsi
  - type: GlassTable
    climberDamage:
      types:
        Slash: 25
    tableDamage:
      types:
        Blunt: 40
    tableMassLimit: 120
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:ChangeConstructionNodeBehavior
        node: TableFrame
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
          PartRodMetal1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: reinforcedglasstable
  - type: Construction
    graph: Table
    node: TableReinforcedGlass
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepTile
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TablePlasmaGlass
  parent: TableBase
  name: plasma glass table
  description: A square piece of plasma glass, standing on four metal legs. Pretty!
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/plasma.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/plasma.rsi
  - type: GlassTable
    climberDamage:
      types:
        Slash: 30
    tableDamage:
      types:
        Blunt: 100
    tableMassLimit: 240
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 250
      behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:ChangeConstructionNodeBehavior
        node: TableFrame
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlassPlasma:
            min: 1
            max: 1
          PartRodMetal1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: plasmaglasstable
  - type: Construction
    graph: Table
    node: TablePlasmaGlass
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepTile
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableBrass
  parent: TableBase
  name: brass table
  description: A shiny, corrosion resistant brass table. Steampunk!
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/brass.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/brass.rsi
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 125
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetBrass1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: brasstable
  - type: Construction
    graph: Table
    node: TableBrass
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableWood
  parent: TableBase
  name: wood table
  description: Do not apply fire to this. Rumour says it burns easily.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/wood.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/wood.rsi
  - type: Damageable
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors: #excess damage (nuke?). avoid computational cost of spawning entities.
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: woodtable
  - type: Construction
    graph: Table
    node: TableWood
  - type: Tag
    tags:
    - Wooden
    - Table # goob
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepWood
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableCarpet
  parent: TableBase
  name: gambling table
  description: Play em' cowboy.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/carpet.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/carpet.rsi
  - type: Damageable
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger: # Excess damage, don't spawn entities
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:DoActsBehavior
        acts: ["Destruction"]
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank:
            min: 1
            max: 1
          MaterialCloth1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: woodgambletable
  - type: Construction
    graph: Table
    node: TableCarpet
  - type: Tag
    tags:
    - Wooden
    - Table # goob
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepCarpet
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableStone
  parent: TableBase
  name: stone table
  description: Literally the sturdiest thing you have ever seen.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/stone.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/stone.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/picaxe2.ogg
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: stonetable
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepFloor
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableWeb
  parent: TableBase
  name: web table
  description: Really smooth and surprisingly durable.
  components:
  - type: Damageable
    damageModifierSet: Web
  - type: Sprite
    sprite: Structures/Furniture/Tables/web.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/web.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: MeleeSound
    soundGroups:
      Brute:
        path:
          "/Audio/Weapons/slash.ogg"
  - type: IconSmooth
    key: webtable
  - type: Construction
    graph: WebStructures
    node: table
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepCarpet
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

# Fancy tables

- type: entity
  id: TableFancyBase
  abstract: true
  parent: TableBase
  name: fancy table
  description: Expensive and rich.
  components:
  - type: Damageable
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank:
            min: 1
            max: 1
          MaterialCloth1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: fancytable
  - type: Tag
    tags:
    - Wooden
    - Table # goob
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepCarpet
  - type: CosmicCorruptible # DeltaV - Cosmic Cult
    convertTo: CosmicTable

- type: entity
  id: TableFancyBlue
  parent: TableFancyBase
  suffix: Blue
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/blue.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/blue.rsi
  - type: Construction
    graph: Table
    node: TableFancyBlue
  - type: IconSmooth
    key: fancytableblue

- type: entity
  id: TableFancyCyan
  parent: TableFancyBase
  suffix: Cyan
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/cyan.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/cyan.rsi
  - type: Construction
    graph: Table
    node: TableFancyCyan
  - type: IconSmooth
    key: fancytablecyan

- type: entity
  id: TableFancyBlack
  parent: TableFancyBase
  suffix: Black
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/black.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/black.rsi
  - type: Construction
    graph: Table
    node: TableFancyBlack
  - type: IconSmooth
    key: fancytableblack

- type: entity
  id: TableFancyRed
  parent: TableFancyBase
  suffix: Red
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/red.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/red.rsi
  - type: Construction
    graph: Table
    node: TableFancyRed
  - type: IconSmooth
    key: fancytablered

- type: entity
  id: TableFancyPurple
  parent: TableFancyBase
  suffix: Purple
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/purple.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/purple.rsi
  - type: Construction
    graph: Table
    node: TableFancyPurple
  - type: IconSmooth
    key: fancytablepurple

- type: entity
  id: TableFancyPink
  parent: TableFancyBase
  suffix: Pink
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/pink.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/pink.rsi
  - type: Construction
    graph: Table
    node: TableFancyPink
  - type: IconSmooth
    key: fancytablepink

- type: entity
  id: TableFancyGreen
  parent: TableFancyBase
  suffix: Green
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/green.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/green.rsi
  - type: Construction
    graph: Table
    node: TableFancyGreen
  - type: IconSmooth
    key: fancytablegreen

- type: entity
  id: TableFancyOrange
  parent: TableFancyBase
  suffix: Orange
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/orange.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/orange.rsi
  - type: Construction
    graph: Table
    node: TableFancyOrange
  - type: IconSmooth
    key: fancytableorange

- type: entity
  id: TableFancyWhite
  parent: TableFancyBase
  suffix: White
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/Fancy/white.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/Fancy/white.rsi
  - type: Construction
    graph: Table
    node: TableFancyWhite
  - type: IconSmooth
    key: fancytablewhite

#Debug

- type: entity
  id: TableDebug
  parent: TableBase
  name: table
  description: PUT ON THEM CODERSOCKS!!
  suffix: DEBUG
  components:
  - type: Tag
    tags:
      - Debug
      - Table # goob
  - type: Sprite
    sprite: Structures/Furniture/Tables/debug.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/debug.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]

# counters

- type: entity
  id: TableCounterWood
  parent: CounterBase
  name: wood counter
  description: Do not apply fire to this. Rumour says it burns easily.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/counterwood.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/counterwood.rsi
    state: full
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WoodDestroy
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: counterwood
    base: state_
  - type: Construction
    graph: Table
    node: CounterWood
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepWood

- type: entity
  id: TableCounterMetal
  parent: CounterBase
  name: metal counter
  description: Looks like a good place to put a drink down.
  components:
  - type: Sprite
    sprite: Structures/Furniture/Tables/countermetal.rsi
  - type: Icon
    sprite: Structures/Furniture/Tables/countermetal.rsi
    state: full
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 125
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: IconSmooth
    key: countermetal
    base: state_
  - type: Construction
    graph: Table
    node: CounterMetal
