# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseAction
  id: ActionHereticRustConstruction
  name: Rust Formation
  description: Transforms a rusted floor into a full wall of rust. Creating a wall underneath a mob will harm it.
  categories: [ HideSpawnMenu ]
  components:
  - type: Action
    checkCanInteract: false
    raiseOnUser: true
    useDelay: 8
    itemIconStyle: NoItem
    icon:
      sprite: _Goobstation/Heretic/abilities_heretic.rsi
      state: construction
  - type: TargetAction
    checkCanAccess: false
    repeat: true
    range: 4
  - type: WorldTargetAction
    event: !type:EventHereticRustConstruction
  - type: HereticAction
    requireMagicItem: true

- type: entity
  parent: BaseAction
  id: ActionHereticAggressiveSpread
  name: Aggressive Spread
  description: Spreads rust onto nearby surfaces.
  categories: [ HideSpawnMenu ]
  components:
  - type: Action
    checkCanInteract: false
    raiseOnUser: true
    predicted: false
    useDelay: 30
    itemIconStyle: NoItem
    sound:
      path: /Audio/Items/welder.ogg
    icon:
      sprite: _Goobstation/Heretic/abilities_heretic.rsi
      state: aggressive_spread
  - type: InstantAction
    event: !type:EventHereticAggressiveSpread
  - type: HereticAction
    requireMagicItem: true
    messageLoc: heretic-speech-rust-spread
  - type: ChangeUseDelayOnAscension
    newUseDelay: 15
    requiredPath: Rust

- type: entity
  parent: BaseAction
  id: ActionHereticEntropicPlume
  name: Entropic Plume
  description: Spews forth a disorienting plume that causes enemies to strike each other, briefly blinds them and poisons them. Also spreads rust in the path of the plume.
  categories: [ HideSpawnMenu ]
  components:
  - type: Action
    checkCanInteract: false
    raiseOnUser: true
    predicted: false
    useDelay: 30
    itemIconStyle: NoItem
    sound:
      path: /Audio/_Goobstation/Wizard/smoke.ogg
    icon:
      sprite: _Goobstation/Heretic/abilities_heretic.rsi
      state: entropic_plume
  - type: InstantAction
    event: !type:EventHereticEntropicPlume
  - type: HereticAction
    requireMagicItem: true
    messageLoc: heretic-speech-rust-plume

- type: entity
  parent: BaseAction
  id: ActionHereticRustCharge
  name: Rust Charge
  description: A charge that must be started on a rusted tile and will destroy any rusted objects you come into contact with, will deal high damage to others and rust around you during the charge. As it is the rust that empowers you with this ability, no focus is needed.
  categories: [ HideSpawnMenu ]
  components:
  - type: Action
    checkCanInteract: false
    raiseOnUser: true
    useDelay: 45
    itemIconStyle: NoItem
    icon:
      sprite: _Goobstation/Heretic/abilities_heretic.rsi
      state: rust_charge
  - type: TargetAction
    range: 0
    checkCanAccess: false
  - type: WorldTargetAction
    event: !type:EventHereticRustCharge
  - type: HereticAction
    requireMagicItem: false

- type: entity
  parent: BaseAction
  id: ActionHereticRustWave
  name: Patron's Reach
  description: Release a toxic wave of rust.
  categories: [ HideSpawnMenu ]
  components:
  - type: Action
    checkCanInteract: true
    raiseOnUser: true
    useDelay: 35
    itemIconStyle: NoItem
    sound:
      path: /Audio/Items/welder.ogg
    icon:
      sprite: _Goobstation/Heretic/abilities_heretic.rsi
      state: rust_wave
  - type: TargetAction
    range: 0
    checkCanAccess: false
  - type: EntityTargetAction
    canTargetSelf: false
  - type: WorldTargetAction
    event: !type:ProjectileSpellEvent
      prototype: ProjectileWaveRust
      speed: 2.8
  - type: SpeakOnAction
    sentence: heretic-speech-rust-wave
