- 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.
Because of how moves are generated when a Pokemon has a setup move in its
move list, Seviper has a high chance of getting bad sets if Poison Jab is
rejected and Coil is added to its moves.
- Add a counter for draining moves; give Pokemon Life Orb with
Substitute if they have a draining move
- Do not Reject U-turn on Mega Beedrill
- Prevent Focus Sash on lead Pokemon that have a recovery move
- Increase the level of non-setup Slurpuff
- Remove AG Pokemon from Random Battle
- Do not reject attacking moves if they are none in the pool; no STAB
is better than a messed up set
- Set HP to activate Sitrus Berry after two subs
- Fixes#2306
- Fix Mega Lucario with only Bullet Punch as STAB
- Make sure dual typed Dark Pokemon have a reliable STAB
- Make sure dual typed Psychic Pokemon have a second STAB
- Only reject moves if there are moves in the pool to replace it
- Add Earth Power to Arceus-Dragon as it only has two Special moves
(which results in bad sets because of Calm Mind)
- Increment the correct type counter for Judgment
- Make sure Dragon types have a Dragon move, in certain circumstances
- Fix the “Pokemon should have benefiting moves” check to reject the
right moves (such as rejecting the 2nd setup move, and moves of the
incorrect setup type, first)
- Reject Focus Punch, Sucker Punch, and Hidden Power when moves are
processed, not after (if they are the only attacking move)
- Simplify the checks for too many Dark moves by using the new type
counter; this should fix remaining Spiritomb issues as well
Genesect formes tend to get bad sets because of the obligatory Techno
Blast. Removed Physical setup from them to fix this.
In addition, removed moveset modifications as they are no longer needed.
- Add Vacuum Wave to Infernape
- Replace Thunder Punch with Stone Edge on Hawlucha
- Don’t count Vacuum Wave as STAB
- Prevent Vacuum Wave with Close Combat or Mach Punch
- Make sure Darkrai has Dark Void
- Make sure Yveltal has a Dark move
- Check the move pool of a Pokemon when deciding to accept
Physical/Special setup
- Don’t count `NoStab` moves as STAB for Protean users
- Prevent Dark Pulse with Hyperspace Fury
- Fix Aura Sphere/Shadow Claw rejection to check setup
- Prevent too many Ice moves on Refrigerate Pokemon
- Reject Acid Spray with any Special moves
- Do not reject Bullet Punch with Adaptability
- Improved the rejection of moves that don’t satisfy setup requirements
- Make sure Gale Wings has a Flying move
- Remove unneeded combo checks (the consensus is that STAB is better
than Ghost/Fighting or Electric/Ice coverage)
- Give AG (Mega Rayquaza) the same chances of appearing as Uber
Gligar always gets Immunity.
Reject Solar Power on Mega Charizard (both formes)
Update move selection to ensure Fire Pokemon with Drought/Sunny Day get a
Fire move.
Adds counters for each type in queryMoves. Many updates to ability checks
were also needed.
Also, update Random Double Battles to use teamDetails like Singles.
By checking the damagingMoves index length instead of the number of
Physical and Special moves, it not only ensures no Life Orb for Pokemon
with Rapid Spin, but also Nuzzle (such as Pachirisu) and any other
potential cases that have been missed.
- Use the recently added `battleOnly` template property to handle formes not directly allowed in-battle.
- Implement utility method `checkBattleForme` to unify handling of Mega and Primal formes.
Reject Sucker Punch if it is the only STAB move on a Pokemon with moves
that boost Special attacks.
Fix issues with setupType not being set properly with setup moves
appearing in mixed sets.
- Prevent Quick Attack as the only STAB on -ate
- Make Adaptability Pokemon get more than one STAB
- Allow Guts with RestTalk
- Make sure Milotic has Marvel Scale with RestTalk
Assault Vest disallows it.
Choice Band and Specs lock into it without giving a proper boost.
We give Life Orb to those so they can get a general damage boost.
- Don’t count Pursuit as STAB
- Prevent phazing moves with setup (unless with RestTalk)
- Prevent Fire Fang with Fire Blast
- Prevent Zen Headbutt with Psychic
- Prevent Substitute with Rest
- Remove Counter exception so Pokemon with it get their sets checked
- Make sure certain Pokemon always get a recovery move (currently:
Alomomola, Chansey, Blissey)
Add new sets for Cherrim-Sunshine specifically.
Reject Mach Punch as the only STAB move if the Pokemon does not have
Technician. Affects almost every Fighting Pokemon except Breloom.
Reject Bullet Punch as the only STAB move if the Pokemon does not have
Technician. Affects Metagross and Mega Lucario.
Don't count Charge Beam as singular STAB, and add checks for redundancy
with Thunderbolt based on the number of remaining Special moves. Affects
Emolga and Magnezone.
Reject Sheer Force with Fake Out in Doubles. Affects Hariyama.
Reject Flash Cannon with Iron Head in Doubles to match the rule in
Singles. Affects Aegislash.
Add Freeze-Dry as an option to Mega Glalie sets. Removed Crunch from its
Singles set and Taunt from both sets. Reject Ice Shard with Freeze-Dry so
it doesn't get too many Ice-type moves.
- Add Protect and Sleep Talk to Registeel
- Allow Shadow Sneak as the only STAB on mono-Ghosts
- Prevent Night Shade/Seismic Toss with STAB
- Reject Thunder Wave with Toxic instead of the reverse
- Remove Wake Up Slap because it's no longer Technician boosted.
- Change Technician to reject if a Pokemon has Skill Link and all their
Technician-boosted moves are Skill Link moves.
- Added Aqua Tail.
Miscellaneous changes:
- Placed Sheer Force within the counterAbilities section.
- Sorted the coutnerAbilities in the Random Doubles Battle code.
Reject Solar Power if there are no Special moves (affects Charizard).
If Rampardos does not have Head Smash, make sure it gets Sheer Force.
Don't set the setup type to Physical if there are no Physical moves and at
least two Special moves (or vice versa for Special setup)
- Do not count Eruption and Water Spout as STAB so Pokemon get an
additional STAB move with them
- Remove Water Spout from Octillery as it’s too slow to make use of it,
and add Scald + Gunk Shot
If both Physical and Special setup moves are present, and there are an
equal number of Physical and Special moves, choose setup based on the
first setup move in the moveset instead of randomizing it.
such as Lucario. Instead of always setting `setupType` to `Special` for
those cases, it now sets it to the one with the most attacks (or random
if it’s equal).
Also, added another check to fix the issue of too many Dark type
attacks on a Pokemon.
- Fixed Stealth Rock (and Defog/Spin, which isn’t as big of a problem)
being on multiple Pokemon
- Reject Snow Cloak without Snow Warning on the team
- Reject Swift Swim without Drizzle/Rain Dance on the team
- Give Mega Venuasaur Chlorophyll as a starting ability (because
Overgrow is useless)
- Give RestTalk Pokemon Leftovers (so they don’t get Focus Sash if they
are the lead)
This fixes a problem introduced by 77b6b666 causing certain Pokemon
with mega stones (and base forme of Audino) to have level 90 in
randbats.
This commit intentionally doesn't introduce any new levels for mons who
have their tier in parenthesis. Looking over the list of mons who don't
have hardcoded levels, most of them are barely improvement over their
base forme, which is the issue in a standard tiers with its limit of
one mega. However, because teams don't have to use a mega in randbats
(because of how its generator works), getting just a slightly version
of a Pokemon is not a big deal as it's still an improvement, even if
minor.
Mold Breaker is rated high but Basculin always prefer Adaptability. Add
Safeguard as an alternative to Destiny Bond for Wobbuffet (but prevent
both on the same set), and Sitrus Berry as an alternative to Leftovers.
Prevent Counter, Metal Burst and Mirror Coat from being rejected. They
only apply to Bastiodon, Chansey and Wobbuffet, who don’t care about
STAB.
Life Orb is selected unless the Speed Boost user has Substitute (in
which case Leftovers is selected later on). Also moved the Speed Boost
check above the Choice checks so that they don’t have to check for
Speed Boost.
The full description is in the comments of the Endless Battle
Clause entry in rulesets.js.
This update fixes a lot of the issues with yesterday's version.
Also included: A minor refactor of deductPP, which did not need
a success variable.
Rainbow Road is a Mario Kart and color themed seasonal.
Every few turns, a player can get an item that changes the course of the
battle, such as a Mushroom to increase speed.
Pokemon also get color moves that are super-effective on certain other
colors.
- Reject Sunny Day if the Pokemon lacks an ability that benefits, and
lacks SolarBeam
- Add Dark Pulse to Pyroar to fix the issue raised in #2063
- Reordered the Status cases to weather/status/recovery/other instead
of just alphabetical
Implement new function getMoveTargets to list all move targets given a
user and a move. Refactor Battle system to remove redundancies with
checking move targets. Run the RedirectTarget in this function instead of
later after TryMove, since technically single-target moves changing
targets should occur before the move is attempted.
Refactor the DeductPP event to be a singleEvent that targets the Pokemon's
ability instead of a global event. Run this event on the move's targets as
calculated by BattlePokemon#getMoveTargets.
Add a new event ModifyAccuracy that affects all moves other than OHKO
moves and switched many event handlers that originally used the Accuracy
event to ModifyAccuracy instead.
- On failure, they will no longer trigger the `AfterMoveSecondarySelf` event. It was a common pattern to check for success on its handlers, so this removes some duplication.
- All failed moves will now run any set `MoveFail` single events.
- Life Orb will now harm the holder if a successful attack did 0 damage (e.g. False Swipe on a 1 HP target).
Added BattlePokemon#isGrounded to check for the grounded-ness of a
Pokemon. Also BattlePokemon#isSemiInvulnerable for whether a Pokemon is
in the first turn of a two-turn move that makes them semi-invulnerable.
Fixed Terrain bugs involving Pokemon in a semi-invulnerable state.
Changed OHKO move check to use BattlePokemon#isSemiInvulnerable, fixing a
graphical bug that would display an immunity message when a Pokemon
attempted an OHKO move on a higher-leveled Pokemon that was being held by
the effect of Sky Drop.
Fixed Misty Terrain bug that was causing Rest and the effect of Yawn to
put Pokemon to sleep.
Fixed Misty Terrain bug that was causing Yawn to fail.
Fixed Electric Terrain bug that was causing Yawn to succeed.
Instead of having a hardcode in scripts.js that people needed to
reference, it seemed more intuitive to take advantage of the Damage
event instead, and have Rock Head negate damage within the event.
Fixed a bug in Gen-NEXT Rock Head exhibiting the same behavior that
was causing the original Rock Head + Mummy glitch.
- Removed Trick/Gyro Ball checks as no Pokemon uses that combination.
- Reject Life Orb on Pokemon with 55 or less base Speed.
- Add a check for slow and strong Regenerator Pokemon to receive Assault
Vest, at slightly higher priority than Sitrus Berry.
- Reject teams significatively weak to a single attack type.
- Improve rejection of multiple megas.
- Reject weather-based abilities without their associated weather.
In place of Challenge Cup 1v1. Challenge Cup 1v1 under the new Challenge
Cup rules (f73ea6a0ea) isn't a good
format. It's supposed to have some competitive element in that you can
make predictions on what an opponent might have to beat your "best"
choice and as a result you can counter-pick. But with the new Challenge
Cup, that goes out the window.
This adds a slightly updated version of the old CC generator.
- CC now follows Hackmons mechanics to differentiate it from Random
further (in other words, CC is now Hackmons CC)
- Took this opportunity to finally rename CC 1v1
- Commented out Gen 1 CC
- Sheer Force may not be user's Ability by the time `AfterMoveSecondary`
effects are checked
- Sheer Force boosted moves called by other moves now ignore
`AfterMoveSecondary` effects properly
This was implemented exactly the wrong way and showed fail messages
in a lot of situations they shouldn't show up, such as when
Close Combat's Def/SpD drops didn't happen.
This reverts commit 1edc40f936.
- Promoted Acedia and Audiosurfer.
- Fixed one of Diatom's ranks.
- Moved shaymin's and MattL's moves to the correct areas, as well as
Acedia's and Audiosurfer's.
STAB Hidden Power without the Pokemon's other STAB can be bad. Since
there's no real way to check if the Pokemon has the other STAB with the
current system, it's better to remove that check.