# Base

- type: entity
  id: DisposalPipeBase
  abstract: true
  placement:
    mode: SnapgridCenter
    snap:
    - Disposal
  components:
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
  - type: SnapGrid
  - type: Anchorable
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: ["Breakage"]
  - type: Rotatable
  - type: Pullable

- type: entity
  id: DisposalHolder
  abstract: true
  name: disposal holder
  components:
  - type: DisposalHolder

# Pipes

- type: entity
  id: DisposalPipe
  parent: DisposalPipeBase
  name: disposal pipe segment
  description: A huge pipe segment used for constructing disposal systems
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-s
  - type: DisposalTransit
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-s
      state_anchored: pipe-s
      state_broken: pipe-b
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.25,0.5,0.25"
      layer: [ Underplating ]

- type: entity
  id: DisposalTagger
  parent: DisposalPipeBase
  name: disposal pipe tagger
  description: A pipe that tags entities for routing
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-tagger
  - type: DisposalTagger
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-tagger
      state_anchored: pipe-tagger
      state_broken: pipe-b
  - type: UserInterface
    interfaces:
    - key: enum.DisposalTaggerUiKey.Key
      type: DisposalTaggerBoundUserInterface
  - type: Physics
    fixtures:
      - shape:
          !type:PhysShapeAabb
            bounds: "-0.5,-0.25,0.5,0.25"
        layer: [ Underplating ]

- type: entity
  id: DisposalTrunk
  parent: DisposalPipeBase
  name: disposal trunk
  description: A pipe trunk used as an entry point for disposal systems
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-t
  - type: DisposalEntry
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-t
      state_anchored: pipe-t
      state_broken: pipe-b
  - type: Physics
    fixtures:
      - shape:
          !type:PhysShapeAabb
            bounds: "-0.5,-0.25,0.4,0.25"
        layer: [ Underplating ]

- type: entity
  id: DisposalRouter
  parent: DisposalPipeBase
  name: disposal router
  description: A three-way router. Entities with matching tags get routed to the side
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-j1s
  - type: DisposalRouter
    degrees:
    - 0
    - -90
    - 180
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-j1s
      state_anchored: pipe-j1s
      state_broken: pipe-b
  - type: Flippable
    entity: DisposalRouterFlipped
  - type: UserInterface
    interfaces:
    - key: enum.DisposalRouterUiKey.Key
      type: DisposalRouterBoundUserInterface
  - type: Physics
    fixtures:
      - shape:
          !type:PhysShapeAabb
            bounds: "-0.5,-0.5,0.5,0.25"
        layer: [ Underplating ]

- type: entity
  id: DisposalRouterFlipped
  parent: DisposalRouter
  suffix: flipped
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-j2s
  - type: DisposalRouter
    degrees:
    - 0
    - 90
    - 180
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-j2s
      state_anchored: pipe-j2s
      state_broken: pipe-b
  - type: Flippable
    entity: DisposalRouter
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.25,0.5,0.5"
      layer: [ Underplating ]

- type: entity
  id: DisposalJunction
  parent: DisposalPipeBase
  name: disposal junction
  description: A three-way junction. The arrow indicates where items exit
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-j1
  - type: DisposalJunction
    degrees:
    - 0
    - -90
    - 180
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-j1
      state_anchored: pipe-j1
      state_broken: pipe-b
  - type: Flippable
    entity: DisposalJunctionFlipped
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.5,0.25"
      layer: [ Underplating ]

- type: entity
  id: DisposalJunctionFlipped
  parent: DisposalJunction
  suffix: flipped
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-j2
  - type: DisposalJunction
    degrees:
    - 0
    - 90
    - 180
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-j2
      state_anchored: pipe-j2
      state_broken: pipe-b
  - type: Flippable
    entity: DisposalJunction
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.25,0.5,0.5"
      layer: [ Underplating ]

- type: entity
  id: DisposalYJunction
  parent: DisposalPipeBase
  name: disposal y-junction
  description: A three-way junction with another exit point.
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-y
  - type: DisposalJunction
    degrees:
    - 0
    - 90
    - -90
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-y
      state_anchored: pipe-y
      state_broken: pipe-b
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.25,0.5"
      layer: [ Underplating ]

- type: entity
  id: DisposalBend
  parent: DisposalPipeBase
  name: disposal bend
  description: A tube bent at a 90 degree angle.
  components:
  - type: Sprite
    drawdepth: BelowFloor
    sprite: Constructible/Power/disposal.rsi
    state: conpipe-c
  - type: DisposalBend
  - type: Appearance
    visuals:
    - type: DisposalVisualizer
      state_free: conpipe-c
      state_anchored: pipe-c
      state_broken: pipe-b
  - type: Physics
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.25,0.25"
      layer: [ Underplating ]
