- Do not count Fake Out as STAB because it can only be used once per
switch-in
- Protean means the Pokemon always has STAB and shouldn't get any move
removed in post-processing
- Prevent too many Dark-type moves
It currently gets Leftovers if it has Stealth Rock, and has a chance of
getting Expert Belt as well, but it should never get any other item. It
is a special case because there isn't a glass cannon as extreme as this.
It is not acceptable as the only STAB move because it is a 40 base power
Normal-type attack... No Normal-type Technician gets it either, unlike
other priority moves.
It's used on defensive Pokemon that shouldn't get Life Orb, Choice or
Expert Belt. Also removed checks that where added because of the old
Weakness Policy selection.
The previous one doesn't apply to Dragonite or Lugia. This prevents
Focus Sash Lugia if it is your first Pokemon.
Also moved the low priority Black Sludge selection above Leftovers for
the case of Poison/Flying Pokemon.
- Reject Trick/Switcheroo with Acrobatics so that the Pokemon can properly
receive Flying Gem
- Reject Rapid Spin with setup
- Do not reject Knock Off with setup
Mostly Gen 1-2 Pokemon were changed.
Added Moonblast where the usage stats were indicating that it was as
commonly used than Dazzling Gleam in Doubles. Reject Moonblast with
Dazzling Gleam.
Reject Return with Double Hit (for Ambipom).
Reject Power Split with Guard Split (for Shuckle).
Reject Acid Spray with Sludge Bomb (for Tentacruel).
Pokemon with Focus Energy have Scope Lens.
Aeroblast is now considered STAB.
- Reject Body Slam instead of Glare (so Dunsparce has a higher chance of
getting Glare + Headbutt rather than Body Slam + Headbutt)
- Reject Substitute with Taunt
- Update moves that are unacceptable as the only attacking move
- STAB is required for almost every mono-attacking case, exception is
that Fairy is allowed for Psychic types and Ice is allowed for certain
Normal types
- Always give Sylveon Hyper Voice
The current variables in place to check for STAB do not work as intended.
If a Pokemon has two STAB moves of the same type, and one of them is set
as a move that shouldn't be counted as STAB, the Pokemon will be counted
as not having STAB. Since nothing in the code checks for Pokemon having
STAB of a specific type, it is refactored to be a boolean instead.
In order to avoid a situation where a move like Infestation sets the STAB
variable to true when it doesn't count as a damaging move, these kinds of
moves no longer increment counters for abilities that boost damage, like
Adaptability.
- Force Super Luck on Unfezant (it has a 33% chance of getting Big Pecks)
- Force Scope Lens on Unfezants with enough attacking moves
- Give Unfezant Night Slash
- Replace Wish with Roost in Doubles
- Reject Water Spout and Eruption with setup or RestTalk
- Allow Origin Pulse with RestTalk
- Give Extremespeed users and Sucker Punch users without STAB Life Orb
instead of Expert Belt
- Prevent Life Orb with Dragon Tail
- Low priority: give Leftovers to Pokemon weak to Stealth Rock
Super Luck + Scope Lens gives a 50% chance of crit, but isn't a very high
priority since a consistent damage boost from a Choice item can be a
better pick.
- Lumineon and Poliwrath have Storm Drain and Water Absorb respectively,
which is always chosen over Swift Swim, so Rain Dance is unneccessary.
- Give Pokemon with Unburden a Focus Sash
- Give Unburden mons with stat-lowering moves a White Herb (specifically
targets Sceptile)
- Added speedsetup counter
- Improve Weakness Policy selection (might give it to more than just
speedsetup later on but this is much better than the previous
implementation that gave it to very bad sets)
- Added Lustrous Orb as a low priority option for Palkia
- Slightly increased defensive requirement of Assault Vest
- 30% more op/s for randomTeam, randomDoublesTeam and randomCCTeam
- 300% more op/s for randomHackmonsCCTeam
- Implement helper method `sampleNoReplace`: takes an array parameter, removes a random element and returns it.
- Random team makers now follow the game RNG. Therefore, it's now possible to reconstruct the teambuilding process for bad sets, given that the starting seed is known.
Went through all fully-evolved Pokemon and updated their moves. Also
removed illegal moves on several Pokemon...
- Added Superpower to SetupException
- Reject Water Pulse with Scald
- Reject Acrobatics with Hurricane
- Prevent Focus Blast and Superpower together
- Reject Physical moves with Acid Spray (only affects Eelektross)
- Do not reject Baton Pass with Protect
- Reject Healing Wish with setup
- Reject Hydro Pump with RestTalk
- Prevent Precipice Blades with Earthquake
- In accepting Shadow Ball + HP Fighting, ensure that it's HP Fighting
(relevant for Reuniclus, Chandelure, and Sylveon, which have Hidden
Power that aren't Fighting)
- If Hidden Power changes the IVs but is later removed by another
processing cycle, reset the IVs to 31 all
- Removed old check for "bulky" Pokemon as it would give Leftovers to
Pokemon that would prefer Life Orb or even Assault Vest. For example,
Kyurem-White and Goodra, respectively.
- If the Pokemon has three attacking moves, give Life Orb to those with
either setup or a recovery move, and give Leftovers to everything else.
- Give Keldeo HP Flying instead of HP Ghost
- Reject Hidden Power if the Pokemon has a special setup move and only
one other special attack
- Dark/Fighting is resisted by Fairy this generation and isn't a
"perfect" combination anymore
- Remove Feint from Pikachu/Raichu
- Replace Rock Blast with Rock Slide on Golem line
- Add Surf to Octillery
- Reject Strong Jaw without bite moves
- Update Iron Fist check to use the punch flag
- Give preference to Rock Slide over Head Smash
- Give preference to Discharge over Thunderbolt and Electroweb
- Modify Tyrantrum's moves
- Add bite moves counter for Strong Jaw
- Use punch flag for ironfist counter
- Give preference to Stone Edge over Head Smash
Mechanics Changes:
- Fire Rocket does less damage, cannot crit.
- Fire Rocket is no longer a bullet move (for Chesnaught)
- Only Li Shang can Train Recruits.
- Recruits start with lowered defenses as well.
- Edit Mushu's movepool.
Flavor Changes:
- Train Recruits now uses Bulk Up's animation.
- Fire Rocket now uses Eruption's animation. Backfires cause the animation
to strike the user instead!
- Use Searing Shot as Fire Rocket instead of Octazooka.
Unaware currently doesn't work because the ModifyMove event is fired on the move before each target is caculated in doubles and triples.
This means that the ModifyMove event should be fired for each target and the move not modified unless it fits the attacker-target.
It's easier and less expensive to use an ability property to check on attacker/target than to fire events.
This fixes Unaware in doubles/triples.
It takes account interaction with Mold Breaker, Gastro Acid, and other ability supressers.
Seasonal is based on Mulan, in honor of Chinese New Year.
General Shang must defeat the Huns, but his new recruits are weak! Over
time, however, they will get stronger over time by training (just like the
movie, they train during I'll Make A Man Out Of You.) Singing will also
make them train faster.
The Han Chinese also have powerful rockets at their disposal (select
Octazooka in battle). However, the rockets sometimes backfire on new
recruits, but as they train the chance of backfire goes down.
Added a counter that tracks Normal damaging moves for purposes of -ate
Abilities, in case it becomes important later. This counter also
future-proofs Aurorus in case it receives other viable Normal attacks
later.
- Rename randbats helper function `canMegaEvo` to `hasMegaEvo`.
- Move duplicate mega evolution possibility checks from `runMegaEvo` and BattlePokemon constructor to `canMegaEvo` battle script.
Stone Edge somehow was a case three times in the switch statement, meaning
only the first one would have been checked. This fix merges the three
checks into one.
If a Pokemon has a move that boosts speed (Rock Polish/Agility), reject
all modified-priority moves.
If a Pokemon has 4 Physical or 4 Special moves, reject Choice Scarf if the
Pokemon has a priority move.
Breloom is the only Pokemon that gets both and will get the better
ability with only one of them. Basically, no more Poison Heal Mach Punch
and no more Technician Focus Punch.
- Serene Grace is automatically rejected for Chansey and Blissey, who
prefer Natural Cure.
- Serene Grace works best with secondaries that have a high chance of
activating, so a seperate counter is used to check those specifically.
- Sheer Force doesn't need a secondaries chance check; both branches of
the check would have allowed Sheer Force to be used.
- Add Eviolite for NFEs
- Removed old and mostly unused custom levels
- Updated some Pokemon levels
- Removed all NFE Pokemon from Random Battle except for Chansey,
Doublade, Pikachu, Porygon2, and Scyther
- Acrobatics Pokemon have Flying Gem.
- Hawlucha no longer has Sky Attack in its random battle movepool, so we
remove references to that in the code.
- Double Random Battles only check for Fake Out on Unburden Pokemon (and
formerly Sky Attack on Hawlucha, which is removed, so there is no need
to cycle through all of their moves.
A series of changes to make sure battles are as balanced as possible.
Made Frodo Ground/Fairy.
Made Samwise Normal/Fairy.
Switched Gandalf and Saruman boosts.
Added Gollum for Mordor, which is pretty much annoying and Fighting-type move absorber.
Changed Swords Dance for Bulk Up on Aragorn to prevent unstoppable sweeps.
Added a SpD boost for Moses to be able to stand to the pharaoh. Also a cool sentence.
Made John Connor faster (slower but in TR) than Terminator T-1000 to give humans an even lead matchup.
Made Blissey on humans have a decent moveset. Including Barrier, yes.
Made specific sets for Hitmontop and Scrafty on humans, being able to take Robot hits.
Made electric attacks on sailors less likely, 66% instead of 100%.
This change makes 1/4 weak Pokémon survive four switch ins and 50% weak Pokémon survive two Switch-ins.
Belly Drum HP still takes precedence (having Charizard in mind kek).
- Groudon no longer has Water Absorb (relevant because of Hebrew
Seismitoad)
- Removed Hebrew LC mons (but not Egyptian ones)
- Limit one Yahweh/Arceus per team
- Removed the rediculous level boost to most Pokemon.
- Tweak EVs for Lucario, Swift Swimmers, and Shell Smashers.
- Removed all LC sailors and fishes, and added some new Pokemon.
- Remove Rain Dance from sailor sets (mostly Swampert)
- Prevent 2 Mega Pokemon on a team for the Sailor Scenario
Make Unburden Hitmonlee Reckless on Terminator battle.
Limit Lucario on megas too.
Improve zam's moveset on that battle as well.
Minimise speed on Terminator battle.
Make Chansey have Eviolite.
Make a more even lead battle of Machamp VS Kyogre.
Machamp is now a Technician Life Orb mon with mixed attack.
Kyogre has now a specific Choice Scarf set.
To not to make Machamp too overwhelming, its level is 75.
This, alongside Life Orb, makes it manageable with Kyogre out.
A trade of hits will end up with either fainted and the other at 10% HP.
Gen 1's defenses were too low, raise them a little.
Change Bolt Strike for Fusion Bolt on sailors, this achieves an almost perfect balance.
Nerf Charizard-Y slightly on Red VS Blue battle. Too strong.
Nerf Hoopa-Unbound's level too, as it's too damn strong.
Added a way to effectively dealing with Smaug on LOTR, adding Bard as a possibility.
Frodo now gets evasion thanks to the one ring, it's invisible after all.
Nerf Groudon slightly on Desert, it is able to sweep an entire team with bad luck on the Pokémon chosen.
Nerf slightly Alakazam on Red vs Blue battle, it can take on a team easily.
Nerf defenses on Gen 1 team so damage is closer to that of Gen 1 (more).
Swampert should not get any boost on sailor team, otherwise it's an insta-win.
Improved the set maker to avoid bad sets due to Present.
Made the mountain 500 meters shorter.
Made the chance to hit an obstacle slightly lower.
Added weight to the sleigh that is lowered by throwing Presents and makes you faster.
Eliminate megas from teams.
Make freeze from event make you unable to move that turn.
Freeze thawing was meant to be when hit, not after a turn after all. Fixed comment.
- Red Card and Eject Button do not activate if the holder is being
forced out.
- Circle Throw, Dragon Tail, Roar, and Whirlwind cannot attempt to force
out a Pokemon with no inactive unfainted allies.
Added functionality for setAbility to send End events to abilities.
Fixed bug with Mold Breaker negating all Battle#singleEvent ability calls,
even those that don't involve damage calculation.
Fixed Skill Swap to now use End and Start events in the right order:
send the End events, then change the abilities, then send Start events.
If the same ability is swapped, don't send End events (the game simply
re-activates the abilities in question)
Moved SwitchOut/Faint events from weather to ability so the weather
can interact properly with Cloud Nine or Air Lock.
Primal weathers persist if a Pokemon with the relevant ability is
on-field, even if the originator switches out.
There is no need to store whether the team has a mega anymore.
With the general use of pokemon.canMegaEvo and it being set to false for
the whole team after a mega evolution, it is what we need to check to avoid
more than one mega evolution or banned mega evolutions.
There's an improbable chance that a nickname gets a hash collision.
In such a case, the player gets five instead of six Pokémon.
This safeguard prevents that improbable event from happening at all.
Seasonal format is a random battle format that changes its rules monthly.
It often includes limited Pokmon pools, wacky mechanics you'd never encounter in game, and other fun stuff.
- Changed Sky Drop to use onTryHit on its first hit as well as its second,
allowing it to check for Protect and Fly naturally.
- Added messages when a Pokemon is freed from Sky Drop.
- Allow Flying-type Pokemon to be hit by Sky Drop if their Ground immunity
has been removed.
- Added BeforeMovePriority to allow Sky Drop to interact with Stance
Change properly.
- Prevent a Pokemon trapped by Sky Drop from Mega Evolving.
- Added onRedirectTarget to allow Sky Drop to interact with Ally Switch
properly.
made it so that shuca berry and chople berry will only be selected in randdubs in the case of a 4x weakness as opposed to being potential item picks for 2x or 4x weaknesses
- added charti & occa for 4x weaknesses
- made yache only for 4x weaknesses
- made it so you cant have fake out & sheer force (9-21-14)
- changed it so shuca berry and chople berry won't be added to
immunities
- unburden mons only have normal gem if they have fake out as opposed to
any normal attacking move
- made life orb more common over expert belt
fixed error in shuca generation
typoed, but fixed it so now it should only give shuca berry to pokemon
without a ground immunity
fixed broken indentation
fixed issues pointed out by slayer95
should have fixed the indentation and edited the immunity check
So yeah, this is a major bug in the randbat set generator, but other
than performance issues and the random 3-move pokemon, it shouldn't
have any other implications.
- Move some variable declarations outside of loops.
- Use single-line if statements wherever reasonable.
- Update a check for Hyper Fang to Gen 6.
- Fix Ghost types getting Chople Berries in Random Doubles Battles.
- Fix a typo intended to fix in d24b184b and another one introduced in the same commit.
randomBattleMoves is now an array, and has been renamed from
viableMoves since it no longer is used for anything other than
random battles.
This commit also does some cleanup of some code relating to
random battle moves, including fixing gen 1's randomSet function,
which apparently has never worked.
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.
The code has been fixed to match the new stricter standards.
JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.
I used a hack to make the multiple declaration errors go away,
so all that remained in jsHint were actual errors, which I've
now mostly fixed.
All this linting ended up uncovering one actual bug: Uproar's
message not showing. It's a very minor bug in a move no one uses,
so I'm going to fold it into this commit.
The one who committed that probably meant Sky Attack. Like Bounce it is also a 2-turn move. Aeroblast is a 100 BP Special Flying-Type attack. Very STAB-worthy.
- Fix an issue introduced in 6539521adc, where Protean didn't activate if the target was immune to the move.
- Protean should not activate if the user fails a Detect/Protect, or the move is Fling or Natural Gift and the user has no item.
- Protean should not activate on the first turn of a Pledge Combo. Aditionally, fix Flash Fire/Storm Drain, etc being activated by the first move in the combo.
- Introduce event 'PrepareHit', which is ran after any move target is resolved but before immunity is checked.
Megas now have their own viable moves, so that more unique megas like Heracross, Charizard and Mewtwo can have their viable options.
Potential mega evolving candidates can now be selected without their mega stone. For example, if the team has Gengar with Gengarite, Heracross without Heracronite can be added.
Make multiple mega evolution selection random
It mistakenly always picked the Y forme rather than randomly choosing either.
Reduce number of getTemplate() calls
Slayer95 pointed out that this is a better implementation.
Fix syntax error
Improve randoms mega selection
Simplifying the code by having the mega template stored in 'template'. For abilities, the original template is stored in 'baseTemplate'. Also added the improved mega selection for Random Doubles, which would be affected by giving viable moves to megas in formats-data.js.
Improve mega selection in randoms
Megas now have their own viable moves, so that more unique megas like
Heracross, Charizard and Mewtwo can have their viable options. Potential
mega evolving candidates can now be selected without their mega stone.
For example, if the team has Gengar with Gengarite, Heracross without
Heracronite can be added.
- Recoil for Parental Bond Double Edge, etc should happen after all the hits have finished.
- Also removed the event 'Secondary', currently unused in the codebase.