- type: entity
  abstract: true
  parent: BaseItem
  id: ProjectileGrenadeBase
  components:
  - type: Appearance
  - type: Damageable
    damageContainer: Inorganic
  - type: DeleteOnTrigger
    keysIn:
    - timer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:TriggerBehavior
        keyOut: timer # explode immediately
  - type: ContainerContainer
    containers:
      cluster-payload: !type:Container
  - type: ProjectileGrenade
  - type: AnimationPlayer
  - type: GenericVisualizer
    visuals:
      enum.Trigger.TriggerVisuals.VisualState:
        enum.ConstructionVisuals.Layer:
          Primed: { state: primed }
          Unprimed: { state: icon }
  - type: Tag
    tags:
    - 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
  parent: [ProjectileGrenadeBase, BaseSecurityContraband]
  id: GrenadeStinger
  name: stinger grenade
  description: Nothing to see here, please disperse.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/stingergrenade.rsi
    layers:
    - state: icon
      map: ["enum.TriggerVisualLayers.Base"]
  - type: ProjectileGrenade
    fillPrototype: PelletClusterRubber
    capacity: 30
  - type: EmitSoundOnTrigger
    keysIn:
    - timer
    sound:
      path: "/Audio/Effects/flash_bang.ogg"
    positional: true
  - type: SpawnOnTrigger
    keysIn:
    - timer
    proto: GrenadeFlashEffect
    predicted: true
  - type: TriggerOnUse
  - type: TimerTrigger
    initialBeepDelay: 0
    beepInterval: 2
    delay: 3.5
  - type: TimerTriggerVisuals
    primingSound:
      path: /Audio/Effects/countdown.ogg
  - type: CartridgeAmmo #Sunrise-Start
    proto: BulletGrenadeStinger
    deleteOnSpawn: true
  - type: SpentAmmoVisuals
  - type: Tag
    tags:
    - HandGrenadeAmmo #Sunrise-End

- type: entity
  parent: [ProjectileGrenadeBase, BaseSyndicateContraband]
  id: GrenadeIncendiary
  name: incendiary grenade
  description: Guaranteed to light up the mood.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/pyrogrenade.rsi
    layers:
    - state: icon
      map: ["enum.TriggerVisualLayers.Base"]
  - type: ProjectileGrenade
    fillPrototype: PelletClusterIncendiary
    capacity: 30
  - type: TriggerOnUse
  - type: TimerTrigger
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 2
    delay: 3.5
  - type: EmitSoundOnTrigger
    keysIn:
    - timer
    sound:
      path: "/Audio/Weapons/Guns/Gunshots/batrifle.ogg"
    positional: true
  - type: StaticPrice
    price: 1500
  - type: CartridgeAmmo #Sunrise-Start
    proto: BulletGrenadeIncendiary
    deleteOnSpawn: true
  - type: SpentAmmoVisuals
  - type: Tag
    tags:
    - HandGrenadeAmmo #Sunrise-End

- type: entity
  parent: [ProjectileGrenadeBase, BaseSyndicateContraband]
  id: GrenadeShrapnel
  name: shrapnel grenade
  description: Releases a deadly spray of shrapnel that causes severe bleeding.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Grenades/shrapnelgrenade.rsi
    layers:
    - state: icon
      map: ["enum.TriggerVisualLayers.Base"]
  - type: ProjectileGrenade
    fillPrototype: PelletClusterLethal
    capacity: 30
  - type: TriggerOnUse
  - type: TimerTrigger
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 2
    delay: 3.5
  - type: EmitSoundOnTrigger
    keysIn:
    - timer
    sound:
      path: "/Audio/Weapons/Guns/Gunshots/batrifle.ogg"
    positional: true
  - type: StaticPrice
    price: 1500
  - type: CartridgeAmmo #Sunrise-Start
    proto: BulletGrenadeShrapnel
    deleteOnSpawn: true
  - type: SpentAmmoVisuals
  - type: Tag
    tags:
    - HandGrenadeAmmo #Sunrise-End
