# SPDX-FileCopyrightText: 2022 CommieFlowers <rasmus.cedergren@hotmail.com>
# SPDX-FileCopyrightText: 2022 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <deltanedas@laptop>
# SPDX-FileCopyrightText: 2023 deltanedas <user@zenith>
# SPDX-FileCopyrightText: 2023 qwerltaz <69696513+qwerltaz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TheWaffleJesus <106146578+TheWaffleJesus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 osjarw <62134478+osjarw@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: constructionGraph
  id: WallmountSubstation
  start: start
  graph:
    - node: start
      edges:
      - to: frame
        steps:
        - material: Steel
          amount: 5
          doAfter: 2

    - node: frame
      entity: BaseSubstationWallFrame
      edges:
      - to: start
        steps:
        - tool: Welding
          doAfter: 4
        completed:
        - !type:GivePrototype
          prototype: SheetSteel1
          amount: 5
        - !type:DeleteEntity {}
      - to: parts
        steps:
        - material: Cable
          amount: 5
          doAfter: 0.5
        - material: CableMV
          amount: 5
          doAfter: 0.5
        - material: CableHV
          amount: 5
          doAfter: 0.5
        - tool: Screwing
          doAfter: 2

    - node: parts
      entity: BaseSubstationWallFrame
      edges:
      - to: electronics
        steps:
        - tag: WallmountSubstationElectronics
          store: board
          name: construction-graph-tag-wallmount-substation-circuit-board
          icon:
            sprite: "Objects/Misc/module.rsi"
            state: "charger_APC"
          doAfter: 0.5
        - anyTags:
            - PowerCell
            - PowerCellSmall
          store: powercell
          name: construction-graph-tag-power-cell
          icon:
            sprite: "Objects/Power/power_cells.rsi"
            state: "medium"
          doAfter: 0.5
        - material: Manipulator
          amount: 1
          doAfter: 0.5
      - to: frame
        completed:
        - !type:GivePrototype
          prototype: CableApcStack1
          amount: 5
        - !type:GivePrototype
          prototype: CableMVStack1
          amount: 5
        - !type:GivePrototype
          prototype: CableHVStack1
          amount: 5
        steps:
        - tool: Cutting
          doAfter: 1


    - node: electronics
      edges:
      - to: substation
        steps:
        - tool: Screwing
          doAfter: 2

    - node: substation
      entity: BaseSubstationWall
      edges:
      - to: parts
        conditions:
        - !type:WirePanel {}
        - !type:ContainerNotEmpty
          container: board
        completed:
        - !type:EmptyAllContainers
          pickup: true
          emptyAtUser: true
        steps:
        - tool: Prying
          doAfter: 1