- type: entity
  parent: BaseItem
  id: CMBaseDefibrillator
  name: emergency defibrillator
  description: A handheld emergency defibrillator, used to restore fibrillating patients. Can optionally bring people back from the dead.
  abstract: true
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Medical/defib.rsi
    layers:
    - state: defib
    - state: defib_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ToggleableVisuals.Enabled:
        enum.ToggleableVisuals.Layer:
          True: { visible: true }
          False: { visible: false }
  - type: Item
    size: Normal
    sprite: _RMC14/Objects/Medical/defib.rsi
    heldPrefix: defib
  - type: Speech
    speechVerb: Robotic
  - type: ItemToggle
    soundActivate:
      path: /Audio/_RMC14/Medical/defib_SafetyOn.ogg
    soundDeactivate:
      path: /Audio/_RMC14/Medical/defib_safetyOff.ogg
  - type: Defibrillator
    zapDelay: 0
    doAfterDuration: 4
    allowDoAfterMovement: false
    canDefibCrit: false
    rmcZapHeal:
    - Brute: -12
    - Burn: -12
    - Toxin: -12
    - Genetic: -12
    zapHeal:
      groups:
        Airloss: -400
    zapSound:
      path: /Audio/_RMC14/Medical/defib_release.ogg
      params:
        volume: -6
    chargeSound:
      path: /Audio/_RMC14/Medical/defib_charge.ogg
      params:
        volume: -8
    failureSound:
      path: /Audio/_RMC14/Medical/defib_failed.ogg
      params:
        volume: -6
    successSound:
      path: /Audio/_RMC14/Medical/defib_success.ogg
      params:
        volume: -6
    readySound:
      path: /Audio/_RMC14/Medical/defib_ready.ogg
      params:
        volume: -6
    zapDamage: 0
  - type: DoAfter
  - type: UseDelay
  - type: StaticPrice
    price: 100
  - type: GuideHelp
    guides:
    - MedicalDoctor
  - type: RequiresSkill
    skills:
      RMCSkillMedical: 2

- type: entity
  id: CMDefibrillator
  parent: [CMBaseDefibrillator, RMCPowerCellSlotUnremovable]
  suffix: RMC14
  components:
  - type: PowerCellDraw
    enabled: false
    useRate: 66
  - type: RMCPowerUsageDisplay
  - type: UseOnSynthBlocked
    whitelist:
      components:
        - Marine

- type: entity
  id: CMDefibrillatorEmpty
  parent: CMDefibrillator
  suffix: RMC14, Empty
  components:
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default

- type: entity
  parent: CMBaseDefibrillator
  id: CMDefibrillatorInfinite
  suffix: RMC14, Infinite

- type: entity
  id: RMCDefibrillatorCompact
  parent: CMDefibrillator
  name: automated external defibrillator
  description: This particular defibrillator has little charge capacity compared to the standard lifepak, but is smaller and quick to use.
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Medical/compact_defib.rsi
  - type: Item
    sprite: _RMC14/Objects/Medical/compact_defib.rsi
    size: Small
  - type: PowerCellDraw
    useRate: 350

# TODO RMC14: synth reset key sprites currently all use a makeshift_key placeholder.
# Replace them with original art that does not include Alien media logos.
- type: entity
  parent: [CMBaseDefibrillator, RMCPowerCellSlotUnremovable]
  id: RMCSynthResetKey
  name: We-Yu synthetic reset key
  description: This device can fix major glitches or programming errors of synthetic units, as well as being able to restart a synthetic that has suffered critical failure. It must be recharged after use.
  components:
  - type: Sprite
    sprite: _RMC14/Objects/Devices/synth_reset_key.rsi
    layers:
    - state: reset_key
    - state: reset_key_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false
  - type: PowerCellDraw
    enabled: false
    useRate: 1000
  - type: RMCPowerUsageDisplay
  - type: RequiresSkill
    skills:
      RMCSkillEngineer: 1
  - type: ItemToggle
    soundActivate:
      path: /Audio/_RMC14/Machines/click.ogg
    soundDeactivate:
      path: /Audio/_RMC14/Machines/click.ogg
  - type: Defibrillator
    zapSound:
      path: /Audio/_RMC14/Medical/reset_key_release.ogg
      params:
        volume: -6
    chargeSound:
      path: /Audio/_RMC14/Medical/reset_key_powerup.ogg
      params:
        volume: -8
    failureSound:
      path: /Audio/_RMC14/Medical/reset_key_shortbeep.ogg
      params:
        volume: -6
    successSound:
      path: /Audio/_RMC14/Medical/reset_key_boot_on.ogg
      params:
        volume: -6
  - type: UseOnSynthBlocked
    reversed: true
    popup: rmc-species-synth-reset-key-invalid
    whitelist:
      components:
        - Marine
  - type: SynthRepairer
  - type: Item
    size: Small
    sprite: _RMC14/Objects/Devices/synth_reset_key.rsi
    heldPrefix: null
  - type: Tag
    tags:
    - RMCSynthResetKey

- type: entity
  parent: RMCSynthResetKey
  id: RMCSynthResetKeySMART
  name: SMART We-Yu synthetic reset key
  description: This device can fix major glitches or programming errors of synthetic units, as well as being able to restart a synthetic that has suffered critical failure. It must be recharged after use. This one has a microfunction AI and can be operated by anyone.
  components:
  - type: Sprite
    layers:
    - state: reset_key_ns
    - state: reset_key_ns_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false
  - type: RequiresSkill
    skills:
      RMCSkillEngineer: 0

- type: entity
  parent: RMCSynthResetKey
  id: RMCSynthResetKeyHyperdyne
  name: Hyperdyne synthetic reset key
  description: A Hyperdyne-pattern reset key for rebooting synthetic units after critical failure. It must be recharged after use.
  components:
  - type: Sprite
    layers:
    - state: hyper_reset_key
    - state: hyper_reset_key_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false

- type: entity
  parent: RMCSynthResetKeySMART
  id: RMCSynthResetKeyHyperdyneSMART
  name: SMART Hyperdyne synthetic reset key
  description: A Hyperdyne-pattern reset key with a microfunction AI, allowing anyone to operate it. It must be recharged after use.
  components:
  - type: Sprite
    layers:
    - state: hyper_reset_ns_key
    - state: hyper_reset_ns_key_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false

- type: entity
  parent: RMCSynthResetKeySMART
  id: RMCSynthResetKeySeegson
  name: Seegson Working Joe reboot key
  description: A rugged reboot key designed for Seegson Working Joe synthetic units. It must be recharged after use.
  components:
  - type: Sprite
    layers:
    - state: seeg_reset_key
    - state: seeg_reset_key_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false

- type: entity
  parent: RMCSynthResetKeySMART
  id: RMCSynthResetKeyMakeshift
  name: makeshift synthetic sparker
  description: A crude synthetic reboot device assembled from scavenged sparking electronics. It must be recharged after use.
  components:
  - type: Sprite
    layers:
    - state: makeshift_key
    - state: makeshift_key_on
      map: [ "enum.ToggleableVisuals.Layer" ]
      visible: false

- type: entity
  parent: RMCSynthResetKey
  id: RMCSynthResetKeyNovaris
  name: Novaris synthetic reset key
  description: An independent Novaris design, based on a previous collaboration with Weyland-Yutani. This device can fix major glitches or programming errors of synthetic units, as well as being able to restart a synthetic that has suffered critical failure. It must be recharged after use.

- type: entity
  parent: RMCSynthResetKey
  id: RMCSynthResetKeyNovarisSMART
  name: SMART Novaris synthetic reset key
  description: An independent Novaris design, based on a previous collaboration with Weyland-Yutani. This device can fix major glitches or programming errors of synthetic units, as well as being able to restart a synthetic that has suffered critical failure. It must be recharged after use. This one has a micro-function AI and can be operated by anyone.
  components:
  - type: RequiresSkill
    skills:
      RMCSkillEngineer: 0
