Spells

Spells are formed and concetrated magic used by player via Spellbook.

Using spell is called casting and cannot be done until spell is ready to use. See the spell life-time diagram down below.


 * 1) Spell selected in Spellbook
 * 2) If conditions are not met -> cancel
 * 3) Countdown is setup (equal to spell Casting time)
 * 4) Spell charging up (each turn countdown is decresed by 1)
 * 5) When countdown is 0 -> spell is ready
 * 6) Ready spell waiting until is casted (unlimited time, but occupies 1 slot)
 * 7) To cast spell player click button with spell and then select tile
 * 8) Available tiles are marked, if no tile is available or player misclick -> spell retures to ready state
 * 9) When casted successfully -> spell slot is cleared
 * 10) Spell takes effect on the tile
 * 11) Every round the lifetime of spell is checked -> when expired -> spell removed

Requirements
Most of spells have these requirement to be successfully casted:


 * Primary requirement is Casting time.
 * Magic Tier (Spellbook only contains spells which are unlocked according to Tier).
 * Magic level on tile.
 * Tile specific biome (have to be tile with ceratin biome or one of the biomes in list).
 * Tile specific abilities (have to be in certain state or has special condition)
 * Entity on tile (certain unit or building on tile with certain settings)
 * Summoning spells may require Trophies

Spell effects
There are several effect which can spell do. Sometimes combination of several:


 * Terraforming (changes tile, neighbors or both)
 * Damage (deals damage to entities)
 * Heal (replenish HP to entities)
 * Armor effect (gives bonus, replenish armor, damages armor)
 * Summon magic creature (summons a Magic unit on tile)
 * Ignites, extinquish tile (fire needed or removed)
 * Convertion (converts enemy to your side)
 * Stat effects (temporarly/permanently gives buff/debuffs)
 * Sacrifices (sacrifices whole or part of friendly unit to get benefits)
 * Infection starter (spreads Infection)