- type: entity
  parent: BaseMachinePowered
  id: Autolathe
  name: autolathe
  description: It produces items using metal and glass.
  components:
  - type: Sprite
    sprite: Structures/Machines/autolathe.rsi
    netsync: false
    layers:
    - state: icon
      map: ["enum.AutolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.AutolatheVisualLayers.BaseUnlit"]
    - state: building
      map: ["enum.AutolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.4"
      mass: 25
      mask:
      - Impassable
      - VaultImpassable
      - SmallImpassable
      layer:
      - Opaque
      - MobImpassable
  - type: Construction
    graph: Machine
    node: machine
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Machine
    board: AutolatheMachineCircuitboard
  - type: MaterialStorage
  - type: Wires
    BoardName: "Autolathe"
    LayoutId: Autolathe
  - type: LatheDatabase
    static: true
    recipes:
      - Wirecutter
      - Screwdriver
      - Welder
      - Wrench
      - Crowbar
      - Multitool
      - MiniHoe
      - Shovel
      - Spade
      - CableStack
      - HandheldGPSBasic
      - HandheldHealthAnalyzer
  - type: Appearance
    visuals:
    - type: AutolatheVisualizer
    - type: WiresVisualizer
  - type: ActivatableUI
    key: enum.LatheUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
    - key: enum.LatheUiKey.Key
      type: LatheBoundUserInterface
  - type: Transform
    anchored: true
  - type: Pullable
  - type: Lathe

- type: entity
  parent: BaseMachinePowered
  id: Protolathe
  name: protolathe
  description: Converts raw materials into useful objects.
  components:
  - type: Sprite
    sprite: Structures/Machines/protolathe.rsi
    netsync: false
    layers:
    - state: icon
      map: ["enum.ProtolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.ProtolatheVisualLayers.BaseUnlit"]
    - state: building
      map: ["enum.ProtolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.4"
      mass: 25
      mask:
      - Impassable
      - VaultImpassable
      - SmallImpassable
      layer:
      - Opaque
      - MobImpassable
  - type: ResearchClient
  - type: Construction
    graph: Machine
    node: machine
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Machine
    board: ProtolatheMachineCircuitboard
  - type: Wires
    BoardName: "Protolathe"
    LayoutId: Protolathe
  - type: TechnologyDatabase
  - type: MaterialStorage
  - type: ProtolatheDatabase
    protolatherecipes:
      - LightTube
      - LightBulb
      - SheetSteel
      - SheetGlass1
      - SheetRGlass
      - SheetPlastic
      - CableStack
      - CableMVStack
      - CableHVStack
      - ConveyorBeltAssembly
      - RCDAmmo
      - HydroponicsToolScythe
      - HydroponicsToolHatchet
      - Shovel
      - HandheldCrewMonitor
      - Scalpel
      - Retractor
      - Cautery
      - Drill
      - Saw
      - Hemostat
      - Beaker
      - LargeBeaker
      - CryostasisBeaker
      - Dropper
      - Syringe
      - PillCanister
      - Drone
      - Flash
      - MicroManipulatorStockPart
      - ScanningModuleStockPart
      - MicroLaserStockPart
      - MatterBinStockPart
      - CapacitorStockPart
      - FirelockElectronics
      - DoorElectronics
      - APCElectronics
      - AirAlarmElectronics
      - FireAlarmElectronics
      - Bucket
      - MopItem
      - SprayBottle
      - FireExtinguisher
      - KitchenKnife
      - ButchCleaver
      - FlashlightLantern
      - TimerTrigger
      - ChemicalPayload
  - type: ActivatableUI
    key: enum.LatheUiKey.Key #Yes only having 1 of them here doesn't break anything
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
    - key: enum.LatheUiKey.Key
      type: LatheBoundUserInterface
    - key: enum.ResearchClientUiKey.Key
      type: ResearchClientBoundUserInterface
  - type: Appearance
    visuals:
    - type: ProtolatheVisualizer
    - type: WiresVisualizer
  - type: Transform
    anchored: true
  - type: Pullable
  - type: Lathe

- type: entity
  parent: Protolathe
  id: CircuitImprinter
  name: Circuit Imprinter
  description: Prints circuit boards for machines.
  components:
  - type: Sprite
    netsync: false
    sprite: Structures/Machines/circuit_imprinter.rsi
    layers:
    - state: icon
      map: ["enum.ProtolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.ProtolatheVisualLayers.BaseUnlit"]
    - state: building
      map: ["enum.ProtolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: ProtolatheDatabase
    protolatherecipes:
      - SMESMachineCircuitboard
      - SubstationMachineCircuitboard
      - ThermomachineFreezerMachineCircuitBoard
      - CloningPodMachineCircuitboard
      - MedicalScannerMachineCircuitboard
      - CrewMonitoringComputerCircuitboard
      - VaccinatorMachineCircuitboard
      - DiagnoserMachineCircuitboard
      - ChemMasterMachineCircuitboard
      - ChemDispenserMachineCircuitboard
      - HydroponicsTrayMachineCircuitboard
      - SolarControlComputerCircuitboard
      - AutolatheMachineCircuitboard
      - ProtolatheMachineCircuitboard
      - ReagentGrinderMachineCircuitboard
      - UniformPrinterMachineCircuitboard
      - ShuttleConsoleCircuitboard
      - CircuitImprinterMachineCircuitboard
      - DawInstrumentMachineCircuitboard
  - type: Machine
    board: CircuitImprinterMachineCircuitboard

- type: entity
  parent: Protolathe
  id: SecurityTechFab
  name: Security TechFab
  description: Prints equipment for use by security crew.
  components:
  - type: Sprite
    netsync: false
    sprite: Structures/Machines/security_techfab.rsi
    layers:
    - state: icon
      map: ["enum.ProtolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.ProtolatheVisualLayers.BaseUnlit"]
    - state: icon
      map: ["enum.ProtolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: ProtolatheDatabase
    protolatherecipes:
      - Flash
      - Handcuffs
      - Stunbaton
      - CartridgePistol
      - ShellShotgun
      - CartridgeLRifle
      - CartridgeMagnum
      - ShellShotgunBeanbag
      - CartridgePistolRubber
      - CartridgeMagnumRubber
      - CartridgeClRifleRubber
      - CartridgeLRifleRubber
      - CartridgeSRifleRubber #Everything below this is shared with other lathes
      - FlashlightLantern
      - Bucket
      - MopItem
      - SprayBottle
      - FireExtinguisher
      - LightTube
      - LightBulb
      - SheetSteel
      - SheetGlass1
      - SheetRGlass
      - SheetPlastic
      - CableStack
      - CableMVStack
      - CableHVStack
      - TimerTrigger

- type: entity
  parent: Autolathe
  id: UniformPrinter
  name: uniform printer
  description: Prints new or replacement uniforms.
  components:
  - type: LatheDatabase
    static: true
    recipes:
      - ClothingUniformJumpsuitColorGrey
      - ClothingUniformJumpskirtColorGrey
      - ClothingUniformJumpsuitBartender
      - ClothingUniformJumpskirtBartender
      - ClothingUniformJumpsuitCaptain
      - ClothingUniformJumpskirtCaptain
      - ClothingUniformJumpsuitCargo
      - ClothingUniformJumpskirtCargo
      - ClothingUniformJumpsuitSalvageSpecialist
      - ClothingUniformJumpsuitChiefEngineer
      - ClothingUniformJumpskirtChiefEngineer
      - ClothingUniformJumpsuitChaplain
      - ClothingUniformJumpskirtChaplain
      - ClothingUniformJumpsuitChef
      - ClothingUniformJumpskirtChef
      - ClothingUniformJumpsuitChemistry
      - ClothingUniformJumpskirtChemistry
      - ClothingUniformJumpsuitClown
      - ClothingUniformJumpsuitCMO
      - ClothingUniformJumpskirtCMO
      - ClothingUniformJumpsuitDetective
      - ClothingUniformJumpskirtDetective
      - ClothingUniformJumpsuitEngineering
      - ClothingUniformJumpskirtEngineering
      - ClothingUniformJumpsuitHoP
      - ClothingUniformJumpskirtHoP
      - ClothingUniformJumpsuitHoS
      - ClothingUniformJumpskirtHoS
      - ClothingUniformJumpsuitHydroponics
      - ClothingUniformJumpskirtHydroponics
      - ClothingUniformJumpsuitJanitor
      - ClothingUniformJumpskirtJanitor
      - ClothingUniformJumpsuitLawyerBlack
      - ClothingUniformJumpsuitLibrarian
      - ClothingUniformJumpskirtColorLightBrown
      - ClothingUniformJumpsuitMedicalDoctor
      - ClothingUniformJumpskirtMedicalDoctor
      - ClothingUniformJumpsuitMime
      - ClothingUniformJumpskirtMime
      - ClothingUniformJumpsuitLawyerPurple
      - ClothingUniformJumpsuitParamedic
      - ClothingUniformJumpskirtParamedic
      - ClothingUniformJumpsuitPrisoner
      - ClothingUniformJumpskirtPrisoner
      - ClothingUniformJumpsuitQM
      - ClothingUniformJumpskirtQM
      - ClothingUniformJumpsuitResearchDirector
      - ClothingUniformJumpskirtResearchDirector
      - ClothingUniformJumpsuitScientist
      - ClothingUniformJumpskirtScientist
      - ClothingUniformJumpsuitSec
      - ClothingUniformJumpskirtSec
      - ClothingUniformJumpsuitWarden
      - ClothingUniformJumpskirtWarden
      - ClothingOuterWinterCap 
      - ClothingOuterWinterCE
      - ClothingOuterWinterCMO
      - ClothingOuterWinterHoP
      - ClothingOuterWinterHoS
      - ClothingOuterWinterQM
      - ClothingOuterWinterRD
      
  - type: Sprite
    sprite: Structures/Machines/uniform_printer.rsi
    netsync: false
    layers:
    - state: icon
      map: ["enum.AutolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.AutolatheVisualLayers.BaseUnlit"]
    - state: building
      map: ["enum.AutolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: Machine
    board: UniformPrinterMachineCircuitboard
