# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@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: ModularMineGraph
  start: start
  graph:

  - node: start
    edges:
    - to: emptyCase
      steps:
      - material: Steel
        amount: 5
        doAfter: 1

  - node: emptyCase
    entity: LandMineModularUnarmed
    edges:
    - to: wiredCase
      steps:
      - material: Cable
        doAfter: 0.5
      - tag: ProximitySensor
        icon:
          sprite: Objects/Misc/proximity_sensor.rsi
          state: icon
        name: construction-graph-tag-proximity-sensor
    - to: start
      completed:
      - !type:SpawnPrototype
        prototype: SheetSteel1
        amount: 5
      - !type:DeleteEntity
      steps:
      - tool: Welding
        doAfter: 2

  - node: wiredCase
    entity: LandMineModularUnarmed
    actions:
    - !type:PlaySound
      sound: /Audio/Machines/button.ogg
    edges:
    - to: emptyCase
      steps:
      - tool: Cutting
        doAfter: 0.5
        completed:
        - !type:SpawnPrototype
          prototype: CableApcStack1
        - !type:SpawnPrototype
          prototype: ProximitySensor
    - to: mine
      steps:
      - tag: Payload
        store: payload
        name: construction-graph-tag-payload
        doAfter: 0.5

  - node: mine
    actions:
    - !type:PlaySound
      sound: /Audio/Machines/button.ogg
    - !type:AdminLog
      message: "A mine was crafted"
    edges:
    - to: wiredCase
      steps:
      - tool: Prying
        doAfter: 0.5
        completed:
        - !type:EmptyContainer
          container: payload