* Move Gen 1 Counter tests into its own section
* Confusion damage, (h)jk recoil, and draining can be countered in gen 1
* Recoil and Drain round down in gen 1 (against substitute)
* Add tests for Counter + fix linting issue
* lastSelectedMove is updated when Mirror Move or Metronome calls another move
* Move pokemon.side.lastMove setting into a (more) correct location
* move pokemon.lastMove as well
* Remove unnecessary seed in test
* The volatiles don't actually do anything
* Gen 1: implement stat down overflow glitch
* Change the wording of the hint slightly
* Add hint for division by zero avoidance
* Gen 1: Confusion/Psybeam can confuse enemies with substitute, and with probability 25/256 (not 26/256)
* Add explanatory hint for secondary effect confusion against Substitute
* Gen 1 Stadium: fix battle crash when Wrap KOs an enemy
* Fix explosion against semi-invulnerable enemies + shift disable-rage message location
* Add relevant Explosion test
* Add explanatory hint for Disable/Explosion boosting Rage
* Move rage interaction back to where it was
* Gen 1: Fix Wrap against a substitute
* Gen 1: Fix Wrap when it hits Ghosts behind a substitute
* Remove unnecessary 'else' statement
* Fix Stadium as well
* Fix Gen 1 Japanese as well
* Gen 1: Fix Counter interaction with Substitute
* reverse an unintentional empty line delete
* reverse an unintentional empty line delete
* updating a couple of comments
* Update gen 1 Japanese version as well
* Update test/sim/moves/counter.js
Co-authored-by: pyuk-bot <msaimrkon@gmail.com>
* Update test/sim/moves/counter.js
Co-authored-by: pyuk-bot <msaimrkon@gmail.com>
Co-authored-by: pyuk-bot <msaimrkon@gmail.com>
* Gen 1: Fix multiple Transform bugs
* Modify partners in crime transformInto to be consistent with pokemon.ts changes
* undoing accidental sync of different branch
This is the change that renames:
- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`
In addition, some other APIs have been updated:
- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
- Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
- Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`
Team functions have been split off into a new `sim/teams` package:
- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`
`Teams.export` has also been rewritten to better match how it works in client.
This implements #8178
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.
This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).
This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:
https://github.com/smogon/pokemon-showdown/pull/8138
* Lint arrow-body-style
* Lint prefer-object-spread
Object spread is faster _and_ more readable.
This also fixes a few unnecessary object clones.
* Enable no-parameter-properties
This isn't currently used, but this makes clear that it shouldn't be.
* Refactor more Promises to async/await
* Remove unnecessary code from getDataMoveHTML etc
* Lint prefer-string-starts-ends-with
* Stop using no-undef
According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:
- it's catching a lot of things it didn't catch in the past, for
reasons unclear to me
- no-unused-vars has to be explicitly disabled in global-types now
- a lot of `ts-ignore`s were never necessary and have been fixed
- Crashlogger can now handle being thrown things that aren't errors.
This has never been a problem in the past, but to satisfy TypeScript
we might as well not die in a fire on the off chance someone tries to
`throw null` or something.
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.
I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.
`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.