- type: entity
  parent: MobHuman
  id: MobHumanTerminator
  # uses random name generator dont worry
  name: exterminator
  components:
  # reduced barotrauma damage
  - type: Barotrauma
    damage:
      types:
        Blunt: 0.1
  # 6x stamina, faster recovery
  - type: Stamina
    decay: 10
    cooldown: 1
    baseCritThreshold: 600
  # immune to space drugs, pax, temporary blindness
  - type: StatusEffects
    allowed:
    - Stun
    - KnockedDown
    - SlowedDown
    - Stutter
    - Electrocution
    - Drunk
    - SlurredSpeech
    - RatvarianLanguage
    - PressureImmunity
    - Muted
    - ForcedSleep
    - StaminaModifier
  - type: MobState
    allowedStates:
    - Alive
    - Dead
  # endoskeleton need it
  - type: TransferMindOnGib
  # self destruct option for phase 1 (manual only, won't trigger on phase 2 transformation)
  - type: AutoImplant
    implants:
    - TerminatorDeathAcidifierImplant
  - type: MobThresholds
    thresholds:
      0: Alive
      # used for health display its not possible to actually fall into crit
      200: Dead
  # take terminator flesh damage
  - type: Damageable
    damageModifierSet: CyberneticFlesh
  # only organ is an endoskeleton, which is transferred when flesh dies
  - type: Body
    prototype: TerminatorFlesh
  # endoskeleton transformation when either you would get burned to crit or killed by any damage
  # you will become an endoskeleton as your last chance to kill the target
  - type: Destructible
    thresholds:
    # the burn trigger is first incase of a bombing or nuking, it might well do over 200 damage but 100 heat is more important
    - trigger:
        !type:DamageTypeTrigger
        damageType: Heat
        damage: 200
      behaviors:
      - !type:PopupBehavior
        popup: terminator-endoskeleton-burn-popup
        popupType: LargeCaution
      - !type:GibBehavior
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:PopupBehavior
        popup: terminator-endoskeleton-gib-popup
        popupType: LargeCaution
      - !type:GibBehavior
  # faster than humans when damaged
  - type: SlowOnDamage
    speedModifierThresholds:
      70: 0.8
      90: 0.6
  # arnold is very strong
  - type: MeleeWeapon
    damage:
      types:
        Blunt: 10
        Structural: 10
  - type: RandomHumanoidAppearance
  # doesnt breathe
  - type: Respirator
    suffocationThreshold: -5
  - type: Inventory
    templateId: terminator
    # metal guy dont shock
  - type: Insulated
  # it looks sick as fuck when the burning guy suddenly turns into a cyborg
  - type: IgniteOnHeatDamage
    fireStacks: 2
    threshold: 12
  # much lower temp heat damage than normal, so that terminator can be decently on fire without immediately gibbing
  - type: TemperatureDamage
    coldDamage: 
      types:
        Cold: 0.1
    heatDamage:
      types:
        Heat: 0.1
  - type: Flammable
    fireSpread: true
    canResistFire: true
    damage:
      types:
        Heat: 0.05
  - type: Thirst
  # john terminator not hungry
    baseDecayRate: 0
  - type: Hunger
    baseDecayRate: 0
  - type: RandomFootstepSound # 1/1000 steps will be a heavy clank. not very subtle.
    sound: 
      path: /Audio/Mecha/sound_mecha_powerloader_step.ogg
      params:
        volume: -6
        pitch: 0.7
        variation: 0.025

- type: entity
  parent:
  - BaseMob
  - MobCombat
  - MobDamageable
  - MobSiliconBase
  id: MobTerminatorEndoskeleton
  # you are now valid
  name: nt-800 "exterminator" endoskeleton
  description: The inner powerhouse of an infiltrator android. Ridiculously hard alloy on the inside, unassuming flesh on the outside.
  components:
  - type: HumanoidAppearance
    species: Terminator
  - type: MovementSpeedModifier
    baseWalkSpeed: 1.5
    baseSprintSpeed: 3.0
  - type: Sprite
    sprite: Mobs/Species/Terminator/parts.rsi
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        # he heavy
        density: 500
        mask:
        - MobMask
        layer:
        - MobLayer
  - type: MobThresholds
    thresholds:
      0: Alive
      # gibbed at 200 so cant go crit
      200: Dead
  # incase some weird stuff happens and the crew adopts a terminator
  - type: Repairable
    doAfterDelay: 15
    allowSelfRepair: false
  - type: Body
    prototype: TerminatorEndoskeleton
  # lets it sit in the terminator flesh's brain slot
  - type: Organ
  - type: Brain
  - type: OrganEyes # to stop welding mask permablindness
  - type: TypingIndicator
    proto: robot # beep boop borp
  - type: Speech
    speechSounds: Pai
  - type: Damageable
    damageModifierSet: Cybernetic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:PlaySoundBehavior
        # endoSKELETON
        sound: /Audio/Effects/bone_rattle.ogg
      # a keepsake or a gift for cargo
      - !type:SpawnEntitiesBehavior
        spawn:
          HeadTerminator:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  # for fire spreading around, the endoskeleton cannot burn
  - type: Flammable
    fireSpread: true
    canResistFire: true
    damage:
      types:
        Heat: 0
  # now his only weapon, but it is stronger
  - type: MeleeWeapon
    damage:
      types:
        Blunt: 15
        Structural: 10
    altDisarm: false
  - type: Puller
    needsHands: false
  - type: Tag
    tags:
    - DoorBumpOpener
    # let mind transfer on gib work
    - MindTransferTarget
  # muh self destruct once complete
  - type: AutoImplant
    implants:
    - TerminatorMicroBombImplant
  # 6x stamina, faster recovery
  - type: Stamina
    decay: 10
    cooldown: 1
    baseCritThreshold: 600
