With the buffs to the healing berries that confuse if a Pokemon has a
conflicting nature, it is now possible for Linoone to use them as a
substitute for Sitrus Berry, if it has Gluttony as its ability.
In Random Battles, natures are always neutral, so the any of the berries
will serve this purpose.
- Z-Moves are always single-target, even if based on spread moves.
- Z-Moves cannot be selected if the base move has no PP.
- Z-Moves can be selected if the base move is disabled.
Previously, the code was duplicated and buggy.
I have suspicions this doesn't fix it completely, but it should at least
crash a lot less and give more informative crash messages.
This fixes Pokemon having two of the same type moves, for example
Fire-types with Fire Blast and Lava Plume or Psychic-types with Psychic
and Psyshock, because the Hidden Power was rejected.
Battle is now an ES6 class... mostly... it's complicated.
Battle's inheritance system has always been a mess. I tried to redo it
in a sensible way but it caused nondeterministic test failures. Not
even kidding; different things would fail each time I ran tests, even
without code changes. I'll investigate closer later, but this refactor
makes it use ES6 classes with only a small amount of hacking, which is
good enough. It is, at the very least, simpler than the previous mess.
BattleEngine.Battle.construct has been renamed BattleEngine.construct.
Corrects all of the following
Gen 2: lasts 2-3 turns
Gen 3: can't hit Ghosts
Gen 4: can hit Ghosts, stops immediately when the user falls asleep or
becomes frozen
Gens 2-6: Stops immediately when the user is prevented from moving
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.
- Improve Flying types by making sure they have a second STAB if they
need it
- Revert bf0af09d7c and instead hardcode
the moveset modification for Aggron; Autotomize does have a benefit
with Heavy Slam
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.
This refactor:
- uses arrow functions where appropriate
Note that arrow functions still aren't used in Mocha, where `this`
is sometimes meaningful.
This also removes the need for .bind() nearly everywhere, as well
as the `self = this` trick.
- refactors Validator and Connection into ES6 classes
- no longer uses Array#forEach for iterating arrays
We strongly prefer for (let i = 0; i < arr.length; i++) because of
performance reasons. Most forEaches have been replaced with for..of,
though, which is 5x slower than the long-form loop but 2x faster
than forEach, which is good enough outside of most inner loops.
The only exception is tournaments, which is due for a more invasive
refactor soon anyway.
Crashlogger now supports passing in a dictionary of additional
information to report, so we no longer need to resort to making fake
errors.
The hadException parameter has now been removed entirely. I don't know
of a use case for it to be false.