Skip to content
Andrew Xue edited this page Sep 9, 2017 · 8 revisions

Overview

Characters use SpellBooks to cast Spells on targets. Add resource costs to a SpellBook by calling AddCost() in the constructor.

BasicSpellBook

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.

TargetType

Denotes whether a SpellBook is for creating friendly-targeted or enemy-targeted spells.

SpellType

The category of a spell. Damage spells are OFFENSE types.

PriorityType

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.

CreateDescriptionHelper()

This is where you would put the description for the SpellBook.

GetHitEffects()

If you don't override IsHit, your spell will always hit, so this is where you would put your various spell effects.

BuffAdder

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.

How do I get my SpellBook in game?

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.

Clone this wiki locally