# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Kit0vras <123590995+Kit0vras@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 NULL882 <104377798+NULL882@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 AJCM <AJCM@tutanota.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 CatMagic <135462166+CatMagic1@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hmeister-real <118129069+Hmeister-real@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hrosts <35345601+Hrosts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kira Bridgeton <161087999+Verbalase@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PoTeletubby <108604614+PoTeletubby@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PoTeletubby <ajcraigaz@gmail.com>
# SPDX-FileCopyrightText: 2024 chromiumboy <50505512+chromiumboy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 keronshb <54602815+keronshb@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-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Scruq445 <storchdamien@gmail.com>
# SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 crasg <109207982+Scruq445@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseSpellbook
  name: spellbook
  parent: [BaseItem, BaseMagicalContraband] # Goob edit
  abstract: true
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper_blood
      - state: cover_strong
        color: "#645a5a"
      - state: decor_wingette_flat
        color: "#4d0303"
      - state: icon_pentagramm
        color: "#f7e19f"
    - type: Spellbook
    - type: EnchantingTool # Goobstation
    - type: Tag
      tags:
      - Spellbook

# For the Wizard Antag
# Do not add discounts or price inflation
- type: entity
  id: WizardsGrimoire
  name: wizards grimoire
  suffix: Wizard
  parent: [ BaseItem, BaseMagicalContraband, StorePresetSpellbook ] # Goob edit
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper_blood
      - state: cover_strong
        color: "#645a5a"
      - state: decor_wingette_flat
        color: "#4d0303"
      - state: icon_pentagramm
        color: "#f7e19f"
    - type: UserInterface
      interfaces:
        enum.StoreUiKey.Key:
          type: StoreBoundUserInterface
        enum.RefundUiKey.Key:
          type: StoreRefundBoundUserInterface
    - type: ActivatableUI
      key: enum.StoreUiKey.Key
    - type: EnchantingTool # Goobstation
    - type: Store
      refundAllowed: true
      ownerOnly: true # get your own tome!
      balance:
        WizCoin: 10 # prices are balanced around this 10 point maximum and how strong the spells are
    - type: GuideHelp # Goobstation
      guides:
      - Wizard

# Used for the Antag Planet
- type: entity
  id: WizardsGrimoireGhost
  name: ghostly grimoire
  description: A modified wizard grimoire that can by used by more than one person and has more wizcoins, but can't buy certain spells.
  suffix: Wizard
  parent: [ BaseItem, BaseMagicalContraband, GhostAntagSpellPreset ] # Goob edit
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper_blood
      - state: cover_strong
        color: "#645a5a"
      - state: decor_wingette_flat
        color: "#4d0303"
      - state: icon_pentagramm
        color: "#f7e19f"
    - type: UserInterface
      interfaces:
        enum.StoreUiKey.Key:
          type: StoreBoundUserInterface
        enum.RefundUiKey.Key:
          type: StoreRefundBoundUserInterface
    - type: ActivatableUI
      key: enum.StoreUiKey.Key
    - type: Store
      refundAllowed: true
      ownerOnly: false
      balance:
        WizCoin: 50 #Increased currency for more use per book
    - type: EnchantingTool # Goobstation
    - type: GuideHelp # Goobstation
      guides:
      - Wizard
    - type: Tag
      tags:
      - GrimoireGhost

# Not meant for wizard antag but meant for spawning, so people can't abuse refund if they were given a tome
- type: entity
  id: WizardsGrimoireNoRefund
  name: wizards grimoire
  suffix: Wizard, No Refund
  parent: [ WizardsGrimoire, StorePresetSpellbook ]
  components:
    - type: Store
      refundAllowed: false
      ownerOnly: true # get your own tome!
      balance:
        WizCoin: 10 # prices are balanced around this 10 point maximum and how strong the spells are

- type: entity
  id: SpawnSpellbook
  name: spawn spellbook
  parent: BaseSpellbook
  components:
    - type: Spellbook
      spellActions:
        ActionSpawnMagicarpSpell: null

- type: entity
  id: ForceWallSpellbook
  name: force wall spellbook
  parent: BaseSpellbook
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper
      - state: cover_strong
        color: "#366ed6"
      - state: decor_vertical_middle
        color: "#95ffff"
      - state: decor_wingette_circle
        color: "#95ffff"
      - state: icon_magic_forcewall
        shader: unshaded
      - state: detail_rivets
        color: gold
    - type: Spellbook
      spellActions:
        ActionForceWall: null

- type: entity
  id: BlinkBook
  name: blink spellbook
  parent: BaseSpellbook
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper
      - state: cover_old
        color: "#657e9c"
      - state: icon_text3
      - state: decor_wingette_circle
        color: gold
      - state: icon_magic
      - state: detail_rivets
        color: gold
    - type: Spellbook
      spellActions:
        ActionBlinkSpell: null # Goob edit

- type: entity
  id: SmiteBook
  name: smite spellbook
  parent: BaseSpellbook
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper
      - state: cover_old
        color: "#c42b40"
      - state: decor_wingette_circle
        color: gold
      - state: icon_magic
      - state: detail_rivets
        color: gold
      - state: detail_bookmark
        color: red
      - state: overlay_blood
    - type: Spellbook
      spellActions:
        ActionSmite: null

- type: entity
  id: KnockSpellbook
  name: knock spellbook
  parent: BaseSpellbook
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper
      - state: cover_strong
        color: "#117045"
      - state: decor_wingette_circle
        color: gold
      - state: icon_magic_knock
      - state: detail_rivets
        color: gold
      - state: detail_bookmark
        color: "#98c495"
    - type: Spellbook
      spellActions:
        ActionKnock: null

- type: entity
  id: FireballSpellbook
  name: fireball spellbook
  parent: BaseSpellbook
  components:
    - type: Sprite
      sprite: Objects/Misc/books.rsi
      layers:
      - state: paper
      - state: cover_old
        color: "#ba5a14"
      - state: decor_wingette_circle
        color: gold
      - state: detail_rivets
        color: gold
      - state: detail_bookmark
        color: "#e89b3c"
      - state: overlay_blood
      - state: icon_magic_fireball
        shader: unshaded
    - type: Spellbook
      spellActions:
        ActionFireball: null

- type: entity
  id: ScrollRunes
  name: scroll of traps # Goob edit
  parent: BaseSpellbook
  components:
  - type: Item
    size: Normal
  - type: Sprite
    sprite: Objects/Magic/magicactions.rsi
    layers:
    - state: spell_default
  - type: Spellbook
    spellActions:
      ActionTrapsSpell: null # Goob edit
