A variable named "pokemonLeft" should probably not be increasing. Since
it's effectively referring to the current size of the team, might as well
use Array.length.
Due to the "each type combination only once" restriction, Normal-type
teams had a ~0.1% chance of having only 5 members, as most of its type
combinations are only used by a single mon which could easily be skipped
due to tier restrictions or bad luck.
The types were also not sorted before filtering, so it was entirely
possible to have Fighting/Psychic and Psychic/Fighting on the same team.
So, this sorts before filtering, but raises the limit to 2 of each
combination per team, which hasn't yielded any 5 mon teams across 10000
generated teams.
- Boosts now show the correct boosting message (i.e. using Swords Dance
at +5 Attack will show the +1 message instead of +2).
- Boosts now show the appropriate maxed out message when a stat cannot
be raised/lowered further, instead of simply failing or failing
silently, unless the boost is an additional effect.
- Remove `randomMonotypeTeam` and use `randomTeam` for Monotype Random
Battle. This prevents having to maintain two functions, in addition to
removing duplicate code.
- Improve Monotype teams by preventing more than one of the same type
combination.
- Remove no longer needed Pichu-Spiky-eared check from
`randomDoublesTeam`.
While Slaking has a gimmick use with skill swap, gastro acid, simple ray, etc., in this random format it makes a battle basically a 5v6 battle, where you can Protect on its loafing around turns or make it switch, lowering offensive pressure and receiving more damage.
* Random Battle: Don't reject Swords Dance with no-sun Growth
This will allow Growth to be rejected first. Affects Victreebel.
* Implement fastPop function
fastPop is a generalization of sampleNoReplace. While sampleNoReplace
removes a random element from the array without regard to order, fastPop
allows for a specific element to be removed. This speeds up the removal of
items from the move pool in random battles in situations where it is
needed.
* Random Battle: Remove Weather Ball from pool if Sunny Day is rejected
Among the newly added rules, there are quite a few intended to enforce
compliance of CONTRIBUTING.md-blessed idioms, as well as ensure
safe usage of classes and constant bindings.
We are also now enforcing usage of early return in commands.js,
which has 100% compliance as of fd2c45c.