Commit Graph

929 Commits

Author SHA1 Message Date
HematiteH2O
111ab3788f
Add Megas For All and Double Trouble (#7893)
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2021-01-09 00:41:06 -08:00
Adam Tran
2c65de1a16
Fix various Future Sight / Doom Desire issues (#7884) 2021-01-07 19:20:30 -05:00
urkerab
2c0bd53966
Grassy Terrain should heal before Leftovers (#7882) 2021-01-07 19:17:48 -05:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
urkerab
845b4386c4 Pressure should not deduct additional PP from Sticky Web 2021-01-05 13:14:56 +00:00
Guangcong Luo
73c7d5e5d8 Fix bug in Sketch validation
Earlier today, I tried to remove the hardcode for Smeargle without
realizing what it was for (Smeargle gets Spore as an event move, which
shouldn't override its ability to Sketch Spore).

It turns out, 7 years ago when I added the Smeargle hardcode, I wrote
a TODO to fix it which I never got around to:

2e1ab04eb6

Anyway, this commit fixes it properly.
2021-01-03 23:52:33 -08:00
Guangcong Luo
6b3a3070c9 Refactor team validator for readability
`checkLearnset` has been renamed `checkCanLearn`.

`reconcileLearnset` has been replaced with `validateMoves`, which
bundles the actual `checkCanLearn` calls with the old
`reconcileLearnset`, making for a better name.
2021-01-03 23:26:20 -08:00
The Immortal
4ba7045bda Validator: Remove extra space from cantLearnReason 2021-01-04 00:58:04 +04:00
Guangcong Luo
91c134fcf3 Remove unused variable 2021-01-03 10:19:54 -08:00
Guangcong Luo
ad656f67e4 Keep track of why moves can't be learned
The validator will now always know and be able to report exactly why
a move can't be learned, instead of sometimes not being able to figure
it out.
2021-01-03 09:53:04 -08:00
The Immortal
d9c2ee8d39 Lum Berry activates after Synchronize
Thanks @DaWoblefet!
2020-12-31 21:58:36 +04:00
MacChaeger
bb8aca0905
Fix move-disabling mechanics for Dynamaxed Pokemon (#7853) 2020-12-30 18:08:53 -05:00
LegoFigure11
cad1d25c4d
Add Gen 8 BSS Factory (#7843) 2020-12-31 02:09:29 +04:00
Adam Tran
d6e05d0a98
Fix Metal Burst interaction with called moves (#7835) 2020-12-30 14:36:06 -05:00
Adam Tran
674eb1449f
Fix Conversion 2 interaction with called moves (#7813) 2020-12-30 11:50:04 -05:00
Adam Tran
2f5fbad4e7
Fix Pursuit interaction with pivot moves (#7819) 2020-12-30 11:48:26 -05:00
Instruct
5b441c2013
Super Staff Bros 4 (#7793)
Collaborative Project lead by @xInstruct with many contributors.

See the Special Thanks section of https://www.smogon.com/articles/super-staff-bros-4
2020-12-24 11:21:02 -05:00
Mia
e601a5eb1f
Suspect tests: Move functionality out of sim/ (#7769) 2020-12-21 13:32:19 +04:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
Marty-D
9110419113
Gen III-IV: Stop suppressing weather when fainted 2020-12-14 17:07:26 -05:00
MacChaeger
da64d93765 Runners: Support 4P (and max games) (#7700) 2020-12-13 20:26:39 +00:00
Guangcong Luo
465d28171e Refactor PRNG for readability
Closes #7787
2020-12-12 21:56:03 +00:00
MacChaeger
58ee2f2130
Activate Jaboca and Rowap Berry on KO (#7779) 2020-12-08 15:15:41 -05:00
urkerab
6daa05781b
Protean should affect the victim of Snatch rather than the user (#7768) 2020-12-07 09:43:55 +04:00
MacChaeger
ef4132edb8
Fix two-turn submoves + Ally Switch in Doubles (#7654) 2020-11-25 15:21:23 -05:00
MacChaeger
ffc632cbf1
Fix Burning Jealousy/Lash Out vs. "turn 0" effects (#7730) 2020-11-25 13:30:03 +04:00
MacChaeger
3dfa1bdd91
Fix Emergency Exit/Wimp Out false positives (#7719) 2020-11-24 05:42:55 -08:00
May Evans
94e9ca7aee
Gen 1: Fix Counter vs Hyper Beam (#7707)
Fixes this issue, which was brought to my attention by EB0LA: 

https://replay.pokemonshowdown.com/gen1ou-1226178707-boclvwycxq72syl17qt9a3729l1tprkpw
https://replay.pokemonshowdown.com/gen1randombattle-1224344866-9ha6ocg38ru2ontlnf0iak467r2nzu0pw

Thanks to Zarel for helping me figure out what to do ^^;
2020-11-18 05:55:18 -08:00
Guangcong Luo
3336decb79 Implement Desync Clause Mod for Gen 1 Counter 2020-11-15 02:18:37 +00:00
Marty-D
826dd94eae Validator: Fix Ability attribution from Virtual Console 2020-11-13 11:28:10 -05:00
Marty-D
b098b54187 Validator: Fix Ability attribution from Dream World 2020-11-12 18:13:58 -05:00
urkerab
ec8cd25d59
Properly update Diamond Storm boosts for Gen 7 (#7638) 2020-11-12 10:27:18 -05:00
The Immortal
cc27e0b2fc species.prevo is a name 2020-11-12 06:59:47 +04:00
The Immortal
fff0f6c806 Release Gigantamax Melmetal
Also added necessary validation for it as its event is a special case.
2020-11-12 05:41:24 +04:00
Kris Johnson
890b4d9f59
Refactor text files (#7680) 2020-11-11 14:40:55 -08:00
Guangcong Luo
8543fc291a Fix Gen 2 evo/tradeback validation 2020-11-09 04:12:59 +00:00
Guangcong Luo
1e39e19f00 Refactor chat to use Utils.splitFirst 2020-11-08 18:31:38 +00:00
Guangcong Luo
ca96d7bf49 Fix crash in tests
It turns out `sentLogPos` isn't incremented in unit tests (no actual
use-case was affected). This is the simplest fix, although at some point
we should revisit how battles send and receive data.
2020-11-08 02:14:30 +00:00
Guangcong Luo
1e9b506ee5 Add detector for infinite event loops
This has happened a few times in the past, so this helps prevent them
from spinlocking entire processes.
2020-11-07 22:56:37 +00:00
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* Split up dex-data over individual files

This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`

These files centralize definitions from `dex-data` and `global-types`.

* Inherit ItemData from Item etc

Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.

This has also been done for

- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat

Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)

The only one left is MoveData, which is just super complicated and
will need its own commit.
2020-11-05 05:00:13 -08:00
Leonard Craft III
920af21aac
Abilities: Add isPermanent flag (#7614) 2020-11-03 10:31:11 -05:00
The Immortal
7d9eb43ef7 Remove unused definitions 2020-11-02 01:30:16 +04:00
Kris Johnson
909419ca27 Fix /randbats interaction with Gen 2 sets 2020-11-01 14:23:40 -07:00
Guangcong Luo
8b68cdd736 Fix Streams bug
It turns out 001f98b4f2 was wrong.

When urkerab asked why it `peek` wasn't awaited:

e91c4c5260 (commitcomment-41364837)

The answer was because clearing the buffer after peeking needed to
happen synchronous: if the buffer is written to after peeking but
before the buffer is cleared, that write is lost forever.

This just goes to show, if you do something subtle enough to require
type assertions, you should probably add a comment about what's going
on.

Fixes #7605

This also removes `BattleStream#start()` which is completely useless
API complication. A better implementation would properly forward
crashes between streams (maybe `pipeTo` should do this) but as it
stands, it's not doing anything.
2020-11-01 02:06:24 +00:00
The Immortal
42f491a092 Fix Ripen 2020-10-30 14:03:35 +04:00
Kris Johnson
a641cfcce8
Fix Overflow Stat Clause and turn it into a mod (#7604) 2020-10-30 10:59:38 +04:00
Guangcong Luo
e90658c038 Validate Natures in tests
(There's no need to validate natures somewhere that has an actual
performance impact.)
2020-10-29 16:19:07 +00:00
Kris Johnson
ab6e173e24
Move natures into their own file (#7601) 2020-10-29 08:38:03 -07:00
Guangcong Luo
e546236221 Improve error for Japan-only event moves
Thanks Plague Von Karma for help with wording!

Refs #7581
2020-10-29 12:06:36 +00:00
The Immortal
2e6ccdd738 Random Doubles: Fix Regieleki 2020-10-28 22:47:43 +04:00