# region base
- type: entity
  abstract: true
  parent: [ MobMovementSpeedModifierMelee, MobStaminaFodder, MobNonHumanHostileBase, MobHumanoidHostileAISimpleMelee ]
  id: BaseMobFleshExpeditions
  name: aberrant flesh
  description: A shambling mass of flesh, animated through anomalous energy.
  components:
  - type: NpcFactionMember
    factions:
    - AberrantFleshExpeditionNF
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Aliens/flesh.rsi
  - type: MobState
    allowedStates:
    - Alive
    - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      56: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      34: 0.7
      45: 0.5
  - type: Bloodstream
    bloodMaxVolume: 100
  - type: MeleeWeapon
    attackRate: 1.0
    soundHit:
      path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Blunt: 8
        Structural: 20
  - type: ReplacementAccent
    accent: genericAggressive
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcAberrantFlesh

# region melee
- type: entity
  parent: BaseMobFleshExpeditions
  id: MobFleshJaredExpeditions
  categories: [ HideSpawnMenu ]
  description: A mindless meat shield who charges threats directly. Weaker than the average human.
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: jared
  - type: DamageStateVisuals
    states:
      Alive:
        Base: jared
      Critical:
        Base: dead
      Dead:
        Base: dead
  - type: MobThresholds
    thresholds:
      0: Alive
      40: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      24: 0.7
      32: 0.5

- type: entity
  parent: MobFleshJaredExpeditions
  id: MobFleshJaredOldExpeditions
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: jared

- type: entity
  parent: BaseMobFleshExpeditions
  id: MobFleshGolemExpeditions
  categories: [ HideSpawnMenu ]
  description: A mindless brute with a heavy build. A bit more resilient than other flesh monsters, but less agile.
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem
  - type: DamageStateVisuals
    states:
      Alive:
        Base: golem
      Critical:
        Base: dead
      Dead:
        Base: dead

- type: entity
  parent: MobFleshGolemExpeditions
  id: MobFleshGolemAltExpeditions
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem2
  - type: DamageStateVisuals
    states:
      Alive:
        Base: golem2
      Critical:
        Base: dead
      Dead:
        Base: dead

- type: entity
  parent: MobFleshGolemExpeditions
  id: MobFleshGolemOldExpeditions
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem
  - type: DamageStateVisuals
    states:
      Alive:
        Base: golem
      Critical:
        Base: dead
      Dead:
        Base: dead

- type: entity
  parent: BaseMobFleshExpeditions
  id: MobFleshAssimilatedMiner
  categories: [ HideSpawnMenu ]
  description: An unfortunate miner that was infected upon contact with aberrant flesh and has been slowly assimilated.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Aliens/flesh_assimilated_miner.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: base
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: base_unshaded
      shader: unshaded
  - type: MobState
    allowedStates:
    - Alive
    - Critical
    - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      80: Critical
      110: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      48: 0.7
      64: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: base
        BaseUnshaded: base_unshaded
      Critical:
        Base: crit
        BaseUnshaded: crit_unshaded
      Dead:
        Base: dead
        BaseUnshaded: dead_unshaded

# region ranged
- type: entity
  parent: [ MobMovementSpeedModifierRanged, BaseMobFleshExpeditions, MobHumanoidHostileAISimpleRanged ]
  id: MobFleshClampExpeditions
  categories: [ HideSpawnMenu ]
  description: A flying flesh monster that can shoot spikes or toothy creatures that can latch on.
  components:
  - type: CanMoveInAir
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.30 # Lowered the value, to allow them to fit through the airlocks
        density: 100
        mask:
          - FlyingMobMask
        layer:
          - FlyingMobLayer
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/_NF/Effects/silence.ogg
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: clamp
  - type: DamageStateVisuals
    states:
      Alive:
        Base: clamp
      Critical:
        Base: dead
      Dead:
        Base: dead
  - type: MobThresholds
    thresholds:
      0: Alive
      32: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      20: 0.7
      26: 0.5
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 4
    rechargeSound:
      path: /Audio/_NF/Effects/silence.ogg
  - type: BasicEntityAmmoProvider
    proto: DartAberrantFleshHorrorSpike #DartAberrantFleshHorrorSpikeCluster
    capacity: 1
    count: 1
  - type: Gun
    showExamineText: false
    fireRate: 0.75
    minAngle: 10
    maxAngle: 20
    angleIncrease: 2
    angleDecay: 3
    selectedMode: SemiAuto
    availableModes:
      - SemiAuto
    soundGunshot:
      collection: BulletMiss

- type: entity
  parent: MobFleshClampExpeditions
  id: MobFleshClampOldExpeditions
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: clamp
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 4
    rechargeSound:
      path: /Audio/_NF/Effects/silence.ogg
  - type: BasicEntityAmmoProvider
    proto: MobMawExpeditions
    capacity: 1
    count: 1
  - type: Gun
    showExamineText: false
    fireRate: 0.5
    minAngle: 10
    maxAngle: 20
    angleIncrease: 2
    angleDecay: 3
    selectedMode: SemiAuto
    availableModes:
      - SemiAuto
    soundGunshot:
      collection: BulletMiss

# region special
- type: entity
  parent: [ MobMovementSpeedModifierSpecial, BaseMobFleshExpeditions ]
  id: MobFleshLoverExpeditions
  categories: [ HideSpawnMenu ]
  description: The Lover's light frame makes it fragile, but capable of flight.
  components:
  - type: CanMoveInAir
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.30 # Lowered the value, to allow them to fit through the airlocks
        density: 100
        mask:
          - FlyingMobMask
        layer:
          - FlyingMobLayer
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/_NF/Effects/silence.ogg
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: lover
  - type: DamageStateVisuals
    states:
      Alive:
        Base: lover
      Critical:
        Base: dead
      Dead:
        Base: dead
  - type: MobThresholds
    thresholds:
      0: Alive
      24: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      15: 0.7
      20: 0.5
  - type: MeleeWeapon
    attackRate: 1.5
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Blunt: 4

#region boss
- type: entity
  parent: [ MobHostileBossBase, BaseMobFleshExpeditions ]
  id: MobHorrorExpeditions
  categories: [ HideSpawnMenu ]
  name: aberrant flesh horror
  description: Tougher and more resilient than most aberrant flesh monsters. Has sharp, bony protrusions and highly developed musculature.
  components:
  - type: Sprite
    layers:
    - map: ["enum.DamageStateVisualLayers.Base"]
      state: horror
  - type: DamageStateVisuals
    states:
      Alive:
        Base: horror
      Dead:
        Base: dead
  - type: MobState
    allowedStates:
    - Alive
    - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      160: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      96: 0.7
      128: 0.5
  - type: MeleeWeapon
    autoAttack: true
    attackRate: 1.5
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Slash: 12
        Structural: 30
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcAberrantFlesh
  # Ghost role stuff
  - type: GhostRole
    allowMovement: true
    name: ghost-role-information-aberrant-flesh-horror-dungeon-name
    description: ghost-role-information-aberrant-flesh-horror-dungeon-description
    rules: ghost-role-information-dungeon-boss-rules
    raffle:
      settings: default
    mindRoles:
    - MindRoleGhostRoleTeamAntagonist
  - type: GhostTakeoverAvailable
  - type: ActionGun
    action: ActionBoneSpike
    gunProto: BoneSpikeGun

- type: entity
  id: BoneSpikeGun
  name: bone spike
  description: Shoots a short salvo of bone spikes.
  categories: [ HideSpawnMenu ]
  components:
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 5
    rechargeSound:
      path: /Audio/Animals/space_dragon_roar.ogg
  - type: BasicEntityAmmoProvider
    proto: DartAberrantFleshHorrorSpikeSpread #DartAberrantFleshHorrorSpike
    capacity: 2
    count: 2
  - type: Gun
    minAngle: 5
    maxAngle: 15
    fireRate: 4
    selectedMode: FullAuto
    availableModes:
      - FullAuto
    soundGunshot:
      path: /Audio/Items/bow_pull.ogg
    soundEmpty: null
    projectileSpeed: 30

- type: entity
  id: ActionBoneSpike
  parent: BaseAction
  categories: [ HideSpawnMenu ]
  name: "[color=yellow]Bone Spike[/color]"
  description: "Shoot a short salvo of bone spikes laced with toxins. [color=yellow]5 second cooldown.[/color]"
  components:
  - type: Action
    icon: { sprite : _NF/Mobs/Aliens/flesh.rsi, state: spike }
    priority: 2
    itemIconStyle: BigAction
  - type: TargetAction
    checkCanAccess: false
    range: 0
  - type: WorldTargetAction
    event: !type:ActionGunShootEvent

# region funny little guy
# embedable projectile that bites you until you either kill it or detach it or die (or it despawns)
- type: entity
  parent: [ BaseMobFleshExpeditions, NFMobTimedDespawn60 ]
  id: MobMawExpeditions
  name: aberrant flesh maw
  description: Immobile, flesh-boring creatures that are launched at victims. Latches on until killed or shaken off. Don't put your fingers in it.
  categories: [ HideSpawnMenu ]
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed: 0
    baseSprintSpeed: 0
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 3
  - type: Ammo
    muzzleFlash: null
  - type: EmbeddableProjectile
    removalTime: 1
    sound: /Audio/Effects/bite.ogg
  - type: Sprite
    layers:
    - map: ["enum.DamageStateVisualLayers.Base"]
      state: maw
  - type: DamageStateVisuals
    states:
      Alive:
        Base: maw
      Dead:
        Base: dead
  - type: MobState
    allowedStates:
    - Alive
    - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      6: Dead
  - type: MeleeWeapon
    attackRate: 0.3
    soundHit:
        path: /Audio/Effects/bite.ogg
    angle: 0
    animation: WeaponArcBite
    damage:
      types:
        Slash: 3
  - type: Butcherable
    spawned:
    - id: MaterialBiomassRandomVeryLow # 1 to 5

# region newborns
# spawned from assimilation sack
- type: entity
  abstract: true
  parent: BaseMobFleshExpeditions
  id: BaseMobFleshExpeditionsNewborn
  name: aberrant flesh newborn
  description: This newborn monster is dripping with amniotic fluid; its movements are sluggish yet deliberate; its limbs, though weak, are lethal nonetheless.
  components:
  - type: MeleeWeapon
    attackRate: 0.8
    soundHit:
      path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Blunt: 6
        Structural: 20
  - type: MovementSpeedModifier
    baseWalkSpeed : 3.8
    baseSprintSpeed : 3.8

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshJaredExpeditions ]
  id: MobFleshJaredExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: jared
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshJaredOldExpeditions ]
  id: MobFleshJaredOldExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: jared
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshGolemExpeditions ]
  id: MobFleshGolemExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshGolemAltExpeditions ]
  id: MobFleshGolemAltExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem2
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshGolemOldExpeditions ]
  id: MobFleshGolemOldExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: golem
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshClampExpeditions ]
  id: MobFleshClampExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: clamp
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshClampOldExpeditions ]
  id: MobFleshClampOldExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Mobs/Aliens/flesh.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: clamp
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"

- type: entity
  parent: [ BaseMobFleshExpeditionsNewborn, MobFleshLoverExpeditions ]
  id: MobFleshLoverExpeditionsNewborn
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: lover
      scale: 0.8,0.8
      color: "maroon"
    - sprite: _NF/Effects/wet.rsi
      state: wet
      color: "pink"
