# ScatteringGrenade is intended for grenades that spawn entities, especially those with timers
- type: entity
  abstract: true
  parent: BaseItem
  id: ScatteringGrenadeBase
  components:
  - type: Appearance
  - type: ContainerContainer
    containers:
      cluster-payload: !type:Container
  - type: Damageable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:TriggerBehavior
  - type: ScatteringGrenade
  - type: OnUseTimerTrigger
    delay: 3
  - type: Tag
    tags:
    - HandGrenade

- type: entity
  parent: [ScatteringGrenadeBase, BaseSyndicateContraband]
  id: ClusterGrenade
  name: clustergrenade
  description: Why use one grenade when you can use three at once!
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/clusterbomb.rsi
    layers:
    - state: icon
      map: ["enum.TriggerVisualLayers.Base"]
  - type: ScatteringGrenade
    fillPrototype: ExGrenade
    distance: 4
  - type: OnUseTimerTrigger
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 0.5
  - type: EmitSoundOnTrigger
    sound:
      path: "/Audio/Machines/door_lock_off.ogg"
  - type: StaticPrice
    price: 2500

- type: entity
  parent: [ScatteringGrenadeBase, BaseSyndicateContraband]
  id: ClusterBananaPeel
  name: cluster banana peel
  description: Splits into 6 explosive banana peels after throwing, guaranteed fun!
  components:
  - type: Sprite
    sprite: Objects/Specific/Hydroponics/banana.rsi
    state: produce
  - type: ScatteringGrenade
    fillPrototype: TrashBananaPeelExplosive
    capacity: 6
    delayBeforeTriggerContents: 20
  - type: LandAtCursor
  - type: DamageOnLand
    damage:
      types:
        Blunt: 10
  - type: EmitSoundOnTrigger
    sound:
      path: "/Audio/Items/bikehorn.ogg"

- type: entity
  parent: [SoapSyndie, ScatteringGrenadeBase, BaseSyndicateContraband]
  id: SlipocalypseClusterSoap
  name: slipocalypse clustersoap
  description: Spreads small pieces of syndicate soap over an area upon landing on the floor.
  components:
  - type: Sprite
    sprite: Objects/Specific/Janitorial/soap.rsi
    layers:
    - state: syndie-4
  - type: ScatteringGrenade
    fillPrototype: SoapletSyndie
    capacity: 30
    delayBeforeTriggerContents: 60
    randomDistance: true
    randomThrowDistanceMax: 3
  - type: LandAtCursor
  - type: DamageOnLand
    damage:
      types:
        Blunt: 10
  - type: EmitSoundOnTrigger
    sound:
      path: "/Audio/Effects/flash_bang.ogg"
  - type: StaticPrice
    price: 1000

- type: entity
  parent: ScatteringGrenadeBase
  id: GrenadeFoamDart
  name: foam dart grenade
  description: Releases a bothersome spray of foam darts that cause severe welching.
  components:
  - type: Sprite
    sprite: Objects/Fun/Foam/foam_grenade.rsi
    layers:
    - state: icon
      map: ["Base"]
    - state: primed
      map: ["enum.TriggerVisualLayers.Base"]
  - type: ScatteringGrenade
    fillPrototype: BulletFoam
    capacity: 30
    velocity: 30
  - type: OnUseTimerTrigger
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 2
  - type: EmitSoundOnTrigger
    sound:
      path: "/Audio/Weapons/Guns/Gunshots/batrifle.ogg"
