- type: entity
  parent: GasPipeBase
  abstract: true
  id: GasUnaryBase
  placement:
    mode: SnapgridCenter
  components:
    - type: AtmosDevice
    - type: SubFloorHide
      blockInteractions: false
      blockAmbience: false
    - type: NodeContainer
      nodes:
        pipe:
          !type:PipeNode
          nodeGroupID: Pipe
          pipeDirection: South

- type: entity
  parent: GasUnaryBase
  id: GasVentPump
  name: air vent
  description: Has a valve and a pump attached to it.
  placement:
    mode: SnapgridCenter
  components:
    - type: ApcPowerReceiver
    - type: ExtensionCableReceiver
    - type: DeviceNetworkComponent
      deviceNetId: Apc
      frequency: 1621
    - type: ApcNetworkConnection
    - type: AtmosAlarmable
      alarmedBy:
      - AirAlarm
    - type: Sprite
      netsync: false
      drawdepth: FloorObjects
      sprite: Structures/Piping/Atmospherics/vent.rsi
      layers:
        - sprite: Structures/Piping/Atmospherics/pipe.rsi
          state: pipeHalf
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
        - state: vent_off
          map: [ "enum.VentVisualLayers.Vent", "enum.SubfloorLayers.FirstLayer" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: VentPumpVisualizer
    - type: GasVentPump
    - type: Construction
      graph: GasUnary
      node: ventpump
    - type: VentCritterSpawnLocation
    - type: AmbientSound
      enabled: false
      volume: -12
      range: 5
      sound:
        path: /Audio/Ambience/Objects/gas_vent.ogg

- type: entity
  parent: GasUnaryBase
  id: GasPassiveVent
  name: passive vent
  description: It is an open vent.
  placement:
    mode: SnapgridCenter
  components:
    # TODO ATMOS: Find sprite for this.
    - type: Sprite
      netsync: false
      drawdepth: FloorObjects
      sprite: Structures/Piping/Atmospherics/vent.rsi
      layers:
        - sprite: Structures/Piping/Atmospherics/pipe.rsi
          state: pipeHalf
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
        - state: vent_off
          map: [ "enum.SubfloorLayers.FirstLayer" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
    - type: GasPassiveVent
    - type: Construction
      graph: GasUnary
      node: passivevent

- type: entity
  parent: GasUnaryBase
  id: GasVentScrubber
  name: air scrubber
  description: Has a valve and pump attached to it.
  placement:
    mode: SnapgridCenter
  components:
    - type: ApcPowerReceiver
    - type: ExtensionCableReceiver
    - type: DeviceNetworkComponent
      deviceNetId: Apc
      frequency: 1621
    - type: ApcNetworkConnection
    - type: AtmosAlarmable
      alarmedBy:
      - AirAlarm
    - type: Sprite
      netsync: false
      drawdepth: FloorObjects
      sprite: Structures/Piping/Atmospherics/scrubber.rsi
      layers:
        - sprite: Structures/Piping/Atmospherics/pipe.rsi
          state: pipeHalf
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
        - state: scrub_off
          map: [ "enum.ScrubberVisualLayers.Scrubber", "enum.SubfloorLayers.FirstLayer" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: ScrubberVisualizer
    - type: AtmosDevice
    - type: GasVentScrubber
    - type: Construction
      graph: GasUnary
      node: ventscrubber
    - type: AmbientSound
      enabled: false
      volume: -12
      range: 5
      sound:
        path: /Audio/Ambience/Objects/gas_vent.ogg

- type: entity
  parent: GasUnaryBase
  id: GasOutletInjector
  name: air injector
  description: Has a valve and pump attached to it.
  placement:
    mode: SnapgridCenter
  components:

    # TODO ATMOS: Actual sprite for this.
    - type: Sprite
      drawdepth: FloorObjects
      netsync: false
      layers:
        - state: pipeHalf
          sprite: Structures/Piping/Atmospherics/pipe.rsi
          map: [ "enum.PipeColorVisualizer+Layers.Pipe", "enum.SubfloorLayers.FirstLayer" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
    - type: GasOutletInjector
    - type: Construction
      graph: GasUnary
      node: outletinjector

- type: entity
  parent: BaseMachinePowered
  id: BaseGasThermoMachine
  name: thermomachine
  abstract: true
  placement:
    mode: SnapgridCenter
  components:
    - type: Sprite
      netsync: false
      sprite: Structures/Piping/Atmospherics/thermomachine.rsi
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
    - type: Rotatable
    - type: GasThermoMachine
    - type: AtmosPipeColor
    - type: AtmosDevice
    - type: UserInterface
      interfaces:
      - key: enum.ThermomachineUiKey.Key
        type: GasThermomachineBoundUserInterface
    - type: ActivatableUI
      inHandsOnly: false
      key: enum.ThermomachineUiKey.Key
    - type: Construction
      graph: Machine
      node: machine
    - type: Wires
      BoardName: "Thermomachine"
      LayoutId: Thermomachine
    - type: NodeContainer
      nodes:
        pipe:
          !type:PipeNode
          nodeGroupID: Pipe
          pipeDirection: South

- type: entity
  parent: BaseGasThermoMachine
  id: GasThermoMachineFreezer
  name: freezer
  description: Cools gas in connected pipes.
  placement:
    mode: SnapgridCenter
  components:
    - type: Sprite
      layers:
        - state: freezer_off
          map: [ "enum.ThermoMachineVisualizer+Layers.Enabled" ]
        - state: pipe
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: ThermoMachineVisualizer
          disabledState: freezer_off
          enabledState: freezer_on
    - type: GasThermoMachine
      mode: Freezer
      minTemperature: 73.15
    - type: Machine
      board: ThermomachineFreezerMachineCircuitBoard

- type: entity
  parent: BaseGasThermoMachine
  id: GasThermoMachineHeater
  name: heater
  description: Heats gas in connected pipes.
  placement:
    mode: SnapgridCenter
  components:
    - type: Sprite
      layers:
        - state: heater_off
          map: [ "enum.ThermoMachineVisualizer+Layers.Enabled" ]
        - state: pipe
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: ThermoMachineVisualizer
          disabledState: heater_off
          enabledState: heater_on
    - type: GasThermoMachine
      mode: Heater
      maxTemperature: 573.15 # This is changed when parts are refreshed.
    - type: Machine
      board: ThermomachineHeaterMachineCircuitBoard
