- type: entity
  suffix: Exploding
  parent: Pen
  id: PenExploding
  components:
  - type: TimerTrigger
    delay: 4
    examinable: false
  - type: Explosive
    explosionType: Default
    maxIntensity: 8
    intensitySlope: 5
    totalIntensity: 20
    canCreateVacuum: false
  - type: ActivateOnPaperOpened
  - type: ExplodeOnTrigger
    keysIn:
    - timer
  - type: TriggerOnUse
  - type: TriggerOnSignal
  - type: DeviceLinkSink # This should be changed into separate behavior where triggering via signal makes beep, while triggering manually is quiet.
    ports:
    - Trigger
  - type: EmitSoundOnUse
    handle: false # don't want the sound to stop the explosion from triggering
  - type: AddComponentsOnTrigger # make them embed into the target, but only when activated so that they can't be metagamed
    components: # copied from PenEmbeddable
    - type: EmbeddableProjectile
      offset: 0.3,0.0
      removalTime: 0.0
    - type: ThrowingAngle
      angle: 315
    - type: LandAtCursor
    - type: DamageOtherOnHit
      damage:
        types:
          Piercing: 3

- type: entity
  parent: [BaseItem, ThirdSyndicateContraband]
  id: PenExplodingBox
  name: exploding pen box
  description: A small box containing an exploding pen. Packaging disintegrates when opened, leaving no evidence behind.
  components:
  - type: Item
    size: Tiny
  - type: Sprite
    sprite: Objects/Storage/penbox.rsi
    state: exploding_pen
  - type: SpawnItemsOnUse
    items:
    - id: PenExploding
    sound:
      path: /Audio/Effects/unwrap.ogg
