This involves a huge refactor for how battles are constructed, but
it's totally worth it.
Currently, tournaments, challenges, and laddering are unsupported; only
unrated searches work. But it does work, and it's beautiful.
Move targets are now intended to be +1 +2 +3 for foes. The old syntax
of using 1 2 3 is still supported, but is not recommended.
(The old syntax will still be used in the old client, but the Preact
client will support the new syntax going forward.)
This makes the difference between move number and move target
clearer.
This also fixes the Conversion 2 ambiguity (although for backwards
compatibility, we do still need to special-case it).
This new protocol spec resolves ambiguities in cases where multiple
message types would be valid (no more wondering if an ability
activation is `-activate` or `-ability`, no more wondering if a
blocked attack is `-fail` or `-block` or `-immune` or `-activate`). It
also better matches the client's `data/text.js`.
Battle protocol documentation, instead of being strewn between
`PROTOCOL.md` and `sim/README.md`, is now in `sim/SIM-PROTOCOL.md`.
Also added:
- documentation for how to do searches and challenges
- documentation for packed team format
Fixes#5005