arcanis/pokelib — pull request #1 by Wack0 (2014-06-27 22:39:03+00:00)
Title: Fixed a whole bunch of stuff.

Some bugs are fixed, and also some issues that seem to be design issues.

This pull request could break existing code, as index numbers are now the same as those internal to R/B. (so Rhydon is 0x1 not 0x0, Master Ball is 0x1 not 0x0 etc). However, those who have an interest in R/B internals would be expecting index numbers to be the same as those internal to R/B, and not off by one.

List of changes made by this PR:

1) Bug in example fixed where a 404 occurs if pokedexId is blank. Small bug but it annoyed me when I was debugging issues in the console.
2) Bag.indexOf() now searches the entire bag and not all but the last item.
3) Bag.add() now works.
4) All items, species and moves are now available to access through the various arrays. I don't know anything about growth rates, so I left that untouched.
5) Modified TeamPokemon.species(). It now checks 0xD163 (Number of Pokémon), rather than checking for species 0 and 0xff (and therefore breaking if those invalid Pokémon are in the party).
6) Added some characters to the PDS conversion process, and fixed an extra character between 0xEB and 0xEC that was causing off-by-one issues with conversions involving characters past 0xEB (like numbers).

Also, let me just say this library is awesome and I've already thought of a list of features to implement when I have time; some big, some small.