We now just use JSON.parse and JSON.stringify - it's supported by all
browsers supported by the client.
Tools.safeJSON has also been moved to Storage.safeJSON, since it's not
used in replays at all.
The Toxic turn tracker is now 1 off from previously; it now counts the
previous Toxic turn rather than the next one. This makes "0" more
intuitively represent the state before any Toxic damage is taken.
This fix mainly just fixes the type issue by removing the need for a
null value at all.
This doesn't change debuggability and saves a bit of bandwidth.
But most importantly, it might help Windows users who are having
trouble compiling because Babel runs out of memory.
Restoring a backup previously required all teams to be packed, or all
teams to be unpacked. Now, we support pasting a mix of packed and
unpacked teams.
I absolutely refuse to believe there's any risk at all to using
document.write with a constant string.
But it's fair that it's non-standard, and won't work if the script
is loaded dynamically/asynchronously, so let's switch to the standard
way to dynamically load scripts and styles.
I'm still using `.src = foo` instead of `.setAttribute('src', foo)`
because there's no reason to write modern code when old-school code
works and is arguably more readable.
I know, I know, unused code should be removed, not commented out. In
my defense:
1. This kind of code is really annoying to dig out of Git.
2. This kind of code will be used when this is refactored for use for
an external messages file, which is planned (and necessary for
translation support.)
Team backup/restore was previously always unpacked, which is good for
readability but bad for memory usage. At high team counts, this can be a
serious problem, so with this change, if you have more than 350 teams,
your teams will be backed up in packed format.
It is possible, in most cases, to correctly track Pressure PP in Gen 3.
It is, however, a fuckton of work, and I'm way too busy to do that work
right now.
So instead, have a warning about how PP tracking might be wrong in the
event of Pressure.
TODO: Send silent still Pressure activations using |split|
Zoroark is now a case in which an opponent might have more apparent
pokemon than we were told from Team Preview.
TODO: Fancier tracking so people don't report bugs about pokemon count
with Zoroark in randbat
Abilities suppressed by Gastro Acid or Core Enforcer now show up as
"(suppressed)" in tooltips, and will no longer show as taking effect
in move tooltips.
Fixes#1132