Commit Graph

49 Commits

Author SHA1 Message Date
Annika
4d73b897b6 Random Battles: Support more value rules
This adds support for `Max Move Count` and `Adjust Level`
2022-03-30 21:56:43 -07:00
Annika
dce7f33b65 Random Battles: March 2022 balance patch 2022-03-03 18:26:01 -08:00
pyuk-bot
32892af464
Fix National Dex Eviolite checks (#8650) 2022-02-01 13:51:04 -05:00
Annika
70aac0296e Random Battle: Account for nonexistent evolutions 2022-01-30 18:02:29 -08:00
Tarrembeau
45aa870868
[Gen 5] Random Battle: Properly level Pokémon in the '(PU)' tier (#8626) 2022-01-13 10:42:12 -08:00
Annika
ed8948153d Random Battle: Make [Gen 5] PUBL Pokémon level 88 2022-01-12 09:55:31 -08:00
WeWuzNidokangz
7097a9ac75
Hackmons Cup: Support custom team bans/unbans (#8607) 2022-01-09 14:46:41 -08:00
Annika
746ef6f8bd Random Battles: Fix Gen 5 Arceus 2021-11-26 21:07:16 -08:00
Annika
d3a2911c27 Random Battles: Use correct Dex APIs 2021-10-08 19:50:52 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Annika
82d21aa33c Random Battles: Fix Venusaur bug in Gen 5 2021-07-02 19:49:43 -07:00
Annika
6363a1854c Random Battles: Don't allow unreleased HAs 2021-06-07 18:45:22 -07:00
Annika
d8988bb250 Random Battles: Fix double-Hidden Power bug 2021-06-05 12:24:08 -07:00
Annika
071e21da5c
Random Battles: Refactor to use Sets and Multisets more (#8292) 2021-05-11 09:16:28 -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
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
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
ACakeWearingAHat
00bd42826f
Random Battles: Updates to Gen 5 (#8127) 2021-03-20 17:31:36 -07:00
Mia
4f710d3ce8 Remove random Monitor.slow() from random-teams 2021-03-10 08:41:27 -06:00
Annika
550a4df374
Random Battles: Refactor Gen 5-7 (#8106) 2021-03-09 19:49:47 -08:00
ACakeWearingAHat
c9e431ed48
Random Battles: Bugfixes for Doubles and old generations (#8058) 2021-02-19 16:08:27 -08:00
Annika
864a37f66d Random Battles: Fix Gen 5 STAB move regression 2021-02-13 12:08:19 -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
396b46b92c Random Battle fixes 2021-02-01 08:00:44 +04:00
The Immortal
7d5f9b455d Gen 5: Random Battle updates
- Various movepool improvements
- Prevent Toxic with setup or Trick Room
- Prevent Rain Dance with RestTalk
- Force Seed Flare and Horn Leech
- Reject Keen Eye
- Reject Intimidate so Shed Skin is rolled
- Fix Toxic/Flame Orb selection
- Improve Leftovers and Life Orb selection
2021-01-30 23:42:08 +04:00
The Immortal
b737c5a728 Gen 5: Random Battle improvements
- Various movepool adjustments
- Prevent Substitute + Circle Throw (Poliwrath)
- Improve Protect rejection
- Prevent Water Spout outside of Choice sets (Kyogre)
- Prevent Ice Punch with RestTalk (optimizes Throh and Muk)
- Make RestTalk Throh have Guts
- Make Gardevoir have Trace
- Fix Tinted Lens rejection (Venomoth)
- Improve Gem selection with Unburden
- Increase the bulk cut-off for Focus Sash
- Allow Sturdy leads to roll Custap Berry (Golem)
2021-01-23 22:28:52 +04:00
The Immortal
7ab649a666 Gen 5: Random Battle updates
- Various movepool changes
- Prevent Trick Room + Haze Cofagrigus
- Prevent Extreme Speed + Roost Dragonite
- Prevent Head Smash + Roost Archeops
- Give Bouffalant Sap Sipper
- Give Rain Dance and Sunny Day Pokemon Life Orb
- Remove Rocky Helmet Ferrothorn
- Improve Leftovers, Life Orb, and Focus Sash selection
- Fix Unown's level
2021-01-21 18:32:13 +04:00
The Immortal
1d941a90d3 Random Battle improvements 2021-01-19 06:01:35 +04:00
The Immortal
0bd3e854ff Gen 5: Fix Moody appearing in Randoms 2021-01-17 16:12:02 +04:00
The Immortal
2bd9e757c4 Past gens: Random Battle improvements 2021-01-10 19:19:33 +04:00
The Immortal
85761cca5b Gen 4 Random: Fix Mono-Electric teams 2020-12-19 14:56:13 +04:00
The Immortal
bce1267fae Improve randoms generator 2020-12-10 15:33:08 +04:00
The Immortal
9965288bd2 Gen 5 Random: Fix Monotype Normal teams
Closes #7782
2020-12-09 22:12:30 +04:00
Kris Johnson
7877b95e67 Random Battle: Fix typo and remove redundant check 2020-11-16 22:40:48 -07:00
The Immortal
201842c421 Allow Same Type Clause to work in gen 5/4 Random 2020-11-15 16:47:03 +04:00
Guangcong Luo
3d68248efa Update to latest eslint
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.
2020-09-29 15:28:08 -07: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
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
The Immortal
f9791abba9 Random Battles: Fix cosmetic formes 2020-06-04 03:06:07 +04:00
ACakeWearingAHat
f797cdd98b
Update Gen 5 Random Battle (#6773) 2020-06-04 02:57:35 +04:00
Leonard Craft III
3496491d4f
Fix Farfetch'd / Sirfetch'd with new apostrophe (#6721)
Also fixes Stick's behavior
2020-05-19 21:56:35 -07:00
The Immortal
fc62da963a Random Battle: Adjust Pokemon rates 2020-05-03 02:31:15 +04:00
The Immortal
9bb97f0228 Random Battle: Update forme generation 2020-05-01 08:18:29 +04:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00