When loading a background, we use Color Thief to get a six-color
palette from the image, for use on the main menu buttons.
Only hue and lightness are extracted.
https://github.com/lokesh/color-thief/
Backgrounds are now stored in localStorage in the current origin,
rather than the prefs origin. This allows faster loading, as well
as different backgrounds for different origins, which other
servers should like since it means their backgrounds get seen
at least once before possibly being replaced.
Special thanks to Joim for the base code.
Replays can now be downloaded into .html files.
The .html files mainly contain replay log data; the actual replay
player is downloaded online. Also included is a textual log and
some minimal CSS to make it look pretty, for offline viewing.
This strategy helps keep the replay file reasonably small; of
the 30 KB or so for a 50-turn battle, around 10 KB is the log
data, and around 20 KB is the textual log.
- Ability activations are now handled consistently
- Ability activations now look different, the ability name appears
under other result anims and doesn't move
- Replace animDelay with the same animationDelay system we use for
everything else in the engine
- Group multiple stat boosts/drops
- Group damage when possible in spread moves in doubles/triples
Now that the symbols at the end aren't necessary for highlighting,
dropping them from tab completion should make talking to people with
emoticons at the end of their name less annoying.
- Special characters at the end of a name are ignored
- Non-ASCII characters in the middle of a name can be replaced with
any other non-alphanumeric character
So, for instance, with a user named 'te•st••':
'test', 'te st', and 'te-st' would all highlight them
- Don't try to use nonexistent resources for CAP or recent Pokémon in old-gen battles.
- Don't try to play invalid cries.
- Do use Substitute old-gen sprites according to the played gen.
This also removes Substitutes' being numbered as 0, and adds to its animation data a `exists` flag set to `false`.
Fixes#562