# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Snowni <101532866+Snowni@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Veritius <veritiusgaming@gmail.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2023 Julian Giebel <juliangiebel@live.de>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Saphire Lattice <lattice@saphi.re>
# SPDX-FileCopyrightText: 2024 emmafornash <89596994+emmafornash@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 yglop <95057024+yglop@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 PunishedJoe <PunishedJoeseph@proton.me>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
# SPDX-FileCopyrightText: 2025 psykana <36602558+psykana@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BasePlasticExplosive
  parent: BaseItem
  abstract: true
  components:
  - type: Item
    size: Small
  - type: Sticky
    stickDelay: 5
    unstickDelay: 5
    stickPopupStart: comp-sticky-start-stick-bomb
    stickPopupSuccess: comp-sticky-success-stick-bomb
    unstickPopupStart: comp-sticky-start-unstick-bomb
    unstickPopupSuccess: comp-sticky-success-unstick-bomb
#    blacklist: # can't stick it to other items # nuh uh # Goobstation - Remove C4 item blacklist
#      components:
#      - Item
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:ExplodeBehavior
  - type: StickyVisualizer
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.Trigger.TriggerVisuals.VisualState:
        base:
          Primed: { state: primed }
          Unprimed: { state: complete }

- type: entity
  name: composition C-4
  description: Used to put holes in specific areas without too much extra hole. A saboteur's favorite.
  parent: [BasePlasticExplosive, BaseMajorContraband]
  id: C4
  components:
  - type: Sprite
    sprite: Objects/Weapons/Bombs/c4.rsi
    state: icon
    layers:
    - state: icon
      map: ["base"]
  - type: Clothing
    sprite: Objects/Weapons/Bombs/c4.rsi
    slots:
    - HEAD
    quickEquip: false
    equipDelay: 3
    unequipDelay: 6
  - type: OnUseTimerTrigger
    delay: 10
    delayOptions: [10, 30, 60, 120, 300]
    initialBeepDelay: 0
    beepSound: /Audio/Machines/Nuke/general_beep.ogg
    startOnStick: true
    canToggleStartOnStick: true
  - type: TriggerOnSignal
  - type: DeviceLinkSink
    ports:
      - Trigger
  - type: Explosive # Powerful explosion in a very small radius. Doesn't break underplating.
    explosionType: DemolitionCharge
    totalIntensity: 60
    intensitySlope: 5
    maxIntensity: 30
    canCreateVacuum: false
  - type: ExplodeOnTrigger
  # <Goobstation> - C4 sentience
  - type: TypingIndicator
    proto: robot
  - type: Speech
    speechVerb: Robotic
    speechSounds: Pai
  - type: GhostRole
    prob: 0.05
    name: ghost-role-information-c4-name
    description: ghost-role-information-c4-description
    rules: ghost-role-information-familiar-rules
    mindRoles:
    - MindRoleGhostRoleFamiliar
  - type: GhostTakeoverAvailable
  - type: IntrinsicRadioReceiver
  - type: IntrinsicRadioTransmitter
    channels:
    - Syndicate
  - type: ActiveRadio
    channels:
    - Syndicate
  - type: Vocal
    sounds:
      Unsexed: EmoteC4
  - type: Emoting
  # </Goobstation>
  - type: HolidayVisuals
    holidays:
      festive:
      - FestiveSeason
  - type: HolidayRsiSwap
    sprite:
      festive: Objects/Weapons/Bombs/c4gift.rsi
  - type: StaticPrice
    price: 625 # 5000 for a bundle of 8

- type: entity
  name: seismic charge
  description: Concussion based explosive designed to destroy large amounts of rock.
  parent: [ BasePlasticExplosive, BaseSecurityCargoContraband ]
  id: SeismicCharge
  components:
  - type: Sprite
    sprite: Objects/Weapons/Bombs/seismic.rsi
    state: icon
    layers:
    - state: icon
      map: ["base"]
  - type: OnUseTimerTrigger
    delay: 5
    delayOptions: [5, 10, 15, 20]
    initialBeepDelay: 0
    beepSound:
      path: /Audio/Effects/Cargo/buzz_two.ogg
      params:
        volume: -6
    startOnStick: false
    canToggleStartOnStick: true
  - type: TimerStartOnSignal
  - type: DeviceLinkSink
    ports:
    - Timer
  - type: Explosive
    explosionType: Cryo
    totalIntensity: 120
    intensitySlope: 2
    maxIntensity: 30
    canCreateVacuum: false
  - type: ExplodeOnTrigger
