Commit Graph

1096 Commits

Author SHA1 Message Date
Annika
f6b21b90ce Trivia: Support games with fewer than 3 players
Requested by Trivia roomstaff
2021-05-02 21:36:22 -07:00
pacmanboss256
c1996a3949
Fix Me First's interaction with recharge moves (#8258) 2021-05-01 20:53:13 -07:00
Annika
99cb226a4b Random Battles update 2021-05-01 18:37:52 -07:00
Daniel Wan
b58cfbae5d
Fix interaction of Destiny Bond and Red Card (#8219) 2021-05-01 14:02:34 -04:00
pacmanboss256
9de563f839
Fix Adrenaline Orb's interaction with max stat stages (#8154) 2021-05-01 14:01:32 -04:00
Instruct
a9d4374e59
Tag Mythical and Legendary pokemon (#8142) 2021-04-30 21:34:17 -07:00
Guangcong Luo
4d70b0a46a
Use data/tags for validator (#8218)
Previously, the validator had its own hardcoded tag system. This
removes the hardcoding and makes it so any pokemon tag in `tags.ts`
can be banned or unbanned.
2021-04-30 18:20:30 -07:00
Guangcong Luo
7d235af30f Fix speed ties after mega evolution 2021-04-29 00:23:55 -07:00
Leonard Craft III
d49a40feb2 Tests: Improve G-Max Volcalith Sea of Fire test 2021-04-26 22:52:59 -05:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
pyuk-bot
66c547432b
Fix Parental Bond to modify damage, not base power (#8226) 2021-04-25 12:06:27 -04:00
urkerab
9a18ada1f9
Grassy Terrain should only weaken moves against grounded targets (#8224) 2021-04-24 18:04:31 -05:00
Leonard Craft III
7c89412d9a Remove accidental .only 2021-04-24 16:24:45 -05:00
Leonard Craft III
ab0cb0d29e Improve Grassy Terrain tests 2021-04-24 16:24:01 -05:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Kris Johnson
a1bdafbfe8
Add room sections (#8205) 2021-04-23 22:39:56 -07:00
pyuk-bot
3639079d1f
Protective Pads should not apply to Gulp Missile (#8207)
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-04-19 12:39:33 -04:00
Leonard Craft III
4818c50374
Fix Transform source Ability leak (#8204) 2021-04-17 15:06:40 -07:00
Karthik
adb164ad51
Fix Magician activation timing (#8202)
Use onAfterMoveSecondarySelf so Weakness Policy happens first
Fixes #8104
2021-04-17 12:26:29 -04:00
Kris Johnson
d0fd8ac8e0 Fix build 2021-04-16 21:47:38 -06:00
Kris Johnson
f4fda49201 Update Battle Factory tests and command 2021-04-16 17:35:26 -06:00
Guangcong Luo
5c3d0f5eae Fix deterministic speed ties
We have apparently been sorting everything by switch-in order this
entire time, not just move redirection. This appears to be a mistake
in #5216

The actual bug fix is just the single line in `comparePriority`,
everything else is just documentation, and a bit of optimization of
how speed ties are resolved.

Fixes #6319
2021-04-10 09:41:22 -07:00
Leonard Craft III
12670422d0 Remove duplicate test 2021-04-09 23:44:05 -05:00
Leonard Craft III
f8cfe3a242 Validator: Don't enforce 3 IV minimum in Hackmons 2021-04-09 23:40:16 -05:00
Leonard Craft III
d858bbda30
Validator: Disallow duplicate moves (#8191) 2021-04-09 20:59:20 -07:00
Guangcong Luo
5cf59da9f0 Add unit test for having valid formats 2021-04-09 18:04:40 -07:00
Annika
b4da54c6da Fix typo in comment 2021-04-09 17:22:25 -07:00
Annika
3ca947225f Random Battles updates 2021-04-09 17:13:18 -07:00
Annika
2baca9339d Random Battles: Fix STAB in 4-player battles 2021-04-09 16:23:23 -07:00
Christopher Monsanto
99fd7b8706
Chat: Implement Discord spoilers (#7948) 2021-04-09 01:39:47 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
May Evans
1365091eed
Rename OU (Tradeback) to Tradebacks OU (#8185) 2021-04-07 11:27:27 -07:00
Karthik
3b1d3844dd
Negate Unburden while Neutralizing Gas is active (#8182) 2021-04-06 12:13:05 -04:00
Leonard Craft III
54ebad4d2f Improve Thousand Arrows tests 2021-04-05 22:49:32 -05:00
Guangcong Luo
77d231eee5 Fix Disguise vs Steelsurge 2021-04-03 18:30:19 -07:00
Leonard Craft III
897a798db6 Expand G-Max Steelsurge test 2021-04-03 19:02:50 -05:00
pyuk-bot
817addfd62
Fix Follow Me, etc. in FFA (#8173) 2021-04-03 15:16:27 -07:00
HoeenHero
47d8bd4d82
Fix hazards not applying if the target side is fainted (#8171)
Co-authored-by: pyuk-bot <msaimrkon@gmail.com>
2021-04-03 15:15:13 -07:00
pyuk-bot
19111bda58
FFA: Don't retarget from a fainted target (#8166) 2021-04-03 01:50:00 -07:00
pyuk-bot
956daf89b6
FFA: Properly set hazards against all foes' sides (#8165) 2021-04-02 23:15:19 -07:00
Guangcong Luo
caf46800ee Rename format from "4 Player" to "Free-For-All"
Users seem to find the latter clearer.
2021-04-02 23:00:29 -07:00
urkerab
d4e6fb227c
Fix Aromatherapy failing if the right slot has a Substitute (#8151) 2021-04-02 17:35:04 -04:00
Karthik
19ae4f693f
Check for Berserk before eating Berries (#8147) 2021-04-02 17:30:34 -04:00
Guangcong Luo
791ded0aa2 Rename FFA to "4 Player" for clarity 2021-04-01 23:37:47 -07:00
Guangcong Luo
ff141e3f80 Fix tests 2021-04-01 23:11:15 -07:00
Guangcong Luo
1acffa98b3 Fix forfeiting in FFA 2021-04-01 14:46:00 -07:00
Guangcong Luo
44ef998ecc Implement free-for-all
This involves a huge refactor for how battles are constructed, but
it's totally worth it.

Currently, tournaments, challenges, and laddering are unsupported; only
unrated searches work. But it does work, and it's beautiful.
2021-04-01 04:44:16 -07:00
Guangcong Luo
39f5717c25 Fix repeate mega evolution bug 2021-03-31 22:16:06 -07:00
Karthik
258269348c
Allow Berries to be used between Unnerve switching to Unnerve (#8145) 2021-03-31 10:07:36 -04:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
Annika
9e7074572e Random Battles update 2021-03-26 15:45:59 -07:00
Guangcong Luo
619a1e228d
Stadium: Apply BRN Atk drop once instead of 5x (#8139) 2021-03-25 23:38:55 -07:00
urkerab
d395d18591
End Uproar if the user is under the effect of Throat Chop (#8135)
SadisticMystic confirmed that the user of Uproar simply calms down at the end of the current turn.
2021-03-23 17:42:41 -04:00
Annika
c1fa436e35 Trivia: Implement a /trivia unrankednew command
This enables the creation of Trivia officials that do not reward points.
2021-03-20 12:30:46 -07:00
Leonard Craft III
9db5e91afa Improve Thick Fat tests 2021-03-19 21:46:54 -05:00
Annika
ff56f7e503 Random Battles update 2021-03-19 18:28:08 -07:00
Annika
ffd0092bfb Random Battles: Add basic unit test framework
This will save me a lot of time typing in `/eval`s on localhost to test, and also hopefully catch regressions!
2021-03-18 18:17:25 -07:00
Marty-D
d1c80dc60f Validator: Fix Diancie exception
Thanks Anubis!
2021-03-08 12:57:53 -05:00
Mia
07b1c01f75
Support hotpatching User/Room/ProcessManager protos (#8095) 2021-03-08 05:23:17 -08:00
Leonard Craft III
013dd54d33
Gen IV: Fix Struggle's interaction with Shedinja (#8048) 2021-02-17 09:44:10 -05:00
Leonard Craft III
3e702fdc40 Add Slow Start tests 2021-02-16 16:48:29 -06:00
Guangcong Luo
1b281650c6 Rename Stadium to Gen 1 Stadium
This is required to add support for Stadium in unit tests. A lot of the
codebase assumes that all mods start with "gen" followed by a number,
but I don't want to touch the others at the moment.
2021-02-15 21:03:47 -08:00
Instruct
e7695c4b78
Gen 3: Add Deoxys Forme Clause and Deoxys Camouflage Mod (#8024) 2021-02-15 01:37:58 -08:00
urkerab
16fe1cbc27
Focus Punch can't be Flinched (#8031) 2021-02-15 01:34:47 -08:00
pyuk-bot
ccb92de32b
Set abilityOrder before entrance effects activate (#8010) 2021-02-11 16:14:59 -05:00
pyuk-bot
e939d9cd6d
Actually don't allow Struggling Pokemon to Dynamax (#8011) 2021-02-10 17:10:41 -05:00
Annika
31605c36b3 Modlog: FIx converter bug in action-taker regex 2021-02-06 11:42:07 -08:00
Guangcong Luo
da30a71706 Revert "Remove User#inRooms and User#games (#7815)"
This reverts commit 5c9c84c415.

This also reverts commit 1fc92ef977.
2021-01-30 15:55:55 -05:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Leonard Craft III
0d78f967d6 Fix Ripen's interaction with Jaboca/Rowap Berries 2021-01-26 20:36:25 -06:00
urkerab
edafebbbd8
Fix Magnet Rise in Inverse Battles (#7943)
* Make Magnet Rise work in Inverse Battles

* Improve Inverse Battle tests

Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-01-26 20:08:50 -06:00
Leonard Craft III
b950891185 Improve Future Sight no target test 2021-01-19 20:43:51 -06:00
Adam Tran
14744879c8
Fix excluding variables in /ms (#7859) 2021-01-18 11:42:58 -06:00
urkerab
d35ddfaf7b
Fix Brick Break against bypassed type immunity (#7916) 2021-01-18 12:13:17 -05:00
urkerab
f0d3c85148
Fix Soundproof blocking self sound moves in Gen 8 (#7917) 2021-01-15 20:05:32 -06:00
Guangcong Luo
a68656a8e7 Support destroying rooms in unit tests
Matchmaking unit tests currently rely on destroying and re-creating a
user causing them to forget about battles they're in, which is not
actually supposed to happen, and breaks #7815.
2021-01-10 03:39:01 -08:00
Guangcong Luo
66fe68e8ee Tests: Refactor users-utils
The old users-utils had an unnecessarily difficult-to-use API. This
new one should be more straightforward and unified.
2021-01-09 22:33:32 -08:00
The Immortal
0fc3d514e6 Rename U-turn test for consistency 2021-01-08 10:46:41 +04: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
cdcdf2da1b Shell Bell should heal from all damage 2021-01-05 17:29:35 +00:00
urkerab
5123b6cc63 Revelation Dance should use Arceus's real type 2021-01-05 16:59:08 +00:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
urkerab
4192201d60 Pressure should deduct additional PP from Z-moves and Max moves 2021-01-05 13:17:27 +00:00
urkerab
845b4386c4 Pressure should not deduct additional PP from Sticky Web 2021-01-05 13:14:56 +00:00
urkerab
6ba98478a6 Cursed Body should be able to disable Z-moves 2021-01-05 13:06:40 +00:00
Leonard Craft III
bed1f4ac99
Add various mechanics tests (#7857)
* Improve Volcalith tests readability

* Add G-Max Volcalith recoil damage order test

* Add 1 HP priority tests

* Add charge move targeting test

* Correct assertions of Ripen / Sturdy

* Skip failing tests

* Add Volcalith Black Sludge test

* Add Pressure Max / Z-move tests

* Add Pressure submove test

* Add NGas speed test

* Skip NGas speed test

* Add White Herb double Intimidate test

* Remove debug log

* Remove duplicate Pressure test

* Improve White Herb Intimidate test title

* Add Rollout Storage tests

* Add spread move Rollout storage test

* Add Magician Weakness Policy test

* Add Sleep tests

* Add Shell Bell spread move test

* Add Synchronize Lum Berry test

* oh yeah it doesn't work

* Remove duplicate test

* Add Sunsteel Strike tests

* Add Leech Seed ally switch test

* Add Primal weather Natural Gift test

* Add Emergency Exit hazards test

* Add generic hazards tests

* Add and standardize Arceus tests

* Add Transform ability test

* Add and standardize Parting Shot tests

* Add Memento tests

* Add Me First test

* Add Cursed Body Z-move test

* Add Assurance targeting test

* Clarify Assurance test description

* Add double faint switch test

* Add Receiver KO boost ability

* Add double Unnerve test

* Add Dynamax Eject Pack test

* Improve Dynamax forced switchout test

* Add Protective Pads Perish Body test

* Add Sticky Web Pressure test

* Add Speed modifier lower bound test

* Add Cloud Nine Hydration test

* Correct Cursed Body test

* Add Grassy Terrain Leftovers test

* Remove leftover debug

* Add additional Receiver and Soul-Heart tests

* Add Spite tests

* mish

* Add Shell Bell multihit test

* Add WP Dragon Tail test

Co-authored-by: The Immortal <the_immortal123@live.com>
2021-01-04 23:47:10 -08:00
The Immortal
fa2698a3a0 Fix PP reduction moves 2021-01-04 16:27:09 +04: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
Adam Tran
fbda1e5d92
Fix Protean/Libero on first of two turn moves (#7870) 2021-01-03 09:42:08 -05:00
The Immortal
d8a90a94f9 Protective Pads should negate Perish Body
Thanks @DaWoblefet!
2021-01-03 16:35:55 +04:00
urkerab
fa78e2a31c
Make Unnerve activate after Skill Swap and Neutralizing Gas wearing off (#7866) 2021-01-02 14:39:54 -05:00
Adam Tran
0f724acb03
Fix Neutralizing Gas ending issues (#7860) 2021-01-01 18:39:19 -05: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
Marty-D
1b046208ba
Add Metal Burst redirection test 2020-12-30 16:41:18 -05: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
Adam Tran
6702decd95
Add Pivot moves as a /ms category (#7822)
* draft test

* Move search for pivot moves
2020-12-26 21:57:03 -08:00
Leonard Craft III
b9363ef707 Tests: unskip oldgen Fury Cutter, improve readability 2020-12-22 23:21:31 -06:00
The Immortal
fda0ee61f4 Gen 7/6: Implement Toxic accuracy mechanics 2020-12-22 15:50:05 +04:00
Leonard Craft III
653ca9d4ae Victory Star tests are Victory Star 2020-12-16 06:41:11 -06:00
Leonard Craft III
8fc481b65a Add Victory Star tests 2020-12-15 19:13:04 -06:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
Adam Tran
56258a08c7
Run checks for Gravity, Heal Block, Throat Chop on called moves (#7758) 2020-12-15 10:15:12 -05:00
Annika
f2bfc82ca1
Chat monitor: Improve the handling of usernames (#7786)
* Chat monitor: Improve the handling of usernames

This PR ignores word boundaries in evasion regexes when filtering usernames, preventing the use of usernames with evasions of slurs in them.

* properly fix merge conflicts
2020-12-14 12:55:11 -08:00
MacChaeger
7d6da41e34
Factory sets: Add more EV validation (#7790) 2020-12-12 10:48:20 +04:00
Adam Tran
f63e7e4a8d
Add Heal Block independent fail message (#7785) 2020-12-11 19:38:52 -05: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
Leonard Craft III
12da66fb21
Correct Protean interactions & Gravity-blocked Status Z-Moves (#7729) 2020-11-30 16:30:51 -05:00
Adam Tran
32d3d8dda6
Fix Max Guard bypass with multiple targets (#7739) 2020-11-30 12:59:53 -05:00
MacChaeger
ebb570e608
Tests: Add a function to save a battle replay (#7692) 2020-11-29 22:08:01 +00:00
MacChaeger
8f6576e59a
Don't activate Flower Gift/Ice Face when KOed (#7733) 2020-11-26 15:36:59 -05:00
MacChaeger
66da9ca824
Wimp Out does switch out before fainted Pokemon (#7731) 2020-11-26 13:56:40 +04:00
The Immortal
006fd097f0 Fix Stance Change mechanics 2020-11-26 13:47:27 +04:00
Annika
a1b085f033
Chat monitor: Support unit tests (#7710) 2020-11-26 01:33:09 -08: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
aviettran
f66569a242
Fix Symbiosis interaction with Eject Button (#7718) 2020-11-24 11:14:05 -05:00
MacChaeger
3dfa1bdd91
Fix Emergency Exit/Wimp Out false positives (#7719) 2020-11-24 05:42:55 -08:00
The Immortal
d958c32f73 Fix After You test description 2020-11-21 23:26:36 +04:00
The Immortal
d65b2427dd Fix Fling vs Protect 2020-11-21 22:54:25 +04:00
The Immortal
271b6be01b Merge Libero and Protean tests 2020-11-21 22:54:00 +04:00
The Immortal
079d931e97 Fix Fling mechanics 2020-11-21 11:16:01 +04:00
The Immortal
8bb09561e0 Add Protean tests 2020-11-21 11:14:34 +04:00
The Immortal
6b1b318977 Fix Metronome interaction with two-turn moves 2020-11-20 13:14:00 +04:00
Annika
fe9a3419f7
Tests: Remove debug print from Pollen Puff test 2020-11-19 21:31:12 -08:00
Leonard Craft
41033e7345 Fix Pollen Puff's interaction with ally Substitute 2020-11-19 22:12:02 -06:00
Marty-D
d28ddeca4e Descriptions: Replace "major" with "non-volatile" 2020-11-17 14:49:19 -05:00
Guangcong Luo
b51db459d7 Fix Desync Clause test
It was in Mirror Coat rather than Counter.

Also switch to checking for "activated", so it doesn't conflict
with #7702 (committed separately so git blame still shows me as
test author)
2020-11-17 00:33:13 +00: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
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
Mia
6145fab828
Allow the Help auto-response filter to be used in all rooms (#7645) 2020-11-08 20:16:25 -08:00
Guangcong Luo
8543fc291a Fix Gen 2 evo/tradeback validation 2020-11-09 04:12:59 +00:00
Annika
ec0a92469a Modlog: Make tests work without SQLite 2020-11-05 22:40:53 -08:00
Leonard Craft III
920af21aac
Abilities: Add isPermanent flag (#7614) 2020-11-03 10:31:11 -05:00
Annika
aa069ce8fd
Support disabling modlogs (#7619)
Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-11-02 22:59:31 -05:00
Annika
7f2dec0797
Modlog: Avoid optional properties in ModlogEntry (#7613)
* Modlog: Avoid optional properties in ModlogEntry

* Use a type

* Make IP nullable

* Add NOT NULL constrains

* Fix typo
2020-11-01 14:07:01 -08:00
Annika
2f130e8762
Modlog: Support logging to a SQLite database (#7513)
* Modlog: Support logging to a SQLite database

Co-authored-by: Christopher Monsanto <chris@monsan.to>
2020-10-30 19:27:25 -04: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
Leonard Craft
b673ff3fe4 Add Berserk to the Berserk sim test 2020-10-30 03:05:46 +00: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
The Immortal
1a0e56a3ac Fix Neutralizing Gas interactions 2020-10-29 04:35:12 +04:00
Kris Johnson
b1e2331c7b
Fix Slow Start's interaction with Neutralizing Gas (#7580) 2020-10-28 12:51:33 -07:00
Guangcong Luo
5f8c36c616 Ban Gen 1 Japan-only event moves
Fixes #7516
2020-10-26 15:30:47 +00:00
Annika
099346ee1e Tools: Modernize modlog entries for blacklists 2020-10-25 16:13:46 -07:00
The Immortal
381c8190c6 Fix Dragon Ascent Rayquaza validation 2020-10-24 04:58:05 +04:00
Leonard Craft III
4e6ff7e72c
Validator: Allow Hidden Ability Entei/Raikou/Suicune in Gen 8 natively (#7563) 2020-10-23 15:28:12 +04:00
Leonard Craft
db2a55a1bb Clarify Neutralizing Gas + Imposter test 2020-10-22 11:53:11 -05:00
Leonard Craft
4e3c8bd3cc Consolidate Neutralizing Gas tests; add Gluttony/Slow Start NGas tests 2020-10-22 11:49:11 -05:00
Guangcong Luo
d6eeb197c1 Improve Chat.toDurationString
- Default precision is now 3.

  (Instead of "3 months 25 days 17 hours 46 minutes 40 seconds", it'll
	say "3 months 25 days 17 hours". You can still set the precision to
	`Infinity` if you actually prefer that.)

- Now displays "forever" for Infinity or overflow durations

- No longer skips blank precision levels

  (Shows "3 hours 0 minutes 10 seconds" instead of
	"3 hours  10 seconds")
2020-10-21 13:05:08 +01:00
Leonard Craft
993a5cc645 Unskip passing validator test 2020-10-20 21:36:28 -05:00
Leonard Craft
07a721dd96 Unskip passing move self-target test 2020-10-19 19:57:37 -05:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Ben Davies
6f26265ff9 Tests: simplify Dashycode transcodeWithSets helper 2020-10-19 05:15:02 -03:00
Leonard Craft III
1081a4423f
Add various mechanics tests (#7506) 2020-10-16 21:07:05 -07:00
The Immortal
7638f8238a Fix Present healing vs Substitute 2020-10-15 18:46:58 +04:00
Guangcong Luo
a65faf263f
Stop using assert.strict.strictEqual (#7515)
It turns out that when I switched us from `assert` to `assert.strict`,
I didn't actually update any existing tests or tell anyone:

0df0d234f2

So apparently everyone else just kept on using `strictEqual`.

This will be a PR and also throw an error if people continue trying to
use it, which should make it much clearer what PS policy is on this.

A lot of the problem may be that TypeScript marks assert.strict.equal
as deprecated when it's not. This was fixed 4 days ago:

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48452

But this probably hasn't made it to a thing yet. Until then, you'll
have to deal with TS marking your tests as deprecated, but it shouldn't
be too long.

Accidentally using `assert` instead of `assert.strict` should now show
an error. This protects against the probably much worse mistake of
accidentally using `assert.equal` rather than `assert.strict.equal`.

`assert.ok` is also deprecated now.
2020-10-14 01:19:03 -07:00
Guangcong Luo
67a4e9f185 Add validator for Pokestar event moves
See #7412
2020-10-13 18:01:32 -07:00
Kris Johnson
510ab4ecb3
Fix typo 2020-10-13 16:55:31 -06:00
Guangcong Luo
7fc498ff88 Add validator for evoItem
See also #7412
2020-10-13 04:40:38 -07:00
Kris Johnson
d9b3a510ad
TextFormatter: Support replacing \n without trusted (#7507) 2020-10-11 13:38:34 -07:00
Guangcong Luo
e40ab96db7 Update Mocha dependency version 2020-10-09 22:33:17 -07:00
Kris Johnson
b107236dc5
Repeats: Refactor storing and deleting repeats, let people repeat room FAQs (#7488) 2020-10-07 23:42:30 -07:00
Leonard Craft III
2ed8a97ff8
Add skipped failing event validator tests (#7472) 2020-10-06 16:06:05 -07:00
Mia
4279d1f3bc
Update attributions in various locations (#7354) 2020-10-06 15:55:26 -07:00
Annika
216e4a7354
Add a plugin to repeat phrases in chatrooms (#7338) 2020-10-05 14:25:18 -07:00
Annika
0877f0ae1e
Modlog: Fix entries with an IP address and no user (#7446) 2020-09-30 17:55:41 -07:00
The Immortal
ca3a106815 Learnsets: Sort V before S 2020-10-01 04:26:23 +04:00
Annika
b3a5f9e59f
Moderation: Refactor room promotions to a function (#7426) 2020-09-28 15:49:26 -07:00
Annika
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
The Immortal
2b0c77939f Correct Weakness Policy mechanics
And added relevant Burning Jealousy tests.
2020-09-26 00:56:41 +04:00
Annika
1e20f6a96f
Trivia: Add leaderboard management commands (#7402) 2020-09-20 16:33:03 -07:00
Annika
6d8d0bd93a
Trivia: Use Chat.ErrorMessage more (#7384) 2020-09-18 16:19:26 -07:00
Annika
422649dca7
Trivia: Add a new game called Mastermind (#7368) 2020-09-14 16:03:50 -07:00
Annika
83e8262d12
Users: Fix bug with IP handling (#7305) 2020-09-05 08:18:42 -07:00
Kris Johnson
8656d633ac
Format volatiles consistently (#7314) 2020-09-05 08:12:24 -07:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Guangcong Luo
ba4998350a Fix more bugs in /hiderank 2020-08-22 16:03:10 -07:00
Annika
05065dbdb8
IPTools: Support wildcards in string ranges (#7223) 2020-08-18 13:37:58 -07:00
Mia
d8ecdb5f83
Help: Only write state when relevant to the room (#7207) 2020-08-18 13:06:52 -07:00
Kirk Scheibelhut
39c14e0868 Remove EBC staleness from abilities upon switching 2020-08-17 12:59:10 -07:00
Leonard Craft III
53dd591819
Skip failing modlog test (#7197) 2020-08-11 05:58:59 -07:00
Annika
ce8a1dd975
IPTools: Remove '-nohost' suffix and make minor improvements (#7108) 2020-08-07 14:47:18 -07:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
Annika
f563252418
Modlog: Fix bugs and support hotpatching (#7163) 2020-08-06 22:05:13 -04:00
Leonard Craft III
9e82f05ebb
Gen 3-4: Fix Camouflage to change to Normal-type (#7130) 2020-08-06 14:54:57 -04:00
Annika
f34ffa9e74
Refactor Modlog into one file (#7127) 2020-08-06 00:39:37 -07:00
Mia
fbe5d90dd0
Youtube: Add tests (#7081) 2020-08-06 00:34:18 -07:00
Mia
647d5af76f
Add a filter for auto-answering questions in the Help room (#7100) 2020-08-05 23:44:46 -07:00
Annika
577b858994
Tests: Allow requiring Config at the top level (#7109)
This solves issues like https://github.com/smogon/pokemon-showdown/pull/7100#discussion_r463922425 and makes it easier to test chat plugins.
2020-08-02 22:10:22 -07:00
Annika
cd85cd7a9d
Hosts & IPTools: Refactor to remove hardcoded ranges (#7078) 2020-07-29 23:04:50 -07:00
Guangcong Luo
fe2eb27860
Refactor ip and modchat permissions (#7076)
- `ip` and `ipself` are now separate permissions. This means that `ip`
  is now a generalized permission for viewing IPs (no more need to use
  `globalban`, since `ipself` now controls the ability to see your own
  IP address)

- `alts` and `altsself` are now also separate (all users used to be
  able to `altsself`).

- `modchat`, `modchatall`, and `manageroom` are now just one `modchat`
  permission whose jurisdiction controls how high you can set modchat.
2020-07-29 00:38:52 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00