# SPDX-FileCopyrightText: 2021 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustinWinningham <justinmwinningham@gmail.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#Due to limitations with placement conditions in the construction system, the other kinds of non-fulltile barricades are currently not constructible.
#This may make it sound like it needs some big refactor to be possible, but make no mistake, it is 100% due to my own technical incompetence.
- type: constructionGraph
  id: Barricade
  start: start
  graph:
    - node: start
      edges:
        - to: barricadefull
          steps:
            - material: WoodPlank
              amount: 4
              doAfter: 3
    - node: barricadefull
      entity: Barricade
      edges:
        - to: start
          completed:
            - !type:SpawnPrototype
              prototype: MaterialWoodPlank1
              amount: 3 #returns 1 less as one breaks
            - !type:DeleteEntity {}
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Prying
              doAfter: 5
        - to: woodWall
          completed:
            - !type:SnapToGrid
              southRotation: true
          steps:
            - material: WoodPlank
              amount: 2
              doAfter: 2
    - node: woodWall
      entity: WallWood
      edges:
      - to: barricadefull
        completed:
        - !type:GivePrototype
          prototype: MaterialWoodPlank1
          amount: 2
        steps:
        - tool: Prying
          doAfter: 10

- type: constructionGraph
  id: BarricadeDirectional
  start: start
  graph:
    - node: start
      edges:
        - to: barricadefull
          steps:
            - material: WoodPlank
              amount: 4
              doAfter: 3
    - node: barricadefull
      entity: BarricadeDirectional
      edges:
        - to: start
          completed:
            - !type:SpawnPrototype
              prototype: MaterialWoodPlank1
              amount: 3 #returns 1 less as one breaks
            - !type:DeleteEntity {}
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Prying
              doAfter: 5

- type: constructionGraph
  id: BarricadeCovering
  start: start
  graph:
    - node: start
      edges:
        - to: barricadecover
          steps:
            - material: WoodPlank
              amount: 2
              doAfter: 3
    - node: barricadecover
      entity: BarricadeBlock
      edges:
        - to: start
          completed:
            - !type:SpawnPrototype
              prototype: MaterialWoodPlank1
              amount: 2 #returns 1 less as one breaks
            - !type:DeleteEntity { }
          conditions:
            - !type:EntityAnchored
              anchored: true
          steps:
            - tool: Prying
              doAfter: 2
