Commit Graph

186 Commits

Author SHA1 Message Date
Leonard Craft III
f033714eda
Implement held Poke Ball legality (#8722) 2022-04-18 12:16:58 -04:00
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
pyuk-bot
0f3d37ab87
Don't activate Jaboca/Rowap Berries vs Magic Guard (#8670) 2022-02-17 17:49:19 -06: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
Kris Johnson
3ea6836249 ORAS: Fix Avalugg's tier 2022-01-24 21:29:52 -07:00
Tarrembeau
0f01485bf2
Random Battle: Add Rhydon to Gen 6 (#8633)
Removing stealth rock from rhyperior to differentiate them better.
2022-01-23 17:48:28 -08:00
WeWuzNidokangz
7097a9ac75
Hackmons Cup: Support custom team bans/unbans (#8607) 2022-01-09 14:46:41 -08:00
Annika
e082ce9434 Random Battles: Alphabetize move arrays 2022-01-02 21:09:20 -08:00
Annika
75ab25b160 Random Battles updates 2021-12-05 18:17:15 -08:00
Annika
4652c56020 Random Battles: Fix Hidden Power IVs
Fixes #8549
2021-12-04 18:10:38 -08:00
Annika
ae84fefa4a Random Battles: Fix item generation for Arceus 2021-11-26 12:10:42 -08:00
Karthik
14df9d7ea2
Gen 4-6: Fix required items for Arceus formes (#8542) 2021-11-25 17:41:30 -07:00
Leonard Craft III
7cf60606c5
Fix paralysis modifier application (#8478) 2021-11-06 15:52:39 -04: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
Karthik
c0541c7747
Fix Powder revealing target of a failed fire move (#8468) 2021-09-11 16:57:08 -05: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
Instruct
da8c1580ea
Gen 5: Refactor to use unreleasedHidden (#8349) 2021-06-05 09:00:15 -07:00
Leonard Craft III
4543abfb9c Fix more regressions from residual factor 2021-05-27 17:38:59 -05: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
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
Kris Johnson
961842b869
Gen 6: Move Conkeldurr to UUBL 2021-05-16 12:42:36 -06: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
Leonard Craft III
771c60d4b9
Improve self-hit confusion damage (#8264) 2021-05-04 13:44:13 -04: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
pyuk-bot
66c547432b
Fix Parental Bond to modify damage, not base power (#8226) 2021-04-25 12:06:27 -04: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
Kris Johnson
d0fd8ac8e0 Fix build 2021-04-16 21:47:38 -06: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
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
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
2021-03-28 12:01:38 -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
Annika
57721b3ecb Prettify JSON for Gen 6 Battle Factory 2021-02-13 14:19:58 -08:00
ACakeWearingAHat
3b9c79624d
Battle Factory: Fix Slowbro and Arceus EVs (#8018) 2021-02-13 13:22:39 -08:00