-
Notifications
You must be signed in to change notification settings - Fork 12
Spell
Characters use SpellBooks to cast Spells on targets. Add resource costs to a SpellBook by calling AddCost() in the constructor.
Most spells cannot target the dead. Extending this class allows you to be lazy and not write in the "can't target dead people" check for every spell. Spells should go into the SpellList file.
Denotes whether a SpellBook is for creating friendly-targeted or enemy-targeted spells.
The category of a spell. Damage spells are OFFENSE types.
Higher priority spells go first. If there is a priority tie, whoever goes first is determined by whoever has the highest agility. If agilities are the same, whoever goes first is determined at random.
This is where you would put the description for the SpellBook.
If you don't override IsHit, your spell will always hit, so this is where you would put your various spell effects.
BuffAdder is a special SpellBook that is used to make SpellBooks whose sole purpose is to add a buff to a target, and nothing else. Extending it allows one to make a buff infliction spell with just the constructor and a base call.
A character can innately start with the SpellBook, in which case you would add it to the Character.SpellBooks class. If you want the SpellBook to be usable as an item, you can code a "Tome" ConsumableItem, add a LearnSpellEffect to SpellEffectList, and have the Tome's use effect be the LearnSpellEffect. Then you can add it as an enemy drop or a shop item.