* Allow AVs should take happiness into account
* Default happiness is already set in pokemon.ts
* Default happiness in the validator
natureModify only receives the set, not the actual Pokemon :/
* Implement Let's Go Normal Rules
* Fixes
* Remove EV limit
* Remove condition
* Add EV Limit = 0
Avoid "Pokemon has exactly 0 EVs - did you forget to EV it?"
* Final fix
* Happiness is fixed to 70
* Revert changes
* Rename Let's Go to LGPE
* Re-add comment
"Standard NatDex" is very weird compared to how OMs usually work.
See "TierShift Mod" and "Godly Gift Mod". NatDex now gets its own mod,
which can be mixed into any other format, instead of needing to start
with NatDex.
This would make Min Source Gen overriding annoying, so it now defaults
to the current gen in Gen 9+, if Obtainable is set and +Past isn't. So
now you don't need to manually set Min Source Gen to enforce Obtainable
in Gen 9.
* Make "All Pokemon" rules more convenient
Previously, "+All Pokemon" did nothing except override "-All Pokemon",
which switched from a default-allow to default-deny system.
They still do that, but they now also override all previous pokemon
bans/unbans. This makes it easier to replace a banlist/whitelist
from an inherited ruleset without needing to reverse every previous
ban/unban.
This also adds an error if you use `+All Pokemon` in a ruleset where
it doesn't do anything.
Fixes#10772
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.
- First, we no longer have separate eslint-no-types configs. Lint
performance shouldn't be enough of a problem to justify the
relevant maintenance complexity.
- Second, our base config should work out-of-the-box now. `npx eslint`
will work as expected, without any CLI flags. You should still use
`npm run lint` which adds the `--cached` flag for performance.
- Third, whatever updates I did fixed style linting, which apparently
has been bugged for quite some time, considering all the obvious
mixed-tabs-and-spaces issues I found in the upgrade.
Also here are some changes to our style rules. In particular:
- Curly brackets (for objects etc) now have spaces inside them. Sorry
for the huge change. ESLint doesn't support our old style, and most
projects use Prettier style, so we might as well match them in this way.
See https://github.com/eslint-stylistic/eslint-stylistic/issues/415
- String + number concatenation is no longer allowed. We now
consistently use template strings for this.
* Use value rules for timer
* lint
* fix rule overrides
* fix the "boolean" value rules
* add limits for number based rules
* Realized that you don't need boolean value rules
* oops
* fix checks for lower bounds
* Use base forme names in banlists where possible
This allows you use e.g. 'Arceus-Normal' instead of 'Arceus-Base'.
Also includes some aliases so that all known base forme names actually work.
* Update formats.ts
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Use base forme names in banlists where possible
This allows you use e.g. 'Arceus-Normal' instead of 'Arceus-Base'.
Also includes some aliases so that all known base forme names actually work.
* Update formats.ts
* Update config/formats.ts
* Update config/formats.ts
* Update config/formats.ts
* Apply suggestions from code review
---------
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
TypeScript 4.8+ supports Lowercase for lowercase strings, which isn't
exactly what ID is, but can be used to type IDs in object keys and data
entries that previously required string. I'm calling it IDEntry in places
where it should be an ID but TypeScript doesn't support that.
Very conveniently, no additional casts will be needed when using ID
where IDEntry is expected.
It's caught at least a few bugs, which is also why I'm PRing: I didn't
write the code for the bugs it found, and don't know if it's the right
way to fix them.
This ballooned into several other type refactors.
This replaces some pretty jank code with much cleaner code.
Anything that would be more cleanly implemented by iterating the
players array is now done by iterating the players array.
Some instances of p1/p2 are lying around but we should slowly deprecate
them.
Changes relevant to our codebase:
- TypeScript now knows that `typeof id === 'string'`! A bunch of casts
on `User | ID` or `Room | RoomID` are no longer necessary!!!
- `override` will protect against certain typoes, and we'll adopt it
(and `--noImplicitOverride`) as soon as sucrase comes in
- `declare` is now required for properties we want to narrow the type
of without directly overwriting - a good thing to use going forward,
but very annoying to fix all our old code for
defaultLevel should not be set to maxLevel if this would make teams break
maxTotalLevel.
Fixes a bug where level 100 pokemon were automatically set to higher
levels in cases where it didn't make sense.
"EV Limit = 510" is now its own rule which can be changed separately
from the rest of Obtainable Misc.
The rest of Obtainable Misc doesn't seem useful to break up, so I
haven't bothered.
`no item` is now a fake item meaning "not holding an item", for the
purposes of the team validator. This means that `-no item` will force
all pokemon to carry items.
`all items` no longer includes not holding an item, so `-all items`
will now work as expected.
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.
Also stop enforcing 4 moves limit and 6 pokemon limit in `-Nonstandard`,
for the same reason we stopped enforcing the level 100 limit; any format
that explicitly wants it higher should automatically override it.
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.
`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