Commit Graph

819 Commits

Author SHA1 Message Date
Kris Johnson
246b667c03 Add [Gen 1] Japanese OU 2021-04-27 20:48:48 -06:00
Kris Johnson
dc57eb71dc Gen 1: Move Raichu to NUBL 2021-04-27 20:33:48 -06:00
pyuk-bot
fa974427ef
Migrate terrains from onTerrain to onResidual (#8232) 2021-04-25 13:00:37 -07:00
Guangcong Luo
f513c619b0 Fix bugs from Residual refactor 2021-04-25 12:14:03 -07:00
Instruct
a84ab6cc04
SSB: Refactor Ic3peak's echoed voice modifier (#8231) 2021-04-25 11:35:39 -07: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
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
InAShellnut
9ab4c86fe3
Add Stadium 2, Nintendo Cup 1997, and Nintendo Cup 2000 (#8195)
An implementation of Nintendo Cup 1997, Nintendo Cup 2000, and Pokemon Stadium 2, for Pokemon Showdown. The only thing which has not been implemented was showing the exact health of both Pokemon in Pokemon Stadium 2, however implementing that requires changes to the showdown client. The Nintendo Cup 1997 code was done by Enigami, and the rest was by myself (Shellnuts).

This should fulfill the requirements asked by the following accepted suggestions:
https://www.smogon.com/forums/threads/please-add-a-pok%C3%A9mon-stadium-2-simulator-in-showdown.3679486/
https://www.smogon.com/forums/threads/add-nintendo-cup-1997-and-2000-as-challenge-only-formats.3653454/
2021-04-22 00:54:14 -07:00
Instruct
7f856ac3a4
SSB4: Support Same Type Clause (#8210) 2021-04-21 09:02:54 -07:00
Karthik
8963e4ace4
Gen 1: Don't allow Pokemon to recharge if frozen (#8211) 2021-04-19 12:45:44 -04: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
Kris Johnson
d0fd8ac8e0 Fix build 2021-04-16 21:47:38 -06:00
Kris Johnson
284b8f2df0 Shared Power: Fix bug 2021-04-15 18:58:07 -06:00
Kris Johnson
568e99b0e5 Shared Power: Fix more abilities 2021-04-15 16:33:13 -06:00
Kris Johnson
fc60b76c48 Add new Pet Mod of the Season 2021-04-13 20:55:47 -06:00
Marty-D
57049728e2
Gen I: Remove superfluous inheritance 2021-04-12 11:05:10 -04:00
Marty-D
94840470c3 Make sure Bide actually ends 2021-04-12 10:52:46 -04: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
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -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
Kris Johnson
418b5dcbe8 Rename Gen 7 Mix and Mega's mod 2021-04-06 17:43:59 -06:00
pyuk-bot
ab722b5b73
Fix repeat mega evolution in Megas For All (#8177) 2021-04-04 18:29:14 -04:00
Kris Johnson
10eb793c92
Pokebilities: Fix various ability interactions 2021-04-03 01:40:35 -06:00
Kris Johnson
1462dafbc4 Gen 1: Move Poliwrath to NUBL 2021-04-02 00:02:48 -06:00
Instruct
c61999b5b7
SSB4: Clean up files to remove AFD stuff (#8160)
* Update random-teams.ts

* bye bye

* a
2021-04-01 23:40:25 -06:00
Kris Johnson
ebf13740f4 Shared Power: Fix Trace and Mirror Armor 2021-04-01 19:42:32 -06:00
Kris Johnson
876b09b010 OMotM/LCotM: Update bans/fix bugs 2021-04-01 17:25:41 -06:00
Guangcong Luo
929963261d Fix crash in Mix and Mega 2021-04-01 08:25:33 -04: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
Kris Johnson
931b6caf8f Add April 2021 OMotM/RoA Spotlights 2021-04-01 03:52:36 -06:00
Guangcong Luo
622645cd04 Fix crash in addSideCondition 2021-03-31 22:38:24 -07:00
Spandan Punwatkar
b77d6cb20f
Add simulator support for multi battle (#7929)
This doesn't include matchmaking support (which had to be removed
for reworking), but it includes everything else.

Co-authored-by: Spandamn <spandan.punwatkar@gmail.com>
Co-authored-by: MacChaeger <msaimrkon@gmail.com>
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-03-31 22:22:25 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
HoeenHero
4d29897b42 SSB: Simplify line missed during review 2021-03-31 23:25:47 -04:00
Instruct
1f7bf2deed
Add Super Staff Bros 4 Wii U (April Fools' prank) (#8148)
* Add new SSB meta

* Update random-teams.ts

* Fix issues

* Complete the meta

* Fix links

* fix

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* review

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* simplify code

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2021-03-31 20:21:43 -07:00
Instruct
ea9ea5c16f
SSB: Small tweaks (#8143)
* SSB: Small tweaks

Boat's move should bypass mbounce. Perish gets meme text.

* uwu

* Cake should no longer get refresh

* Thanks Freudian Slip
2021-03-30 12:31:21 -06:00
Guangcong Luo
d18c0a4e1f Refactor more things to use pokemon.allies/foes
(This will make multi battles easier to implement.)
2021-03-28 20:06:18 -07: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
Annika
0c2563ddc2
SSB: Give Lilypad Overflow 62 BP
Requested by instruct.
2021-03-24 23:11:56 -07:00
Instruct
fb471f8569
SSB: Fix description of Lilypad Overflow (#8137) 2021-03-23 17:05:01 -07:00
HematiteH2O
409d5acfef
Megas for All: Minor Ability polish (#8136)
* Megas for All: Minor Ability polish

* Attribute Arena Rock to the proper source
* Don't always animate delayed moves when the user is KOed
* Add visual indicator of which Pokémon currently has Gravitational Pull
* Damage the correct Pokémon with Stealth Rock and G-Max Steelsurge through Gravitational Pull

* Megas for All: Minor Ability polish

* Don't animate delayed moves through Long Whip unless the user is active - it gets very weird if it tries when the user is absent, because most of the animations bring back the user and then it just hangs out indefinitely behind the other Pokémon and... it's very funny but also not correct
2021-03-23 15:00:27 -06:00
Kris Johnson
5e6c259dec
Gen 3/4: Remove HAs in getSpecies (#8134) 2021-03-23 10:19:50 -07:00
HematiteH2O
654a106df4
Megas for All: Slates 30 and 31, balance/bugfixes (#8114)
* Megas for All: Slate 30 and balance/bugfixes

Adding all four new Abilities from Slate 30 (Pool Floaties, Red Licorice, Stygian Shades and Long Whip), but also fixing issues with various other Abilities, including minor balance changes to Savage, Heavenly Techniques, Body of Water and Forgery, and bugfixes to Forgery (again), Seismic Scream and Settle.

* Megas for All: Slate 30 ability (Long Whip)

This is so convoluted, but it has to be able to stack with itself as many as five times over, so I hope this is okay. Let me know if there's a way to streamline this! (and same for Settle, for that matter)

* Megas for All: Slate 30

* Megas for All: Add slate 30 stones

* Megas for All: Update Court Change

* Megas for All: Add slate 30 Mega Evolutions

* Megas for All: Slate 30 and balance changes

Forgery can no longer fake a Z-Crystal, so the entire section dedicated to making that work is no longer necessary. However, there's a new form of non-groundedness that needs to be added (the new 'poolfloaties' volatile), and I also modified the damage section slightly because Settle and Body of Water have some weird interactions, and this was the best way I could find to handle them with perfect accuracy. (For reference, Settle is meant to use the user's physical Attack stat without actually becoming a physical move for any other intents or purposes, while Body of Water is now about halfway to the Body Press effect but keeps the user's offensive stat changes rather than its defensive ones.)

* Megas for All: Add two new move modifiers

* Megas for All: Add missing trailing comma

* Megas for All: Improve Red Licorice ability

* Update abilities.ts

Okay I do think this was at least part of the problem so I'm gonna address that first

* Update scripts.ts

* Megas for All: Fix Cinccino and Falinks

Just fixing two minor errors that came up since the last time I touched this patch

* Update data/mods/megasforall/abilities.ts

Co-authored-by: Annika <annika0uwu@gmail.com>

* Megas for All: Define bladeMoves only once

(okay I was so tired when I worked on this code and I'm actually very embarrassed to see that there are three of these in quick succession and I only changed two of them ._.
so uh! clearly Annika's suggestion not to define it three separate times in the first place is the right call XP)

* Update data/mods/megasforall/abilities.ts

Co-authored-by: Annika <annika0uwu@gmail.com>

* Update scripts.ts

* Megas for All: Abilities for slate 31 and bugfixes

* Revise some shortDescs so they can fit better
* Accommodate for Illusion in some messages (previously, they gave away the Pokémon's real name)
* Revise Forgery (again) - it can no longer copy Mega Stones, and it no longer wears off when the user is hit
* Improve the functionality of Clairvoyance (for consistency with Future Sight and other delayed moves)
* Preserve type change indicators for SOS and Stance Change (established convention is for every Mega in the mod to have these regardless of whether it has changed type, but they disappear when changing form)
* Make sure Sticky Gel doesn't ignite more than once at a time (has been happening)
* Add an activation message to Stygian Shades to reduce confusion
* Overhaul Long Whip (now compatible with the varying base powers of Triple Axel and Triple Kick; now decides accuracy at the start and guarantees that every subsequent hit will land; now persists after the source faints and behaves more similarly to other delayed moves)
* Add new Abilities from slate 31, the very over-the-top complicated Gravitational Pull and the refreshingly simple Chakra Lock

* Megas for All: Improve functionality of Long Whip

* Megas for All: Slate 31

* Megas for All: Slate 31 stones

* Megas for All: Slate 31 compatibility

Modify all entry hazards to account for Gravitational Pull and Triple Axel and Triple Kick to account for Long Whip

* Megas for All: Add slate 31 forms

Add Mega Torterra, Mega Infernape and Mega Empoleon and revise Mega Zoroark's stats

* Megas for All: Slate 31 moves and balance changes

* Megas for All: Minor Ability corrections

* Megas for All: longWhipBoost

* Update moves.ts

* Megas for All: Fix Long Whip

* Megas for All: Fix Alchemist

SHOOT sorry I skipped over this
Meant to do it in the same commit
That was just a copying error

* Apply suggestions from code review

Aaaaa thank you so much! ;u;

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Megas for All: Condense Long Whip conditions

WOW this saves so much space I never knew you could do that

* Update conditions.ts

Co-authored-by: Annika <annika0uwu@gmail.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2021-03-23 02:34:41 -06:00
Instruct
6c5a97e342
SSB4: Bugfixes and Balance changes (#8109) 2021-03-22 22:06:59 -04:00