PokeRival
PokeRival

Database

How battles work

Turns, priority, speed and what happens at the end of every turn.

Battle Last updated

In short

One turn

You pick an action for your active Pokemon: a move, a switch, an item from the Bag, or an attempt to run from a wild Pokemon. Against another player there are no items. The opponent picks too. Nothing happens until both choices are in, and then the server resolves the whole turn and sends back what happened, line by line.

A wild battle on Route 1
1 your Pokemon, 2 the opponent, 3 your four moves, 4 Switch, 5 Bag, 6 Forfeit (Run in a wild battle when it is allowed), 7 the last lines of the log

Battles are singles only. Doubles are not in the game.

The battle log after one turn
One turn, line by line: each side's move and what it did

Who goes first

Three rules, in this order:

  1. Switches, items and running resolve before any move. A Pokemon that switches out is gone before the attack aimed at it lands.
  2. Priority. Every move has a priority, usually 0. Quick Attack is +1, Protect is +4, Trick Room is -7. Higher goes first, whatever the speed. Prankster gives a status move +1.
  3. Speed. At equal priority the faster Pokemon moves first. Speed here is the stat after stages, paralysis, Choice Scarf and the like. A Quick Claw holder has a one in five chance to jump the queue.

Trick Room reverses the speed rule for five turns: the slower Pokemon moves first within the same priority bracket.

Who moves first
The three rules, checked in this order

Can the move happen at all

Before a move resolves the engine checks the attacker in a fixed order. A frozen Pokemon has a one in five chance to thaw and act. A sleeping one wakes after its sleep counter runs out, one to three turns. A paralysed one fails to act one time in four. A confused one hits itself one time in three. A flinched one loses its action outright. Any of these ending the turn early is shown in the log with its reason.

Then accuracy is rolled, then damage, then the move's own effects, then anything the target's ability or held item does in response.

The end of the turn

After both actions, in order:

  • burn, poison and badly poison deal their damage
  • sandstorm chips anyone not Rock, Ground or Steel
  • Leech Seed, Ingrain, Aqua Ring and the healing or draining effects fire
  • weather, terrain, screens, Trick Room and Gravity count down and expire
  • a Pokemon that fainted is announced and its side must send out a replacement before the next turn
The end of a turn
What happens after both actions, in order

Then the turn counter advances and both sides choose again.

Fainting

A Pokemon at zero HP faints at the moment it reaches zero, even in the middle of a turn. Its side picks a replacement from the party, and that switch is free: it does not cost the next turn's action. When a side has nothing left able to fight, the battle ends.

Where the dice are

Every roll is made on the server: accuracy, critical hits, the damage spread, secondary effects, who goes first on a speed tie. The client only sends which move you chose. There is nothing to be gained by reading the page source, and nothing to be lost by a slow connection: the turn waits for your choice.