For too long, ntbb-session and ntbb-database have been maintained
outside of this repo, but no longer! All these files are now part of the
repository, making it significantly more self-contained.
If I had to say why it took this long, I think it was mostly inertia. It
was easier leaving them where they were than having to audit them for
private keys in the wrong places, etc.
I'm starting to think of PS more as sim first, website secondary than
the other way around, now. Especially now that we don't have a forum,
the website itself isn't really important... Maybe one day I'll get rid
of the landing page and make the sim itself the first thing you see when
you hit pokemonshowdown.com... but today is not that day!
The repo is still not "batteries-included" since I am not going to teach
anyone how to set up PHP and MySQL or even get the config files working.
But for anyone who wanted their own client, well, it gets a lot easier
to do now.
We do searches on keyup rather than keydown, but Enter registers on
keydown, so if you're typing quickly, "lum[enter]" and you press
Enter before releasing 'm', you do the search for "lu" instead.
Searching for "Ghost" would match "Arceus-Ghost" before the "Ghost"
type filter. This now puts the "Ghost" type filter first. "aghost"
(or just "agh") is still a valid way of getting Arceus-Ghost.
Compound words are now matched by the teambuilder for acronym and
substring search.
This means that "zhb" is now a valid search term for "Zen Headbutt",
and "ww" is a valid search term for "Whirlwind". "shock" is also a
valid search term for "Psyshock" and "Venoshock".
If, during effect activation, a Pokemon isn't where it's supposed to
be, we search the rest of the player's team for it.
For instance, when Destiny Bond activates, Deoxys has already fainted,
so it's not where we expect it to be. Normally, we search the player's
team for Deoxys, find the Deoxys, and Destiny Bond activates as normal.
The problem comes in formats without Species Clause. We might find the
wrong Deoxys! Normally, this isn't a big problem. For a Pokemon to
match, it has to have the exact same name, so the message displayed is
still "Deoxys took the foe's Blaziken down with it!" and everything
goes on normally.
The problem comes in Doubles formats without Species Clause. Finding
the wrong Deoxys overwrites its slot number, which, if it's an active
Deoxys, puts it in an inconsistent state, causing crashes later on.
This fix changes it so if a Pokemon isn't where it's supposed to be,
we search the rest of the player's team, excluding other active
Pokemon, for it.
This renames the previous isInactive flag in getPokemon to isSwitch,
which more accurately describes how its matching works.