# spawn animation, spawns actual narsie when it ends
- type: entity
  id: MobHellspawnBossSpawn
  suffix: Spawn
  components:
  - type: Sprite
    noRot: true
    sprite: Mobs/Demons/hellspawn.rsi
    layers:
    - state: spawn
    - state: spawn_unshaded
      shader: unshaded
    drawdepth: Ghosts
  - type: Transform
    anchored: true
  - type: Physics
    bodyType: Static
    canCollide: false
  - type: TimedDespawn
    lifetime: 3.2
  - type: SpawnOnDespawn
    prototype: MobHellspawnBoss
  - type: AmbientSound
    range: 13
    volume: 15
    sound:
      path: /Audio/Animals/space_dragon_roar.ogg
  - type: PointLight
    radius: 1.6
    energy: 4.5
    color: "#ff4242"
    castShadows: false
  - type: TriggerOnSpawn
  - type: TimerTrigger
    delay: 1
  - type: ExplodeOnTrigger
    keysIn: [timer]
  - type: Explosive
    explosionType: JustStructuralCharge
    totalIntensity: 125
    intensitySlope: 5
    maxIntensity: 75
    deleteAfterExplosion: false
    canCreateVacuum: false

- type: entity
  parent: MobHellspawn
  id: MobHellspawnBoss
  # categories: [ HideSpawnMenu ]
  suffix: Boss
  components:
  - type: Damageable
    damageContainer: BiologicalMetaphysical
    damageModifierSet: HellSpawnBoss
  - type: ExplosionResistance
    damageCoefficient: 0.25
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.9
        density: 300
        mask:
        - FlyingMobMask
        layer:
        - FlyingMobLayer
  - type: HTN
    rootTask:
      task: SimpleHostileCompound
    blackboard:
      VisionRadius: !type:Single
        20
      AggroVisionRadius: !type:Single
        20
      MeleeRange: !type:Single
        2
      FollowRange: !type:Single
        10
  - type: MobThresholds
    thresholds:
      0: Alive
      750: Dead
  - type: Stamina
    baseCritThreshold: 450
    stunTime: 2
  - type: AmbientSound
    sound: /Audio/Ambience/ambiodd.ogg
    range: 15
  # Abilities start
  - type: NPCUseActionWhenTargetInRange
    actions:
    - actionId: ActionFireStarter
      minRange: 0
      maxRange: 4
    - actionId: ActionHellSpawnRush
      minRange: 3
      maxRange: 0
    - actionId: ActionHellSpawnTentacleRight
      minRange: 1.5
      maxRange: 4
    - actionId: ActionHellSpawnTentacleLeft
      minRange: 4
      maxRange: 6.5
  - type: HellSpawnRush
    blacklist:
      tags:
      - Hellspawn
      - GlassBeaker
      - DrinkBottle
      - DrinkCan
  - type: HellSpawnInvincibility
  - type: HellSpawn
  - type: HellSpawnTentacle
  - type: HellSpawnSpiral
  - type: MeleeWeapon
    attackRate: 0.6
    hidden: true
    soundHit:
      path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    bluntStaminaDamageFactor: 1.2
    damage:
      types:
        Blunt: 40
        Slash: 10
        Structural: 50
  - type: MeleeThrowOnHit
    distance: 2
    speed: 12
  # Abilities end
  - type: Butcherable
    spawned:
    - id: ClothingUniformJumpsuitGalaxyBlue
      prob: 0.5
    - id: ClothingUniformJumpsuitGalaxyRed
      prob: 0.5
    - id: PKAUpgradeDamage
      prob: 0.25
    - id: PKAUpgradeFireRate
      prob: 0.25
    - id: PKAUpgradeRange
      prob: 0.25
    - id: PowerCellAntiqueProto
      prob: 0.2
    - id: ArtifactFragment
      amount: 3
    - id: ComplexXenoArtifactItem
      prob: 0.5
    - id: MedipenCombatInjector
      prob: 0.2
    - id: LeftArmCyberGorillaUpgraded
      prob: 0.15
    - id: CultPylon
      prob: 0.1
    - id: ReaperCultPylon
      prob: 0.1
    - id: NarbeeCultPylon
      prob: 0.1
    - id: NarsieCultPylon
      prob: 0.1
    # Meme
    - id: ClothingNeckGoldmedal
      prob: 0.5
    - id: BibleNarsie
      prob: 0.4
    - id: MobGoliath
      prob: 0.2
    - id: MobBasilisk
      prob: 0.2
    - id: SoulShardGhost
      prob: 0.15
    - id: MobSkeletonPirate
      prob: 0.1
    - id: SpawnPointGhostParadoxClone
      prob: 0.1
    - id: SpawnPointGhostParadoxClone
      prob: 0.1
    - id: SpawnPointGhostParadoxClone
      prob: 0.1
    - id: ResearchDiskDebug
      prob: 0.05
    - id: ClothingHeadHatUshanka
      prob: 0.2
    - id: PFigurineChaminaM
      prob: 0.01
    - id: PFigurinePirateJugger
      prob: 0.01
    # Armors
    - id: ClothingOuterHardsuitSalvage
      prob: 0.25
    - id: ClothingOuterHardsuitGoliath
      prob: 0.2
    - id: ClothingOuterHardsuitMaxim
      prob: 0.15
    - id: ClothingOuterSoftsuitCBURN
      prob: 0.1
    # Weapons
    - id: WeaponLaserGun
      prob: 0.05
    - id: WeaponSubMachineGunPPSH
      prob: 0.05
    - id: WeaponSniperDragunov
      prob: 0.05
    - id: WeaponLightMachineGunDP28
      prob: 0.05
    - id: Musket
      prob: 0.05
    - id: WeaponRevolverPirate
      prob: 0.05
    - id: WeaponPistolFlintlock
      prob: 0.05
    - id: WeaponShotgunGA12
      prob: 0.05
    - id: WeaponPistolM1984
      prob: 0.05
    - id: ClothingHandsPowerGlovesNoUplink
      prob: 0.05
    - id: WeaponMeleeMoltenCollider
      prob: 0.05
    - id: WeaponMeleeMoltenAmputator
      prob: 0.05
    - id: WeaponShotgunCycler
      prob: 0.05
    - id: HyperEutacticBlade
      prob: 0.05
    # Boss lunch
    - id: MaterialGoliathHide1
      prob: 0.25
    - id: MaterialGoliathHide1
      prob: 0.2
    - id: MaterialGoliathHide1
      prob: 0.15
    - id: FoodMeatGoliath
      prob: 0.15
    - id: FoodMeatGoliath
      prob: 0.1
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageGroupTrigger # Sunrise-Edit
        damageGroup: Brute # Sunrise-Edit
        damage: 1500
      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
  - type: PressureImmunity
  - type: Tag
    tags:
    - Hellspawn
    - CannotSuicide
    - DoorBumpOpener
    - FootstepSound

- type: entity
  parent: AltarFangs
  id: ComputerBossTravel
  name: boss battle altar
  placement:
    mode: SnapgridCenter
  components:
  - type: UserInterface
    interfaces:
      enum.HellSpawnArenaUiKey.Key:
        type: HellSpawnArenaConsoleBoundUserInterface
  - type: ActivatableUI
    key: enum.HellSpawnArenaUiKey.Key
  - type: HellSpawnConsole
  - type: Godmode
  - type: BlockedTool

- type: entity
  name: boss battle altar spawner
  id: SpawnComputerBossTravel
  parent: MarkerBase
  components:
  - type: Sprite
    layers:
    - state: green
    - sprite: Structures/Furniture/Altars/Cults/fangs.rsi
      state: full
  - type: ConditionalSpawner
    prototypes:
    - ComputerBossTravel

- type: entity
  id: HellSpawnCultist
  parent: MobHuman
  # categories: [ HideSpawnMenu ]
  components:
  - type: NpcFactionMember
    factions:
    - Syndicate
  - type: Loadout
    prototypes:
    - CultLeaderGear
  - type: RandomHumanoidAppearance
    randomizeName: true
  - type: HellSpawnCultist
  - type: MobThresholds
    thresholds:
      0: Alive
      50: Dead
  - type: PassiveDamage
    allowedStates:
    - Alive
    damageCap: 50
    damage:
      types:
        Blunt: 3.75
  - type: AmbientSound
    range: 13
    volume: -5
    sound:
      path: /Audio/_Sunrise/BloodCult/narsie_summoned.ogg

- type: entity
  id: HellSpawnCultistDummy
  parent: MobHuman
  # categories: [ HideSpawnMenu ]
  components:
  - type: NpcFactionMember
    factions:
    - Syndicate
  - type: Loadout
    prototypes:
    - CultistGear
  - type: RandomHumanoidAppearance
    randomizeName: true
  - type: TimedDespawn
    lifetime: 15
  - type: SpawnOnDespawn
    prototype: CultTeleportOutEffect
  - type: AmbientSound
    range: 6
    volume: 2
    sound:
      path: /Audio/_Sunrise/BloodCult/enter_blood.ogg
  - type: MobThresholds
    thresholds:
      0: Alive
      75: Dead
  - type: PointLight
    radius: 1
    energy: 2
    color: "#ff4242"
    castShadows: false
  - type: ExplosionResistance
    damageCoefficient: 0.3
  - type: Vocalizer
    minVocalizeInterval: 3s
    maxVocalizeInterval: 6s
    hideChat: true
  - type: DatasetVocalizer
    dataset: NarSieAds

- type: entity
  parent: BaseBulletIncendiary
  id: BulletSkyFlare
  name: sky flare
  suffix: Boss
  components:
  - type: Sprite
    sprite: _Sunrise/Objects/Weapons/Projectiles/sky_flare.rsi
    layers:
    - state: SkyFlare
      shader: unshaded
  - type: Fixtures
    fixtures:
      projectile:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        hard: false
        mask:
        - Impassable
        - BulletImpassable
      fly-by: &flybyfixture
        shape: !type:PhysShapeCircle
          radius: 1.5
        layer:
        - Impassable
        - MidImpassable
        - HighImpassable
        - LowImpassable
        hard: False
  - type: Projectile
    deleteOnCollide: true
    damage:
      types:
        Heat: 15
        Blunt: 5
  - type: IgniteOnCollide
    fireStacks: 1
    count: 10
  - type: SpiralMovement
    radiusCoefficient: 0.3
    omegaCoefficient: 1
  - type: TimedDespawn
    lifetime: 3
