- 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

- 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: DisposalUnit
  parent: BaseConstructible
  name: disposal unit
  description: A pneumatic waste disposal unit
  placement:
    mode: SnapgridCenter
    snap:
    - Disposal
  components:
  - type: Sprite
    netsync: false
    sprite: Constructible/Power/disposal.rsi
    layers:
    - state: condisposal
      map: ["enum.DisposalUnitVisualLayers.Base"]
    - state: dispover-handle
      map: ["enum.DisposalUnitVisualLayers.Handle"]
    - state: dispover-ready
      map: ["enum.DisposalUnitVisualLayers.Light"]
  - type: PowerReceiver
  - type: DisposalUnit
    flushTime: 2
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.4,-0.25,0.4,0.25"
      mask:
      - SmallImpassable
      layer:
      - Opaque
      - MobImpassable
  - type: Anchorable
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:PlaySoundBehavior
        sound: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
  - type: Appearance
    visuals:
    - type: DisposalUnitVisualizer
      state_unanchored: condisposal
      state_anchored: disposal
      state_charging: disposal-charging
      overlay_charging: dispover-charge
      overlay_ready: dispover-ready
      overlay_full: dispover-full
      overlay_engaged: dispover-handle
      state_flush: disposal-flush
      flush_sound: /Audio/Machines/disposalflush.ogg
      flush_time: 2
  - type: UserInterface
    interfaces:
    - key: enum.DisposalUnitUiKey.Key
      type: DisposalUnitBoundUserInterface

- 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 ]

- type: entity
  id: DisposalMailingUnit
  name: disposal mailing unit
  description: A pneumatic waste disposal unit
  placement:
    mode: SnapgridCenter
    snap:
    - Disposal
  components:
  - type: Sprite
    netsync: false
    sprite: Constructible/Power/disposal.rsi
    layers:
    - state: condisposal
      map: ["enum.DisposalUnitVisualLayers.Base"]
    - state: dispover-handle
      map: ["enum.DisposalUnitVisualLayers.Handle"]
    - state: dispover-ready
      map: ["enum.DisposalUnitVisualLayers.Light"]
  - type: PowerReceiver
  - type: Configuration
    keys:
    - Tag
  - type: DisposalMailingUnit
    flushTime: 2
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.35,-0.3,0.35,0.3"
      mask:
      - Impassable
      - MobImpassable
      - VaultImpassable
      - SmallImpassable
      layer:
      - Opaque
      - Impassable
      - MobImpassable
      - VaultImpassable
      - SmallImpassable
  - type: SnapGrid
  - type: Anchorable
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Appearance
    visuals:
    - type: DisposalUnitVisualizer
      state_unanchored: condisposal
      state_anchored: disposal
      state_charging: disposal-charging
      overlay_charging: dispover-charge
      overlay_ready: dispover-ready
      overlay_full: dispover-full
      overlay_engaged: dispover-handle
      state_flush: disposal-flush
      flush_sound: /Audio/Machines/disposalflush.ogg
      flush_time: 2
  - type: UserInterface
    interfaces:
    - key: enum.DisposalMailingUnitUiKey.Key
      type: DisposalMailingUnitBoundUserInterface
    - key: enum.ConfigurationUiKey.Key
      type: ConfigurationBoundUserInterface
  - type: Pullable
