# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 JohnOakman <sremy2012@hotmail.fr>
# SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Autodocs

- type: entity
  parent: [ConstructibleMachine, BaseMachinePowered]
  id: Autodoc
  name: Autodoc Mk.XIV
  description: A programmable robotic surgeon capable of automatically operating on patients.
  components:
  - type: Sprite
    sprite: _Shitmed/Structures/Machines/autodoc.rsi
    layers:
    - state: idle
  - type: Hands
  - type: HandsFill
    hands:
      multitool: OmnimedToolAutodoc
      surgery_specific: null
  - type: WiresPanel
  - type: Wires
    layoutId: Autodoc # do it, snip the safety wire :godo:
    boardName: wires-board-name-autodoc
  - type: Machine
    board: AutodocCircuitboard
  - type: Construction
    graph: Machine
    node: machine
    containers:
     - machine_board
     - machine_parts
     - storagebase
  - type: EmptyOnMachineDeconstruct
    containers:
    - surgery_specific
    - storagebase
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
        showEnts: False
        occludes: True
        ents: []
      machine_parts: !type:Container
        showEnts: False
        occludes: True
        ents: []
      storagebase: !type:Container
        showEnts: False
        occludes: True
        ents: []
  - type: ApcPowerReceiver
    powerLoad: 10000
  - type: AutomationSlots
    slots:
    - !type:AutomatedStorage
      input: AutomationSlotStorage
      output: AutomationSlotStorage
    - !type:AutomatedHand
      input: AutomationSlotAutodocHand
      output: AutomationSlotAutodocHand
      handName: surgery_specific
  - type: DeviceList
  - type: DeviceNetwork
    deviceNetId: Wired
    receiveFrequencyId: BasicDevice
  - type: DeviceLinkSink
    ports:
    - OperatingTableReceiver
  - type: UserInterface
    interfaces:
      enum.AutodocUiKey.Key:
        type: AutodocBoundUserInterface
      enum.StorageUiKey.Key:
        type: StorageBoundUserInterface
      enum.WiresUiKey.Key:
        type: WiresBoundUserInterface
  - type: ActivatableUI
    key: enum.AutodocUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: Autodoc
  - type: Sanitized
  - type: DoAfter # Required for it to do surgery
  - type: TypingIndicator
    proto: robot
  - type: Speech
    speechVerb: Robotic
    speechSounds: Pai
  - type: Storage
    clickInsert: false # incredibly annoying for linking it
    openOnActivate: false # use the verb, UI is higher priority
    grid:
    - 0,0,3,3
  - type: SurgerySpeedModifier
    speedModifier: 1
  - type: GuideHelp
    guides: [ Autodoc ]

- type: entity
  parent: Autodoc
  id: AutodocSyndie
  # TODO: make it valid
  suffix: Syndie
  components:
  - type: Machine
    board: AutodocSyndieCircuitboard
  - type: SurgerySpeedModifier
    speedModifier: 1.0 # as good as a surgeon using a multitool, nukies need it or something

# Autodoc tools

- type: entity
  parent: OmnimedTool
  id: OmnimedToolAutodoc
  suffix: Unremoveable, Autodoc
  components:
  - type: Unremoveable
  - type: Hemostat
    speed: 2
  - type: Scalpel
    speed: 2
  - type: Drill
    speed: 2
  - type: BoneSetter
    speed: 2
  - type: Retractor
    speed: 2
  - type: Cautery
    speed: 2
  - type: BoneGel
    speed: 2
  - type: BoneSaw
    speed: 2
  - type: Tweezers
    speed: 2
  - type: Tending
    speed: 2
  - type: Stitches
    speed: 2
