# The literal bare minimum needed to be a controllable mob. Cannot move but can interact.
- type: entity
  abstract: true
  save: false
  id: BaseControllable
  components:
  - type: Sprite
    noRot: true
    drawdepth: Mobs
  - type: GravityAffected
  - type: Physics
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        density: 50
        mask:
        - MobMask
        layer:
        - MobLayer
  - type: Clickable
  - type: InteractionOutline
  - type: Input
    context: "human"
  - type: Actions
  - type: Alerts
  - type: Appearance
  - type: RotationVisuals
    defaultRotation: 0
    horizontalRotation: 0
  - type: DoAfter
  - type: Examiner
  - type: Eye
  - type: ContentEye
  - type: CameraRecoil
  - type: MindContainer
  - type: RequireProjectileTarget
    active: False

# The progenitor. This should only container the most basic components possible.
# Only put things on here if every mob *must* have it. This includes ghosts.
- type: entity
  abstract: true
  save: false
  parent: BaseControllable
  id: BaseMob
  components:
  - type: MobCollision
  - type: Physics
    bodyType: KinematicController
  - type: InputMover
  - type: MobMover
  - type: MovementSpeedModifier
  - type: LagCompensation

- type: entity
  save: false
  id: MobPolymorphable
  abstract: true
  components:
  - type: Polymorphable

# Used for mobs that have health and can take damage.
- type: entity
  save: false
  id: MobDamageable
  abstract: true
  components:
  - type: Damageable
    damageContainer: Biological
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTypeTrigger
        damageType: Blunt
        damage: 400
      behaviors:
      - !type:GibBehavior { }
    - trigger:
        !type:DamageTypeTrigger
        damageType: Heat
        damage: 1500
      behaviors:
      - !type:SpawnEntitiesBehavior
        spawnInContainer: true
        spawn:
          Ash:
            min: 1
            max: 1
      - !type:BurnBodyBehavior
      - !type:PlaySoundBehavior
        sound:
          collection: MeatLaserImpact
    - trigger:
        !type:DamageTypeTrigger
        damageType: Radiation
        damage: 15
      behaviors:
      - !type:PopupBehavior
        popup: mouth-taste-metal
        popupType: LargeCaution
        targetOnly: true
    - trigger:
        !type:DamageTypeTrigger
        damageType: Radiation
        damage: 40
      behaviors:
      - !type:VomitBehavior
  - type: RadiationReceiver
  - type: Stamina
  - type: StunVisuals
  - type: MobState
  - type: MobThresholds
    thresholds:
      0: Alive
      100: Critical
      200: Dead
  - type: MobStateActions
    actions:
      Critical:
      - ActionCritSuccumb
      - ActionCritFakeDeath
      - ActionCritLastWords
  - type: StoreDamageTakenOnMind
  - type: Deathgasp
  - type: HealthExaminable
    examinableTypes:
    - Blunt
    - Slash
    - Piercing
    - Heat
    - Shock
    - Cold
    - Caustic
    - Asphyxiation
    - Radiation
  - type: DamageOnHighSpeedImpact
    damage:
      types:
        Blunt: 5
    soundHit:
      path: /Audio/Effects/hit_kick.ogg
  - type: Pullable
  - type: LightningTarget
    priority: 2
    lightningExplode: false
  - type: GhostOnMove
    mustBeDead: true

# Used for mobs that can enter combat mode and can attack.
- type: entity
  save: false
  id: MobCombat
  abstract: true
  components:
  - type: CombatMode
  - type: MeleeWeapon
    hidden: true
    soundHit:
      collection: MetalThud
    damage:
      types:
        Blunt: 5

# Used for mobs that are affected by atmospherics, pressure, and heat
- type: entity
  save: false
  id: MobAtmosExposed
  abstract: true
  components:
  - type: AtmosExposed
  - type: Temperature
    currentTemperature: 310.15
    specificHeat: 42
  - type: TemperatureDamage
    heatDamageThreshold: 325
    coldDamageThreshold: 0
    coldDamage: #per second, scales with temperature & other constants
      types:
        Cold : 0.1
    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

# Used for mobs that require regular atmospheric conditions.
- type: entity
  parent: MobAtmosExposed
  id: MobAtmosStandard
  abstract: true
  components:
  - type: ThermalRegulator
    metabolismHeat: 800
    radiatedHeat: 100
    implicitHeatRegulation: 250
    sweatHeatRegulation: 500
    shiveringHeatRegulation: 500
    normalBodyTemperature: 310.15
    thermalRegulationTemperatureThreshold: 2
  - type: Temperature
    currentTemperature: 310.15
    specificHeat: 42
  - type: TemperatureDamage
    heatDamageThreshold: 325
    coldDamageThreshold: 260
    coldDamage:
      types:
        Cold: 1 #per second, scales with temperature & other constants
    heatDamage:
      types:
        Heat: 1.5 #per second, scales with temperature & other constants
  - type: Barotrauma
    damage:
      types:
        Blunt: 0.15 #per second, scales with pressure and other constants.

# Used for mobs that can be set on fire
- type: entity
  save: false
  id: MobFlammable
  abstract: true
  components:
  - type: Flammable
    fireSpread: true
    canResistFire: true
    damage: #per second, scales with number of fire 'stacks'
      types:
        Heat: 1.5
  - type: FireVisuals
    sprite: Mobs/Effects/onfire.rsi
    normalState: Generic_mob_burning

# Used for mobs that need to breathe
- type: entity
  save: false
  id: MobRespirator
  abstract: true
  components:
  - type: Internals
  - type: Respirator
    damage:
      types:
        Asphyxiation: 2
    damageRecovery:
      types:
        Asphyxiation: -1.0

# Used for mobs that have a bloodstream
- type: entity
  save: false
  id: MobBloodstream
  abstract: true
  components:
  - type: SolutionContainerManager
  - type: InjectableSolution
    solution: bloodstream
  - type: Bloodstream
    bloodlossDamage:
      types:
        Bloodloss: 0.5
    bloodlossHealDamage:
      types:
        Bloodloss: -1
