- type: entity
  id: TableBase
  parent: BaseConstructible
  name: table
  description: A square piece of metal standing on four metal legs.
  abstract: true
  components:
  - type: Damageable
    resistances: metallicResistances
  - type: PlaceableSurface
  - type: Sprite
    netsync: false
    drawdepth: FloorTiles
  - type: Icon
    state: full
  - type: IconSmooth
    key: state
    base: state_
  - type: Climbable

- type: entity
  id: TableFrame
  parent: TableBase
  name: table frame
  description: Pieces of metal that make the frame of a table.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/frame.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/frame.rsi
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableFrame

- type: entity
  id: Table
  parent: TableBase
  name: table
  description: A square piece of metal standing on four metal legs.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/generic.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/generic.rsi
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: Table

- type: entity
  id: TableBar
  parent: TableBase
  name: bar table
  description: Fancy table. Perfect for serving drinks.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/bar.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/bar.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
          MaterialCloth1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableBar

- type: entity
  id: TableMetal
  parent: TableBase
  name: metal table
  description: Just a metal table.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/metal.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/metal.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

- 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: Constructible/Structures/Tables/reinforced.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/reinforced.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 75
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableReinforced

- type: entity
  id: TableGlass
  parent: TableBase
  name: glass table
  description: A square piece of glass, standing on four metal legs.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/glass.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/glass.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/glass_break2.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableGlass

- 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: Constructible/Structures/Tables/r_glass.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/r_glass.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/glass_break2.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
          PartRodMetal1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableReinforcedGlass

- 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: Constructible/Structures/Tables/wood.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/wood.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/woodhit.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableWood

- type: entity
  id: TableCarpet
  parent: TableBase
  name: gambling table
  description: Play em' cowboy.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/carpet.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/carpet.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/woodhit.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank:
            min: 1
            max: 1
          MaterialCloth1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    graph: table
    node: TableCarpet

- type: entity
  id: TableStone
  parent: TableBase
  name: stone table
  description: Literally the sturdiest thing you have ever seen.
  components:
  - type: Sprite
    sprite: Constructible/Structures/Tables/stone.rsi
  - type: Icon
    sprite: Constructible/Structures/Tables/stone.rsi
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/picaxe2.ogg
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

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