In this section we are going to explain the current different types and how these works.

For now we only have the most basic battle types which are:

- Player(s) vs player(s): this works in a "free way", you can hit anyone and anyone can hit you.

- Player(s) vs environment: where the first player to hit an enemy will be the one that will enter in battle-mode, be chased, and awarded by that enemy.
Note: other players could hit the same target and the damage will be applied normally, but the first player will be the only one considered as target until the battle finished, and he will get ALL the prices.

The current battle system works in real-time (none turns or waits), if you hit an enemy it will chase you and hit you back automatically.

The battle area is by default the respawn area for that enemy on the current map (this doesn't apply for PvP for which case the battle area is the entire map).

Both (current) battle types extend from the same Battle class that can be found in packages/actions/server. This class contains the method runBattle, which is the one that handles the current action execution (in Reldens every skill is an action).

The first important thing to note is: the battle starts with the target is actually affected by the action, so for example, if you create a skill that use a physic body (like throw a rock, or a fireball), the battle won't start until the bullet-body hits the target. This doesn't count for normal attacks or effects that will be executed without use a physic body and always automatically affect the target (after cast time ends).

The battle can be configured with a timer, so enemies will stop chasing you if you are in their area for more than the specified time without attack them.

As you can see this is a really basic implementation that will be improved a lot in the next releases, and in the future we will even include turn-based battles.