# SPDX-FileCopyrightText: 2023 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 AJCM <AJCM@tutanota.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseAction
  id: ActionRevertPolymorph
  name: Revert
  description: Revert back into your original form.
  components:
  - type: ConfirmableAction
    popup: revert-polymorph-action-popup
  - type: InstantAction
    event: !type:RevertPolymorphActionEvent

- type: entity
  abstract: true
  parent: BaseAction
  id: BaseActionPolymorph
  components:
  - type: Action
    checkCanInteract: false # Goobstation
    itemIconStyle: NoItem
    useDelay: 60
  - type: InstantAction
    event: !type:PolymorphActionEvent

- type: entity
  parent: BaseActionPolymorph
  id: ActionPolymorphWizardSpider
  name: Spider Polymorph
  description: Polymorphs you into a Spider.
  components:
  - type: Action
    icon:
      sprite: Mobs/Animals/spider.rsi
      state: tarantula
  - type: InstantAction
    event: !type:PolymorphActionEvent
      protoId: WizardSpider

- type: entity
  parent: BaseActionPolymorph
  id: ActionPolymorphWizardRod
  name: Rod Form
  description: Take on the form of an immovable rod, destroying everything in your path.
  components:
  - type: Action
    useDelay: 25 # Goob edit
    icon:
      sprite: _Goobstation/Wizard/actions.rsi # Goob edit
      state: immrod # Goob edit
  - type: InstantAction
    event: !type:PolymorphSpellEvent # Goob edit
      protoId: WizardRod
  - type: SpeakOnAction
    sentence: action-speech-spell-rod-form # Goobstation
  - type: Magic # Goobstation
    requiresClothes: true
    requiresSpeech: true
    school: Transmutation
  - type: ActionUpgrade
    effectedLevels:
      2: ActionPolymorphWizardRodII
      3: ActionPolymorphWizardRodIII
      4: ActionPolymorphWizardRodIV
      5: ActionPolymorphWizardRodV


- type: entity
  parent: BaseActionPolymorph
  id: ActionPolymorphJaunt
  name: Ethereal Jaunt
  description: Melt into the Ethereal Plane for a quick getaway!
  components:
  - type: Magic
    requiresClothes: true # Goobstation
    school: Translocation # Goobstation
  - type: Sprite # Goobstation - for apprentices
    sprite: _Goobstation/Wizard/actions.rsi
    state: jaunt
  - type: Action
    useDelay: 30
    icon:
      sprite: _Goobstation/Wizard/actions.rsi # Goob edit
      state: jaunt
  - type: InstantAction
    event: !type:PolymorphSpellEvent # Goob edit
      protoId: Jaunt
    # TODO: Effect ECS (from cardboard box)
  - type: ActionUpgrade
    effectedLevels:
      2: ActionPolymorphJauntII
      3: ActionPolymorphJauntIII

- type: entity
  parent: ActionPolymorphJaunt
  id: ActionPolymorphJauntII
  name: Ethereal Jaunt II
  description: Melt into the Ethereal Plane for an even quicker getaway!
  components:
  - type: Action
    useDelay: 22

- type: entity
  parent: ActionPolymorphJaunt
  id: ActionPolymorphJauntIII
  name: Ethereal Jaunt III
  description: Are you even tangible anymore?
  components:
  - type: Action
    useDelay: 14
