# SPDX-FileCopyrightText: 2025 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
# SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <linebarrelerenthusiast@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: ProjectileCosmicNova
  name: Astral Nova
  description: Uh oh.
  parent: BaseBullet
  categories: [ HideSpawnMenu ]
  components:
  - type: PointLight
    color: "#42a4ae"
    radius: 2.0
    energy: 5.0
  - type: TimedDespawn
    lifetime: 10
  - type: Projectile
    impactEffect: CosmicNovaImpactVfx
    forceSound: true
    soundHit:
      path: /Audio/_DV/CosmicCult/ability_nova_impact.ogg
      params:
        variation: 0.1
        volume: +14
  - type: CosmicAstralNova
  - type: Sprite
    sprite: _DV/CosmicCult/Effects/ability_novavfx.rsi
    layers:
    - state: vfx
      shader: unshaded
  - type: GravityWell
    maxRange: 4
    baseRadialAcceleration: 12.5
    baseTangentialAcceleration: 4
    gravPulsePeriod: 0.05
  - type: SingularityDistortion
    intensity: +20
    falloffPower: 1.5
  - type: AmbientSound
    enabled: true
    volume: 0
    range: 10
    sound:
      path: /Audio/_DV/CosmicCult/ability_nova_ambient.ogg
  - type: CosmicCorrupting
    corruptionSpeed: 0.4
    useVFX: false
    mobile: true

- type: entity
  id: ProjectileRogueCosmicNova
  parent: ProjectileCosmicNova
  name: Usurped Astral Nova
  components:
    - type: CosmicAstralNova
      doStun: false

- type: entity
  id: ProjectileCosmicRazor
  name: Astral Bolt
  parent: BaseBullet
  categories: [ HideSpawnMenu ]
  description: Marks a target for additional damage.
  components:
  - type: Reflective
    reflective: Magic
  - type: Sprite
    noRot: false
    sprite: _DV/CosmicCult/Effects/weaponprojectiles.rsi
    layers:
      - state: razor
        shader: unshaded
  - type: DamageMarkerOnCollide
    whitelist:
      components:
      - MobState
    damage:
      types:
        Cold: 15
        Asphyxiation: 10
        Ion: 25
  - type: Projectile
    impactEffect: BulletImpactEffectCosmic
    damage:
      types:
        Cold: 10
        Asphyxiation: 5
        Ion: 15
    soundHit:
      path: /Audio/_DV/CosmicCult/projectile_razor_hit.ogg
  - type: Ammo
    muzzleFlash: null
  # Short lifespan
  - type: TimedDespawn
    lifetime: 15
  - type: PointLight
    color: "#42a4ae"
    radius: 1.5
    energy: 6
    castShadows: false
  - type: LightBehaviour
    behaviours:
      - !type:FadeBehaviour
        interpolate: Linear
        minDuration: 0.58
        maxDuration: 0.59
        startValue: 0.1
        endValue: 6
        property: Energy
        enabled: true
        reverseWhenFinished: true


- type: entity
  id: BulletImpactEffectCosmic
  categories: [ HideSpawnMenu ]
  components:
  - type: TimedDespawn
    lifetime: 0.66
  - type: Sprite
    drawdepth: Effects
    layers:
    - shader: unshaded
      map: ["enum.EffectLayers.Unshaded"]
      sprite: _DV/CosmicCult/Effects/weaponarcs.rsi
      state: arc_cosmic
  - type: EffectVisuals
  - type: PointLight
    color: "#42a4ae"
    radius: 1.5
    energy: 6
    castShadows: false
  - type: LightBehaviour
    behaviours:
      - !type:FadeBehaviour
        interpolate: Linear
        minDuration: 0.64
        maxDuration: 0.65
        startValue: 0.1
        endValue: 6
        property: Energy
        enabled: true
        reverseWhenFinished: true
  - type: Tag
    tags:
      - HideContextMenu
