- type: entity
  abstract: true
  id: DisposalUnitBase
  parent: BaseMachinePowered
  description: A pneumatic waste disposal unit.
  placement:
    mode: SnapgridCenter
    snap:
    - Disposal
  components:
  - type: Climbable
    vaultable: false
  - type: Sprite
    sprite: Structures/Piping/disposal.rsi
    layers:
    - state: condisposal
      map: [ "enum.DisposalUnitVisualLayers.Unanchored" ]
    - state: disposal
      map: [ "enum.DisposalUnitVisualLayers.Base" ]
    - state: disposal-charging
      map: [ "enum.DisposalUnitVisualLayers.BaseCharging" ]
    - state: disposal-flush
      map: [ "enum.DisposalUnitVisualLayers.OverlayFlush" ]
    - state: dispover-charge
      map: [ "enum.DisposalUnitVisualLayers.OverlayCharging" ]
    - state: dispover-ready
      map: [ "enum.DisposalUnitVisualLayers.OverlayReady" ]
    - state: dispover-full
      map: [ "enum.DisposalUnitVisualLayers.OverlayFull" ]
    - state: dispover-handle
      map: [ "enum.DisposalUnitVisualLayers.OverlayEngaged" ]
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 55
        mask:
        - MachineMask
        layer:
        - MachineLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
          params:
            volume: -6
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
  - type: Appearance
  - type: UserInterface
    interfaces:
      enum.DisposalUnitUiKey.Key:
        type: DisposalUnitBoundUserInterface
  - type: ContainerContainer
    containers:
      disposals: !type:Container
  - type: StaticPrice
    price: 70
  - type: PowerSwitch

- type: entity
  id: DisposalUnit
  parent: DisposalUnitBase
  name: disposal unit
  components:
  - type: Sprite
    sprite: Structures/Piping/disposal.rsi
    snapCardinals: true
  - type: Construction
    graph: DisposalMachine
    node: disposal_unit
  - type: DisposalUnit
  - type: ThrowInsertContainer
    containerId: disposals
    probability: 0.67
  - type: UserInterface
    interfaces:
      enum.DisposalUnitUiKey.Key:
        type: DisposalUnitBoundUserInterface
  - type: Rummageable
    table: !type:NestedSelector
      tableId: RatKingLoot
  - type: RequireProjectileTarget

- type: entity
  id: MailingUnit
  parent: DisposalUnitBase
  name: mailing unit
  description: A pneumatic mail delivery unit.
  components:
  - type: Sprite
    sprite: Structures/Piping/disposal.rsi
    snapCardinals: true
    layers:
      - state: conmailing
        map: [ "enum.DisposalUnitVisualLayers.Unanchored" ]
      - state: mailing
        map: [ "enum.DisposalUnitVisualLayers.Base" ]
      - state: mailing-charging
        map: [ "enum.DisposalUnitVisualLayers.BaseCharging" ]
      - state: mailing-flush
        map: [ "enum.DisposalUnitVisualLayers.OverlayFlush" ]
      - state: dispover-charge
        map: [ "enum.DisposalUnitVisualLayers.OverlayCharging" ]
      - state: dispover-ready
        map: [ "enum.DisposalUnitVisualLayers.OverlayReady" ]
      - state: dispover-full
        map: [ "enum.DisposalUnitVisualLayers.OverlayFull" ]
      - state: mailover-handle
        map: [ "enum.DisposalUnitVisualLayers.OverlayEngaged" ]
  - type: Construction
    graph: DisposalMachine
    node: mailing_unit
  - type: DisposalUnit
    whitelist:
      components:
      - Item
    blacklist:
      components:
      - EntityStorage
  - type: MailingUnit
  - type: DeviceNetwork
    deviceNetId: Wired
    receiveFrequencyId: MailingUnit
    transmitFrequencyId: MailingUnit
  - type: WiredNetworkConnection
  - type: Configuration
    config:
      tag:
  - type: Appearance
  - type: UserInterface
    interfaces:
      enum.MailingUnitUiKey.Key:
        type: MailingUnitBoundUserInterface
      enum.ConfigurationUiKey.Key:
        type: ConfigurationBoundUserInterface
