- type: entity
  parent: [VolatileGrenadeBase, TimerGrenadeBase, 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
    keysIn:
    - timer
    duration: 30
    spreadAmount: 50
  - type: EmitSoundOnTrigger
    keysIn:
    - timer
    sound: /Audio/Items/smoke_grenade_smoke.ogg
    positional: true
  - type: DeleteOnTrigger
    keysIn:
    - timer
  - 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
    keysIn:
    - timer
    duration: 15
    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
    keysIn:
    - timer
    duration: 10
    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: TimerTrigger
    delay: 5
  - type: SmokeOnTrigger
    keysIn:
    - timer
    duration: 10
    spreadAmount: 20
    smokePrototype: AluminiumMetalFoam
  - type: StaticPrice
    price: 350
  #Sunrise-Start
  - type: CartridgeAmmo
    proto: BulletMetalFoamGrenade
    deleteOnSpawn: true
  - type: SpentAmmoVisuals
  - type: Tag
    tags:
    - HandGrenadeAmmo
  #Sunrise-End

- type: entity
  parent: [ BaseEngineeringContraband, VolatileGrenadeBase, TimerGrenadeBase ] # 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: EmitSoundOnTrigger
    keysIn:
    - timer
    sound: /Audio/Items/smoke_grenade_smoke.ogg
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Items/smoke_grenade_prime.ogg
  - type: TimerTrigger
    delay: 3
  - type: ReleaseGasOnTrigger
    keysIn:
    - timer
    removeFraction: 0.25
    air:
      volume: 1000
      moles: # Target is 3117.84 mols total for filling 30 tiles (goal is 101.325 kPa @ 20C)
        Oxygen: 654.7464 # oxygen
        Nitrogen: 2463.0936 # nitrogen
      temperature: 293.15
  - type: StaticPrice
    price: 350
  - type: GenericVisualizer
    visuals:
      enum.ReleaseGasOnTriggerVisuals.Key:
        enabled:
          True: { state: active }
          False: { state: spent }
  - type: RemoveComponentsOnTrigger # should prevent it from being re-triggered
    keysIn:
    - timer
    triggerOnce: true
    components:
    - type: TriggerOnUse
    - type: TimerTrigger
  #Sunrise-Start
  - type: CartridgeAmmo
    proto: BulletAirGrenade
    deleteOnSpawn: true
  - type: SpentAmmoVisuals
  - type: Tag
    tags:
    - HandGrenadeAmmo
  #Sunrise-End
