Commit Graph

203 Commits

Author SHA1 Message Date
Annika
3ca947225f Random Battles updates 2021-04-09 17:13:18 -07:00
Annika
2baca9339d Random Battles: Fix STAB in 4-player battles 2021-04-09 16:23:23 -07:00
Annika
eb864962e2 Random Battles: Prevent Gmax regional Pikachus 2021-04-08 12:26:53 -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
pyuk-bot
2a63878645
Random FFA Battle: Don't give anything Ally Switch (#8167) 2021-04-03 01:50:18 -07:00
Annika
d38d81cf68 Random Battles: Remove April Fools' joke 2021-04-01 17:46:59 -07:00
Annika
124b396e54 Random Battle: Adjust levels for No Dmax + Doubles 2021-04-01 17:46:59 -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
ACakeWearingAHat
489919fefd
Random Battles No Dmax: Adjust CAP levels (#8157) 2021-04-01 00:52:53 -04:00
ACakeWearingAHat
f8ca24badf
Random Battles: Improve joke sets (#8155)
* Rands AFD patches

some minor hardcodes to account for abilities and items

* Update data/random-teams.ts

* Update data/random-teams.ts

* Update data/random-teams.ts

Co-authored-by: Annika <annika0uwu@gmail.com>
2021-03-31 21:12:40 -07:00
Annika
d5b11819bd Random Battles: Fix tests
I should get in the habit of running full-test locally more often...
2021-03-31 20:58:48 -07:00
Annika
e2d5438023 Random Battles: Add April Fools' joke 2021-03-31 20:16:05 -07:00
ACakeWearingAHat
0c91d7da4d
Random Battles: Allow Curse Registeel (#8146) 2021-03-29 20:16:40 -07:00
Annika
24c4ed134c Random Battles: Revert SpeedSetup changes
Requested by the Random Battles community.

I do not approve of this design in the slightest.
2021-03-27 18:37:11 -07:00
Annika
a115f1d415 Random Battles: Make speedsetup 2-stage boosts 2021-03-27 16:03:18 -07:00
Annika
2e8b32333d Random Battles: Fix Necrozma frequency 2021-03-26 17:03:20 -07:00
Annika
9e7074572e Random Battles update 2021-03-26 15:45:59 -07:00
Annika
19c5883e84 Random Battles: Fix Weakness Policy 2021-03-19 20:48:57 -07:00
Annika
ff56f7e503 Random Battles update 2021-03-19 18:28:08 -07:00
Annika
7f237eb87f Random Battles: Fix Golisopod's moveset
Oops I forgot to push this with the other two
2021-03-18 18:31:14 -07:00
ACakeWearingAHat
3d9aa7dec3
Random Battle: bugfixes and minor updates (#8124) 2021-03-18 11:35:07 -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
3b2f5e1b4e Random Battles: Allow Rock Head + Curse 2021-03-10 18:08:07 -08:00
ACakeWearingAHat
333371b709
Add [Gen 8] Random Battle (No Dynamax) (#8111) 2021-03-10 17:19:50 -08:00
Annika
9b354e51d4 Random Battles: Prevent Taunt + Encore 2021-03-10 10:29:09 -08:00
Annika
550a4df374
Random Battles: Refactor Gen 5-7 (#8106) 2021-03-09 19:49:47 -08:00
Annika
776be29d89
Random Battles: Allow Aerial Ace + Choice Scarf 2021-03-07 15:13:23 -08:00
Annika
15261b6611 Random Battles updates
https://www.smogon.com/forums/threads/random-battles-changelog.3678462/#post-8774180
2021-03-05 15:09:30 -08:00
ACakeWearingAHat
d0eeeac7f0
Random Battles: Improve documentation (#8096) 2021-03-05 14:18:00 -08:00
Annika
0b7d09079d Random Battles: Fix items in Random Doubles
oops i meant to put that only in the gen 4 file
2021-03-03 23:20:06 -08:00
Annika
13a870a4a3
Random Battles: Refactor Generation 4 (#8087) 2021-03-03 13:16:50 -08:00
Annika
377c315b2f Random Battles update 2021-02-26 14:57:51 -08:00
Flametix
7d1c893e12
Fix typo in Challenge Cup team generator (#8075) 2021-02-25 19:15:09 -08:00
ACakeWearingAHat
b8238a6ad6
Random Battles: Bugfixes for movesets (#8074) 2021-02-25 15:29:43 -08:00
Annika
591eb345ce
Random Battles: Refactor LGPE and Gens 1-3 (#8060) 2021-02-23 10:27:19 -08:00
Annika
68dde4c058
Implement RandomTeams#multipleSamplesNoReplace (#8059) 2021-02-22 11:42:25 -08:00
ACakeWearingAHat
c9e431ed48
Random Battles: Bugfixes for Doubles and old generations (#8058) 2021-02-19 16:08:27 -08:00
Annika
f39fa2d90d Random Battles update
https://www.smogon.com/forums/threads/random-battles-changelog.3678462/#post-8758859
2021-02-19 14:21:36 -08:00
Annika
b08db6df5c Random Battles: Fix Virizion's physical moveset 2021-02-17 22:11:30 -08:00
Annika
08179d793d
Random Battles: Remove extraneous break statement 2021-02-16 16:46:45 -08:00
pyuk-bot
5e7c8287d3
Randbats: Let Nihilego's Beast Boost boost SpA (#8043) 2021-02-15 19:40:57 -08:00
ACakeWearingAHat
3ecff5293d
Random Battles Bugfixes (#8039)
- Prevent Air Slash from generating on Swords Dance Virizion by further specifying a line in move enforcement (Co-authored-by: Annika <annika0uwu@gmail.com>)
- Prevent Scaldless Slowking
- Make Darmanitan-Zen-Galar get Salac Berry instead of Sitrus Berry
- Make Stone Edge more likely to generate in Random Doubles (formerly erroneously uncommon due to a singles rejection)
- Fix RestTalk setup sweepers from rejecting the setup move erroneously (affects Type: Null, Throh, Suicune, etc.)
2021-02-15 15:51:33 -08:00
Kris Johnson
f358054f6b
Make tests pass locally (#8034) 2021-02-15 01:32:49 -08:00
Annika
f2c12e759e Random Battles updates
- Keep Sitrus Berry Eiscue, remove Reversal from Eiscue's movepool and add Substitute, and prevent Zen Headbutt + Substitute sets
    - give Eiscue a Salac Berry if it has Substitute
    - Ensure that Entei always gets Extreme Speed
    - Don't select Moxie if Defog is in a Pokémon's moveset
    - Add Strange Steam to the list of preferred fairy moves in the moveRejectionCheckers
    - Prevent Volt Switch sets with < 90 Speed from having Life Orb
    - Prevent Comfey from getting Stored Power without Calm Mind
    - Do not allow Hurricane to be given to Pokémon with physical setup movesets
    - Prevent Grass Knot + Surf
    - Prevent Defog + Moxie
    - Give Belly Drum sets Sitrus Berry
2021-02-14 15:56:54 -08: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
pyuk-bot
ea36d00ad2
Randbats: Pikachu should not get Eviolite (#8026) 2021-02-12 19:44:02 -08:00
Annika
d4378730e5 Random Battles: Fix Eviolite generation 2021-02-12 19:16:49 -08:00
Annika
94910027b5 Random Battles: Fix items for Xerneas and Ninjask 2021-02-12 18:31:12 -08:00
Annika
47fb5835ea Random Battles: Remove refactor artifacts 2021-02-12 17:51:53 -08:00
Annika
1ed3dbeff1 Random Battles set improvements
- Comfey will no longer get Choice Specs and Stored Power
- HItmonlee will no longer get Curse and Reckless
2021-02-12 17:49:51 -08:00
Annika
4977d045e4 Random Doubles Battles: Fix Body Press selection
Co-authored-by: ACakeWearingAHat <carrotlobotomy@gmail.com>
2021-02-12 17:25:36 -08:00
Annika
c55726a0f0 Random Battles: Fix set generation with STAB moves 2021-02-12 16:59:40 -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
The Immortal
b4b58400a1 Random Battle updates 2021-02-01 23:42:05 +04:00
The Immortal
767d32efe2 Random Battle: Enforce Grassy Glide Rillaboom 2021-01-26 01:22:30 +04:00
The Immortal
1d941a90d3 Random Battle improvements 2021-01-19 06:01:35 +04:00
The Immortal
710d9b99ed Fix build 2021-01-11 21:08:16 +04:00
The Immortal
ed23a6f07e Random Battle updates 2021-01-11 20:46:12 +04:00
LegoFigure11
cad1d25c4d
Add Gen 8 BSS Factory (#7843) 2020-12-31 02:09:29 +04:00
The Immortal
1307f8abca Zarude-Dada should be legal 2020-12-27 13:45:47 +04:00
The Immortal
157e8a0f32 Random Battle improvements 2020-12-16 22:55:18 +04:00
ACakeWearingAHat
4fda00e8ac
Update Doubles/Gen 2 Random Battle (#7808) 2020-12-15 11:52:47 +04:00
The Immortal
bce1267fae Improve randoms generator 2020-12-10 15:33:08 +04:00
Guangcong Luo
ea58695f0f Revert "CC/HC: Fix level balancing formula (#7773)"
This change was controversial. pyuk agreed to revert in preparation for
Random Battles Team Tour 4 as mentioned in:

https://www.smogon.com/forums/threads/revert-the-level-changes-to-hackmons-cup.3674551/

This reversion should not be interpreted as taking a side in whether
the level formula should be changed after the tour.

This reverts commit b6bf805a1a.
2020-12-09 23:18:41 +00:00
The Immortal
2bb8a45968 Random Battle updates 2020-12-09 10:51:44 +04:00
MacChaeger
b6bf805a1a
CC/HC: Fix level balancing formula (#7773) 2020-12-08 09:55:30 +04:00
The Immortal
aec64e8704 Random Battle updates 2020-12-07 14:14:47 +04:00
The Immortal
83bc516260 Random Battle improvements 2020-12-01 16:07:26 +04:00
The Immortal
342d6b0c7c Random Battle improvements 2020-11-19 16:42:26 +04:00
Kris Johnson
7877b95e67 Random Battle: Fix typo and remove redundant check 2020-11-16 22:40:48 -07:00
The Immortal
97dba8173f Random Battle improvements 2020-11-16 07:26:28 +04:00
ACakeWearingAHat
1aafb31a6d
Update Gen 2/Gen 8 Doubles Random Battle (#7693) 2020-11-15 15:02:07 +04:00
urkerab
2a8f3146ea
Fix Gastrodon-East in Challenge Cup (#7688) 2020-11-12 17:03:24 +04:00
The Immortal
2bc4a51a50 Random Battle improvements 2020-11-03 19:43:57 +04:00
The Immortal
3165246829 Random Battle: Minor updates 2020-10-31 17:38:23 +04:00
The Immortal
501f502ebc Add Pikachu-World event 2020-10-31 00:07:31 +04:00
The Immortal
2e6ccdd738 Random Doubles: Fix Regieleki 2020-10-28 22:47:43 +04:00
The Immortal
5353a8a239 Random Battle improvements 2020-10-27 22:56:10 +04:00
ACakeWearingAHat
b4ac82a807
Allow Randdubs Power Construct Zydog (#7583) 2020-10-26 23:31:27 +04:00
The Immortal
f565659fd3 Random Battle updates 2020-10-26 20:12:55 +04:00
ACakeWearingAHat
186dbae731
Random Doubles Updates (#7569) 2020-10-26 20:05:10 +04:00
The Immortal
4ddc744847 Add new Random Battle sets 2020-10-23 21:14:38 +04:00
The Immortal
61dacb6252 Random Battle improvements 2020-10-21 21:04:21 +04:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* 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.
2020-10-19 02:42:28 -07:00
The Immortal
5c39dcc9ce Random Battle updates 2020-10-17 14:37:13 +04:00
The Immortal
a4c38fb898 Random Battle improvements 2020-10-09 13:54:52 +04:00
The Immortal
f01a965570 Random Battle improvements 2020-10-05 04:27:57 +04:00
The Immortal
7855d4772d Random Battle improvements 2020-10-01 00:52:55 +04:00
The Immortal
0d71ec82c3 Random Battle improvements 2020-09-22 11:56:21 +04:00
ACakeWearingAHat
e3b9b95283
Random Battles updates (#7358) 2020-09-14 01:29:48 +04:00
The Immortal
d25ec1cbca BF/CAP 1v1: Move sets loading outside constructor 2020-09-02 15:44:34 +04:00
The Immortal
5f93b4bd28 Random Battle improvements 2020-09-01 17:16:52 +04:00
ACakeWearingAHat
d02ee67d03
Random Doubles Updates (#7270) 2020-08-28 15:20:27 +04:00
The Immortal
965cb43cf2 Random Battle: Improve Rillaboom 2020-08-27 00:04:56 +04:00
ACakeWearingAHat
80c16d7818
Random Doubles: Fix Moxie (#7259) 2020-08-26 01:12:38 +04:00
The Immortal
29b410b8de Random Battle updates 2020-08-24 15:56:34 +04:00
ACakeWearingAHat
2c4eda8798
Random Doubles fixes (#7177) 2020-08-08 15:58:22 +04:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
The Immortal
1360f7d06d Random Battle updates 2020-08-01 17:31:16 +04:00