Commit Graph

1118 Commits

Author SHA1 Message Date
The Immortal
ef946414e8 Remove Pumpkaboo-Super learnset
This is unneeded because they are just level up moves. Having this
means adding exceptions in multiple places.
2016-11-26 14:08:51 +04:00
The Immortal
6bef707583 Random Battle fixes 2016-11-26 14:07:09 +04:00
Guangcong Luo
5e413c3bef Revert "Refactor Protect/etc, fixing Z move penalty"
This reverts commit fed4fefd85.
2016-11-26 02:31:29 -05:00
Guangcong Luo
fed4fefd85 Refactor Protect/etc, fixing Z move penalty
Protect is now implemented in scripts.js:runProtect, for slightly less
duplicated code.
2016-11-25 22:20:01 -06:00
urkerab
a580d7706f Add various Z-move messages (#2947) 2016-11-25 20:24:35 -05:00
Ivo Julca
a0601bdb73 Add MoveAborted event, to be run when move execution stops on BeforeMove 2016-11-25 15:23:52 -05:00
Ivo Julca
e45d4bbdac Fix turn order to account for abilities traced by Mega Evolutions 2016-11-24 22:44:27 -05:00
Marty-D
db06476c1f Fix Prankster immunity condition 2016-11-23 18:34:38 -05:00
Marty-D
70b98abcb1 Update protection-breaking with Baneful Bunker 2016-11-22 18:06:51 -05:00
The Immortal
2869cf008d Random Battle improvements 2016-11-23 00:05:02 +04:00
Kevin Lau
41a063391b Random Battle: Give Fire-type Guts Pokemon a Toxic Orb (#2934)
Because they can't get burned.
2016-11-22 23:50:39 +04:00
The Immortal
6ef8fed674 Fix Rayquaza interaction with Z-Crystals 2016-11-21 15:37:42 +04:00
The Immortal
3c0864a3df Random Battle updates 2016-11-21 02:50:26 +04:00
Kevin Lau
34e1472eec Random Battle: Fix Arceus item generation (#2919)
Z-Crystals don't affect Judgment's type, so an Arceus with Judgment as its
STAB should receive a plate only.
2016-11-20 02:30:38 -05:00
Ivo Julca
6dc9cb16ec Randbats: Adjust rate for Silvally 2016-11-20 02:27:23 -05:00
Ivo Julca
607c217d2f CC: Normal Arceus should not hold a typed Z-Crystal 2016-11-20 02:27:04 -05:00
Ivo Julca
9e46ee727e Set zMoveUsed flag only after the Z-Move could actually be used
Fixes issue when put to sleep before moving.
2016-11-20 01:31:39 -05:00
Ivo Julca
3a5348bfc9 CC: Fix rare issue of sets with illegal items being generated
Found via stress-testing with a test/simulator/misc/random-teams.js variant.
2016-11-20 01:10:45 -05:00
Ivo Julca
0a1fa67a5a Fix generation checks in random team generators 2016-11-20 00:52:36 -05:00
Guangcong Luo
ad8ef6c090 Merge/fix CC/HC random pokemon generation
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.
2016-11-19 23:49:33 -05:00
urkerab
3cc3217aa4 Allow Hackmons Cup for past gens (#2913) 2016-11-20 01:22:09 +04:00
Ivo Julca
7fd8283600 Introduce requiredItems as an alternative to requiredItem
The list of acceptable items can always be retrieved from `requiredItems`.
2016-11-19 15:44:57 -05:00
Ivo Julca
00ced09ba3 Revert 4aaa3cb 2016-11-19 15:44:56 -05:00
Ivo Julca
4aaa3cb260 Move .templateRequiredItem to array everywhere 2016-11-19 15:23:42 -05:00
Guangcong Luo
4abed0add6 Fix crash in random battles 2016-11-19 14:54:33 -05:00
Guangcong Luo
b9e32f1d29 Rename restoreboost to clearnegativeboost 2016-11-19 14:48:19 -05:00
Slayer95
a3e3249a8f Spectral Thief should zero boosts despite of target abilities (#2906) 2016-11-19 14:38:54 -05:00
Marty-D
fd7a1a0a35 Fix typo 2016-11-19 13:21:02 -05:00
Marty-D
e7e133f397 Fix stat restoring Z-Effect 2016-11-19 12:56:40 -05:00
The Immortal
ca665d83e9 Fix typo 2016-11-19 15:29:36 +04:00
The Immortal
0d2ed2db11 Make randomTeam work for multiple gens 2016-11-19 15:28:20 +04:00
The Immortal
15bea251f3 Update Challenge/Hackmons Cup scripts 2016-11-19 14:11:14 +04:00
Ivo Julca
4a7b859128 Remove old megaevo decisions from queue on priority Pursuit 2016-11-19 02:54:53 -05:00
Guangcong Luo
b2393799c2 Suppress crash in mega evolution 2016-11-19 02:27:11 -05:00
Ivo Julca
78ab0bdf31 Implement Spectral Thief 2016-11-18 18:26:16 -05:00
Ivo Julca
c1b8aa52d2 Fix Z-Move single-use restriction 2016-11-18 18:26:16 -05:00
Ivo Julca
f2b5d74159 Store total damage across move hits as move.totalDamage 2016-11-18 13:55:57 -05:00
Guangcong Luo
6bd05bed2c Fix specialized Z moves
Specialized Z moves like Catastropika etc weren't working correctly.

Also, the generic Z moves weren't changing category correctly.
2016-11-18 03:53:03 -05:00
Guangcong Luo
224cf25e46 Fix bugs in Z-moves 2016-11-18 01:46:56 -06:00
Guangcong Luo
8f7d189838 Implement Z-moves 2016-11-18 02:44:29 -05:00
Ivo Julca
c8308ccd89 Sheer Cold no longer affects Ice-type Pokémon 2016-11-18 01:53:24 -05:00
panpawn
516bc8c5c6 Fix build errors (#2899)
Usage of `var` is deprecated
2016-11-18 00:42:39 -05:00
Ivo Julca
511a45eb95 Implement immunity of Dark-types to Prankster
The immunity also applies to any moves, even non-Status, called by
other Prankster-boosted moves.
2016-11-18 00:35:52 -05:00
Guangcong Luo
ae0abfb574 Gen 7 Challenge Cup 2016-11-17 23:41:11 -05:00
Guangcong Luo
acfeb39e7e Stub Z-move implementation
This is only the |request| half.
2016-11-17 23:41:11 -05:00
Ivo Julca
a1405e9c43 Gen 7: Turn order is decided by the ability and stats of the mega forme 2016-11-17 21:00:48 -05:00
The Immortal
e19aa8b77b Add gen 7 beta formats 2016-11-18 03:37:55 +04:00
Marty-D
83acbc578d Add preliminary Gen 7 changes 2016-11-17 11:06:12 -06:00
The Immortal
e65eed19a1 Random Battle: Minor improvements 2016-11-17 20:15:33 +04:00
The Immortal
564c28f158 Random Battle: Improve special setup sets
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.
2016-11-06 20:19:56 +04:00
The Immortal
21cd59d2f8 Random Battle: Improvements 2016-11-01 10:13:44 +04:00
The Immortal
bc49845604 Random Battle updates
- Improve Aerodactyl’s moves
- Make sure Dedenne has STAB other than Nuzzle
2016-10-30 01:58:47 +04:00
Guangcong Luo
7d8d47c97c Refactor BattleEngine
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.
2016-10-22 23:11:26 -05:00
The Immortal
736598eaf3 Random Battle: Improvements
- Update moves for Cosplay Pikachu
- Prevent Protect with dual screens
- Lower Castform’s rate
2016-10-19 22:30:04 +04:00
The Immortal
f11cf66b03 Random Battle updates 2016-10-16 18:11:43 +04:00
urkerab
efdc8e33a0 Run powder immunities in the correct order (#2842) 2016-10-14 23:11:59 -04:00
The Immortal
95ab7f66f4 Random Battle updates
Fixes #2796
2016-10-10 23:55:51 +04:00
Marty-D
aac63d3e26 Fix various issues with Bide
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
2016-10-06 21:33:30 -04:00
The Immortal
b078676c35 Remove the Seasonal format 2016-10-05 23:07:35 +04:00
The Immortal
741a07f324 Random Battle: Update items 2016-10-01 02:05:27 +04:00
Marty-D
bc652d4f62 Fix Struggle recoil timing
Fixes #2780
Also fixes a damage rounding issue.
2016-09-24 20:39:45 -04:00
The Immortal
ff09fc86dc Random Battle: Give Reuniclus Magic Guard
Regenerator is generally a good ability, but Reuniclus always prefers
Magic Guard.
2016-09-17 17:45:50 +04:00
The Immortal
c32b324ee4 Random Battle: Give weather abusers Life Orb 2016-09-12 21:50:56 +04:00
The Immortal
63a457ff50 Random Battle updates
- Give Togetic Super Luck
- Prevent Physical and Special setup on the same set
2016-09-11 05:03:27 +04:00
The Immortal
3c10010305 Allow Togetic in Randoms 2016-09-07 04:12:43 +04:00
The Immortal
61a6975424 Remove randomDoublesTeam
It’s almost identical to randomTeam.
2016-09-07 04:11:41 +04:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
The Immortal
2a63a84544 Random Battle improvements 2016-08-23 22:16:14 +04:00
urkerab
d5b985adc5 Make Illusion wear off properly after Ability-ending effects (#2638) 2016-08-11 18:47:58 -04:00
The Immortal
5704e1b059 Random Battle: Buff Slurpuff 2016-08-06 01:36:41 +04:00
Ivo Julca
62a5397083 Lint: Use latest version and features of ESLint 2016-08-03 01:24:36 -05:00
Marty-D
cd974caf3d Add Poison Touch activation 2016-07-29 11:39:38 -04:00
urkerab
2855e26d07 Slice template types before sorting (#2648) 2016-07-27 00:38:17 +04:00
The Immortal
62c8d78b8e Random Battle updates
Closes #2603
2016-07-13 00:53:27 +04:00
asgdf
92dd3cb57d Replace confusing variable name (#2619)
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.
2016-07-11 18:29:50 -05:00
asgdf
c695a33a97 Make 5 mon monotype randbats teams way less likely (#2611)
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.
2016-07-09 20:38:20 +04:00
The Immortal
e17527180e Random Battle: Prevent Draco Meteor with Outrage 2016-07-08 22:12:58 +04:00
Marty-D
a99bd01cf3 Refactor boosting
- 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.
2016-07-06 11:28:06 -04:00
Juanma Serrano
e1d8459dc4 Seasonal: Fix typos 2016-07-03 12:34:09 +02:00
Juanma Serrano
b647742cdf Seasonal: Use learnset if no random moves set found 2016-07-03 11:00:22 +02:00
Kevin Lau
2df9f27b9f Implement July Seasonal: Fireworks Frenzy (#2602)
Sky Battle with Fire-type "hail" in the form of fireworks sparks.
2016-07-03 01:44:49 -07:00
Guangcong Luo
21a742a591 Add hint clarifying no-PP message
We've gotten way too many "bug reports" about it.
2016-06-26 22:41:05 -07:00
The Immortal
2e42e97e4f Random Battle: Improve Water-type Pokemon 2016-06-26 05:31:48 +04:00
Ivo Julca
2215696664 Fix syntax error from de04698 2016-06-18 21:20:25 -05:00
The Immortal
de04698b7f 80d27e1: Use find instead of filter
And remove unneeded parentheses from df66184.
2016-06-19 01:13:11 +04:00
The Immortal
80d27e1276 Random Battle improvements 2016-06-19 00:33:53 +04:00
Kevin Lau
e3ef19dadd Seasonal: Pass custom move sets into randomSet when generating teams (#2591)
This fixes issues like getting Choice items on Pokemon with setup moves.
2016-06-17 17:44:21 +02:00
urkerab
2b95a4eb10 Fix ability activation for Oblivious, Overcoat and Own Tempo (#2589) 2016-06-17 11:40:44 -04:00
Ivo Julca
9b73eae8b7 Imprison should not hide targetable disabled moves 2016-06-17 10:00:48 -05:00
urkerab
69012290e3 Remove unnecessary format parameter to randomTeam (#2590) 2016-06-17 12:25:37 +04:00
Kevin Lau
df66184dad Random Battle: Reject Hidden Power with Rest (#2585)
Affects Roserade, since if it has Rest it prefers Natural Cure over
Technician as an ability and thus Hidden Power will be too weak.
2016-06-16 05:02:08 +04:00
Juanma Serrano
ded5df548c Seasonal: Remove CAP and add Pelipper ability 2016-06-05 19:13:57 +02:00
Juanma Serrano
d6fb82af55 Add June Seasonal, June Jubilee: Revenge 2016-06-05 18:43:59 +02:00
urkerab
be0f9d3be2 Show ability activation when it causes an immunity (#2555)
- Also improve `trySetStatus` and `moveHit` implementations
2016-05-22 18:44:54 -04:00
The Immortal
c1af24faff Random Battle: Improve NFE Pokemon 2016-05-23 02:27:55 +04:00
The Immortal
e44d406cbb Scripts: Use Array#includes 2016-05-23 02:07:35 +04:00
Ivo Julca
89f7cb1951 Fix up Battle Factory after a876232d 2016-05-17 05:37:30 -05:00
The Immortal
a876232d33 Update random team generators
- 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`.
2016-05-17 00:30:40 +04:00
The Immortal
92515e9b8b Random Battle: Adjust Meowstic rate 2016-05-05 22:12:42 +04:00
urkerab
68af97f71d Always use Object.values(template.abilities) (#2543) 2016-05-02 12:18:40 -07:00
Juanma Serrano
0b229ba7d5 Random Doubles Battle: Remove Slaking
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.
2016-05-01 21:26:35 +02:00
The Immortal
046b8df3d4 Add AfterMega event
This is a useful event that prevents the need for mods in several OMs.
2016-05-01 20:37:23 +04:00
The Immortal
45b4d937c3 Random Battle: Remove SolarBeam if Sunny Day is rejected 2016-04-27 14:51:02 +04:00
Kevin Lau
108c77e00d Random Battle: Various sun-related fixes (#2536)
* 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
2016-04-27 03:03:44 +04:00
Ivo Julca
22779102cc Lint: Add miscellaneous extra rules
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.
2016-04-25 21:52:21 -05:00
Kevin Lau
99e1cc04f0 Random Battle: Explosion should not be the only STAB
Affects Glalie-Mega.
2016-04-22 00:33:16 +03:00
mizdra
f262d02c42 Fix recoil in Gen 3-4 (#2461)
* Fix the 1/3 recoil moves in Gen 3-4
* Fix rounding recoil in Gen 3-4
2016-04-18 16:26:54 -04:00
cadaeic
9a4a6f707b Implement Triple Kick multiple accuracy checks (#2495)
* Implement Triple Kick multiple accuracy checks

* Implement Triple Kick multiple accuracy checks
2016-04-10 14:29:23 -07:00
The Immortal
514ac92d7f Random Battle: Improve Dunsparce 2016-04-11 00:57:57 +04:00
Juanma Serrano
067dd4db14 Remove OM of the Decade 2016-04-02 13:39:39 +02:00
Bär Halberkamp
0a3a65ee9e Fix shitmons 2016-04-01 14:19:50 +02:00
Juanma Serrano
7b48c14579 OMotD: Fix typo 2016-04-01 13:59:34 +02:00
Juanma Serrano
9349b8e7f5 Implement new OMs of the Decade 2016-04-01 13:55:14 +02:00
The Immortal
a8776fdb45 Random Battle: Prevent Psychic and Psyshock together 2016-03-19 07:07:22 +04:00
Ivo Julca
0281176fd1 Remove usage of Array|Object methods implemented by Sugar.js
Adds a dependency to shim Object.values until it's natively available.
2016-03-09 16:55:34 -05:00
Ivo Julca
23573646de Fix information leak in random formats 2016-03-04 19:46:25 -05:00
Quite Quiet
20877368a3 Pass list of hit targets with [spread] 2016-03-03 22:57:11 +01:00
Quite Quiet
7a14a8f547 Notify client when a move is a spread move 2016-03-02 10:42:09 +01:00
Juanma Serrano
b88cf8fb7c Seasonal update
Improve Grappling Hook and add a move for Summer
2016-03-02 09:55:13 +01:00
Juanma Serrano
c92f87993f Implement March Seasonal, Dimension Doom 2016-02-29 14:44:51 +01:00
The Immortal
5047fda6fc Random Battle improvements 2016-02-28 00:35:15 +04:00
The Immortal
9e16f45902 Random Battle updates
- 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
2016-02-27 03:24:51 +04:00
The Immortal
2b02f1ee2e Random Battle: Prevent Trick with setup 2016-02-17 18:06:37 +04:00
The Immortal
00ea930a93 CC: Fix Smeargle having CAP moves 2016-02-16 18:20:35 +04:00
The Immortal
ab7eb70c44 Random Battle: Add minimum SpD for Assault Vest
Fixes #2424
2016-02-16 16:42:00 +04:00
Guangcong Luo
76dd4a586f Remove unused isSetup variable 2016-02-16 01:08:55 -05:00
Guangcong Luo
b665660608 Refactor for more ES6 features
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.
2016-02-10 17:40:21 -06:00
The Immortal
477d11c906 Random Battle: Improve Lucario 2016-02-08 01:30:32 +04:00
Guangcong Luo
8a8838552d Improve crashlogger
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.
2016-02-04 03:04:05 -06:00
Marty-D
4c8ab041ce Fix Protean interaction with Toxic 2016-01-20 21:05:49 -05:00
Guangcong Luo
85ddb7dddb Fix Pressure PP deduction
It was deducting PP for called moves and second turns of two-turn moves.
2016-01-19 20:01:09 -05:00
Guangcong Luo
f3d10c0122 Merge pull request #2368 from urkerab/sample-no-replace
Simplify sampleNoReplace function
2016-01-13 20:11:45 -08:00
urkerab
4a5b7f6c88 Simplify sampleNoReplace function 2016-01-14 01:06:16 +00:00
Kevin Lau
3de25827cb Random Battle: Reject Tinted Lens without variable-damage attacks 2016-01-11 21:37:24 -08:00
The Immortal
8e868eba9d CC: Fix Rotom formes and Pumpkaboo-Super 2016-01-11 19:10:50 +04:00
The Immortal
7b2c60c536 Random Battle: Prevent Trick with Sucker Punch
Affects Zoroark.
2016-01-11 09:17:44 +04:00
Kevin Lau
17bbc24027 Seasonal: Reduce number of Pokemon 4x weak to Ice 2016-01-05 20:28:53 -08:00
Kevin Lau
f8e881a416 Implement January Seasonal, Polar Opposites
Mono-Ice, Inverse Battles.
2016-01-04 14:17:51 -08:00
Guangcong Luo
78db0952e8 Fix bug with formes in random battles 2016-01-04 12:37:36 -05:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
The Immortal
6eabca8b25 Random Battle improvements 2015-12-31 21:10:09 +04:00
Guangcong Luo
1f750fead0 Remove forme name from default nickname 2015-12-30 22:11:46 -05:00
The Immortal
4a48d8c398 Random Battle: Fix Rest/Sleep Talk sets 2015-12-30 19:52:34 +04:00
The Immortal
c85d1c038b Random Battle: Improve Snorlax and Swellow 2015-12-29 22:40:57 +04:00
Marty-D
17009c4a7b Challenge Cup: Fix item generation 2015-12-29 11:52:28 -05:00
The Immortal
1b2dfac818 Random Battle changes
- Fix the teamDetails changes from f26a418
- More RestTalk improvements
- Don’t count Sand in type combo limit
2015-12-25 13:38:20 +04:00
The Immortal
f26a418ea3 Random Battle updates 2015-12-25 04:05:43 +04:00
The Immortal
a8951205ec Random Battle: Prevent Sleep Talk without Rest
More strictly than previously.
2015-12-22 21:39:25 +04:00
Kevin Lau
8d25d46f43 Random Battle: Favor Poison Jab over Sludge Wave on Seviper
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.
2015-12-21 01:15:34 -08:00
The Immortal
ce41ed8435 Random Battle updates 2015-12-18 03:09:47 +04:00