tools.js no longer needs sugar and a toId definition included externally,
which should make using it in scripts a lot easier, as well as cut
down the repeated toId definitions in every PS process.
- There’s no need to check for validation or report set problems if the
Pokemon is banned from the format.
- Improve the error message for event only hidden abilities.
Fixes#1342. The one in rulesets is the general check, and the one in
team-validator is the event check. I don’t think we can combine it into
a single check; duplication is needed.
This adds an `eventOnly` flag for Pokemon that can only be obtained via
an event. It also adds an `eventOnlyHidden` flag for Pokemon whose
hidden ability can only be obtained via an event. This removes the need
for the `dreamWorldPokeball` flag, and those events are added.
If a Pokemon can only be obtained via event, the team validator checks
if any of its events matches its current set.
checkLearnset has some ridiculous indentation; this commit alleviates
it, mostly by aggressively using early returns (well, early continues
in this case).
To put it simply, it was trying to check future Pokémon for egg moves in gen 2.
Since this condition is only checked in gen 2, the entry with which you are checking the move must be gen 2 as well.
E.g., to enforce players to bring teams with 4-6 Pokémon to Team Preview,
and make them choose 2 of them there to battle with:
```
teamLength: {
validate: [4, 6],
battle: 2
}
```
This is relevant information as some crashes may only happen after some other crash
has created inconsistent state either in PS itself or in Node.js internals.
The mega forme can now be banned/tiered separately. The old-style mega
stone bans are still supported, but megas can now also be tiered,
even below their base forme.
Any Pokemon with only one Ability in Gen 3 can get the new Gen 4 one by
evolving. Such as, Extreme Speed Zigzagoon has Pickup only in Gen 3 but
its evolution, Linoone, can have either Pickup or Gluttony in Gen 4 or
higher.
We now ban boosting both Speed and non-Speed with Baton Pass.
To make this simpler, we introduce changeSet as separate from
validateSet, which allows us to pass setHas to validateSet
This is quite complex.
In gen 2, the egg moves pass through father and species through mother.
Therefore, we must check that:
1. Two egg moves come from the same father or are learned in another way.
2. If two egg moves come from the same father, check if the father can learn those two as well.
Also, we must keep track of the state of egg and machine moves in the learnset in order to properly reject them when the problem is found.
Related commits: 17e8515486 and 33cc1e09eb