# SPDX-FileCopyrightText: 2022 CommieFlowers <rasmus.cedergren@hotmail.com>
# SPDX-FileCopyrightText: 2022 E F R <602406+Efruit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 corentt <36075110+corentt@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 qwerltaz <69696513+qwerltaz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: MIT

- type: constructionGraph
  id: AirAlarm
  start: start
  graph:
  - node: start
    edges:
    - to: assembly
      steps:
      - material: Steel
        amount: 2
        doAfter: 2.0

  - node: assembly
    entity: AirAlarmAssembly
    actions:
    - !type:AppearanceChange
    edges:
    - to: wired
      steps:
      - material: Cable
        amount: 2
        doAfter: 1
    - to: start
      completed:
      - !type:GivePrototype
        prototype: SheetSteel1
        amount: 2
      - !type:DeleteEntity {}
      steps:
      - tool: Welding
        doAfter: 2

  - node: wired
    entity: AirAlarmAssembly
    edges:
    - to: electronics
      steps:
      - tag: AirAlarmElectronics
        store: board
        name: construction-graph-tag-air-alarm-electronics
        icon:
          sprite: "Objects/Misc/module.rsi"
          state: "door_electronics" # /tg/ uses the same sprite, right?
        doAfter: 1
    - to: assembly
      completed:
      - !type:GivePrototype
        prototype: CableApcStack1
        amount: 2
      steps:
      - tool: Cutting
        doAfter: 1

  - node: electronics
    actions:
    - !type:AppearanceChange
    edges:
    - to: air_alarm
      steps:
      - tool: Screwing
        doAfter: 2

  - node: air_alarm
    entity: AirAlarm
    edges:
    - to: wired
      conditions:
      - !type:AllWiresCut {}
      - !type:WirePanel {}
      - !type:ContainerNotEmpty
        container: board
      completed:
      - !type:EmptyAllContainers
        pickup: true
        emptyAtUser: true
      steps:
      - tool: Prying
        doAfter: 1

- type: constructionGraph
  id: FireAlarm
  start: start
  graph:
  - node: start
    edges:
    - to: assembly
      steps:
      - material: Steel
        amount: 2
        doAfter: 2.0

  - node: assembly
    entity: FireAlarmAssembly
    actions:
    - !type:AppearanceChange
    edges:
    - to: wired
      steps:
      - material: Cable
        amount: 2
        doAfter: 1
    - to: start
      completed:
      - !type:GivePrototype
        prototype: SheetSteel1
        amount: 2
      - !type:DeleteEntity {}
      steps:
      - tool: Welding
        doAfter: 2

  - node: wired
    entity: FireAlarmAssembly
    edges:
    - to: electronics
      steps:
      - tag: FireAlarmElectronics
        store: board
        name: construction-graph-tag-fire-alarm-electronics
        icon:
          sprite: "Objects/Misc/module.rsi"
          state: "door_electronics" # /tg/ uses the same sprite, right?
        doAfter: 1
    - to: assembly
      completed:
      - !type:GivePrototype
        prototype: CableApcStack1
        amount: 2
      steps:
      - tool: Cutting
        doAfter: 1

  - node: electronics
    actions:
    - !type:AppearanceChange
    edges:
    - to: fire_alarm
      steps:
      - tool: Screwing
        doAfter: 2

  - node: fire_alarm
    entity: FireAlarm
    edges:
    - to: wired
      conditions:
      - !type:AllWiresCut {}
      - !type:WirePanel {}
      - !type:ContainerNotEmpty
        container: board
      completed:
      - !type:EmptyAllContainers
        pickup: true
        emptyAtUser: true
      steps:
      - tool: Prying
        doAfter: 1
