Magic

Magic system is mostly determined by mages and races. Mage generals are your spellcasters, they cast and organize all your magic actions and transform raw mana into spells. Each race has mages of varying strength, is limited in how many spells it can cast each count according to table below and can access spells from one of the two available spell tables (see below).

**Magic development**

Magic development has levels 0-10. Players start at level 0 and can upgrade their development level once they fulfill the requirements.

### Limits of spells

Each specific spell can be cast on each governorate only once per count – you can’t cast two Dragon Breath’s on governorate A at the same count. If that happens, the more efficient spell is calculated.

Upgrades of basic spells are considered the same spells, ie. Fear II is considered the same spell as Fear I and only one of them will be calculated.

Each governorate can be affected at any time at maximum by 2 damage spells, while buffs and debuffs don't have any limits.

During count, spells are calculated in this order: 1) Spell Breach 2) buffs, 3) debuffs without Spell Breach, 4) damage spells.

It doesn’t matter whether the governorate was going to be affected by more than 2 spells of each type at count or during gameplay , the stronger ones (with higher efficiency) will be calculated for debuffs and damage spells. For buffs, already activated buffs take precedence (if I cast 2 buffs on myself, they take precedence and buffs cast by teammates are not calculated) and after that the time they were cast.

Races are also subjected to racial spell limit, which determines how many spells overall (of any type, on any governorate, anything that is cast outside of your own governorate is counted against this limit) can the given race cast.

Racial Spell Limit
 Elf, Necromancer
 Human, Vampire
 Dwarf, Ent, Hobbit
 Giant, Orc

### Casting spells

Players can cast spells in three ways:

1. On themselves – casting on yourself is always immediate, doesn’t need cores, always successful, always at full strength
2. On teammates – casting on teammates happens always during count, needs cores, is always successful and always at full strength
3. On enemy players – casting on enemies happens always during count, needs cores, success and strength are determined based on magic attack and magic defence of attacking and defending party

### Types of spells

Similarly, there are three types of spells:

1. Buffs – helpful spells for you and your teammates, you can’t cast them on enemies, they are always successful and always at full strength.
2. Debuffs – harmful spells used to weaken your enemies, their success is based on your magic attack and enemy’s magic defence
3. Damage – harmful spells which cause direct damage to enemy’s population, army or buildings, their success is based on your magic attack and enemy’s magic defence

### Duration of spells

There are also three types of duration:

1. At count – these spells influence only calculations done during the count, classic example are damage spells, they are cast destroy for example 10% of enemy army during your magic phase and they are done
2. Number of counts – these spells come into effect as soon as you cast them on yourself or after the count, work during your turns and during the count. For example, buffs for mage attack, as soon as you cast them, your mage gets increased strength and cores he creates are stronger and his increased strength can influence the count as well. It expires after the number of counts has passed.
3. Number of turns – these spells come into effect as soon as you cast them on yourself or after the count, work during your turns and expire after the number of turns has passed. For example, debuffs against your pop growth, your pop grows more slowly for a certain number of turns.

### Efficiency

Efficiency of your spells is calculated from attack and defence of mage generals. Following table shows all possibilities. The difference is according to an attacking general, the first line is when attack is 5 or more higher then defence and the last line is when defence is 5 or more higher then attack.

Efficiency works differently for different types of spells.

#### Buffs

Whether they are cast on yourself or on your teammate (they can’t be cast on enemies), whether they work immediately for number of turns or at count or for number of counts, are unaffected by efficiency and ALWAYS work at 100%.

#### Debuff

Spells can also be cast only on enemies and they work two ways. Either for number of turns or at count. Their effect is largely based on efficiency, except for general debuffs – you can’t lower general’s strength by 2,34 for example. Here apply the same rules as for killing pops by damage spells. Only the negative effect itself is affected, turns are set and don’t change.

Example: Attacker casts debuff spell, that lowers pop growth by 50 for 7 turns. The attacker (necromancer) whose mage general has attack 8 and the defender's defence of mage is 6 (elf). The diffence is +2 and the spell has 70% efficiency. The spell lowers pop growth by 50\*0,7=35 and still for 7 turns. Only the negative effect itself is affected, turns are set and don’t change. In a case the mage general of defender would have defence 4 (human), the efficiency would be 90% and the spell effect -45 pop growth for 7 turns.

Example: Attacker casts debuff spell, that lowers mage general defence by 2. It has efficiency of 80%. The spell lowers mage general defence by 2\*0,8=1,6. That means, that his defence is lowered by 1 for sure and there is 60% chance that it will lowered by 2.

#### Damage

Spells can be cast only on enemies and always work at count. Their effect is determined largely by efficiency and little by random. Each integer is a guaranteed effect and remainder serves as % chance to advance to the next integer. Except for damage done to buildings, damage to buildings can be directly multiplied by efficiency without any problems.

Example: Attacker casts Dragon’s breath. Dragon’s breath, among other things, deals 100 damage to 3 buildings. It has efficiency of 80%, therefore it does 100\*0,8 = 80 damage to 3 buildings.

Example: Attacker casts Dragon’s breath. One of its effect is killing 10% population. It has efficiency of 80%. Target has 40 population. Therefore it kills 40\*0,1\*0,8=3,2 pops. That means, that 3 pops are killed for sure and there is 20% chance for 1 additional pop to be killed.

Example: Attacker casts Dragon’s breath. One of its effect is killing 10% population. It has efficiency of 20%. Target has 40 population. Therefore it kills 40\*0,1\*0,2=0,8 pops. That means, that 1 pop is killed with 80% chance.

### Empowered mode

Debuff and damage spells can be cast either in standard mode, which is assumed in previous text, or in empowered mode. Empowering a spell costs 100 energy, but provides +30% efficiency. Efficiency cannot be higher than 100%.

### Spellcasting modes

Core overload - spells gain +2 strength for the current count, but lose -2 strength for the next count

Prolonged duration - debuffs and buffs gain +2 turn duration for the current count, but lose -2 turn duration for the next count

Spell resistance - governorate gains +2 magic defense for the current count, but loses -2 magic defense for the next count