- type: entity
  id: BaseSubdermalImplant
  name: implant
  description: A microscopic chip that's injected under the skin.
  abstract: true
  components:
  - type: SubdermalImplant
  - type: Tag
    tags:
    - SubdermalImplant
    - HideContextMenu

#Fun implants

- type: entity
  parent: BaseSubdermalImplant
  id: SadTromboneImplant
  name: sad trombone implant
  description: This implant plays a sad tune when the user dies.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    whitelist:
      components:
      - MobState # admeme implanting a chair with trombone implant needs to give the chair mobstate so it can die first
  - type: TriggerOnMobstateChange
    mobState:
    - Dead
  - type: EmitSoundOnTrigger
    sound:
      collection: SadTrombone
      params:
        variation: 0.125

- type: entity
  parent: BaseSubdermalImplant
  id: LightImplant
  name: light implant
  description: This implant emits light from the user's skin on activation.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionToggleLight
  - type: PointLight
    enabled: false
    radius: 2.5
    softness: 5
    mask: /Textures/Effects/LightMasks/cone.png
    autoRot: true
  - type: Tag
    tags:
    - SubdermalImplant
    - HideContextMenu
    - Flashlight
  - type: UnpoweredFlashlight

- type: entity
  parent: BaseSubdermalImplant
  id: BikeHornImplant
  name: bike horn implant
  description: This implant lets the user honk anywhere at any time.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionActivateHonkImplant
  - type: TriggerOnActivateImplant
  - type: EmitSoundOnTrigger
    predicted: true
    sound:
      collection: BikeHorn
      params:
        variation: 0.125
  - type: Tag
    tags:
    - BikeHorn

#Security implants

- type: entity
  parent: BaseSubdermalImplant
  id: TrackingImplant
  name: tracking implant
  description: This implant has a tracking device attached to the suit sensor network.
  categories: [ HideSpawnMenu ]
  components:
    - type: SubdermalImplant
      whitelist:
        components:
        - MobState # admeme implanting a chair with tracking implant needs to give the chair mobstate so it can die first
    - type: SuitSensor
      randomMode: false
      controlsLocked: true
      mode: SensorCords
      activationContainer: "implant"
    - type: DeviceNetwork
      deviceNetId: Wireless
      transmitFrequencyId: SuitSensor
    - type: StationLimitedNetwork
    - type: WirelessNetworkConnection
      range: 500

#Traitor implants

- type: entity
  parent: BaseSubdermalImplant
  id: StorageImplant
  name: storage implant
  description: This implant grants hidden storage within a person's body using bluespace technology.
  categories: [ HideSpawnMenu ]
  components:
    - type: StorageImplant
    - type: SubdermalImplant
      implantAction: ActionOpenStorageImplant
      whitelist:
        components:
        - Hands # no use giving a mouse a storage implant, but a monkey is another story...
    - type: Storage
      grid:
      - 0,0,0,1
      - 1,0,1,0
      - 1,2,1,2
      - 2,1,2,2
    - type: ContainerContainer
      containers:
        storagebase: !type:Container
          ents: [ ]
    - type: UserInterface
      interfaces:
        enum.StorageUiKey.Key:
          type: StorageBoundUserInterface

- type: entity
  parent: BaseSubdermalImplant
  id: FreedomImplant
  name: freedom implant
  description: This implant lets the user break out of hand restraints up to three times before ceasing to function anymore.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionActivateFreedomImplant
    whitelist:
      components:
      - Cuffable # useless if you cant be cuffed
  - type: TriggerOnActivateImplant
  - type: UncuffOnTrigger
    targetUser: true

- type: entity
  parent: BaseSubdermalImplant
  id: RadioImplant
  name: radio implant
  description: This implant grants access to the Syndicate channel without a headset.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
  - type: RadioImplant
    radioChannels:
    - Syndicate

- type: entity
  parent: BaseSubdermalImplant
  id: UplinkImplant
  name: uplink implant
  description: This implant lets the user access a hidden Syndicate uplink at will.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionOpenUplinkImplant
    whitelist:
      components:
      - Hands # prevent mouse buying grenade penguin since its not telepathic
  - type: RemoteStore
  - type: UserInterface
    interfaces:
      enum.StoreUiKey.Key:
        type: StoreBoundUserInterface

- type: entity
  parent: BaseSubdermalImplant
  id: EmpImplant
  name: EMP implant
  description: This implant creates an electromagnetic pulse when activated.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionActivateEmpImplant
  - type: TriggerOnActivateImplant
  - type: EmpOnTrigger
    range: 2.75
    energyConsumption: 50000
    disableDuration: 10

- type: entity
  parent: BaseSubdermalImplant
  id: ScramImplant
  name: scram implant
  description: This implant randomly teleports the user within a large radius when activated.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionActivateScramImplant
  - type: TriggerOnActivateImplant
  - type: ScramOnTrigger
    targetUser: true

- type: entity
  parent: BaseSubdermalImplant
  id: DnaScramblerImplant
  name: DNA scrambler implant
  description: This implant lets the user randomly change their appearance and name once.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionActivateDnaScramblerImplant
    whitelist:
      components:
      - HumanoidProfile # syndies cant turn hamlet into a human
  - type: TriggerOnActivateImplant
  - type: DnaScrambleOnTrigger
    targetUser: true
  - type: DeleteOnTrigger

- type: entity
  categories: [ HideSpawnMenu, Spawner ]
  parent: BaseSubdermalImplant
  id: ChameleonControllerImplant
  name: chameleon controller implant
  description: This implant allows you to instantly change the appearance of all worn chameleon clothing.
  components:
  - type: ChameleonControllerImplant
  - type: SubdermalImplant
    implantAction: ActionChameleonController
  - type: UseDelay
    delay: 1
  - type: UserInterface
    interfaces:
      enum.ChameleonControllerKey.Key:
        type: ChameleonControllerBoundUserInterface

- type: entity
  parent: BaseSubdermalImplant
  id: VoiceMaskImplant
  name: identity mask implant
  description: This implant allows you to change your identity at will.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: ActionChangeVoiceMaskImplant
  - type: VoiceMask
    overrideIdentity: true
    changeIDName: true
  - type: UserInterface
    interfaces:
      enum.VoiceMaskUIKey.Key:
        type: VoiceMaskBoundUserInterface
  - type: Tag
    tags:
    - SubdermalImplant

#Nuclear Operative/Special Exclusive implants

- type: entity
  parent: BaseSubdermalImplant
  id: MicroBombImplant
  name: micro-bomb implant
  description: This implant detonates the user upon activation or upon death.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    permanent: true
    implantAction: ActionActivateMicroBomb
  - type: TriggerOnMobstateChange
    mobState:
    - Dead
  - type: TriggerOnActivateImplant
  - type: ExplodeOnTrigger
  - type: GibOnTrigger
    targetUser: true
    deleteItems: true
  - type: Explosive
    explosionType: MicroBomb
    totalIntensity: 120
    intensitySlope: 5
    maxIntensity: 30
    canCreateVacuum: false
  - type: Tag
    tags:
    - SubdermalImplant
    - HideContextMenu
    - MicroBomb


- type: entity
  parent: BaseSubdermalImplant
  id: MacroBombImplant
  name: macro-bomb implant
  description: This implant creates a large explosion on death after a preprogrammed countdown.
  categories: [ HideSpawnMenu ]
  components:
    - type: SubdermalImplant
      permanent: true
    - type: ReplacementImplant
      whitelist:
        tags:
        - MicroBomb # replace microbomb implant with macrobomb
    - type: TriggerOnMobstateChange #activates the timer
      mobState:
      - Dead
      preventSuicide: true
    - type: TimerTrigger
      delay: 7
      beepSound:
        path: /Audio/Machines/Nuke/general_beep.ogg
        params:
          volume: -2
    - type: ExplodeOnTrigger
      keysIn:
      - timer
    - type: GibOnTrigger
      targetUser: true
      deleteItems: true
      keysIn:
      - timer
    - type: Explosive
      explosionType: Default
      totalIntensity: 3500
      intensitySlope: 15
      maxIntensity: 70
      canCreateVacuum: true
    - type: Tag
      tags:
      - SubdermalImplant
      - HideContextMenu

- type: entity
  parent: BaseSubdermalImplant
  id: DeathAcidifierImplant
  name: death-acidifier implant
  description: This implant melts the user and their equipment upon death.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    permanent: true
    implantAction: ActionActivateDeathAcidifier
  - type: TriggerOnMobstateChange
    mobState:
    - Dead
  - type: TriggerOnActivateImplant
  - type: GibOnTrigger
    targetUser: true
    deleteItems: true
  - type: SpawnOnTrigger
    proto: Acidifier
    predicted: true
  - type: Tag
    tags:
    - SubdermalImplant
    - HideContextMenu

- type: entity
  parent: BaseSubdermalImplant
  id: DeathRattleImplant
  name: death rattle implant
  description: This implant will inform the Syndicate radio channel should the user fall into critical condition or die.
  categories: [ HideSpawnMenu ]
  components:
    - type: SubdermalImplant
      permanent: true
      whitelist:
        components:
        - MobState # admeme implanting a chair with rattle implant needs to give the chair mobstate so it can die first
    - type: TriggerOnMobstateChange
      mobState:
      - Critical
      - Dead
    - type: RattleOnTrigger
      targetUser: true

- type: entity
  parent: BaseSubdermalImplant
  id: FakeMindShieldImplant
  name: fake mindshield implant
  description: This implant allows the implanter to produce a fake signal that NT security huds use to identify individuals implanted with a mindshield.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
    implantAction: FakeMindShieldToggleAction
    implantComponents:
    - type: FakeMindShield # TODO: put the component on the implant and use implant relay events for the status icon
  - type: FakeMindShieldImplant

# Sec and Command implants

- type: entity
  parent: BaseSubdermalImplant
  id: MindShieldImplant
  name: mindshield implant
  description: This implant will ensure loyalty to Nanotrasen and prevent mind control devices.
  categories: [ HideSpawnMenu ]
  components:
   - type: SubdermalImplant
   - type: MindShieldImplant

# Centcomm implants

- type: entity
  parent: BaseSubdermalImplant
  id: RadioImplantCentcomm
  name: radio implant
  description: This implant grants access to the Centcomm channel without a headset. Only authorized for Centcomm employees.
  categories: [ HideSpawnMenu ]
  components:
  - type: SubdermalImplant
  - type: RadioImplant
    radioChannels:
    - CentCom

- type: entity
  parent: DeathRattleImplant
  id: DeathRattleImplantCentcomm
  name: centcomm death rattle implant
  description: This implant will inform the Centcomm radio channel should the user fall into critical condition or die.
  categories: [ HideSpawnMenu ]
  components:
  - type: RattleOnTrigger
    radioChannel: CentCom
