# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: MIT

- type: entity
  parent: [ GrenadeBase, BaseMinorContraband ]
  id: PipeBomb
  name: pipe bomb
  description: An improvised explosive made from pipes and wire.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Bombs/pipebomb.rsi
    layers:
    - state: base
      map: ["enum.TriggerVisualLayers.Base"]
    - state: wires
  - type: OnUseTimerTrigger # todo: make it activate through welder/lighter/fire instead
    delay: 5
    examinable: false
    initialBeepDelay: 0
    beepSound: /Audio/Effects/lightburn.ogg
  - type: RandomTimerTrigger
    min: 1
    max: 10
  - type: ExplodeOnTrigger
  - type: Explosive # Weak explosion in a very small radius. Doesn't break underplating.
    explosionType: Default
    totalIntensity: 50
    intensitySlope: 5
    maxIntensity: 6
    canCreateVacuum: false
  - type: Appearance
  - type: TimerTriggerVisuals
  - type: Construction
    graph: PipeBomb
    node: pipebomb

- type: entity
  parent: [ BaseItem, BaseMinorContraband ]
  id: PipeBombGunpowder
  name: pipe bomb
  description: An improvised explosive made from a pipe. This one has no gunpowder.
  suffix: Gunpowder
  components:
  - type: Sprite
    sprite: Objects/Weapons/Bombs/pipebomb.rsi
    state: base
  - type: Construction
    graph: PipeBomb
    node: gunpowder
    defaultTarget: pipebomb

- type: entity
  parent: [ BaseItem, BaseMinorContraband ]
  id: PipeBombCable
  name: pipe bomb
  description: An improvised explosive made from a pipe. This one has no cable.
  suffix: Cable
  components:
  - type: Sprite
    sprite: Objects/Weapons/Bombs/pipebomb.rsi
    state: base
  - type: Construction
    graph: PipeBomb
    node: cable
    defaultTarget: pipebomb
