# SPDX-FileCopyrightText: 2020 Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 20kdc <asdd2808@gmail.com>
# SPDX-FileCopyrightText: 2021 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 qwerltaz <69696513+qwerltaz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 12rabbits <53499656+12rabbits@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Dimastra <65184747+Dimastra@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Dimastra <dimastra@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JIPDawg <51352440+JIPDawg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JIPDawg <JIPDawg93@gmail.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 Moomoobeef <62638182+Moomoobeef@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 PopGamer46 <yt1popgamer@gmail.com>
# SPDX-FileCopyrightText: 2024 PursuitInAshes <pursuitinashes@gmail.com>
# SPDX-FileCopyrightText: 2024 QueerNB <176353696+QueerNB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Saphire Lattice <lattice@saphi.re>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Spessmann <156740760+Spessmann@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 osjarw <62134478+osjarw@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stellar-novas <stellar_novas@riseup.net>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@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: Firelock
  start: start
  graph:
    - node: start
      edges:
        - to: frame1
          completed:
            - !type:SnapToGrid { }
          steps:
            - material: Steel
              amount: 3
              doAfter: 1


    - node: frame1
      entity: FirelockFrame
      actions:
      - !type:AppearanceChange
      edges:
        - to: frame2
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - material: Cable
              amount: 2
              doAfter: 1
        - to: start
          completed:
            - !type:SpawnPrototype
              prototype: SheetSteel1
              amount: 3
            - !type:DeleteEntity {}
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Welding
              doAfter: 1

    - node: frame2
      actions:
      - !type:AppearanceChange
      edges:
        - to: frame3
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tag: FirelockElectronics
              store: board
              name: construction-graph-tag-firelock-electronics-circuit-board
              icon:
                sprite: "Objects/Misc/module.rsi"
                state: "mainboard"

        - to: frame1
          completed:
            - !type:SpawnPrototype
              prototype: CableApcStack1
              amount: 2
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Cutting
              doAfter: 1.5

    - node: frame3
      actions:
      - !type:AppearanceChange
      edges:
        - to: frame4
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Screwing
              doAfter: 0.25
        - to: frame2
          completed:
            - !type:EmptyAllContainers
              pickup: true
              emptyAtUser: true
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Prying
              doAfter: 0.25

    - node: frame4
      entity: FirelockFrame
      actions:
      - !type:AppearanceChange
      edges:
        - to: Firelock
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Anchoring
              doAfter: 1

        - to: FirelockEdge
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Welding
              doAfter: 0.5

        - to: FirelockGlassFrame
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - material: Glass
              amount: 2
              doAfter: 2

        - to: frame3
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Screwing
              doAfter: 0.75

    - node: Firelock
      entity: Firelock
      edges:
        - to: frame4
          conditions:
            - !type:DoorWelded
              welded: true
          steps:
            - tool: Anchoring
              doAfter: 0.25
          completed:
            - !type:SnapToGrid
              southRotation: true

    - node: FirelockGlassFrame
      edges:
        - to: FirelockGlass
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Anchoring
              doAfter: 1
        - to: frame4
          completed:
            - !type:SpawnPrototype
              prototype: SheetGlass1
              amount: 2
          steps:
            - tool: Prying
              doAfter: 1


    - node: FirelockGlass
      entity: FirelockGlass
      edges:
        - to: FirelockGlassFrame
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Anchoring
              doAfter: 1
          completed:
            - !type:SnapToGrid
              southRotation: true

    - node: FirelockEdge
      entity: FirelockEdge
      edges:
        - to: frame4
          conditions:
            - !type:DoorWelded
              welded: true
          steps:
            - tool: Anchoring
              doAfter: 0.25