In VGC/Battle Spot, it's possible to Hyper Train level 50 pokemon since
they can be level-changed from level 100 in the games, but this
detection was broken.
This commit consolidates all Pokemon icons in 'picon'.
Perhaps now we'll be able to rename picon -> pokemonicon now that the
old name is no longer used... but I guess that can be reserved for a
future commit.
PS makes back sprites larger than front sprites, which is standard for
Gen 5 (although we do it slightly differently - Gen 5 makes backsprites
2x size; we make backsprites 1.5x size) and onwards (where the games do
a 3D engine with real perspective, and we fake perspective by making
backsprites 1.5x size).
This is, of course, wrong for gens 1-4, where the games fake perspective
by drawing pokemon in backsprites bigger, but making the image sizes the
same. This fixes it so the front sprites are the same size as the back
sprites, using the same fake perspective system.
I finally got to reading the SM2 documentation more closely, and saw:
> precision can vary between 20 msec to perhaps 0.5 seconds and the
> sound's position property will reflect this delta when the
> onPosition() callback fires
Emphasis on "this.position will reflect this delta".
Anyway, this new system should have significantly less noticeable
stuttering.
All audio is now stored as mp3/ogg, and cries now use the same filename
format as sprite IDs.
All cries have been updated to Gen 7, and at much higher quality and
lower filesize, too. They're roughly the same size of the old ones, e.g.
bulbasaur.mp3 is 8KB, same as the old bulbasaur.wav, but with much
better fidelity since the source file is a 159KB wav file.
Music is now also available in mp3/ogg, making it playable in the desktop
client.
I still mildly dislike Vorbis for being more CPU-intensive and not
hardware-accelerated, but we don't seem to have any other choice for the
desktop client.
TODO: Feature detection for ogg support. Browsers make this ridiculously
hard for some reason. The main problem is that SM2 supports MP3 a whole
lot of different ways, so MP3 should still be playable even without the
corresponding HTML5 support.