Commit Graph

240 Commits

Author SHA1 Message Date
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Annika
33e82d85d5 Random Battles update 2021-07-01 16:33:40 -07:00
Marty-D
965eaff862
Gen 7 UU: Ban Quagsire
https://www.smogon.com/forums/posts/8900000/
2021-06-27 18:22:35 -04:00
Kris Johnson
a1ec8acea4 CAP: Nerf Chromera and Buff Voodoom 2021-06-12 22:52:49 -06:00
Karthik
9e19fea383
Gen 5: Reveal Mail in Team Preview (#8363) 2021-06-12 18:02:36 -07:00
Annika
6363a1854c Random Battles: Don't allow unreleased HAs 2021-06-07 18:45:22 -07:00
Annika
c55658ce06 Random Battles: Fix 3-move Pokemon 2021-06-05 20:33:44 -07:00
Annika
d8988bb250 Random Battles: Fix double-Hidden Power bug 2021-06-05 12:24:08 -07:00
Instruct
da8c1580ea
Gen 5: Refactor to use unreleasedHidden (#8349) 2021-06-05 09:00:15 -07:00
Leonard Craft III
d946308900
Fix the order of many end-turn resolution effects (#8307)
Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>
2021-05-17 11:53:52 -04:00
Annika
e2d468b6b1 Random Battles: Bugfixes 2021-05-12 14:42:19 -07:00
Guangcong Luo
7e965b41a7 Revert timing for adding rules to field in #8274
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.
2021-05-11 23:02:01 -07:00
Annika
071e21da5c
Random Battles: Refactor to use Sets and Multisets more (#8292) 2021-05-11 09:16:28 -07:00
Annika
0b438673a6 Fix BSS Factory item generation 2021-05-09 13:00:36 -07:00
Annika
15e6f9406f
Random Battles: Remove Normalium Z Porygon-Z 2021-05-08 18:13:19 -07:00
pyuk-bot
a76052af54
Scale team limits in Random Battles to maxTeamSize (#8281) 2021-05-07 23:52:20 -07:00
Annika
5d177a8384 Random Battles: Remove wrongly-implemented rules 2021-05-07 10:19:45 -07:00
Annika
0b4c904331 Random Battles: Fix crash 2021-05-06 23:27:48 -07:00
Annika
2b3741ec2f Random Battles: Support more Value Rules
Specifically, randomized formats will now support Max Team Size, Min Source Gen, Adjust Level, Adjust Level Down, and Force Monotype.

This fixes the issue with randomly-generated Multi Battle teams containing six Pokémon, instead of three as desired.
2021-05-06 22:45:08 -07:00
Karthik
367b4e7c2d
Implement Zacian/Zamazenta/Xerneas forme leak (#8261) 2021-05-06 19:24:59 -07:00
Guangcong Luo
36295dc27a
Simplify Team Preview events (#8274)
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.
2021-05-06 18:53:58 -07:00
Guangcong Luo
55980d416c
Support value rules (#8267)
`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
2021-05-06 01:16:16 -07:00
Karthik
ee5928622f
Gen VII: Backport Psychic Terrain priority hint (#8262) 2021-05-02 19:36:52 -05:00
pyuk-bot
fa974427ef
Migrate terrains from onTerrain to onResidual (#8232) 2021-04-25 13:00:37 -07:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
urkerab
9a18ada1f9
Grassy Terrain should only weaken moves against grounded targets (#8224) 2021-04-24 18:04:31 -05:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
pyuk-bot
3639079d1f
Protective Pads should not apply to Gulp Missile (#8207)
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-04-19 12:39:33 -04:00
Annika
2baca9339d Random Battles: Fix STAB in 4-player battles 2021-04-09 16:23:23 -07:00
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
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
2021-04-08 03:00:37 -07:00
Spandan Punwatkar
b77d6cb20f
Add simulator support for multi battle (#7929)
This doesn't include matchmaking support (which had to be removed
for reworking), but it includes everything else.

Co-authored-by: Spandamn <spandan.punwatkar@gmail.com>
Co-authored-by: MacChaeger <msaimrkon@gmail.com>
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-03-31 22:22:25 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
Annika
9e7074572e Random Battles update 2021-03-26 15:45:59 -07:00
Annika
ff56f7e503 Random Battles update 2021-03-19 18:28:08 -07:00
Annika
c7fd226253 Random Battles: Remove extraneous break statements 2021-03-16 17:23:27 -07:00
Annika
04f2e7d588 Random Battles update
https://www.smogon.com/forums/threads/random-battles-changelog.3678462/#post-8779954
2021-03-11 11:17:15 -08:00
Annika
550a4df374
Random Battles: Refactor Gen 5-7 (#8106) 2021-03-09 19:49:47 -08:00
Marty-D
dfb4f2cd90 Implement buggy Trick/Switcheroo behaviour with Kyogre/Groudon
Thanks Zaggyo!
To be reverted assuming it's patched someday.
2021-02-17 13:53:01 -05:00
ACakeWearingAHat
0c42a8f5bf
Random Doubles Updates (#8029)
Patch notes (2/13/21):
-Prevent Virizion with 1 attack by preventing Coaching from generating with any other setup move.
-Prevent First Impression from generating with any setup move, for Sirfetch'd.
-Reject Protect if Belly Drum is in the movepool but hasn't been rolled, in an attempt to prevent Belly Drum-less Eiscue.
-Fix post-refactor bug causing heavy-duty boots to generate where it shouldn't
-Glastrier: Icicle Crash over Avalanche
-Keldeo: Muddy Water over Hydro Pump and Scald, added Air Slash.
-Regieleki: Electroweb over Eerie Impulse
-Various level balancing. Pokemon above 56.00% win rate nerfed. Pokemon below 46.00% win rate buffed. Highlights: Moltres-Galar, Regidrago, Calyrex-Shadow, Zacian-C down again, Maractus, Toxapex, Shuckle, etc. up. See pull request for full list of level changes.

Gen 7 Random Doubles: Remove Protect from Typhlosion to prevent Choice Scarf Protect.
2021-02-13 15:09:55 -08:00
ACakeWearingAHat
3b9c79624d
Battle Factory: Fix Slowbro and Arceus EVs (#8018) 2021-02-13 13:22:39 -08:00
Annika
bb4cbf3394
Random Battles: Refactor for code standards and readability (#8021)
This PR
- Brings all Random Battles code up to the standard 120-charaacter line length limit
- Improves readability for all Random Battles code
- Refactors current-gen Random Battles team generation to be more modular and readable

Documentation thanks to @ACakeWearingAHat!
2021-02-12 15:50:04 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Marty-D
bc144b8504 Descriptions: Remove duplicates 2021-01-24 13:26:04 -05:00
The Immortal
1d941a90d3 Random Battle improvements 2021-01-19 06:01:35 +04:00
urkerab
f0d3c85148
Fix Soundproof blocking self sound moves in Gen 8 (#7917) 2021-01-15 20:05:32 -06:00
The Immortal
ed23a6f07e Random Battle updates 2021-01-11 20:46:12 +04:00
The Immortal
3ae56399bd Label Pokemon banned from LC as NFE 2021-01-11 00:29:18 +04:00
The Immortal
2bd9e757c4 Past gens: Random Battle improvements 2021-01-10 19:19:33 +04:00
urkerab
2c0bd53966
Grassy Terrain should heal before Leftovers (#7882) 2021-01-07 19:17:48 -05:00