#region base
- type: entity
  abstract: true
  parent: [ MobStaminaFodder, MobMovementSpeedModifierMelee, NFMobSimpleHostileBase, NFMobRoadkillable ]
  id: NFMobCarpBase
  suffix: "Frontier"
  components:
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcCarps
      amount: 1

#region Carps
- type: entity
  parent: [ NFMobCarpBase, MobCarp ]
  id: NFMobCarp
  categories: [ HideSpawnMenu ]
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      32: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      19: 0.7
      26: 0.5

- type: entity
  parent: [ NFMobCarpBase, MobCarpMagic ]
  id: NFMobCarpMagic
  categories: [ HideSpawnMenu ]
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      40: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      24: 0.7
      32: 0.5
  - type: Sprite
    sprite: _NF/Mobs/Aliens/Carps/magic.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: mouth
      shader: unshaded

- type: entity
  parent: [ NFMobCarpBase, MobCarpHolo ]
  id: NFMobCarpHolo
  categories: [ HideSpawnMenu ]
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      40: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      24: 0.7
      32: 0.5
  - type: Sprite
    sprite: _NF/Mobs/Aliens/Carps/holo.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: mouth
      shader: unshaded

- type: entity
  parent: [ NFMobCarpBase, MobCarpRainbow ]
  id: NFMobCarpRainbow
  categories: [ HideSpawnMenu ]
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      48: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      28: 0.7
      38: 0.5

- type: entity
  parent: [ NFMobCarpBase, MobShark ]
  id: NFMobShark
#  categories: [ HideSpawnMenu ] # No spawner
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      64: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      38: 0.7
      52: 0.5
  - type: MeleeWeapon
    damage:
      types:
        Slash: 7
        Bloodloss: 7
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcCarpsWyvern
      amount: 1

#region Snakes
- type: entity
  parent: [ NFMobCarpBase, MobPurpleSnake ]
  id: NFMobSmallRainbowSnake
  suffix: Frontier, Rainbow
  #categories: [ HideSpawnMenu ] # No spawner
  components:
  - type: NpcFactionMember
    factions:
    - SimpleHostile
  - type: MobThresholds
    thresholds:
      0: Alive
      40: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      24: 0.7
      32: 0.5
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        density: 25
        mask:
        - SmallMobMask
        layer:
        - SmallMobLayer # Allows small snakes to pass under the tables
  - type: Sprite
    drawdepth: SmallMobs
    sprite: _NF/Mobs/Aliens/snake.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: mouth
      shader: unshaded
  - type: RandomSprite
    available:
    - enum.DamageStateVisualLayers.Base:
        alive: Rainbow
      enum.DamageStateVisualLayers.BaseUnshaded:
        mouth: ""
  - type: DamageStateVisuals
    states:
      Alive:
        Base: alive
        BaseUnshaded: mouth
      Dead:
        Base: dead
        BaseUnshaded: dead_mouth
  - type: MeleeWeapon
    angle: 0
    animation: WeaponArcBite
    damage:
      types:
        Piercing: 3
        Slash: 3
        Structural: 20

#region Wyverns
- type: entity
  parent: [ MobMovementSpeedModifierRanged, NFMobCarpBase, MobCarp ]
  id: NFMobRainbowWyvernIce
  #categories: [ HideSpawnMenu ] # No spawner
  name: wyvern
  suffix: Frontier, Ice
  description: A smaller relative of a space dragon known for its hunting prowess and ability to conjure magical projectiles.
  components:
  - type: HTN
    rootTask:
      task: SimpleRangedHostileCompound
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        density: 25
        mask:
        - FlyingMobMask
        layer:
        - FlyingMobLayer
  - type: Sprite
    drawdepth: SmallMobs
    sprite: _NF/Mobs/Aliens/Carps/wyvern.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
      scale: 0.5, 0.5
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: alive-unshaded-ice
      shader: unshaded
      scale: 0.5, 0.5
  - type: RandomSprite
    available:
    - enum.DamageStateVisualLayers.Base:
        alive: Rainbow
      enum.DamageStateVisualLayers.BaseUnshaded:
        alive-unshaded-ice: ""
  - type: DamageStateVisuals
    states:
      Alive:
        Base: alive
        BaseUnshaded: alive-unshaded-ice
      Dead:
        Base: dead
        BaseUnshaded: dead-unshaded
  - type: MeleeWeapon
    angle: 0
    animation: WeaponArcThrust
    damage:
      types:
        Piercing: 4
        Slash: 4
        Structural: 20
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 1.5
    rechargeSound:
      path: /Audio/_NF/Effects/silence.ogg
  - type: BasicEntityAmmoProvider
    proto: ProjectileIcicleLowDamage
    capacity: 1
    count: 1
  - type: Gun
    showExamineText: false
    fireRate: 0.5
    minAngle: 10
    maxAngle: 20
    angleIncrease: 2
    angleDecay: 3
    selectedMode: SemiAuto
    availableModes:
    - SemiAuto
    soundGunshot: /Audio/Weapons/Xeno/alien_spitacid.ogg
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcCarpsWyvern
      amount: 1

- type: entity
  parent: NFMobRainbowWyvernIce
  id: NFMobRainbowWyvernFire
  #categories: [ HideSpawnMenu ] # No spawner
  suffix: Frontier, Fire
  components:
  - type: Sprite
    drawdepth: SmallMobs
    sprite: _NF/Mobs/Aliens/Carps/wyvern.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
      scale: 0.5, 0.5
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: alive-unshaded-fire
      shader: unshaded
      scale: 0.5, 0.5
  - type: RandomSprite
    available:
    - enum.DamageStateVisualLayers.Base:
        alive: Rainbow
      enum.DamageStateVisualLayers.BaseUnshaded:
        alive-unshaded-fire: ""
  - type: DamageStateVisuals
    states:
      Alive:
        Base: alive
        BaseUnshaded: alive-unshaded-fire
      Dead:
        Base: dead
        BaseUnshaded: dead-unshaded
  - type: BasicEntityAmmoProvider
    proto: NFBulletMagicFireBoltMob
    capacity: 1
    count: 1

- type: entity
  parent: NFMobRainbowWyvernIce
  id: NFMobRainbowWyvernCaustic
  #categories: [ HideSpawnMenu ] # No spawner
  suffix: Frontier, Caustic
  components:
  - type: Sprite
    drawdepth: SmallMobs
    sprite: _NF/Mobs/Aliens/Carps/wyvern.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
      scale: 0.5, 0.5
    - map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
      state: alive-unshaded-caustic
      shader: unshaded
      scale: 0.5, 0.5
  - type: RandomSprite
    available:
    - enum.DamageStateVisualLayers.Base:
        alive: Rainbow
      enum.DamageStateVisualLayers.BaseUnshaded:
        alive-unshaded-caustic: ""
  - type: DamageStateVisuals
    states:
      Alive:
        Base: alive
        BaseUnshaded: alive-unshaded-caustic
      Dead:
        Base: dead
        BaseUnshaded: dead-unshaded
  - type: BasicEntityAmmoProvider
    proto: NFBulletAcid
    capacity: 1
    count: 1

#region boss
- type: entity
  parent: [ MobHostileBossBase, NFMobSimpleHostileBase, MobDragonDungeon ]
  id: NFMobDragonDungeon
  suffix: Frontier, Dungeon
  components:
  - type: GhostRole
    description: ghost-role-information-space-dragon-dungeon-description
    rules: ghost-role-information-dungeon-boss-rules
    raffle:
      settings: default
  - type: SlowOnDamage
    speedModifierThresholds:
      100: 0.7
  - type: MobThresholds
    thresholds:
      0: Alive
      250: Dead
  # half damage, spread evenly
  - type: MeleeWeapon
    damage:
      groups:
        Brute: 15
  - type: ActionGun
    action: ActionDragonsBreath
    gunProto: DragonsBreathGun
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcCarpsDragon
      amount: 1
