Commit Graph

49 Commits

Author SHA1 Message Date
Annika
08c30438fb Fix CI 2022-04-04 16:25:21 -07:00
Annika
d09e2d8354 Random Battles: April 2022 patch 2022-04-04 16:22:31 -07:00
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
pyuk-bot
a9bd134661
Gen 6 Randbats: Fix base forme abilities of megas (#8682)
* Gen 6 Randbats: Fix base forme abilities of megas

* Actually fix the ability pool
2022-03-05 12:35:48 -08:00
Annika
dce7f33b65 Random Battles: March 2022 balance patch 2022-03-03 18:26:01 -08:00
pokeblade101
530548b76a
Random Battle: Make Luvdisc level 100 in Gen 6 and 7 (#8664) 2022-02-12 21:09:26 -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
WeWuzNidokangz
7097a9ac75
Hackmons Cup: Support custom team bans/unbans (#8607) 2022-01-09 14:46:41 -08:00
Annika
75ab25b160 Random Battles updates 2021-12-05 18:17:15 -08:00
Annika
ae84fefa4a Random Battles: Fix item generation for Arceus 2021-11-26 12:10:42 -08:00
Annika
5d90cc66f4 Add [Gen 7] Monotype Battle Factory
Also removes Monotype teams from regular Battle Factory, as per https://www.smogon.com/forums/threads/monotype-in-gen-7-battle-factory-and-going-forward.3688757/#post-9001460
2021-10-10 20:27:17 -07:00
Annika
d3a2911c27 Random Battles: Use correct Dex APIs 2021-10-08 19:50:52 -07:00
Annika
3aa9934e65 Random Battles updates 2021-08-02 14:20:38 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Annika
6363a1854c Random Battles: Don't allow unreleased HAs 2021-06-07 18:45:22 -07:00
Annika
c1c1f8976d Random Battles: Fix Hidden Power bug in Gen 6 2021-05-27 10:18:04 -07:00
Annika
a77db612c8 Random Battles updates 2021-05-23 16:11:54 -07:00
Annika
e2d468b6b1 Random Battles: Bugfixes 2021-05-12 14:42:19 -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
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
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
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
Annika
3ca947225f Random Battles updates 2021-04-09 17:13:18 -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
Annika
c7fd226253 Random Battles: Remove extraneous break statements 2021-03-16 17:23:27 -07:00
Annika
550a4df374
Random Battles: Refactor Gen 5-7 (#8106) 2021-03-09 19:49:47 -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
1d941a90d3 Random Battle improvements 2021-01-19 06:01:35 +04:00
The Immortal
2bd9e757c4 Past gens: Random Battle improvements 2021-01-10 19:19:33 +04:00
LegoFigure11
cad1d25c4d
Add Gen 8 BSS Factory (#7843) 2020-12-31 02:09:29 +04:00
The Immortal
e0b3ade226 Gen 6/7: Random Battle improvements 2020-12-28 15:46:33 +04:00
The Immortal
788d0f5bc0 Gen 6/7: Random Battle updates 2020-12-25 14:24:46 +04:00
The Immortal
bce1267fae Improve randoms generator 2020-12-10 15:33:08 +04:00
Kris Johnson
7877b95e67 Random Battle: Fix typo and remove redundant check 2020-11-16 22:40:48 -07:00
The Immortal
61b484ee4a Past gens random battle updates 2020-10-01 17:51:20 +04:00
urkerab
5d714fbb56
Replace @ts-ignore with type assertions or other less unsafe constructs (#7390) 2020-09-19 02:07:48 -07: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
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
The Immortal
5e250e7e86 Gen 6: Update Random Battle 2020-07-19 18:43:14 +04:00
The Immortal
f9791abba9 Random Battles: Fix cosmetic formes 2020-06-04 03:06:07 +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
9bb97f0228 Random Battle: Update forme generation 2020-05-01 08:18:29 +04:00
Guangcong Luo
826e544b65 Refactor random set generation
The whole `checkBattleForme` system, introduced in 4410843e5a
and currently used in Gen 6 and 7, seems to have always been bugged.

As TI mentions in #5970, we already use `getPokemonPool` for alternate
forme handling.

I've replaced it with a roll for cosmetic formes.
2020-04-30 17:52:04 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00