- type: entity
  id: BaseDefibrillator
  parent: BaseItem
  name: defibrillator
  description: CLEAR! Zzzzat!
  abstract: true
  components:
    - type: Sprite
      sprite: Objects/Specific/Medical/defib.rsi
      layers:
        - state: icon
        - state: screen
          map: [ "enum.ToggleableVisuals.Layer" ]
          visible: false
          shader: unshaded
    - type: Appearance
    - type: GenericVisualizer
      visuals:
        enum.ToggleableVisuals.Enabled:
          enum.ToggleableVisuals.Layer:
            True: { visible: true }
            False: { visible: false }
    - type: Item
      size: Large
    - type: Speech
      speechVerb: Robotic
    - type: ItemToggle
      soundActivate:
        path: /Audio/Items/Defib/defib_safety_on.ogg
      soundDeactivate:
        path: /Audio/Items/Defib/defib_safety_off.ogg
    - type: Defibrillator
      zapHeal:
        types:
          Asphyxiation: -40
    - type: DoAfter
    - type: UseDelay
    - type: StaticPrice
      price: 30
    - type: GuideHelp
      guides:
      - MedicalDoctor

- type: entity
  id: Defibrillator
  parent: [ BaseDefibrillator, PowerCellSlotMediumItem ]
  components:
  - type: MultiHandedItem
  - type: ToggleCellDraw
  - type: PowerCellDraw
    useCharge: 100

- type: entity
  id: DefibrillatorEmpty
  parent: Defibrillator
  suffix: Empty
  components:
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default

- type: entity
  id: DefibrillatorOneHandedUnpowered
  parent: BaseDefibrillator
  suffix: One-Handed, Always Powered

- type: entity
  id: DefibrillatorCompact # This should be a research item at some point
  parent: [ BaseDefibrillator, PowerCellSlotMediumItem ]
  name: compact defibrillator
  description: Now in fun size!
  components:
  - type: Sprite
    sprite: Objects/Specific/Medical/defibsmall.rsi
    layers:
      - state: icon
      - state: screen
        map: [ "enum.ToggleableVisuals.Layer" ]
        visible: false
        shader: unshaded
      - state: ready
        map: ["enum.PowerDeviceVisualLayers.Powered"]
        shader: unshaded
  - type: Item
    size: Normal
  - type: ToggleCellDraw
  - type: PowerCellDraw
    useCharge: 100
  - type: Defibrillator
    zapHeal:
      types:
        Asphyxiation: -40
    doAfterDuration: 6
  - type: DoAfter
  - type: UseDelay

- type: entity
  id: DefibrillatorSyndicate
  parent: [ DefibrillatorCompact, BaseSyndicateContraband ]
  name: interdyne defibrillator
  description: Doubles as a self-defense weapon against war-crime inclined tiders.
  components:
  - type: Sprite
    sprite: Objects/Specific/Medical/defibsyndi.rsi
    layers:
      - state: icon
      - state: screen
        map: [ "enum.ToggleableVisuals.Layer" ]
        visible: false
        shader: unshaded
      - state: ready
        map: ["enum.PowerDeviceVisualLayers.Powered"]
        shader: unshaded
  # Sunrise-Start
  - type: Defibrillator
    doAfterDuration: 0.45
    allowUseOnAlive: true
    reagents:
      Omnizine: 5
      Epinephrine: 5
      Tazinide: 10
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellSmallNuclear
        disableEject: true
        locked: true
  - type: PowerCellDraw
    useCharge: 25
  - type: PowerDrainOnMeleeHit
    chargePerHit: 25
  # Sunrise-End
  - type: MeleeWeapon
    damage:
      types:
        Blunt: 8
  - type: ItemToggleMeleeWeapon
    activatedSoundOnHit:
      path: /Audio/Items/Defib/defib_zap.ogg
      params:
        variation: 0.250
    activatedSoundOnHitNoDamage:
      path: /Audio/Items/Defib/defib_zap.ogg
      params:
        variation: 0.250
        volume: -10
    activatedDamage:
      types:
        Blunt: 8
        Shock: 16
