Damage System

This describes how damage is done in the game.


1 Damage dealing

The damage dealing is divided to 2 cases. First one being damage that is dealth right away, called immediate damage (in case of melee attacks), and the other is delayed damage which is when it is dealt with some delay (in case of magic attack)

An example of player using delayed attack principle

2 Immediate damage

In moment of player's attack (on the server), atatck and defence is calculated. Then, damage is dealt to the target, and then damage after effects phase is initiated.

3 Delayed damage

For delayed damage to work, the damage number is generated in moment of actual attack action. The number is, however, saved into an array held in the target character, along with a timer.
When timer's time is up, then the damage number is taken and dealt to the character (if he is still alive).
After that, damage after effects phase is initiated

4 Attack / defence calculation

!NEGATIVE DAMAGE NUMBER is only encoding for telling, that the damage is from poison!
In this phase, both characters (attacker and defender) are taken WITH CURENT SETUP AND BONUSES, and roll for attacks / defences is done, with respect to the attack styles and game rules.
This results in number representing the damage to be dealt, and boolean which is telling, whether the damage was critical.

5 Damage after effects