Gen 1 Endless Battle Clause now accounts for:
- frozen pokemon
- Struggle against Ghosts
- Ditto transforming into Ditto
Gen 1 Stadium now correctly simulates Transform failing in Transform-vs-Transform situations.
We now have a `Teams.import` function. This supports importing teams
in any format, allowing it to be the backbone of a new series of
commandline functions, which support teams in any format.
`./build decl` now builds TS declarations for everything exported by
`sim/`. Unfortunately, the built TS declarations still refer to global
types, so some things still have `any` type, but it's much better than
nothing.
This is a dumb hack, but it allows everyone to use PS's lib files
with `require('pokemon-showdown')`.
This is EXTREMELY unsupported and I make ZERO guarantees about API
stability.
Changes relevant to our codebase:
- TypeScript now knows that `typeof id === 'string'`! A bunch of casts
on `User | ID` or `Room | RoomID` are no longer necessary!!!
- `override` will protect against certain typoes, and we'll adopt it
(and `--noImplicitOverride`) as soon as sucrase comes in
- `declare` is now required for properties we want to narrow the type
of without directly overwriting - a good thing to use going forward,
but very annoying to fix all our old code for
defaultLevel should not be set to maxLevel if this would make teams break
maxTotalLevel.
Fixes a bug where level 100 pokemon were automatically set to higher
levels in cases where it didn't make sense.
"EV Limit = 510" is now its own rule which can be changed separately
from the rest of Obtainable Misc.
The rest of Obtainable Misc doesn't seem useful to break up, so I
haven't bothered.
This fixes an issue where a Weezing-Galar evolved from a Koffing
gotten from a Virtual Console transfer from RBY/GSC should be able
to have a non-Hidden Ability, but couldn't.
Thanks @Karthik99999 for bringing this to my attention.
Fixes#8327
`no item` is now a fake item meaning "not holding an item", for the
purposes of the team validator. This means that `-no item` will force
all pokemon to carry items.
`all items` no longer includes not holding an item, so `-all items`
will now work as expected.
It turns out rules need to be added before sides are initialized,
so that they can hook `ModifySpecies` during side initialization.
The proper way to fix this is pretty complex so this is just a hack.
Also stop enforcing 4 moves limit and 6 pokemon limit in `-Nonstandard`,
for the same reason we stopped enforcing the level 100 limit; any format
that explicitly wants it higher should automatically override it.
In format events:
`onFieldTeamPreview` has been renamed back to `onTeamPreview`. It's now
a custom event (like `onBegin`), rather than a field event.
Team Preview data has been entirely moved from `onBegin` into
`onTeamPreview`.
`onFieldStart` for formats/rules now happens after Team Preview, rather
than before. Use `onBegin` for things that happen before Team Preview.
`teamLength`, `maxLevel`, `cupLevelLimit`, and `minSourceGen` no longer
exist as properties of `Format`. Instead, they're value rules that
become properties of `RuleTable`, and can be specified as custom rules
and inherited through rulesets like anything else.
See the PR for a full reckoning of changes:
https://github.com/smogon/pokemon-showdown/pull/8267
`maxTeamSize` is a bad variable name (not that `teamLength.battle` is
any better, but that'll get fixed in a future refactor).
- Rename `maxTeamSize` to `chosenTeamSize`, to better indicate that
this is the size after Team Preview, and that it is also the minimum
size after Team Preview.
- Don't limit team sizes to 6 if `teamLength.battle` isn't specified.
This removes an unnecessary `teamLength.battle` requirement in all
Custom Game formats.
- Stop requiring `maxTeamSize` as a parameter for `battle.getRequests`.
It's not even used except as a hint to the Preact client, and was
never state in the first place.
- Stop supporting partial `side.chooseTeam`. This is an unused feature
and removing it massively simplifies the code and fixes a bug in
`cupLevelLimit` which definitely was not written with the
understanding that `chooseTeam` could be partial.
- Fix a bug in #7929 which seemed to misunderstand what `teamsize` was
for.