- type: entity
  id: NFMobAtmos
  abstract: true
  components:
  - type: Temperature
    heatDamageThreshold: 2000 # Should prevent mobs from taking damage on planets with extreme heat
    coldDamageThreshold: -250 # Should make mobs immune to cold planets
    currentTemperature: 310.15
    coldDamage: #per second, scales with temperature & other constants
      types:
        Cold: 0.1
    specificHeat: 42
    heatDamage: #per second, scales with temperature & other constants
      types:
        Heat: 1.5
  - type: ThermalRegulator
    metabolismHeat: 800
    radiatedHeat: 100
    implicitHeatRegulation: 500
    sweatHeatRegulation: 2000
    shiveringHeatRegulation: 2000
    normalBodyTemperature: 310.15
    thermalRegulationTemperatureThreshold: 2
  - type: MovedByPressure
  - type: Insulated

- type: entity
  id: MobLaserReflect
  abstract: true
  components:
  - type: Reflect
    reflectProb: 0.8
    reflects:
      - Energy

# region Regeneration
- type: entity
  id: MobPassiveRegenWeak
  abstract: true
  components:
  - type: PassiveDamage
    allowedStates:
    - Alive
    damageCap: 500
    damage:
      groups:
        Brute: -0.5
        Burn: -0.5
        Airloss: -1

- type: entity
  id: MobPassiveRegen
  abstract: true
  components:
  - type: PassiveDamage
    allowedStates:
    - Alive
    - Critical
    damageCap: 500
    damage:
      groups:
        Brute: -0.5
        Burn: -0.5
        Airloss: -1

- type: entity
  id: MobPassiveRegenStrong
  abstract: true
  components:
  - type: PassiveDamage
    allowedStates:
    - Alive
    - Critical
    - Dead
    damageCap: 9999
    damage:
      groups:
        Brute: -0.5
        Burn: -0.5
        Airloss: -1
#endregion

#region Restrictions

# A base restriction set.
# Should be applied on any mob base with MobEnhancedMovement,
# or on upstream definitions.
# This should not be used on non-abstract Frontier mobs.
- type: entity
  abstract: true
  id: NFBaseMobRestrictions
  components:
  - type: NFSalvageMobRestrictions
    addComponentsOnDeath:
    - type: Unrevivable
    - type: Strippable
    - type: UserInterface
      interfaces:
        enum.StrippingUiKey.Key:
         type: StrippableBoundUserInterface
    removeComponentsOnDeath:
    - type: Insulated
    - type: Reflect
    - type: MovementIgnoreGravity
    - type: Tool
    - type: Prying
    - type: CanMoveInAir
    - type: Tag
    - type: Access
    - type: Timer
    - type: TimedSpawner
    - type: Jittering

# Restriction modifiers.
# Will be applied on top of NFBaseMobRestrictions.
- type: entity
  abstract: true
  id: NFMobBossRestrictions
  components:
  - type: NFSalvageMobRestrictions
    addComponentsLeaveGrid:
    - type: TimedDespawn
      lifetime: 240
    - type: PassiveDamage
      allowedStates:
      - Alive
      damage:
        types:
          Cellular: 0.4
    - type: Pacified
    removeComponentsReturnGrid:
    - type: TimedDespawn
    - type: PassiveDamage
    - type: Pacified

- type: entity
  abstract: true
  id: NFMobRestrictionsSilicon
  components:
  - type: NFSalvageMobRestrictions
    addComponentsOnDeath:
    - type: Strippable
    - type: UserInterface
      interfaces:
        enum.StrippingUiKey.Key:
         type: StrippableBoundUserInterface
    removeComponentsOnDeath:
#    - type: Pullable # TODO: This makes the mob stuck to your hand if it dies when you pull it
    - type: Carriable # Carrying system from nyanotrasen.
    - type: Tool
    - type: Prying
    - type: MovementIgnoreGravity
    - type: Access
    addComponentsOnRevival:
#    - type: Pullable # TODO: This makes the mob stuck to your hand if it dies when you pull it
    - type: Carriable # Carrying system from nyanotrasen.
    - type: Tool
      speedModifier: 1.5
      qualities:
        - Prying
    - type: Prying # Open door from xeno.yml.
      pryPowered: true
      force: true
      speedModifier: 1.5
      useSound:
        path: /Audio/Items/crowbar.ogg
    - type: MovementIgnoreGravity
    removeComponentsOnRevival:
    - type: Strippable
    - type: UserInterface
#endregion

#region Despawn timers
- type: entity
  abstract: true
  id: NFMobTimedDespawn30
  components:
  - type: TimedDespawn
    lifetime: 30

- type: entity
  abstract: true
  id: NFMobTimedDespawn60
  components:
  - type: TimedDespawn
    lifetime: 60

- type: entity
  abstract: true
  id: NFMobTimedDespawn80
  components:
  - type: TimedDespawn
    lifetime: 80

- type: entity
  abstract: true
  id: NFMobTimedDespawn120
  components:
  - type: TimedDespawn
    lifetime: 120

- type: entity
  abstract: true
  id: NFMobTimedDespawn180
  components:
  - type: TimedDespawn
    lifetime: 180

- type: entity
  abstract: true
  id: NFMobTimedDespawn1200
  components:
  - type: TimedDespawn
    lifetime: 1200

- type: entity
  abstract: true
  id: NFMobTimedDespawn1800
  components:
  - type: TimedDespawn
    lifetime: 1800

- type: entity
  abstract: true
  id: NFMobTimedDespawn3000
  components:
  - type: TimedDespawn
    lifetime: 3000
#endregion

#region Movement
- type: entity
  id: MobEnhancedMovement
  abstract: true
  components:
  - type: MovementAlwaysTouching
  - type: MovementIgnoreGravity
  - type: NoSlip
  - type: ProtectedFromStepTriggers
  - type: Climbing
  - type: Tool
    speedModifier: 1.5
    qualities:
      - Prying
    hideQualities: true
  - type: Prying
    pryPowered: true
    force: true
    speedModifier: 1.5
    useSound:
      path: /Audio/Items/crowbar.ogg
  - type: Access
    groups:
    - AllAccess

- type: entity # For reference 4.5 is the speed of unencumbered humans
  id: MobMovementSpeedModifierMelee
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 4.2 # ~10% slowdown
    baseSprintSpeed : 4.2 # ~10% slowdown

- type: entity
  id: MobMovementSpeedModifierEVAMelee
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 3.8 # ~15% slowdown
    baseSprintSpeed : 3.8 # ~15% slowdown

- type: entity
  id: MobMovementSpeedModifierRanged
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 3.5
    baseSprintSpeed : 3.5

- type: entity
  id: MobMovementSpeedModifierEVARanged
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 3 # ~15% slowdown
    baseSprintSpeed : 3 # ~15% slowdown

- type: entity
  id: MobMovementSpeedModifierSpecial
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 5
    baseSprintSpeed : 5

- type: entity
  id: MobMovementSpeedModifierBoss
  abstract: true
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed : 4.5
    baseSprintSpeed : 4.5
#endregion

#region Stamina
- type: entity
  id: MobStaminaFodder
  abstract: true
  components:
  - type: MobThrowableOnHit
  - type: Stamina
    critThreshold: 80

- type: entity
  id: MobStaminaSpecial
  abstract: true
  components:
  - type: MobThrowableOnHit
  - type: Stamina
    critThreshold: 200

- type: entity
  id: MobStaminaBoss
  abstract: true
  components:
  - type: Stamina
    critThreshold: 500
#endregion

#region Dungeon boss
- type: entity
  id: MobHostileBossBase
  abstract: true
  parent:
  - MobEnhancedMovement
  - MobStaminaBoss
  - MobMovementSpeedModifierBoss
  - MobPassiveRegenWeak
  - NFBaseMobRestrictions
  - NFMobBossRestrictions
  components:
  - type: Hands
  - type: Puller
  - type: Stamina
    critThreshold: 999
  - type: Tag
    tags:
    - CanPilot
    - FootstepSound
    - DoorBumpOpener
    - CannotSuicide
  - type: FTLKnockdownImmune
#endregion

#region Inventories
- type: entity # All slots are fillable, most of them are "hidden"
  id: MobHumanoidInvetory
  abstract: true
  components:
  - type: Inventory
    templateId: hostilehumanoid # Supports loadouts
  - type: InventorySlots

- type: entity # Slots for loot containers: pockets, belt, back
  id: MobHumanoidInvetorySimplified
  abstract: true
  components:
  - type: Inventory
    templateId: hostilehumanoidsimplified # Does not support loadouts
  - type: InventorySlots
#endregion

#region AI packages
- type: entity
  id: MobHumanoidHostileAISimpleMelee
  abstract: true
  components:
  - type: HTN
    rootTask:
       task: SimpleHostileCompound
    blackboard:
      NavClimb: !type:Bool
        false
      NavInteract: !type:Bool
        true
      NavPry: !type:Bool
        true
      NavSmash: !type:Bool # They use this option too much for my liking, but I'll keep it here as an option
        true

- type: entity
  id: MobHumanoidHostileAISimpleRanged
  abstract: true
  components:
  - type: HTN
    rootTask:
       task: SimpleRangedHostileCompound
    blackboard:
      NavClimb: !type:Bool
        false
      NavInteract: !type:Bool
        true
      NavPry: !type:Bool
        true
      NavSmash: !type:Bool # They use this option too much for my liking, but I'll keep it here as an option
        true

- type: entity
  id: MobHumanoidHostileAIComplex
  abstract: true
  components:
  - type: HTN
    rootTask:
       task: SimpleHumanoidHostileCompound
    blackboard:
      NavClimb: !type:Bool
        false
      NavInteract: !type:Bool
        true
      NavPry: !type:Bool
        true
#      NavSmash: !type:Bool # They use this option too much for my liking, but I'll keep it here as an option
#        true
#endregion

#region NPC types
# Human NPC, uses equipment, immune to vacuum/low pressure
- type: entity
  save: false
  suffix: AI, Hostile
  abstract: true
  parent:
  - NFMobAtmos
  - MobMovementSpeedModifierMelee
  - MobStaminaFodder
  - MobBloodstream
  - MobFlammable
  - MobEnhancedMovement
  - BaseMobSpecies
  - MobHumanoidHostileAIComplex
  - BaseC3MobHuman
  - NFBaseMobRestrictions
  id: MobHumanoidHostileBase
  components:
  - type: NPCRetaliation
    attackMemoryLength: 10
  - type: MobMover
  - type: StandingState
  - type: RandomHumanoidAppearance
    randomizeName: true
  - type: MobThresholds
    thresholds:
      0: Alive
      80: Critical
      120: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      40: 0.7
      60: 0.5
  - type: Blindable
  - type: Butcherable
    butcheringType: Spike
    spawned:
    - id: FoodMeatRotten
      amount: 2
  - type: NpcFactionMember
    factions:
    - SimpleHostile
  - type: Carriable # Carrying system from nyanotrasen.
  - type: Vocalizer
    hideChat: true
    minVocalizeInterval: 120
    maxVocalizeInterval: 240
  - type: DatasetVocalizer
    dataset: syndicatehumanoidchatter
  - type: FTLKnockdownImmune
  - type: Respirator
    updateInterval: 99999 # Shouldn't run often, if ever.
    suffocationThreshold: -100 # Should never happen.
    damage:
      types: {}
    damageRecovery:
      types: {}

# NonHuman NPC base, no equipment, immune to vacuum/low pressure
- type: entity
  save: false
  suffix: AI, Hostile
  abstract: true
  parent:
  - BaseMob
  - MobMovementSpeedModifierMelee
  - MobStaminaFodder
  - MobDamageable
  - MobCombat
  - NFMobAtmos
  - MobBloodstream
  - MobFlammable
  - MobEnhancedMovement
  - MobHumanoidHostileAIComplex
  - BaseC3MobCreature
  - NFBaseMobRestrictions
  id: MobNonHumanHostileBase
  components:
  - type: NPCRetaliation
    attackMemoryLength: 10
  - type: Reactive
    groups:
      Flammable: [Touch]
      Extinguish: [Touch]
      Acidic: [Touch, Ingestion]
  - type: StatusEffects
    allowed:
    - SlowedDown
    - Stutter
    - Electrocution
    - ForcedSleep
    - TemporaryBlindness
    - Pacified
    - Drowsiness
    - Adrenaline
  - type: Buckle
  - type: StandingState
  - type: InputMover
  - type: MobMover
  - type: ZombieImmune
  - type: Hands
  - type: Puller
  - type: NameIdentifier
    group: GenericNumber
  - type: SlowOnDamage
    speedModifierThresholds:
      30: 0.7
      50: 0.5
  - type: MobState
    allowedStates:
    - Alive
    - Critical
    - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      65: Critical
      100: Dead
  - type: NpcFactionMember
    factions:
    - SimpleHostile
  - type: Carriable # Carrying system from nyanotrasen.
  - type: Tag
    tags:
    - CanPilot
    - FootstepSound
    - DoorBumpOpener
    - CannotSuicide
  - type: FTLKnockdownImmune

# A simpler base for extending existing mobs (e.g. carp, kangaroos, snakes, xenos)
- type: entity
  save: false
  suffix: Frontier, Hostile
  abstract: true
  parent:
  - MobFlammable
  - MobMovementSpeedModifierMelee
  - MobStaminaFodder
  - MobEnhancedMovement
  - MobHumanoidHostileAISimpleMelee
  - BaseC3MobCreature
  - NFBaseMobRestrictions
  id: NFMobSimpleHostileBase
  components:
  - type: NPCRetaliation
    attackMemoryLength: 10
  - type: Reactive
    groups:
      Flammable: [Touch]
      Extinguish: [Touch]
      Acidic: [Touch, Ingestion]
  - type: StatusEffects
    allowed:
    - SlowedDown
    - Stutter
    - Electrocution
    - ForcedSleep
    - TemporaryBlindness
    - Pacified
    - Drowsiness
    - Adrenaline
  - type: ZombieImmune
  - type: NameIdentifier
    group: GenericNumber
  - type: NpcFactionMember
    factions:
    - SimpleHostile
  - type: Carriable # Kept for consistency with other mobs
  - type: FTLKnockdownImmune
#endregion

#region Roadkill
# Parent for consistent roadkill settings
- type: entity
  abstract: true
  id: NFMobRoadkillable
  components:
  - type: Roadkill
    killSpeed: 25
    destroySpeed: 40 # yeehaw
    destroySound:
      collection: gib
#endregion

#region Gibb
- type: entity
  abstract: true
  id: NFMobNoEquipmentOnGib
  components:
  - type: TriggerOnBeingGibbed
  - type: GibOnTrigger
    deleteItems: true
    deleteOrgans: true
    gib: false
    useArgumentEntity: true
