# SPDX-FileCopyrightText: 2019 Injazz <43905364+Injazz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2019 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2019 Swept <49448379+SweptWasTaken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 GlassEclipse <tsymall5@gmail.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2020 V�ctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 py01 <pyronetics01@gmail.com>
# SPDX-FileCopyrightText: 2021 BulletGrade <66234359+BulletGrade@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Moony <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 moonheart08 <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 AlexMorgan3817 <46600554+AlexMorgan3817@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Arendian <137322659+Arendian@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Cody ~ Aexxie <125095677+Aexxie@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Dawid Bla <46636558+DawBla@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Hmeister-fake <144629361+Hmeister-fake@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 I.K <45953835+notquitehadouken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Slava0135 <40753025+Slava0135@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 crazybrain23 <44417085+crazybrain23@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 potato1234_x <79580518+potato1234x@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CaasGit <87243814+CaasGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CatMagic <135462166+CatMagic1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DenisShvalov <115770678+DenisShvalov@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Firewatch <54725557+musicmanvr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hrosts <35345601+Hrosts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ian <ignaz.k@live.de>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Joel Zimmerman <JoelZimmerman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Ko4ergaPunk <62609550+Ko4ergaPunk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kukutis96513 <146854220+Kukutis96513@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Lye <128915833+Lyroth001@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mangohydra <156087924+Mangohydra@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MerrytheManokit <167581110+MerrytheManokit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MureixloI <132683811+MureixloI@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 NakataRin <45946146+NakataRin@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 OrangeMoronage9622 <whyteterry0092@gmail.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 Preston Smith <92108534+thetolbean@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Repo <47093363+Titian3@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Saphire Lattice <lattice@saphi.re>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Stalen <33173619+stalengd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TakoDragon <69509841+BackeTako@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TsjipTsjip <19798667+TsjipTsjip@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ubaser <134914314+UbaserB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Unkn0wn_Gh0st <shadowstalkermll@gmail.com>
# SPDX-FileCopyrightText: 2024 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2024 Vigers Ray <60344369+VigersRay@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 dffdff2423 <dffdff2423@gmail.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 foboscheshir <156405958+foboscheshir@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 shamp <140359015+shampunj@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 strO0pwafel <153459934+strO0pwafel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stroopwafel <j.o.luijkx@student.tudelft.nl>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 to4no_fix <156101927+chavonadelal@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 voidnull000 <18663194+voidnull000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 PunishedJoe <PunishedJoeseph@proton.me>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: BaseItem
  id: GrenadeBase
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/grenade.rsi
    layers:
    - state: icon
      map: ["enum.TriggerVisualLayers.Base"]
  - type: Item
    size: Small
  - type: Clothing
    quickEquip: false
    slots:
    - Belt
  - type: OnUseTimerTrigger
    delay: 3
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:TriggerBehavior
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Appearance
  - type: AnimationPlayer
  - type: GenericVisualizer
    visuals:
      enum.Trigger.TriggerVisuals.VisualState:
        enum.ConstructionVisuals.Layer:
          Primed: { state: primed }
          Unprimed: { state: icon }
  - type: Tag # Goobstation
    tags:
    - Grenade
    - HandGrenade
  - type: Fixtures
    fixtures:
      fix1:
        shape: !type:PhysShapeCircle
          radius: 0.2
        density: 20 # derived from base_item
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2

- type: entity
  name: explosive grenade
  description: Grenade that creates a small but devastating explosion.
  parent: [GrenadeBase, BaseSyndicateContraband]
  id: ExGrenade
  components:
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    maxIntensity: 10
    intensitySlope: 3
    totalIntensity: 120 # about a ~4 tile radius
    canCreateVacuum: false
  - type: OnUseTimerTrigger
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 2 # 2 beeps total (at 0 and 2)

- type: entity
  name: flashbang
  description: Eeeeeeeeeeeeeeeeeeeeee.
  parent: [ GrenadeBase, BaseSecurityContraband ]
  id: GrenadeFlashBang
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/flashbang.rsi
  - type: FlashOnTrigger
    range: 7
  - type: SoundOnTrigger
    sound:
      path: "/Audio/Effects/flash_bang.ogg"
  - type: DeleteOnTrigger
  - type: SpawnOnTrigger
    proto: GrenadeFlashEffect
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/countdown.ogg
  - type: GuideHelp
    guides:
    - Security
    - Antagonists
  - type: Flashbang # Goobstation
  - type: Tag
    tags:
    - HandGrenade
    - GrenadeFlashBang

- type: entity
  id: GrenadeFlashEffect
  categories: [ HideSpawnMenu ]
  components:
    - type: PointLight
      enabled: true
      radius: 5
      energy: 8
      netsync: false
    - type: LightFade
      duration: 0.5
    - type: TimedDespawn
      lifetime: 0.5

#The explosive values for these are pretty god damn mediocre, but SS14's explosion system is hard to understand - this is a good enough approximation of how it was in SS13.
#Ideally, there should be a weak radius around the bomb outside of its gibbing / spacing range capable of dealing fair damage to players / structures.
- type: entity
  name: syndicate minibomb
  description: A syndicate-manufactured explosive used to stow destruction and cause chaos.
  parent: [GrenadeBase, BaseSyndicateContraband]
  id: SyndieMiniBomb
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/syndgrenade.rsi
  - type: ExplosionResistance
    damageCoefficient: 0.1
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:TimerStartBehavior
    - trigger:
        !type:DamageTrigger
        damage: 45
      behaviors:
      - !type:TriggerBehavior
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: OnUseTimerTrigger
    delay: 5
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Minibomb
    totalIntensity: 200
    intensitySlope: 30 #Will destroy the tile under it reliably, space 1-2 more to rods. Only does any significant damage in a 5-tile cross.
    maxIntensity: 60
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/minibombcountdown.ogg
      params:
        volume: 12
  - type: StaticPrice
    price: 2000

- type: entity
  name: self destruct
  description: Go out on your own terms!
  parent: GrenadeBase
  id: SelfDestructSeq
  categories: [ HideSpawnMenu ]
  components:
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Minibomb
    totalIntensity: 400
    intensitySlope: 30
    maxIntensity: 125
    canCreateVacuum: true
  - type: OnUseTimerTrigger
    delay: 4.5
    beepSound:
      path: /Audio/Effects/Grenades/SelfDestruct/SDS_Charge2.ogg
      params:
        volume: 30
    initialBeepDelay: 0
    beepInterval: 16


- type: entity
  name: supermatter grenade
  description: Grenade that simulates delamination of the supermatter engine, pulling things in a heap and exploding after some time.
  parent: [GrenadeBase, BaseSyndicateContraband]
  id: SupermatterGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/supermattergrenade.rsi
  - type: OnUseTimerTrigger
    delay: 3
    beepInterval: 0.46
    beepSound:
      path: /Audio/Effects/Grenades/Supermatter/smbeep.ogg
      params:
        volume: -5
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/Grenades/Supermatter/smbeep.ogg
      params:
        volume: -5
  - type: Explosive
    explosionType: Default
    totalIntensity: 200
    intensitySlope: 30
    maxIntensity: 120
  - type: SoundOnTrigger
    removeOnTrigger: true
    sound:
      path: /Audio/Effects/Grenades/Supermatter/supermatter_start.ogg
      volume: 5
  - type: AnchorOnTrigger
    removeOnTrigger: true
  - type: TwoStageTrigger
    triggerDelay: 10.45
    components:
      - type: AmbientSound
        enabled: true
        volume: -5
        range: 14
        sound:
          path: /Audio/Effects/Grenades/Supermatter/supermatter_loop.ogg
      - type: GravityWell
        maxRange: 8
        baseRadialAcceleration: 8
        baseTangentialAcceleration: .5
        gravPulsePeriod: 0.02
      - type: SingularityDistortion
        intensity: 150
        falloffPower: 1.5
      - type: PointLight
        enabled: true
        color: "#ffaa44"
        energy: 8
        radius: 6
        softness: 1
        offset: "0, 0"
      - type: SoundOnTrigger
        sound:
          path: /Audio/Effects/Grenades/Supermatter/supermatter_end.ogg
          params:
            volume: 5
      - type: DeleteOnTrigger
  - type: StaticPrice
    price: 1000

- type: entity
  name: whitehole grenade
  description: Grenade that repulses everything around for some time.
  parent: SupermatterGrenade
  id: WhiteholeGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/whiteholegrenade.rsi
  - type: OnUseTimerTrigger
    delay: 3
    beepInterval: 0.69
  - type: SoundOnTrigger
    removeOnTrigger: true
    sound:
      path: /Audio/Effects/Grenades/Supermatter/whitehole_start.ogg
      volume: 5
  - type: TwoStageTrigger
    triggerDelay: 11.14
    components:
      - type: AmbientSound
        enabled: true
        volume: -5
        range: 14
        sound:
          path: /Audio/Effects/Grenades/Supermatter/whitehole_loop.ogg
      - type: GravityWell
        maxRange: 10
        baseRadialAcceleration: -180
        baseTangentialAcceleration: -5
        gravPulsePeriod: 0.01
      - type: SingularityDistortion
        intensity: -200
        falloffPower: 1.5
      - type: PointLight
        enabled: true
        color: "#ffffff"
        energy: 8
        radius: 6
        softness: 1
        offset: "0, 0"
      - type: SoundOnTrigger
        sound:
          path: /Audio/Effects/Grenades/Supermatter/supermatter_end.ogg
          params:
            volume: 15
      - type: DeleteOnTrigger
  - type: StaticPrice
    price: 1000

- type: entity
  name: the nuclear option
  description: Please don't throw it, think of the children.
  parent: GrenadeBase
  id: NuclearGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/nukenade.rsi
  - type: OnUseTimerTrigger
    delay: 5
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    totalIntensity: 20000 # ~15 tile radius.
    intensitySlope: 5
    maxIntensity: 50
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:TriggerBehavior
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/countdown.ogg

- type: entity
  name: modular grenade
  description: A grenade casing. Requires a trigger and a payload.
  parent: BaseItem
  id: ModularGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/modular.rsi
    layers:
    - state: empty
      map: [ "enum.ConstructionVisuals.Layer" ]
  - type: Item
    size: Small
  - type: Tag
    tags:
    - HandGrenade
  - type: PayloadCase
  - type: Construction
    graph: ModularGrenadeGraph
    node: emptyCase
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:TriggerBehavior
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ConstructionVisuals.Key:
        enum.ConstructionVisuals.Layer:
          emptyCase: { state: empty }
          wiredCase: { state: wired }
          caseWithTrigger: { state: no-payload }
          caseWithPayload: { state: no-trigger }
          grenade: { state: complete }
      enum.Trigger.TriggerVisuals.VisualState:
        enum.ConstructionVisuals.Layer:
          Primed: { state: primed }
          # Unprimed: <Use state determined by enum.ConstructionVisuals.Layer>
  - type: StaticPrice
    price: 75

- type: entity
  name: EMP grenade
  description: A grenade designed to wreak havoc on electronic systems.
  parent: [GrenadeBase, BaseSyndicateContraband]
  id: EmpGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/empgrenade.rsi
  - type: EmpOnTrigger
    range: 5.5
    energyConsumption: 50000
  - type: DeleteOnTrigger
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/countdown.ogg
  - type: StaticPrice
    price: 666 # 2000 for 3, I love fractions

- type: entity
  name: holy hand grenade
  description: O Lord, bless this thy hand grenade, that with it thou mayst blow thine enemies to tiny bits, in thy mercy.
  parent: [GrenadeBase, BaseSyndicateContraband]
  id: HolyHandGrenade
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/holyhandgrenade.rsi
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Holy # Shitchap
    totalIntensity: 3500
    intensitySlope: 15
    maxIntensity: 70
    canCreateVacuum: true
  - type: OnUseTimerTrigger
    delay: 3 # by canon
  - type: PointLight
    radius: 7
    energy: 3
    netsync: false
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/hallelujah.ogg
  - type: StaticPrice
    price: 10000

- type: entity
  parent: [ GrenadeBase, BaseSecurityContraband ]
  id: SmokeGrenade
  name: smoke grenade
  description: A tactical grenade that releases a large, long-lasting cloud of smoke when used.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/smoke.rsi
  - type: SmokeOnTrigger
    duration: 15 # goob edit - faster foam
    spreadAmount: 50
  - type: SoundOnTrigger
    sound: /Audio/Items/smoke_grenade_smoke.ogg
  - type: DeleteOnTrigger
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Items/smoke_grenade_prime.ogg

- type: entity
  parent: [ BaseCivilianContraband, SmokeGrenade ]
  id: CleanerGrenade
  name: cleanade
  description: Special grenade for janitors, releasing large cloud of space cleaner foam.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/janitor.rsi
  - type: SmokeOnTrigger
    duration: 5 # goob edit - faster foam
    spreadAmount: 50
    smokePrototype: Foam
    solution:
      reagents:
      - ReagentId: SpaceCleaner
        Quantity: 30

- type: entity
  parent: SmokeGrenade
  id: TearGasGrenade
  name: tear gas grenade
  description: A riot control tear gas grenade. Causes irritation, pain and makes you cry your eyes out.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/tear_gas.rsi
  - type: SmokeOnTrigger
    duration: 5 # goob edit - faster smoke
    spreadAmount: 30
    smokePrototype: TearGasSmokeWhite
    solution:
      reagents:
      - ReagentId: TearGas
        Quantity: 20

- type: entity
  parent: [ BaseEngineeringContraband, SmokeGrenade ]
  id: MetalFoamGrenade
  name: metal foam grenade
  description: An emergency tool used for patching hull breaches with special quick-set metal foam. Almost as good as real floors!
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/metalfoam.rsi
  - type: OnUseTimerTrigger
    delay: 5
  - type: SmokeOnTrigger
    duration: 5 # goob edit - faster smoke
    spreadAmount: 20
    smokePrototype: AluminiumMetalFoam
  - type: StaticPrice
    price: 350

- type: entity
  parent: [ BaseEngineeringContraband, GrenadeBase ] # Prevent inheriting DeleteOnTrigger from SmokeGrenade
  id: AirGrenade
  name: air grenade
  description: A special solid state chemical grenade used for quickly releasing standard air into a spaced area. Fills up to 30 tiles!
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/airboom.rsi
  - type: SoundOnTrigger
    sound: /Audio/Items/smoke_grenade_smoke.ogg
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Items/smoke_grenade_prime.ogg
  - type: OnUseTimerTrigger
    delay: 3
  - type: ReleaseGasOnTrigger
    removeFraction: 0.25
    air:
      volume: 1000
      moles: # Target is 3117.84 mols total for filling 30 tiles (goal is 101.325 kPa @ 20C)
      - 654.7464 # oxygen
      - 2463.0936 # nitrogen
      temperature: 293.15
  - type: StaticPrice
    price: 350
  - type: GenericVisualizer
    visuals:
      enum.ReleaseGasOnTriggerVisuals.Key:
        enabled:
          True: { state: active }
          False: { state: spent }

# Non-explosive "dummy" grenades to use as a distraction.

- type: entity
  name: trick grenade
  description: All the grenade without any of the boom.
  parent: GrenadeBase
  id: GrenadeDummy
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/grenade.rsi
  - type: DeleteOnTrigger
  - type: SpawnOnTrigger
    proto: GrenadeFlashEffect
  - type: SoundOnTrigger
    sound:
      path: /Audio/Effects/Emotes/parp1.ogg
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/countdown.ogg

- type: entity
  name: syndicate trickybomb
  description: A syndicate-manufactured explosive used to make an excellent distraction.
  parent: [GrenadeDummy, BaseSyndicateContraband]
  id: SyndieTrickyBomb
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/syndgrenade.rsi
  - type: OnUseTimerTrigger
    delay: 5
  - type: SoundOnTrigger
    sound:
      path: /Audio/Effects/Emotes/parp1.ogg
  - type: Appearance
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/minibombcountdown.ogg
      params:
        volume: 12
  - type: StaticPrice
    price: 1000
