PS officially doesn't use this, but some bots used to read this
directly from GitHub, and building it is nontrivial, so this lets
bots read it from our webserver instead.
It's available at:
https://play.pokemonshowdown.com/data/formats.js
(And as usual, feel free to use HTTP if your language's HTTPS
implementation is hard to use.)
`learnsets-g6` has always been versioned because in Gen 6, it contained
START move order.
For instance, Clefairy in BW2 has the following level-up moveset:
- START: Pound
- START: Growl
- L4: Encore
- L7: Sing
- L10: Double Slap
If you catch a wild level-10 Clefairy, its moveset will be: Growl,
Encore, Sing, Double Slap. A level-10 wild Clefairy will always have
Growl and never have Pound, because the order of its first two moves
matters.
PS's regular learnsets file doesn't take this into account, so we
tracked a `learnsets-g6` file that did, but also needed to keep in sync
with new game updates.
Well, these are no longer necessary. We've updated to Gen 7 and now
Gen 8, and we've never had START ordering for any of them. Anyone who
wants START ordering for Gen 6 can find it here:
https://github.com/Zarel/Pokemon-Gen-6-Learnsets
For this repo, though, `learnsets-g6` is still around (used only by
PSdex), but it can now be automatically built from `learnsets` without
losing anything, and so it can finally be `.gitignore`d.
git rev-parse --short sometimes returns less than 8 characters,
meaning the dedup logic is off. One alternative is just to check
origin.startsWith instead, but making them both a uniform 8 works as
well.
This makes it so a regular build will rebuild battle text, instead of
requiring a full build.
battle text is under active development, so this is pretty useful,
even if conceptually, text is purely a graphical thing and not actually
needed by headless battles.
All battle text messages have been moved out of `src/battle.ts` and
into its own file `data/text.js`.
Code for handling this is in the new files `src/battle-log.ts` and
`src/battle-text-parser.ts`.
`data/text.js` is now extremely self-contained, and nearly ready for
translation support!
This is a significant modernization of battle.ts. In addition to moving
messages out:
Functions for getting names (`pokemon.getLowerName()` etc) have been
removed.
`battle.minorQueue` has been removed. Minor lines are now processed
directly on the main queue, with a new `battle.waitForAnimations`
flag to decide whether or not the main queue should wait for animations
to finish before moving on to the next line.
`battle.waitForResult()` and `battle.endPrevAction()` have been
removed. These confusingly-named functions closed the messagebar (and
flush the minor queue). They've been replaced with
`scene.maybeCloseMessagebar()`.
`pokemon.markMove()` and `pokemon.markAbility()` have been renamed
`pokemon.rememberMove()` and `pokemon.rememberAbility()`.
This splits battle-dex.ts up into:
- `battle-dex.ts`
- dex data access, misc tools
- `battle-log.ts`
- manipulating HTML, especially in battle logs
This turned out to be a pretty significant portion of what was
previously battle-dex.
This is the first step of moving the entire client over to
TypeScript + Preact!!!!
The main change here is that battledata.js has been split into three
files:
- `src/battle-dex.ts`
- `src/battle-dex-data.ts`
- `src/battle-dex-misc.js`
These are concatenated back into `battledata.js` in the client, so
third parties (and specifically, old replay files) should be
unaffected. Also, this makes sure that we don't have more than two
dependencies right now.
The compilation is done with Babel 7 beta, because no stable version
of Babel supports TypeScript. We're not using `tsc` because it can't
compile to ES3 and it doesn't support preserving line numbers.
`toRoomid` has been moved from client.js to battle-dex.ts.
We no longer have the relevant Githook for automatic building, so
putting it in `githooks/` no longer makes much sense. It's now manually
called with a build script `./build`, like other PS websites (most
notably PSDex and the damagecalc).