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.