API

Assembly: Spark.Spellbooks Interface: ISpellbooksPlugin Implementation: SpellbooksPlugin

Interface

public interface ISpellbooksPlugin
{
    List<SpellbookEntry> GetAllSpellbooks();
    SpellbookEntry GetSpellbook(string spellbookId);
}

Methods

GetAllSpellbooks

List<SpellbookEntry> GetAllSpellbooks()

Returns all spellbook entries in the database.

GetSpellbook

SpellbookEntry GetSpellbook(string spellbookId)

Returns the spellbook with the given ID, or null if not found.

SpellbookEntry

Extends SparkDatabaseEntry. Defines a collection of abilities.

Field
Type
Description

abilities

List<SpellbookAbilityData>

Abilities in this spellbook

Methods:

SpellbookAbilityData

Field
Type
Description

ability

AbilityEntry

The ability

autoAddToBar

bool

Auto-add to ability bar when requirements met

Components

SpellbookAutoAddHandler

MonoBehaviour that handles one-time auto-addition of abilities to the ability bar.

Field
Type
Description

barIdentifier

string

Target ability bar

numberOfSlots

int

Slots to fill

processOnEnable

bool

Process on component enable

Methods:

Checks ability requirements using IRequirementsPlugin and adds qualifying abilities to AbilityBarEntity. Tracks which abilities have been auto-added to avoid duplicates.

Trigger Types

Trigger
Description

AddSpellbookTriggerType

Grants or removes a spellbook

AddSpellbookTriggerDataAsset

Field
Type
Description

spellbookEntry

SpellbookEntry

Spellbook to add/remove

removeSpellbook

bool

Remove instead of add

delay

float

Execution delay

Save Data

SpellbookSaveData

Extends SaveDataEntry.

Methods:

Tracks spellbook ownership and which abilities have been auto-added to bars to prevent re-adding.

Usage

Last updated

Was this helpful?