# SPDX-FileCopyrightText: 2022 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: MIT

- type: constructionGraph
  id: SurveillanceCamera
  start: start
  graph:
    - node: start
      edges:
        - to: assembly
          steps:
            - material: Steel
              amount: 1 # Goob
              doAfter: 2.0

    - node: assembly
      entity: SurveillanceCameraAssembly
      edges:
        - to: lens #goobstation edge - lens to cameras
          steps:
            - material: Glass
              amount: 1
              doAfter: 1
        - to: start
          completed:
            - !type:GivePrototype
              prototype: SheetSteel1
              amount: 2
            - !type:DeleteEntity {}
          steps:
            - tool: Welding
              doAfter: 2

    # <Goob>
    - node: lens
      entity: SurveillanceCameraAssembly
      edges:
        - to: electronics
          steps:
            - material: Cable
              amount: 1
              doAfter: 1

    - node: electronics
      entity: SurveillanceCameraAssembly
      edges:
      - to: wired
        steps:
        - tag: CameraElectronics
          store: board
          name: construction-graph-tag-camera-electronics
          icon:
            sprite: "Objects/Misc/module.rsi"
            state: "door_electronics" # goida
          doAfter: 1
    # </Goob>

    - node: wired
      entity: SurveillanceCameraAssembly
      edges:
        - to: camera
          steps:
            - tool: Screwing
              doAfter: 2

    # once a camera is constructed, it will
    # instead just require wire cutting + welding
    # to immediately deconstruct
    - node: camera
      entity: SurveillanceCameraConstructed
      edges:
        - to: start
          conditions:
            - !type:AllWiresCut {}
            - !type:WirePanel {}
            - !type:ContainerNotEmpty # goob
              container: board
          completed:
            - !type:GivePrototype
              prototype: SheetSteel1
              amount: 2
            - !type:GivePrototype # goobstation - lens to camera
              prototype: SheetGlass1
              amount: 1
            - !type:EmptyAllContainers # goob
              pickup: true
              emptyAtUser: true
            - !type:DeleteEntity {}
          steps:
            - tool: Welding
              doAfter: 2
