New Spells
To add a new spell, a few steps are required.
Creating the DatabseDatabase Entry
The spell database data/db_spells.json needs to be appended with an entry for the new spell. This is done by creating a new entry with a new unique ID, and specifying the key and value pairs. Which keys are required depends on the type of spell that is added. More nformationinformation can be found here.
The spell also needs to be added to the spell_list of the unit or interactable that should use the spell, in either the data/db_stats_player.json file, the data/db_stats_npc.json file, or the data/db_stats_interactable.json file.
Creating the Spell Scene
Every spell needs an associated scene. The scene consists of a node of type Node, which has to be named spell_[id], where [id] is replaced by the ID of the spell. This scene will then be added to the spell container of the unit that should have the spell available.
Creating the Spell Script
Every spell scene needs an attached spell script that handles the triggering of the spell. The script should inherit from the BaseSpell class, which contains some core functionality.