- type: entity
  id: BaseLathe
  name: "lathe"
  abstract: true
  placement:
    mode: SnapgridCenter
  components:
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: Static
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.4"
      mass: 25
      mask:
      - Impassable
      - VaultImpassable
      - SmallImpassable
      layer:
      - Opaque
      - MobImpassable
  - type: SnapGrid
  - type: Lathe
  - type: MaterialStorage
  - type: Anchorable
  - type: Pullable
  - type: UserInterface
    interfaces:
    - key: enum.LatheUiKey.Key
      type: LatheBoundUserInterface
  - type: PowerReceiver

- type: entity
  parent: BaseLathe
  id: Autolathe
  name: "autolathe"
  description: It produces items using metal and glass.
  components:
  - type: Sprite
    sprite: Constructible/Power/autolathe.rsi
    layers:
    - state: icon
      map: ["enum.AutolatheVisualLayers.Base"]
    - state: unlit
      shader: unshaded
      map: ["enum.AutolatheVisualLayers.BaseUnlit"]
    - state: icon
      map: ["enum.AutolatheVisualLayers.AnimationLayer"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: Construction
    graph: machine
    node: machine
  - type: Damageable
    resistances: metallicResistances
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:ChangeConstructionNodeBehavior
        node: machineFrame
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Machine
    board: AutolatheMachineCircuitboard
  - type: Wires
    BoardName: "Autolathe"
    LayoutId: Autolathe
  - type: LatheDatabase
    static: true
    recipes:
      - Brutepack
      - Ointment
      - Wirecutter
      - Screwdriver
      - Welder
      - Wrench
      - Crowbar
      - Multitool
      - MiniHoe
      - Shovel
      - Spade
  - type: Appearance
    visuals:
    - type: AutolatheVisualizer
    - type: WiresVisualizer

- type: entity
  parent: BaseLathe
  id: Protolathe
  name: "protolathe"
  description: Converts raw materials into useful objects.
  components:
  - type: Sprite
    sprite: Constructible/Power/protolathe.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: ResearchClient
  - type: Construction
    graph: machine
    node: machine
  - type: Damageable
    resistances: metallicResistances
  - 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: ProtolatheDatabase
    protolatherecipes:
      - LightTube
      - LightBulb
      - SheetSteel
      - GlassStack
      - SheetRGlass
      - SheetPlastic
      - CableStack
      - MVWireStack
      - HVWireStack
      - ConveyorAssembly
      - RCD
      - RCDAmmo
      - Scythe
      - Hatchet
      - Shovel
      - Scalpel
      - Retractor
      - Cautery
      - Drill
      - BoneSaw
      - Hemostat
      - Beaker
      - LargeBeaker
      - CryostasisBeaker
      - Dropper
      - Syringe
      - Flash
      - Handcuffs
      - Stunbaton
      - CartridgePistolBase
      - ShellShotgunBase
      - CartridgeLRifleBase
      - CartridgeMagnumBase
      - FirelockElectronics
      - DoorElectronics
      - APCElectronics
      - Bucket
      - MopItem
      - SprayBottle
      - FireExtinguisher
      - KitchenKnife
      - ButchCleaver
      - FlashlightLantern

  - type: UserInterface
    interfaces:
    - key: enum.LatheUiKey.Key
      type: LatheBoundUserInterface
    - key: enum.ResearchClientUiKey.Key
      type: ResearchClientBoundUserInterface
  - type: Appearance
    visuals:
    - type: ProtolatheVisualizer
    - type: WiresVisualizer
