- type: entity
  id: TableBase
  name: "table"
  description: A square piece of metal standing on four metal legs.
  abstract: true
  placement:
    mode: SnapgridCenter
  components:
  - type: Clickable
  - type: PlaceableSurface
  - type: Sprite
    netsync: false
    drawdepth: FloorTiles
  - type: Icon
    state: full
  - type: IconSmooth
    key: state
    base: state_
  - type: Physics
    shapes:
    - !type:PhysShapeAabb
      layer:
      - VaultImpassable
  - type: SnapGrid
    offset: Center
  - type: Climbable

- 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:
      15:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/metalbreak.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            SteelSheet1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]

- 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:
      1:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/metalbreak.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            SteelSheet1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: TableFrame

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      1:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/metalbreak.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            SteelSheet1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      15:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/metalbreak.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            SteelSheet1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: MetalTable

- type: entity
  id: TableR
  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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      75:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/metalbreak.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            SteelSheet1:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: ReinforcedTable

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      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: Tables
    node: GlassTable

- type: entity
  id: TableGlassR
  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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      20:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/glass_break2.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            ShardGlass:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: RGlassTable

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      15:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/woodhit.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            WoodPlank:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: WoodTable

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      15:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/woodhit.ogg
        - !type:SpawnEntitiesBehavior
          spawn:
            WoodPlank:
              min: 1
              max: 1
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
  - type: Construction
    graph: Tables
    node: PokerTable

- 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: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
      50:
        behaviors:
        - !type:PlaySoundBehavior
          sound: /Audio/Effects/picaxe2.ogg
        - !type:DoActsBehavior
          acts: [ "Destruction" ]

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