- type: entity
  parent: BaseItem
  abstract: true
  id: BasePayload
  components:
  - type: Appearance
  - type: Sprite
  - type: Tag
    tags:
    - Payload
  - type: Damageable
  - type: Injurable
    damageContainer: Inorganic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

- type: entity
  name: explosive payload
  parent: [ BasePayload, BaseSecurityContraband ]
  id: ExplosivePayload
  components:
  - type: Sprite
    sprite: Objects/Devices/payload.rsi
    state: payload-explosive-armed
  - type: Explosive
    explosionType: Default
    # same as the standard grenade, but those numbers were also just picked out of a hat.
    maxIntensity: 10
    intensitySlope: 3
    totalIntensity: 120 # about a ~4 tile radius
  - type: ExplodeOnTrigger

- type: entity
  name: chemical payload
  parent: [ BasePayload, BaseMedicalScienceContraband ]
  id: ChemicalPayload
  description: A chemical payload. Has space to store two beakers. In combination with a trigger and a case, this can be used to initiate chemical reactions.
  components:
  - type: Sprite
    sprite: Objects/Devices/payload.rsi
    state: payload-empty
    layers:
    - state: payload-empty
      map: ["base"]
  - type: ChemicalPayload
    beakerSlotA: &slotDef
      whitelist:
        components:
        - FitsInDispenser
      swap: false
    beakerSlotB: *slotDef
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ChemicalPayloadVisuals.Slots:
        base:
          None: { state: payload-empty }
          Left: { state: payload-chemical-left }
          Right: { state: payload-chemical-right }
          Both: { state: payload-chemical-armed }
  - type: ItemSlots
  - type: ContainerContainer
    containers:
      BeakerSlotA: !type:ContainerSlot
      BeakerSlotB: !type:ContainerSlot
  - type: StaticPrice
    price: 60

- type: entity
  name: flash payload
  parent: [ BasePayload, BaseSecurityScienceCommandContraband ]
  id: FlashPayload
  description: A single-use flash payload.
  components:
    - type: Sprite
      sprite: Objects/Devices/payload.rsi
      state: payload-flash-armed
    - type: DeleteOnTrigger
    - type: FlashOnTrigger
      range: 6
    - type: EmitSoundOnTrigger
      sound:
        path: "/Audio/Effects/flash_bang.ogg"
      positional: true
