# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Rinary <72972221+Rinary1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: PolymorphAshJauntAnimation
  name: Unknown
  description: You can't figure out what that is.
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - sprite: _Goobstation/Heretic/polymorphs.rsi
      state: ash_jaunt
      drawdepth: WallMountedItems
      loop: false
  - type: TimedDespawn
    lifetime: 1

- type: entity
  id: PolymorphAshJauntEndAnimation
  name: Unknown
  description: You can't figure out what that is.
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    layers:
    - sprite: _Goobstation/Heretic/polymorphs.rsi
      state: ash_jaunt_end
      drawdepth: WallMountedItems
      loop: false
  - type: TimedDespawn
    lifetime: 1

- type: entity
  id: PolymorphAshJaunt
  name: Unknown
  description: You can't figure out what that is.
  parent: BaseMobJaunt
  categories: [ HideSpawnMenu ]
  components:
  - type: MovementSpeedModifier
    baseWalkSpeed: 3
    baseSprintSpeed: 3

# heretic ascend flesh form
- type: entity
  parent: [ SimpleSpaceMobBase, FlyingMobBase ]
  id: MobHereticFleshAscend
  name: eldritch horror
  description: An incomprehensible mess of limbs and eyes. You can feel it's stare into your soul.
  suffix: DO NOT MAP
  categories: [ DoNotMap ]
  components:
  - type: Bloodstream
    bloodMaxVolume: 1984
    bleedReductionAmount: 5
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTypeTrigger
        damageType: Blunt
        damage: 3000 # no gibbing at 400
      behaviors:
      - !type:GibBehavior
  - type: NpcFactionMember
    factions:
    - Heretic
  - type: CombatMode
  - type: MovementSpeedModifier
    baseWalkSpeed: 5
    baseSprintSpeed: 7.5
    weightlessModifier: 1.5
  - type: Sprite
    drawdepth: Mobs
    sprite: _Goobstation/Heretic/eldritch_horror.rsi
    noRot: true
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: alive
  - type: DamageStateVisuals
    states:
      Alive:
        Base: alive
      Dead:
        Base: dead
  - type: Clickable
  - type: InteractionOutline
  - type: Physics
    bodyType: KinematicController
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.40
        density: 100
        mask:
        - FlyingMobMask
        layer:
        - FlyingMobLayer
  - type: MobState
    allowedStates:
      - Alive
      - Dead
  - type: MobThresholds
    thresholds:
      0: Alive
      1500: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      0: 1.0 # it's an unstoppable flesh abomination
  - type: Damageable
    damageContainer: Biological
  - type: StatusEffects
    allowed:
    - RadiationProtection
  - type: MeleeWeapon
    hidden: false
    altDisarm: false
    autoAttack: true
    attackRate: 3
    damage:
      types:
       Blunt: 20
       Structural: 60
    soundHit:
      collection: Punch
    animation: WeaponArcFist
  - type: Devourer
    foodPreferenceWhitelist:
      components:
      - HumanoidAppearance
    stomachStorageWhitelist:
      components:
      - MobState
    chemical: Ichor
    healRate: 50.0
    whitelist:
      components:
      - MobState
      - Door
      tags:
      - Wall
  - type: Metabolizer
    solutionOnBody: false
    updateInterval: 0.25
    metabolizerTypes: [ Dragon ]
    groups:
    - id: Medicine
    - id: Poison
  - type: Butcherable
    spawned:
    - id: RandomAnomalySpawner
      amount: 3 # 3 anoms on heretic butcher holy shit eh
  - type: Tag
    tags:
    - CannotSuicide
    - DoorBumpOpener
  - type: CollectiveMind
    defaultChannel: MansusLink
    channels:
    - MansusLink
  - type: Examiner
  - type: Pullable
  - type: Reflect
    reflectProb: 0.7
    reflects:
      - Energy
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepThud
  - type: Flammable
    damage:
      types: {}
  - type: Temperature
    damageCap: 0 # immune to temperature damage
  - type: Puller
    needsHands: false
  - type: InteractionPopup
    successChance: 1
    interactSuccessString: hugging-success-generic
    interactSuccessSound: /Audio/Effects/thudswoosh.ogg
    messagePerceivedByOthers: hugging-success-generic-others

- type: entity
  categories: [ HideSpawnMenu ]
  parent: BaseStructure
  id: VoidPrison
  name: Void Prison
  description: A Yawning void encases their mortal coil.
  components:
  - type: Sprite
    sprite: _Goobstation/Heretic/Effects/effects.rsi
    layers:
    - state: voidball_effect
      shader: unshaded
      map: [ "base" ]
    drawdepth: OverMobs
    noRot: true
  - type: CosmicLapse
  - type: Speech
    enabled: False
  - type: Transform
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.3
        mask:
        - MobMask
        layer:
        - WallLayer
  - type: SpawnAnimation
    animationLength: 1.2
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.SpawnAnimationVisuals.Spawned:
        base:
          True: { state: voidball_effect }
          False: { state: voidball_opening }
  - type: VoidPrison
