# SPDX-FileCopyrightText: 2022 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TinManTim <73014819+Tin-Man-Tim@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 OnsenCapy <101037138+OnsenCapy@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: lightning
  id: BaseLightning
  abstract: true
  components:
  - type: Sprite
    sprite: /Textures/Effects/lightning.rsi
    drawdepth: Effects
    layers:
    - state: "lightning_1"
      shader: unshaded
  - type: Physics
    canCollide: false
  - type: Electrified
    requirePower: false
  - type: Lightning
  - type: PointLight
    enabled: true
    color: "#4080FF"
    radius: 3.5
    softness: 1
    autoRot: true
    castShadows: false
  - type: Beam
    sound: /Audio/Effects/Lightning/lightningshock.ogg
  - type: TimedDespawn
    lifetime: 3
  - type: Tag
    tags:
      - HideContextMenu

- type: entity
  name: lightning
  id: Lightning
  parent: BaseLightning
  categories: [ HideSpawnMenu ]
  components:
    - type: Lightning
      canArc: true

- type: entity
  name: spooky lightning
  id: LightningRevenant
  parent: BaseLightning
  categories: [ HideSpawnMenu ]
  components:
    - type: Sprite
      sprite: /Textures/Effects/lightning.rsi
      drawdepth: Effects
      layers:
        - state: "lightning_3"
          color: plum
          shader: unshaded
    - type: PointLight
      enabled: true
      color: plum
      radius: 3.5
      softness: 1
      autoRot: true
      castShadows: false
    - type: Lightning
      canArc: true
    - type: Electrified # Goobstation
      ignoreInsulation: true
      requirePower: false
      shockDamage: 40

- type: entity
  name: charged lightning
  id: ChargedLightning
  parent: BaseLightning
  categories: [ HideSpawnMenu ]
  components:
    - type: Sprite
      sprite: /Textures/Effects/lightning.rsi
      drawdepth: Effects
      layers:
        - state: "blue_lightning"
          shader: unshaded
    - type: Electrified
      requirePower: false
      shockDamage: 40
    - type: Lightning
      canArc: true
      lightningPrototype: ChargedLightning

- type: entity
  name: lightning
  id: Spark
  parent: BaseLightning
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: /Textures/Effects/lightning.rsi
    drawdepth: Effects
    layers:
    - state: "lightning_1"
      shader: unshaded
  - type: Electrified
    shockDamage: 0
  - type: Lightning
    lightningPrototype: Spark
  - type: PointLight
    radius: 0.2
    softness: .4
  - type: Beam
    sound: /Audio/Effects/sparks4.ogg
  - type: TimedDespawn
    lifetime: .3
  - type: Tag
    tags:
      - HideContextMenu

- type: entity
  name: supercharged lightning
  id: SuperchargedLightning
  parent: ChargedLightning
  categories: [ HideSpawnMenu ]
  components:
    - type: Sprite
      sprite: /Textures/Effects/lightning.rsi
      drawdepth: Effects
      layers:
        - state: "yellow_lightning"
          shader: unshaded
    - type: Electrified
      requirePower: false
      shockDamage: 50
    - type: Lightning
      canArc: true
      lightningPrototype: SuperchargedLightning
    - type: PointLight
      enabled: true
      color: "#FFFF00"
      radius: 3.5
      softness: 1
      autoRot: true
      castShadows: false

- type: entity
  name: hypercharged lightning
  id: HyperchargedLightning
  parent: ChargedLightning
  categories: [ HideSpawnMenu ]
  components:
    - type: Sprite
      sprite: /Textures/Effects/lightning.rsi
      drawdepth: Effects
      layers:
        - state: "red_lightning"
          shader: unshaded
    - type: Electrified
      requirePower: false
      shockDamage: 60
    - type: Lightning
      canArc: true
      lightningPrototype: HyperchargedLightning
    - type: PointLight
      enabled: true
      color: "#ff0000"
      radius: 3.5
      softness: 1
      autoRot: true
      castShadows: false
