Magic

Spells have a wide variety of effects from a simple fireball to enchanting weapons, summoning creatures, healing, analyzing items, teleporting, modifying the dungeon’s terrain and many more.

They are generally cast using the character's innate magical power: Mana.

Most characters can learn new spells during their adventure.

## Elements

There are 6 magical elements in the game : Fire, Earth, Air, Water, Spirit and Blood.

Most spells in the game are associated with one or more of the elements, giving a theme to their damage and effects. Here are some of the themes for the various elements:

* **Fire:** high fire damage, explosive spells, causes burns, creates light
* **Earth:** physical and nature damage, inflict physical status effects, modify terrain, protection, knockback
* **Air:** lightning damage, push and pull characters and objects, increase or decrease speed/accuracy/dodge
* **Water:** cold damage, healing spells, status effects, freezing effects, utility
* **Spirit:** spirit damage, mental status effects, magic shields and protections, mana burns
* **Blood:** blood damage, healing, life transfer and life stealing, bleeding effects

Having a high affinity to an element increases the potency of the spells related to that element.

## Mana

Characters with innate spellcasting abilities have one mana pool for each element they have an affinity for.

The maximum amount of mana in that pool is equal to the affinity of the corresponding element + the character’s magic power value. Each pool starts empty at the beginning of a fight.

All spells have a cost, generally paid using one or more of the various mana pools available to a character, depending on the elements they're associated with. Some spells may require non-specific mana, which means the game will subtract one point from a random non-empty mana pool.

*For example, a fireball may cost 2 points of Fire Mana, or a Lightning Chain may costs 2 points of Fire Mana and 2 points of Air Mana.*

### Mana regeneration

There is one mana regeneration attribute for each mana pool available to a character.
At the start of the character's turn, their mana pools fill up by the value of the corresponding mana regeneration.

It is at least 1 if the character has at least 1 to the corresponding element’s affinity. It then increases by 1 for every 3 point of  that elemental affinity.

(and so on, there's no cap to mana regeneration)

## Casting a spell

Not all spells work the same way and some need to be channeled a long time before taking effect, while some are almost instantaneous and barely take any time in the character's turn.

* **Standard cast**:

This is the standard way for spells to be cast, it uses the character's main action.
* **Channeled spells**:

Some spells take more time to cast than just the character's main action : those are channeled spells.
Channeled spells are channeled actions. At the start of the cast, the character pays the mana cost then starts channeling, ending their turn.
On their next turn, the spell cast finishes and the spell takes effect, usually with more powerful effects than normal spells.
* **Quick cast**:

Some spells can be cast very quickly, using the character's quick action instead of their main action.
### Failed cast

Various factors may make a spellcast fail:

* **Confusion**: Casting a spell while confused will make a spellcast fail.

* **Stagger**: Casting a spell while staggering gives the spellcast a 25% chance of failing.

* **Partially learnt spells**:

Characters can cast spells that have not been learnt fully (see Learning), however, casting those spells has a chance of failing.
The chance of failing is determined by a roll of a twenty sided die.
The spell cast is successful if:

```
 d20 < 10 - Total Mana Cost + Caster's Mind modifier
```

### Casting from a gem

Magical gems can be set in a character’s equipment. Each gem contains a spell that will be available to the character as long as it remains in their equipment.

The cost of the spell will still be subtracted from the character's mana pools.

### Casting from a scroll

Scrolls allow characters to cast spells they haven't learned as a quick action with no mana cost, however, they do not benefit from elemental affinity.

Scrolls are consumed when read.

Reading a scroll while confused will result in a failed cast.

## Learning

During their adventure, the player gets various opportunities to learn new spells for characters in the party.
Characters learn new spells using a learning points system.

* Learning a spell requires 10 learning points for each point of mana the spell costs

* While they're learning a spell, a character can cast the spell but it'll be harder to cast successfully (see failed casts)

* When they reach the maximum number of learning points for a spell, it can be used forever without fear of it failing. Well, at least not because the character hasn't learnt it well enough.

Some characters start already knowing a few spells, depending on their class and affinities.

### Earning learning points

There are various ways to gain learning points for new spells, which will usually be favored by different classes.

* **Casting**:

Casting a partially learnt spell will award learning points at the following rate:

```
Learning points = 1 + Mind modifier
```

* **From gems**:

The character will earn some learning points when casting a spell from a gem at the same rate as partially learnt spells.
* **From spell books**:

Spell books contain a number of spells that can be learned by characters. Studying spell books during a Rest will let a character earn learning points for all of the spells listed in the book. Spell books can be found or bought.
Characters learn spells from books at the following rate:

```
Learning points = 1 + 2 x Mind modifier
```

* **From scrolls**:

Wizards, Archeologists and their advanced classes can learn spells from studying a scroll as if it were a book.
* **From analysis**:

Characters with good Analysis skills can identify abilities used by enemies.
Successfully identifying a spell cast by the enemy will grant the character some learning points for that spell at the following rate :

```
Learning points = 1 + 2 x Perception modifier
```