- type: entity
  parent: BaseStructure
  id: BaseRailing
  abstract: true
  name: railing
  description: Basic railing meant to protect idiots like you from falling.
  components:
  - type: Sprite
    drawdepth: SmallObjects
    sprite: Structures/Walls/railing.rsi
  - type: Icon
    sprite: Structures/Walls/railing.rsi
  - type: Physics
    bodyType: Static
  - type: InteractionOutline
  - type: Repairable
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: FlimsyMetallic
  - type: Climbable
  - type: Construction
    graph: Railing
  - type: RCDDeconstructable
    cost: 2
    delay: 2
    fx: EffectRCDDeconstruct2

- type: entity
  parent: BaseRailing
  id: Railing
  components:
  - type: Sprite
    state: side
  - type: Icon
    state: side
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,-0.49,0.49,-0.25"
        density: 1000
        mask:
        - TableMask
        layer:
        - TableLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    node: railing

- type: entity
  parent: BaseRailing
  id: RailingCorner
  components:
  - type: Sprite
    state: corner
  - type: Icon
    state: corner
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,-0.49,0.49,-0.25"
        density: 1000
        mask:
        - TableMask
        layer:
        - TableLayer
      fix2:
        shape:
          !type:PhysShapeAabb
          bounds: "0.25,-0.49,0.49,0.49"
        density: 1000
        mask:
        - TableMask
        layer:
        - TableLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 0
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    node: railingCorner

- type: entity
  parent: BaseRailing
  id: RailingCornerSmall
  components:
  - type: Sprite
    state: corner_small
  - type: Icon
    state: corner_small
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,0.25,-0.25,0.49"
        density: 1000
        mask:
        - TableMask
        layer:
        - TableLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 0
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    node: railingCornerSmall

- type: entity
  parent: BaseRailing
  id: RailingRound
  components:
  - type: Sprite
    state: round
  - type: Icon
    state: round
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,-0.49,0.49,-0.25"
        density: 1000
        mask:
          - TableMask
        layer:
          - TableLayer
      fix2:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.49,-0.49,-0.25,0.49"
        density: 1000
        mask:
          - TableMask
        layer:
          - TableLayer
      fix3:
        shape:
          !type:PhysShapeAabb
          bounds: "0.25,-0.49,0.49,0.49"
        density: 1000
        mask:
          - TableMask
        layer:
          - TableLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          PartRodMetal1:
            min: 0
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Construction
    node: railingRound
